@adobe/alloy 2.20.0-beta.2 → 2.20.0-beta.6
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/libEs5/baseCode/index.js +61 -0
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +53 -0
- package/libEs5/components/ActivityCollector/configValidators.js +22 -0
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +68 -0
- package/libEs5/components/ActivityCollector/createLinkClick.js +38 -0
- package/libEs5/components/ActivityCollector/getLinkName.js +139 -0
- package/libEs5/components/ActivityCollector/getLinkRegion.js +61 -0
- package/libEs5/components/ActivityCollector/index.js +78 -0
- package/libEs5/components/ActivityCollector/utils.js +104 -0
- package/libEs5/components/Audiences/index.js +49 -0
- package/libEs5/components/Audiences/injectProcessDestinations.js +67 -0
- package/libEs5/components/Audiences/injectProcessResponse.js +38 -0
- package/libEs5/components/Context/createComponent.js +39 -0
- package/libEs5/components/Context/implementationDetails.js +27 -0
- package/libEs5/components/Context/index.js +59 -0
- package/libEs5/components/Context/injectDevice.js +66 -0
- package/libEs5/components/Context/injectEnvironment.js +40 -0
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +58 -0
- package/libEs5/components/Context/injectPlaceContext.js +32 -0
- package/libEs5/components/Context/injectTimestamp.js +23 -0
- package/libEs5/components/Context/injectWeb.js +30 -0
- package/libEs5/components/DataCollector/index.js +110 -0
- package/libEs5/components/DataCollector/validateApplyResponse.js +35 -0
- package/libEs5/components/DataCollector/validateUserEventOptions.js +50 -0
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +31 -0
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
- package/libEs5/components/DecisioningEngine/constants.js +28 -0
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +35 -0
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +30 -0
- package/libEs5/components/DecisioningEngine/createContextProvider.js +95 -0
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +27 -0
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +50 -0
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +82 -0
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +48 -0
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +130 -0
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +48 -0
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +89 -0
- package/libEs5/components/DecisioningEngine/index.js +119 -0
- package/libEs5/components/DecisioningEngine/utils.js +82 -0
- package/libEs5/components/EventMerge/createComponent.js +24 -0
- package/libEs5/components/EventMerge/createEventMergeId.js +20 -0
- package/libEs5/components/EventMerge/index.js +24 -0
- package/libEs5/components/Identity/addEcidQueryToPayload.js +22 -0
- package/libEs5/components/Identity/addEcidToPayload.js +20 -0
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +25 -0
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +45 -0
- package/libEs5/components/Identity/configValidators.js +21 -0
- package/libEs5/components/Identity/constants/authState.js +18 -0
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +15 -0
- package/libEs5/components/Identity/createComponent.js +97 -0
- package/libEs5/components/Identity/createLegacyIdentity.js +72 -0
- package/libEs5/components/Identity/getEcidFromResponse.js +23 -0
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +35 -0
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +29 -0
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +29 -0
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +27 -0
- package/libEs5/components/Identity/index.js +129 -0
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +31 -0
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +68 -0
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +52 -0
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +100 -0
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +20 -0
- package/libEs5/components/Identity/injectProcessIdSyncs.js +41 -0
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +33 -0
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +34 -0
- package/libEs5/components/Identity/visitorService/getVisitor.js +19 -0
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +49 -0
- package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +144 -0
- package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +49 -0
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +245 -0
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +181 -0
- package/libEs5/components/LegacyMediaAnalytics/index.js +71 -0
- package/libEs5/components/LibraryInfo/index.js +68 -0
- package/libEs5/components/MachineLearning/index.js +26 -0
- package/libEs5/components/MachineLearning/processResponse.js +19 -0
- package/libEs5/components/Personalization/constants/loggerMessage.js +16 -0
- package/libEs5/components/Personalization/constants/scopeType.js +18 -0
- package/libEs5/components/Personalization/constants/surface.js +19 -0
- package/libEs5/components/Personalization/createActionsProvider.js +71 -0
- package/libEs5/components/Personalization/createApplyPropositions.js +115 -0
- package/libEs5/components/Personalization/createClickStorage.js +64 -0
- package/libEs5/components/Personalization/createCollect.js +53 -0
- package/libEs5/components/Personalization/createComponent.js +145 -0
- package/libEs5/components/Personalization/createFetchDataHandler.js +92 -0
- package/libEs5/components/Personalization/createGetPageLocation.js +20 -0
- package/libEs5/components/Personalization/createHandleConsentFlicker.js +29 -0
- package/libEs5/components/Personalization/createNotificationHandler.js +38 -0
- package/libEs5/components/Personalization/createOnClickHandler.js +51 -0
- package/libEs5/components/Personalization/createOnDecisionHandler.js +43 -0
- package/libEs5/components/Personalization/createPersonalizationDetails.js +104 -0
- package/libEs5/components/Personalization/createPreprocessors.js +23 -0
- package/libEs5/components/Personalization/createSetTargetMigration.js +28 -0
- package/libEs5/components/Personalization/createViewCacheManager.js +90 -0
- package/libEs5/components/Personalization/createViewChangeHandler.js +45 -0
- package/libEs5/components/Personalization/dom-actions/action.js +120 -0
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +41 -0
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +32 -0
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +108 -0
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +25 -0
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +27 -0
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +21 -0
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +35 -0
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/index.js +100 -0
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +25 -0
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +104 -0
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +23 -0
- package/libEs5/components/Personalization/dom-actions/images.js +36 -0
- package/libEs5/components/Personalization/dom-actions/index.js +9 -0
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +35 -0
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +31 -0
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +31 -0
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +45 -0
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +32 -0
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +36 -0
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +54 -0
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +20 -0
- package/libEs5/components/Personalization/dom-actions/scripts.js +90 -0
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +20 -0
- package/libEs5/components/Personalization/dom-actions/setHtml.js +27 -0
- package/libEs5/components/Personalization/dom-actions/setStyles.js +25 -0
- package/libEs5/components/Personalization/dom-actions/setText.js +17 -0
- package/libEs5/components/Personalization/dom-actions/swapImage.js +31 -0
- package/libEs5/components/Personalization/event.js +49 -0
- package/libEs5/components/Personalization/flicker/index.js +86 -0
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +71 -0
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +43 -0
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +78 -0
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +194 -0
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +44 -0
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +118 -0
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +20 -0
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +286 -0
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +22 -0
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +51 -0
- package/libEs5/components/Personalization/index.js +162 -0
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +24 -0
- package/libEs5/components/Personalization/utils/createAsyncArray.js +38 -0
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +18 -0
- package/libEs5/components/Personalization/utils/surfaceUtils.js +101 -0
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +34 -0
- package/libEs5/components/Privacy/computeConsentHash.js +33 -0
- package/libEs5/components/Privacy/createComponent.js +88 -0
- package/libEs5/components/Privacy/createConsentHashStore.js +59 -0
- package/libEs5/components/Privacy/createConsentRequest.js +29 -0
- package/libEs5/components/Privacy/createConsentRequestPayload.js +33 -0
- package/libEs5/components/Privacy/createStoredConsent.js +31 -0
- package/libEs5/components/Privacy/index.js +63 -0
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +47 -0
- package/libEs5/components/Privacy/parseConsentCookie.js +37 -0
- package/libEs5/components/Privacy/validateSetConsentOptions.js +21 -0
- package/libEs5/components/StreamingMedia/configValidators.js +24 -0
- package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
- package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +112 -0
- package/libEs5/components/StreamingMedia/createMediaRequest.js +29 -0
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
- package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +58 -0
- package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +72 -0
- package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +90 -0
- package/libEs5/components/StreamingMedia/createTrackMediaSession.js +52 -0
- package/libEs5/components/StreamingMedia/index.js +69 -0
- package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +40 -0
- package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +35 -0
- package/libEs5/constants/apiVersion.js +15 -0
- package/libEs5/constants/browser.js +22 -0
- package/libEs5/constants/consentPurpose.js +16 -0
- package/libEs5/constants/consentStatus.js +18 -0
- package/libEs5/constants/contentType.js +16 -0
- package/libEs5/constants/cookieNameKey.js +18 -0
- package/libEs5/constants/cookieNamePrefix.js +16 -0
- package/libEs5/constants/coreCommands.js +17 -0
- package/libEs5/constants/debugQueryParam.js +15 -0
- package/libEs5/constants/decisionProvider.js +15 -0
- package/libEs5/constants/domain.js +17 -0
- package/libEs5/constants/ecidNamespace.js +15 -0
- package/libEs5/constants/edgeBasePath.js +15 -0
- package/libEs5/constants/elementAttribute.js +16 -0
- package/libEs5/constants/eventType.js +20 -0
- package/libEs5/constants/handle.js +15 -0
- package/libEs5/constants/highEntropyUserAgentClientHints.js +15 -0
- package/libEs5/constants/httpHeaderNames.js +17 -0
- package/libEs5/constants/httpStatusCode.js +20 -0
- package/libEs5/constants/identityMapAuthenticatedState.js +17 -0
- package/libEs5/constants/legacyCookies.js +18 -0
- package/libEs5/constants/libraryName.js +15 -0
- package/libEs5/constants/libraryVersion.js +17 -0
- package/libEs5/constants/namespace.js +15 -0
- package/libEs5/constants/pageWideScope.js +15 -0
- package/libEs5/constants/propositionEventType.js +32 -0
- package/libEs5/constants/queryStringIdentityParam.js +15 -0
- package/libEs5/constants/schema.js +25 -0
- package/libEs5/constants/shadowSeparator.js +15 -0
- package/libEs5/constants/tagName.js +22 -0
- package/libEs5/core/buildAndValidateConfig.js +115 -0
- package/libEs5/core/componentCreators.js +39 -0
- package/libEs5/core/config/createConfig.js +20 -0
- package/libEs5/core/config/createCoreConfigs.js +31 -0
- package/libEs5/core/consent/createConsent.js +61 -0
- package/libEs5/core/consent/createConsentStateMachine.js +137 -0
- package/libEs5/core/createComponentRegistry.js +86 -0
- package/libEs5/core/createCookieTransfer.js +80 -0
- package/libEs5/core/createEvent.js +170 -0
- package/libEs5/core/createEventManager.js +144 -0
- package/libEs5/core/createInstanceFunction.js +27 -0
- package/libEs5/core/createLifecycle.js +74 -0
- package/libEs5/core/createLogController.js +70 -0
- package/libEs5/core/createLogger.js +103 -0
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +27 -0
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +66 -0
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +42 -0
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +35 -0
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +99 -0
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +28 -0
- package/libEs5/core/index.js +238 -0
- package/libEs5/core/initializeComponents.js +41 -0
- package/libEs5/core/injectCreateResponse.js +77 -0
- package/libEs5/core/injectExecuteCommand.js +104 -0
- package/libEs5/core/injectHandleError.js +36 -0
- package/libEs5/core/injectShouldTransferCookie.js +28 -0
- package/libEs5/core/network/getRequestRetryDelay.js +73 -0
- package/libEs5/core/network/injectSendNetworkRequest.js +102 -0
- package/libEs5/core/network/isRequestRetryable.js +27 -0
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +39 -0
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +44 -0
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +50 -0
- package/libEs5/core/validateCommandOptions.js +34 -0
- package/libEs5/index.js +59 -0
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +24 -0
- package/libEs5/utils/assign.js +16 -0
- package/libEs5/utils/assignConcatArrayValues.js +48 -0
- package/libEs5/utils/assignIf.js +21 -0
- package/libEs5/utils/clone.js +22 -0
- package/libEs5/utils/cookieJar.js +21 -0
- package/libEs5/utils/crc32.js +36 -0
- package/libEs5/utils/createCallbackAggregator.js +38 -0
- package/libEs5/utils/createLoggingCookieJar.js +33 -0
- package/libEs5/utils/createMerger.js +33 -0
- package/libEs5/utils/createSubscription.js +90 -0
- package/libEs5/utils/createTaskQueue.js +50 -0
- package/libEs5/utils/deduplicateArray.js +31 -0
- package/libEs5/utils/deepAssign.js +48 -0
- package/libEs5/utils/defer.js +26 -0
- package/libEs5/utils/dom/appendNode.js +17 -0
- package/libEs5/utils/dom/awaitSelector.js +105 -0
- package/libEs5/utils/dom/createNode.js +47 -0
- package/libEs5/utils/dom/index.js +58 -0
- package/libEs5/utils/dom/isShadowSelector.js +18 -0
- package/libEs5/utils/dom/matchesSelector.js +28 -0
- package/libEs5/utils/dom/querySelectorAll.js +32 -0
- package/libEs5/utils/dom/removeNode.js +21 -0
- package/libEs5/utils/dom/selectNodes.js +30 -0
- package/libEs5/utils/dom/selectNodesWithShadow.js +66 -0
- package/libEs5/utils/endsWith.js +23 -0
- package/libEs5/utils/filterObject.js +55 -0
- package/libEs5/utils/find.js +30 -0
- package/libEs5/utils/fireImage.js +38 -0
- package/libEs5/utils/flatMap.js +17 -0
- package/libEs5/utils/flattenArray.js +36 -0
- package/libEs5/utils/flattenObject.js +42 -0
- package/libEs5/utils/getApexDomain.js +45 -0
- package/libEs5/utils/getBrowser.js +35 -0
- package/libEs5/utils/getLastArrayItems.js +23 -0
- package/libEs5/utils/getNamespacedCookieName.js +19 -0
- package/libEs5/utils/groupBy.js +31 -0
- package/libEs5/utils/includes.js +23 -0
- package/libEs5/utils/index.js +408 -0
- package/libEs5/utils/injectDoesIdentityCookieExist.js +27 -0
- package/libEs5/utils/injectFireReferrerHideableImage.js +75 -0
- package/libEs5/utils/injectStorage.js +74 -0
- package/libEs5/utils/intersection.js +26 -0
- package/libEs5/utils/isBlankString.js +23 -0
- package/libEs5/utils/isBoolean.js +22 -0
- package/libEs5/utils/isEmptyObject.js +23 -0
- package/libEs5/utils/isFunction.js +22 -0
- package/libEs5/utils/isInteger.js +24 -0
- package/libEs5/utils/isNamespacedCookieName.js +26 -0
- package/libEs5/utils/isNil.js +22 -0
- package/libEs5/utils/isNonEmptyArray.js +22 -0
- package/libEs5/utils/isNonEmptyString.js +23 -0
- package/libEs5/utils/isNumber.js +23 -0
- package/libEs5/utils/isObject.js +23 -0
- package/libEs5/utils/isString.js +22 -0
- package/libEs5/utils/isUnique.js +30 -0
- package/libEs5/utils/isValidRegExp.js +26 -0
- package/libEs5/utils/memoize.js +36 -0
- package/libEs5/utils/noop.js +18 -0
- package/libEs5/utils/padStart.js +27 -0
- package/libEs5/utils/parseUrl.js +72 -0
- package/libEs5/utils/prepareConfigOverridesForEdge.js +52 -0
- package/libEs5/utils/querystring.js +16 -0
- package/libEs5/utils/request/createAddIdentity.js +22 -0
- package/libEs5/utils/request/createDataCollectionRequest.js +68 -0
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +35 -0
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +44 -0
- package/libEs5/utils/request/createHasIdentity.js +19 -0
- package/libEs5/utils/request/createRequest.js +62 -0
- package/libEs5/utils/request/createRequestParams.js +44 -0
- package/libEs5/utils/request/createRequestPayload.js +36 -0
- package/libEs5/utils/request/index.js +58 -0
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +17 -0
- package/libEs5/utils/stackError.js +34 -0
- package/libEs5/utils/startsWith.js +23 -0
- package/libEs5/utils/stringToBoolean.js +18 -0
- package/libEs5/utils/toArray.js +23 -0
- package/libEs5/utils/toError.js +23 -0
- package/libEs5/utils/toISOStringLocal.js +39 -0
- package/libEs5/utils/toInteger.js +31 -0
- package/libEs5/utils/updateErrorMessage.js +24 -0
- package/libEs5/utils/uuid.js +16 -0
- package/libEs5/utils/validateConfigOverride.js +16 -0
- package/libEs5/utils/validateIdentityMap.js +25 -0
- package/libEs5/utils/validation/booleanValidator.js +20 -0
- package/libEs5/utils/validation/callbackValidator.js +20 -0
- package/libEs5/utils/validation/createAnyOfValidator.js +32 -0
- package/libEs5/utils/validation/createArrayOfValidator.js +34 -0
- package/libEs5/utils/validation/createDefaultValidator.js +22 -0
- package/libEs5/utils/validation/createDeprecatedValidator.js +44 -0
- package/libEs5/utils/validation/createLiteralValidator.js +21 -0
- package/libEs5/utils/validation/createMapOfValuesValidator.js +40 -0
- package/libEs5/utils/validation/createMaximumValidator.js +21 -0
- package/libEs5/utils/validation/createMinimumValidator.js +21 -0
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +29 -0
- package/libEs5/utils/validation/createNonEmptyValidator.js +27 -0
- package/libEs5/utils/validation/createObjectOfValidator.js +48 -0
- package/libEs5/utils/validation/createUniqueItemsValidator.js +21 -0
- package/libEs5/utils/validation/createUniqueValidator.js +23 -0
- package/libEs5/utils/validation/domainValidator.js +21 -0
- package/libEs5/utils/validation/index.js +239 -0
- package/libEs5/utils/validation/integerValidator.js +20 -0
- package/libEs5/utils/validation/matchesRegexpValidator.js +21 -0
- package/libEs5/utils/validation/numberValidator.js +20 -0
- package/libEs5/utils/validation/regexpValidator.js +20 -0
- package/libEs5/utils/validation/requiredValidator.js +20 -0
- package/libEs5/utils/validation/stringValidator.js +20 -0
- package/libEs5/utils/validation/utils.js +137 -0
- package/libEs5/utils/values.js +25 -0
- package/libEs6/baseCode/index.js +61 -0
- package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +52 -0
- package/libEs6/components/ActivityCollector/configValidators.js +19 -0
- package/libEs6/components/ActivityCollector/createGetLinkDetails.js +70 -0
- package/libEs6/components/ActivityCollector/createLinkClick.js +37 -0
- package/libEs6/components/ActivityCollector/getLinkName.js +136 -0
- package/libEs6/components/ActivityCollector/getLinkRegion.js +58 -0
- package/libEs6/components/ActivityCollector/index.js +80 -0
- package/libEs6/components/ActivityCollector/utils.js +104 -0
- package/libEs6/components/Audiences/index.js +47 -0
- package/libEs6/components/Audiences/injectProcessDestinations.js +60 -0
- package/libEs6/components/Audiences/injectProcessResponse.js +38 -0
- package/libEs6/components/Context/createComponent.js +34 -0
- package/libEs6/components/Context/implementationDetails.js +24 -0
- package/libEs6/components/Context/index.js +52 -0
- package/libEs6/components/Context/injectDevice.js +70 -0
- package/libEs6/components/Context/injectEnvironment.js +42 -0
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +45 -0
- package/libEs6/components/Context/injectPlaceContext.js +29 -0
- package/libEs6/components/Context/injectTimestamp.js +21 -0
- package/libEs6/components/Context/injectWeb.js +28 -0
- package/libEs6/components/DataCollector/index.js +106 -0
- package/libEs6/components/DataCollector/validateApplyResponse.js +33 -0
- package/libEs6/components/DataCollector/validateUserEventOptions.js +49 -0
- package/libEs6/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +30 -0
- package/libEs6/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
- package/libEs6/components/DecisioningEngine/constants.js +25 -0
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +31 -0
- package/libEs6/components/DecisioningEngine/createConsequenceAdapter.js +29 -0
- package/libEs6/components/DecisioningEngine/createContextProvider.js +95 -0
- package/libEs6/components/DecisioningEngine/createDecisionHistory.js +25 -0
- package/libEs6/components/DecisioningEngine/createDecisionProvider.js +41 -0
- package/libEs6/components/DecisioningEngine/createEvaluableRulesetPayload.js +79 -0
- package/libEs6/components/DecisioningEngine/createEvaluateRulesetsCommand.js +45 -0
- package/libEs6/components/DecisioningEngine/createEventRegistry.js +120 -0
- package/libEs6/components/DecisioningEngine/createOnResponseHandler.js +45 -0
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +79 -0
- package/libEs6/components/DecisioningEngine/index.js +124 -0
- package/libEs6/components/DecisioningEngine/utils.js +83 -0
- package/libEs6/components/EventMerge/createComponent.js +23 -0
- package/libEs6/components/EventMerge/createEventMergeId.js +18 -0
- package/libEs6/components/EventMerge/index.js +21 -0
- package/libEs6/components/Identity/addEcidQueryToPayload.js +20 -0
- package/libEs6/components/Identity/addEcidToPayload.js +18 -0
- package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +23 -0
- package/libEs6/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +31 -0
- package/libEs6/components/Identity/configValidators.js +18 -0
- package/libEs6/components/Identity/constants/authState.js +15 -0
- package/libEs6/components/Identity/constants/defaultIdSyncTtlMinutes.js +13 -0
- package/libEs6/components/Identity/createComponent.js +97 -0
- package/libEs6/components/Identity/createLegacyIdentity.js +69 -0
- package/libEs6/components/Identity/getEcidFromResponse.js +19 -0
- package/libEs6/components/Identity/getIdentity/createGetIdentity.js +34 -0
- package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +28 -0
- package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +27 -0
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +25 -0
- package/libEs6/components/Identity/index.js +125 -0
- package/libEs6/components/Identity/injectAddLegacyEcidToPayload.js +30 -0
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +59 -0
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +52 -0
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +98 -0
- package/libEs6/components/Identity/injectHandleResponseForIdSyncs.js +19 -0
- package/libEs6/components/Identity/injectProcessIdSyncs.js +34 -0
- package/libEs6/components/Identity/injectSetDomainForInitialIdentityPayload.js +32 -0
- package/libEs6/components/Identity/visitorService/awaitVisitorOptIn.js +33 -0
- package/libEs6/components/Identity/visitorService/getVisitor.js +17 -0
- package/libEs6/components/Identity/visitorService/injectGetEcidFromVisitor.js +48 -0
- package/libEs6/components/LegacyMediaAnalytics/constants/constants.js +141 -0
- package/libEs6/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +46 -0
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +239 -0
- package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +180 -0
- package/libEs6/components/LegacyMediaAnalytics/index.js +67 -0
- package/libEs6/components/LibraryInfo/index.js +59 -0
- package/libEs6/components/MachineLearning/index.js +23 -0
- package/libEs6/components/MachineLearning/processResponse.js +18 -0
- package/libEs6/components/Personalization/constants/loggerMessage.js +13 -0
- package/libEs6/components/Personalization/constants/scopeType.js +15 -0
- package/libEs6/components/Personalization/constants/surface.js +16 -0
- package/libEs6/components/Personalization/createActionsProvider.js +70 -0
- package/libEs6/components/Personalization/createApplyPropositions.js +103 -0
- package/libEs6/components/Personalization/createClickStorage.js +58 -0
- package/libEs6/components/Personalization/createCollect.js +48 -0
- package/libEs6/components/Personalization/createComponent.js +133 -0
- package/libEs6/components/Personalization/createFetchDataHandler.js +84 -0
- package/libEs6/components/Personalization/createGetPageLocation.js +17 -0
- package/libEs6/components/Personalization/createHandleConsentFlicker.js +26 -0
- package/libEs6/components/Personalization/createNotificationHandler.js +33 -0
- package/libEs6/components/Personalization/createOnClickHandler.js +52 -0
- package/libEs6/components/Personalization/createOnDecisionHandler.js +42 -0
- package/libEs6/components/Personalization/createPersonalizationDetails.js +94 -0
- package/libEs6/components/Personalization/createPreprocessors.js +19 -0
- package/libEs6/components/Personalization/createSetTargetMigration.js +27 -0
- package/libEs6/components/Personalization/createViewCacheManager.js +81 -0
- package/libEs6/components/Personalization/createViewChangeHandler.js +47 -0
- package/libEs6/components/Personalization/dom-actions/action.js +49 -0
- package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +36 -0
- package/libEs6/components/Personalization/dom-actions/appendHtml.js +30 -0
- package/libEs6/components/Personalization/dom-actions/clicks/collectClicks.js +91 -0
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +18 -0
- package/libEs6/components/Personalization/dom-actions/createRedirect.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/createFragment.js +19 -0
- package/libEs6/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/getChildren.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/getElementById.js +21 -0
- package/libEs6/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getNonce.js +33 -0
- package/libEs6/components/Personalization/dom-actions/dom/getParent.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/helperForEq.js +19 -0
- package/libEs6/components/Personalization/dom-actions/dom/index.js +26 -0
- package/libEs6/components/Personalization/dom-actions/dom/insertAfter.js +23 -0
- package/libEs6/components/Personalization/dom-actions/dom/insertBefore.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +35 -0
- package/libEs6/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +102 -0
- package/libEs6/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/setStyle.js +21 -0
- package/libEs6/components/Personalization/dom-actions/images.js +31 -0
- package/libEs6/components/Personalization/dom-actions/index.js +13 -0
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +33 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +29 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +29 -0
- package/libEs6/components/Personalization/dom-actions/prependHtml.js +45 -0
- package/libEs6/components/Personalization/dom-actions/rearrangeChildren.js +31 -0
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +34 -0
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +51 -0
- package/libEs6/components/Personalization/dom-actions/replaceHtml.js +18 -0
- package/libEs6/components/Personalization/dom-actions/scripts.js +85 -0
- package/libEs6/components/Personalization/dom-actions/setAttributes.js +18 -0
- package/libEs6/components/Personalization/dom-actions/setHtml.js +24 -0
- package/libEs6/components/Personalization/dom-actions/setStyles.js +22 -0
- package/libEs6/components/Personalization/dom-actions/setText.js +15 -0
- package/libEs6/components/Personalization/dom-actions/swapImage.js +29 -0
- package/libEs6/components/Personalization/event.js +45 -0
- package/libEs6/components/Personalization/flicker/index.js +82 -0
- package/libEs6/components/Personalization/handlers/createProcessDomAction.js +61 -0
- package/libEs6/components/Personalization/handlers/createProcessHtmlContent.js +40 -0
- package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +77 -0
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +175 -0
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +41 -0
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +110 -0
- package/libEs6/components/Personalization/handlers/processDefaultContent.js +17 -0
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +293 -0
- package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +17 -0
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +49 -0
- package/libEs6/components/Personalization/index.js +167 -0
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +21 -0
- package/libEs6/components/Personalization/utils/createAsyncArray.js +35 -0
- package/libEs6/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
- package/libEs6/components/Personalization/utils/surfaceUtils.js +76 -0
- package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +31 -0
- package/libEs6/components/Privacy/computeConsentHash.js +30 -0
- package/libEs6/components/Privacy/createComponent.js +85 -0
- package/libEs6/components/Privacy/createConsentHashStore.js +57 -0
- package/libEs6/components/Privacy/createConsentRequest.js +28 -0
- package/libEs6/components/Privacy/createConsentRequestPayload.js +31 -0
- package/libEs6/components/Privacy/createStoredConsent.js +30 -0
- package/libEs6/components/Privacy/index.js +63 -0
- package/libEs6/components/Privacy/injectSendSetConsentRequest.js +45 -0
- package/libEs6/components/Privacy/parseConsentCookie.js +26 -0
- package/libEs6/components/Privacy/validateSetConsentOptions.js +18 -0
- package/libEs6/components/StreamingMedia/configValidators.js +22 -0
- package/libEs6/components/StreamingMedia/constants/eventTypes.js +31 -0
- package/libEs6/components/StreamingMedia/constants/playbackState.js +16 -0
- package/libEs6/components/StreamingMedia/createMediaEventManager.js +122 -0
- package/libEs6/components/StreamingMedia/createMediaRequest.js +28 -0
- package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
- package/libEs6/components/StreamingMedia/createMediaSessionCacheManager.js +59 -0
- package/libEs6/components/StreamingMedia/createStreamingMediaComponent.js +69 -0
- package/libEs6/components/StreamingMedia/createTrackMediaEvent.js +88 -0
- package/libEs6/components/StreamingMedia/createTrackMediaSession.js +51 -0
- package/libEs6/components/StreamingMedia/index.js +64 -0
- package/libEs6/components/StreamingMedia/validateMediaEventOptions.js +33 -0
- package/libEs6/components/StreamingMedia/validateMediaSessionOptions.js +34 -0
- package/libEs6/constants/apiVersion.js +12 -0
- package/libEs6/constants/browser.js +19 -0
- package/libEs6/constants/consentPurpose.js +13 -0
- package/libEs6/constants/consentStatus.js +15 -0
- package/libEs6/constants/contentType.js +13 -0
- package/libEs6/constants/cookieNameKey.js +15 -0
- package/libEs6/constants/cookieNamePrefix.js +14 -0
- package/libEs6/constants/coreCommands.js +14 -0
- package/libEs6/constants/debugQueryParam.js +13 -0
- package/libEs6/constants/decisionProvider.js +12 -0
- package/libEs6/constants/domain.js +14 -0
- package/libEs6/constants/ecidNamespace.js +13 -0
- package/libEs6/constants/edgeBasePath.js +12 -0
- package/libEs6/constants/elementAttribute.js +13 -0
- package/libEs6/constants/eventType.js +17 -0
- package/libEs6/constants/handle.js +12 -0
- package/libEs6/constants/highEntropyUserAgentClientHints.js +13 -0
- package/libEs6/constants/httpHeaderNames.js +14 -0
- package/libEs6/constants/httpStatusCode.js +17 -0
- package/libEs6/constants/identityMapAuthenticatedState.js +14 -0
- package/libEs6/constants/legacyCookies.js +15 -0
- package/libEs6/constants/libraryName.js +13 -0
- package/libEs6/constants/libraryVersion.js +16 -0
- package/libEs6/constants/namespace.js +13 -0
- package/libEs6/constants/pageWideScope.js +13 -0
- package/libEs6/constants/propositionEventType.js +33 -0
- package/libEs6/constants/queryStringIdentityParam.js +13 -0
- package/libEs6/constants/schema.js +22 -0
- package/libEs6/constants/shadowSeparator.js +13 -0
- package/libEs6/constants/tagName.js +19 -0
- package/libEs6/core/buildAndValidateConfig.js +94 -0
- package/libEs6/core/componentCreators.js +47 -0
- package/libEs6/core/config/createConfig.js +17 -0
- package/libEs6/core/config/createCoreConfigs.js +27 -0
- package/libEs6/core/consent/createConsent.js +60 -0
- package/libEs6/core/consent/createConsentStateMachine.js +125 -0
- package/libEs6/core/createComponentRegistry.js +83 -0
- package/libEs6/core/createCookieTransfer.js +78 -0
- package/libEs6/core/createEvent.js +161 -0
- package/libEs6/core/createEventManager.js +135 -0
- package/libEs6/core/createInstanceFunction.js +25 -0
- package/libEs6/core/createLifecycle.js +65 -0
- package/libEs6/core/createLogController.js +68 -0
- package/libEs6/core/createLogger.js +99 -0
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +24 -0
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +58 -0
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +39 -0
- package/libEs6/core/edgeNetwork/injectGetLocationHint.js +32 -0
- package/libEs6/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +100 -0
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +21 -0
- package/libEs6/core/index.js +236 -0
- package/libEs6/core/initializeComponents.js +40 -0
- package/libEs6/core/injectCreateResponse.js +70 -0
- package/libEs6/core/injectExecuteCommand.js +100 -0
- package/libEs6/core/injectHandleError.js +33 -0
- package/libEs6/core/injectShouldTransferCookie.js +25 -0
- package/libEs6/core/network/getRequestRetryDelay.js +72 -0
- package/libEs6/core/network/injectSendNetworkRequest.js +96 -0
- package/libEs6/core/network/isRequestRetryable.js +25 -0
- package/libEs6/core/network/requestMethods/injectSendBeaconRequest.js +38 -0
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +41 -0
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +49 -0
- package/libEs6/core/validateCommandOptions.js +33 -0
- package/libEs6/index.js +55 -0
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +20 -0
- package/libEs6/utils/assign.js +14 -0
- package/libEs6/utils/assignConcatArrayValues.js +36 -0
- package/libEs6/utils/assignIf.js +19 -0
- package/libEs6/utils/clone.js +18 -0
- package/libEs6/utils/cookieJar.js +19 -0
- package/libEs6/utils/crc32.js +33 -0
- package/libEs6/utils/createCallbackAggregator.js +31 -0
- package/libEs6/utils/createLoggingCookieJar.js +28 -0
- package/libEs6/utils/createMerger.js +30 -0
- package/libEs6/utils/createSubscription.js +70 -0
- package/libEs6/utils/createTaskQueue.js +48 -0
- package/libEs6/utils/deduplicateArray.js +23 -0
- package/libEs6/utils/deepAssign.js +40 -0
- package/libEs6/utils/defer.js +24 -0
- package/libEs6/utils/dom/appendNode.js +15 -0
- package/libEs6/utils/dom/awaitSelector.js +98 -0
- package/libEs6/utils/dom/createNode.js +38 -0
- package/libEs6/utils/dom/index.js +20 -0
- package/libEs6/utils/dom/isShadowSelector.js +14 -0
- package/libEs6/utils/dom/matchesSelector.js +26 -0
- package/libEs6/utils/dom/querySelectorAll.js +29 -0
- package/libEs6/utils/dom/removeNode.js +19 -0
- package/libEs6/utils/dom/selectNodes.js +28 -0
- package/libEs6/utils/dom/selectNodesWithShadow.js +63 -0
- package/libEs6/utils/endsWith.js +19 -0
- package/libEs6/utils/filterObject.js +55 -0
- package/libEs6/utils/find.js +28 -0
- package/libEs6/utils/fireImage.js +37 -0
- package/libEs6/utils/flatMap.js +14 -0
- package/libEs6/utils/flattenArray.js +26 -0
- package/libEs6/utils/flattenObject.js +28 -0
- package/libEs6/utils/getApexDomain.js +42 -0
- package/libEs6/utils/getBrowser.js +65 -0
- package/libEs6/utils/getLastArrayItems.js +19 -0
- package/libEs6/utils/getNamespacedCookieName.js +15 -0
- package/libEs6/utils/groupBy.js +29 -0
- package/libEs6/utils/includes.js +21 -0
- package/libEs6/utils/index.js +71 -0
- package/libEs6/utils/injectDoesIdentityCookieExist.js +24 -0
- package/libEs6/utils/injectFireReferrerHideableImage.js +65 -0
- package/libEs6/utils/injectStorage.js +69 -0
- package/libEs6/utils/intersection.js +21 -0
- package/libEs6/utils/isBlankString.js +20 -0
- package/libEs6/utils/isBoolean.js +18 -0
- package/libEs6/utils/isEmptyObject.js +20 -0
- package/libEs6/utils/isFunction.js +18 -0
- package/libEs6/utils/isInteger.js +23 -0
- package/libEs6/utils/isNamespacedCookieName.js +23 -0
- package/libEs6/utils/isNil.js +18 -0
- package/libEs6/utils/isNonEmptyArray.js +18 -0
- package/libEs6/utils/isNonEmptyString.js +20 -0
- package/libEs6/utils/isNumber.js +19 -0
- package/libEs6/utils/isObject.js +20 -0
- package/libEs6/utils/isString.js +18 -0
- package/libEs6/utils/isUnique.js +27 -0
- package/libEs6/utils/isValidRegExp.js +24 -0
- package/libEs6/utils/memoize.js +34 -0
- package/libEs6/utils/noop.js +16 -0
- package/libEs6/utils/padStart.js +25 -0
- package/libEs6/utils/parseUrl.js +62 -0
- package/libEs6/utils/prepareConfigOverridesForEdge.js +50 -0
- package/libEs6/utils/querystring.js +14 -0
- package/libEs6/utils/request/createAddIdentity.js +19 -0
- package/libEs6/utils/request/createDataCollectionRequest.js +69 -0
- package/libEs6/utils/request/createDataCollectionRequestPayload.js +30 -0
- package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +42 -0
- package/libEs6/utils/request/createHasIdentity.js +15 -0
- package/libEs6/utils/request/createRequest.js +63 -0
- package/libEs6/utils/request/createRequestParams.js +40 -0
- package/libEs6/utils/request/createRequestPayload.js +35 -0
- package/libEs6/utils/request/index.js +20 -0
- package/libEs6/utils/sanitizeOrgIdForCookieName.js +13 -0
- package/libEs6/utils/stackError.js +34 -0
- package/libEs6/utils/startsWith.js +19 -0
- package/libEs6/utils/stringToBoolean.js +15 -0
- package/libEs6/utils/toArray.js +21 -0
- package/libEs6/utils/toError.js +21 -0
- package/libEs6/utils/toISOStringLocal.js +37 -0
- package/libEs6/utils/toInteger.js +30 -0
- package/libEs6/utils/updateErrorMessage.js +23 -0
- package/libEs6/utils/uuid.js +14 -0
- package/libEs6/utils/validateConfigOverride.js +14 -0
- package/libEs6/utils/validateIdentityMap.js +23 -0
- package/libEs6/utils/validation/booleanValidator.js +18 -0
- package/libEs6/utils/validation/callbackValidator.js +17 -0
- package/libEs6/utils/validation/createAnyOfValidator.js +26 -0
- package/libEs6/utils/validation/createArrayOfValidator.js +28 -0
- package/libEs6/utils/validation/createDefaultValidator.js +18 -0
- package/libEs6/utils/validation/createDeprecatedValidator.js +37 -0
- package/libEs6/utils/validation/createLiteralValidator.js +16 -0
- package/libEs6/utils/validation/createMapOfValuesValidator.js +35 -0
- package/libEs6/utils/validation/createMaximumValidator.js +16 -0
- package/libEs6/utils/validation/createMinimumValidator.js +16 -0
- package/libEs6/utils/validation/createNoUnknownFieldsValidator.js +25 -0
- package/libEs6/utils/validation/createNonEmptyValidator.js +23 -0
- package/libEs6/utils/validation/createObjectOfValidator.js +43 -0
- package/libEs6/utils/validation/createUniqueItemsValidator.js +18 -0
- package/libEs6/utils/validation/createUniqueValidator.js +21 -0
- package/libEs6/utils/validation/domainValidator.js +17 -0
- package/libEs6/utils/validation/index.js +232 -0
- package/libEs6/utils/validation/integerValidator.js +18 -0
- package/libEs6/utils/validation/matchesRegexpValidator.js +17 -0
- package/libEs6/utils/validation/numberValidator.js +18 -0
- package/libEs6/utils/validation/regexpValidator.js +18 -0
- package/libEs6/utils/validation/requiredValidator.js +18 -0
- package/libEs6/utils/validation/stringValidator.js +17 -0
- package/libEs6/utils/validation/utils.js +127 -0
- package/libEs6/utils/values.js +21 -0
- package/package.json +2 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _index = require("../../utils/index.js");
|
|
5
|
+
var _mergeLifecycleResponses = require("./mergeLifecycleResponses.js");
|
|
6
|
+
var _handleRequestFailure = require("./handleRequestFailure.js");
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
9
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var HTTP_STATUS_OK = 200;
|
|
20
|
+
var _default = exports.default = function _default(_ref) {
|
|
21
|
+
var cookieTransfer = _ref.cookieTransfer,
|
|
22
|
+
lifecycle = _ref.lifecycle,
|
|
23
|
+
createResponse = _ref.createResponse,
|
|
24
|
+
processWarningsAndErrors = _ref.processWarningsAndErrors;
|
|
25
|
+
return function (_ref2) {
|
|
26
|
+
var request = _ref2.request,
|
|
27
|
+
responseHeaders = _ref2.responseHeaders,
|
|
28
|
+
responseBody = _ref2.responseBody,
|
|
29
|
+
_ref2$runOnResponseCa = _ref2.runOnResponseCallbacks,
|
|
30
|
+
runOnResponseCallbacks = _ref2$runOnResponseCa === void 0 ? _index.noop : _ref2$runOnResponseCa,
|
|
31
|
+
_ref2$runOnRequestFai = _ref2.runOnRequestFailureCallbacks,
|
|
32
|
+
runOnRequestFailureCallbacks = _ref2$runOnRequestFai === void 0 ? _index.noop : _ref2$runOnRequestFai;
|
|
33
|
+
var onResponseCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
34
|
+
onResponseCallbackAggregator.add(lifecycle.onResponse);
|
|
35
|
+
onResponseCallbackAggregator.add(runOnResponseCallbacks);
|
|
36
|
+
var onRequestFailureCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
37
|
+
onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure);
|
|
38
|
+
onRequestFailureCallbackAggregator.add(runOnRequestFailureCallbacks);
|
|
39
|
+
var getHeader = function getHeader(key) {
|
|
40
|
+
return responseHeaders[key];
|
|
41
|
+
};
|
|
42
|
+
return lifecycle.onBeforeRequest({
|
|
43
|
+
request: request,
|
|
44
|
+
onResponse: onResponseCallbackAggregator.add,
|
|
45
|
+
onRequestFailure: onRequestFailureCallbackAggregator.add
|
|
46
|
+
}).then(function () {
|
|
47
|
+
return processWarningsAndErrors({
|
|
48
|
+
statusCode: HTTP_STATUS_OK,
|
|
49
|
+
getHeader: getHeader,
|
|
50
|
+
body: JSON.stringify(responseBody),
|
|
51
|
+
parsedBody: responseBody
|
|
52
|
+
});
|
|
53
|
+
}).catch((0, _handleRequestFailure.default)(onRequestFailureCallbackAggregator)).then(function () {
|
|
54
|
+
var response = createResponse({
|
|
55
|
+
content: responseBody,
|
|
56
|
+
getHeader: getHeader
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// This will clobber any cookies set via HTTP from the server. So care should be given to remove any state:store handles if that is not desirable
|
|
60
|
+
cookieTransfer.responseToCookies(response);
|
|
61
|
+
return onResponseCallbackAggregator.call({
|
|
62
|
+
response: response
|
|
63
|
+
}).then(_mergeLifecycleResponses.default);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
6
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
var _default = exports.default = function _default(_ref) {
|
|
16
|
+
var logger = _ref.logger;
|
|
17
|
+
return function (adobeEdgeHeader) {
|
|
18
|
+
if (adobeEdgeHeader) {
|
|
19
|
+
var headerParts = adobeEdgeHeader.split(";");
|
|
20
|
+
if (headerParts.length >= 2 && headerParts[1].length > 0) {
|
|
21
|
+
try {
|
|
22
|
+
var regionId = parseInt(headerParts[1], 10);
|
|
23
|
+
// eslint recommends using Number.isNaN instead, but this function is
|
|
24
|
+
// not available in Internet Explorer. Number.isNaN is more robust to
|
|
25
|
+
// non-numeric parameters. Since we already know regionId will be an
|
|
26
|
+
// integer, using isNaN is okay.
|
|
27
|
+
// https://github.com/airbnb/javascript#standard-library--isnan
|
|
28
|
+
// eslint-disable-next-line no-restricted-globals
|
|
29
|
+
if (!isNaN(regionId)) {
|
|
30
|
+
return {
|
|
31
|
+
regionId: regionId
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// No need to do anything. The log statement below will log an error
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
logger.warn("Invalid adobe edge: \"" + adobeEdgeHeader + "\"");
|
|
39
|
+
}
|
|
40
|
+
return {};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _index = require("../../utils/index.js");
|
|
5
|
+
var _cookieNameKey = require("../../constants/cookieNameKey.js");
|
|
6
|
+
var _legacyCookies = require("../../constants/legacyCookies.js");
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
9
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
var _default = exports.default = function _default(_ref) {
|
|
19
|
+
var orgId = _ref.orgId,
|
|
20
|
+
cookieJar = _ref.cookieJar;
|
|
21
|
+
var clusterCookieName = (0, _index.getNamespacedCookieName)(orgId, _cookieNameKey.CLUSTER);
|
|
22
|
+
var fromClusterCookie = function fromClusterCookie() {
|
|
23
|
+
return cookieJar.get(clusterCookieName);
|
|
24
|
+
};
|
|
25
|
+
var fromTarget = function fromTarget() {
|
|
26
|
+
var mboxEdgeCluster = cookieJar.get(_legacyCookies.MBOX_EDGE_CLUSTER);
|
|
27
|
+
if (mboxEdgeCluster) {
|
|
28
|
+
return "t" + mboxEdgeCluster;
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
};
|
|
32
|
+
return function () {
|
|
33
|
+
return fromClusterCookie() || fromTarget();
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _httpStatusCode = require("../../constants/httpStatusCode.js");
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var MESSAGE_PREFIX = "The server responded with a";
|
|
18
|
+
var _default = exports.default = function _default(_ref) {
|
|
19
|
+
var logger = _ref.logger;
|
|
20
|
+
return function (networkResponse) {
|
|
21
|
+
var statusCode = networkResponse.statusCode,
|
|
22
|
+
body = networkResponse.body,
|
|
23
|
+
parsedBody = networkResponse.parsedBody;
|
|
24
|
+
if (statusCode < 200 || statusCode >= 300 || !parsedBody && statusCode !== _httpStatusCode.NO_CONTENT || parsedBody && !Array.isArray(parsedBody.handle)) {
|
|
25
|
+
var bodyToLog = parsedBody ? JSON.stringify(parsedBody, null, 2) : body;
|
|
26
|
+
var messageSuffix = bodyToLog ? "response body:\n" + bodyToLog : "no response body.";
|
|
27
|
+
throw new Error(MESSAGE_PREFIX + " status code " + statusCode + " and " + messageSuffix);
|
|
28
|
+
}
|
|
29
|
+
if (parsedBody) {
|
|
30
|
+
var _parsedBody$warnings = parsedBody.warnings,
|
|
31
|
+
warnings = _parsedBody$warnings === void 0 ? [] : _parsedBody$warnings,
|
|
32
|
+
_parsedBody$errors = parsedBody.errors,
|
|
33
|
+
errors = _parsedBody$errors === void 0 ? [] : _parsedBody$errors;
|
|
34
|
+
warnings.forEach(function (warning) {
|
|
35
|
+
logger.warn(MESSAGE_PREFIX + " warning:", warning);
|
|
36
|
+
});
|
|
37
|
+
errors.forEach(function (error) {
|
|
38
|
+
logger.error(MESSAGE_PREFIX + " non-fatal error:", error);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _domain = require("../../constants/domain.js");
|
|
5
|
+
var _apiVersion = require("../../constants/apiVersion.js");
|
|
6
|
+
var _index = require("../../utils/index.js");
|
|
7
|
+
var _mergeLifecycleResponses = require("./mergeLifecycleResponses.js");
|
|
8
|
+
var _handleRequestFailure = require("./handleRequestFailure.js");
|
|
9
|
+
/*
|
|
10
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
11
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
|
|
15
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
var _default = exports.default = function _default(_ref) {
|
|
21
|
+
var config = _ref.config,
|
|
22
|
+
lifecycle = _ref.lifecycle,
|
|
23
|
+
cookieTransfer = _ref.cookieTransfer,
|
|
24
|
+
sendNetworkRequest = _ref.sendNetworkRequest,
|
|
25
|
+
createResponse = _ref.createResponse,
|
|
26
|
+
processWarningsAndErrors = _ref.processWarningsAndErrors,
|
|
27
|
+
getLocationHint = _ref.getLocationHint,
|
|
28
|
+
getAssuranceValidationTokenParams = _ref.getAssuranceValidationTokenParams;
|
|
29
|
+
var edgeDomain = config.edgeDomain,
|
|
30
|
+
edgeBasePath = config.edgeBasePath,
|
|
31
|
+
datastreamId = config.datastreamId;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Sends a network request that is aware of payload interfaces,
|
|
35
|
+
* lifecycle methods, configured edge domains, response structures, etc.
|
|
36
|
+
*/
|
|
37
|
+
return function (_ref2) {
|
|
38
|
+
var request = _ref2.request,
|
|
39
|
+
_ref2$runOnResponseCa = _ref2.runOnResponseCallbacks,
|
|
40
|
+
runOnResponseCallbacks = _ref2$runOnResponseCa === void 0 ? _index.noop : _ref2$runOnResponseCa,
|
|
41
|
+
_ref2$runOnRequestFai = _ref2.runOnRequestFailureCallbacks,
|
|
42
|
+
runOnRequestFailureCallbacks = _ref2$runOnRequestFai === void 0 ? _index.noop : _ref2$runOnRequestFai;
|
|
43
|
+
var onResponseCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
44
|
+
onResponseCallbackAggregator.add(lifecycle.onResponse);
|
|
45
|
+
onResponseCallbackAggregator.add(runOnResponseCallbacks);
|
|
46
|
+
var onRequestFailureCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
47
|
+
onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure);
|
|
48
|
+
onRequestFailureCallbackAggregator.add(runOnRequestFailureCallbacks);
|
|
49
|
+
return lifecycle.onBeforeRequest({
|
|
50
|
+
request: request,
|
|
51
|
+
onResponse: onResponseCallbackAggregator.add,
|
|
52
|
+
onRequestFailure: onRequestFailureCallbackAggregator.add
|
|
53
|
+
}).then(function () {
|
|
54
|
+
var endpointDomain = request.getUseIdThirdPartyDomain() ? _domain.ID_THIRD_PARTY : edgeDomain;
|
|
55
|
+
var locationHint = getLocationHint();
|
|
56
|
+
var edgeBasePathWithLocationHint = locationHint ? edgeBasePath + "/" + locationHint + request.getEdgeSubPath() : "" + edgeBasePath + request.getEdgeSubPath();
|
|
57
|
+
var configId = request.getDatastreamIdOverride() || datastreamId;
|
|
58
|
+
var payload = request.getPayload();
|
|
59
|
+
if (configId !== datastreamId) {
|
|
60
|
+
payload.mergeMeta({
|
|
61
|
+
sdkConfig: {
|
|
62
|
+
datastream: {
|
|
63
|
+
original: datastreamId
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
var url = "https://" + endpointDomain + "/" + edgeBasePathWithLocationHint + "/" + _apiVersion.default + "/" + request.getAction() + "?configId=" + configId + "&requestId=" + request.getId() + getAssuranceValidationTokenParams();
|
|
69
|
+
cookieTransfer.cookiesToPayload(payload, endpointDomain);
|
|
70
|
+
return sendNetworkRequest({
|
|
71
|
+
requestId: request.getId(),
|
|
72
|
+
url: url,
|
|
73
|
+
payload: payload,
|
|
74
|
+
useSendBeacon: request.getUseSendBeacon()
|
|
75
|
+
});
|
|
76
|
+
}).then(function (networkResponse) {
|
|
77
|
+
processWarningsAndErrors(networkResponse);
|
|
78
|
+
return networkResponse;
|
|
79
|
+
}).catch((0, _handleRequestFailure.default)(onRequestFailureCallbackAggregator)).then(function (_ref3) {
|
|
80
|
+
var parsedBody = _ref3.parsedBody,
|
|
81
|
+
getHeader = _ref3.getHeader;
|
|
82
|
+
// Note that networkResponse.parsedBody may be undefined if it was a
|
|
83
|
+
// 204 No Content response. That's fine.
|
|
84
|
+
var response = createResponse({
|
|
85
|
+
content: parsedBody,
|
|
86
|
+
getHeader: getHeader
|
|
87
|
+
});
|
|
88
|
+
cookieTransfer.responseToCookies(response);
|
|
89
|
+
|
|
90
|
+
// Notice we're calling the onResponse lifecycle method even if there are errors
|
|
91
|
+
// inside the response body. This is because the full request didn't actually fail--
|
|
92
|
+
// only portions of it that are considered non-fatal (a specific, non-critical
|
|
93
|
+
// Konductor plugin, for example).
|
|
94
|
+
return onResponseCallbackAggregator.call({
|
|
95
|
+
response: response
|
|
96
|
+
}).then(_mergeLifecycleResponses.default);
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _index = require("../../utils/index.js");
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /*
|
|
11
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
12
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
var _default = exports.default = function _default(returnValues) {
|
|
22
|
+
// Merges all returned objects from all `onResponse` callbacks into
|
|
23
|
+
// a single object that can later be returned to the customer.
|
|
24
|
+
var lifecycleOnResponseReturnValues = returnValues.shift() || [];
|
|
25
|
+
var consumerOnResponseReturnValues = returnValues.shift() || [];
|
|
26
|
+
var lifecycleOnBeforeRequestReturnValues = returnValues;
|
|
27
|
+
return _index.assignConcatArrayValues.apply(void 0, [{}].concat(_toConsumableArray(lifecycleOnResponseReturnValues), _toConsumableArray(consumerOnResponseReturnValues), _toConsumableArray(lifecycleOnBeforeRequestReturnValues)));
|
|
28
|
+
};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = exports.createExecuteCommand = void 0;
|
|
4
|
+
var _createInstanceFunction = require("./createInstanceFunction.js");
|
|
5
|
+
var _index = require("../utils/index.js");
|
|
6
|
+
var _createLogController = require("./createLogController.js");
|
|
7
|
+
var _createLifecycle = require("./createLifecycle.js");
|
|
8
|
+
var _createComponentRegistry = require("./createComponentRegistry.js");
|
|
9
|
+
var _injectSendNetworkRequest = require("./network/injectSendNetworkRequest.js");
|
|
10
|
+
var _injectExtractEdgeInfo = require("./edgeNetwork/injectExtractEdgeInfo.js");
|
|
11
|
+
var _createConsent = require("./consent/createConsent.js");
|
|
12
|
+
var _createConsentStateMachine = require("./consent/createConsentStateMachine.js");
|
|
13
|
+
var _createEvent = require("./createEvent.js");
|
|
14
|
+
var _injectCreateResponse = require("./injectCreateResponse.js");
|
|
15
|
+
var _injectExecuteCommand = require("./injectExecuteCommand.js");
|
|
16
|
+
var _validateCommandOptions = require("./validateCommandOptions.js");
|
|
17
|
+
var _componentCreators = require("./componentCreators.js");
|
|
18
|
+
var _buildAndValidateConfig = require("./buildAndValidateConfig.js");
|
|
19
|
+
var _initializeComponents = require("./initializeComponents.js");
|
|
20
|
+
var _createConfig = require("./config/createConfig.js");
|
|
21
|
+
var _createCoreConfigs = require("./config/createCoreConfigs.js");
|
|
22
|
+
var _injectHandleError = require("./injectHandleError.js");
|
|
23
|
+
var _injectSendFetchRequest = require("./network/requestMethods/injectSendFetchRequest.js");
|
|
24
|
+
var _injectSendXhrRequest = require("./network/requestMethods/injectSendXhrRequest.js");
|
|
25
|
+
var _injectSendBeaconRequest = require("./network/requestMethods/injectSendBeaconRequest.js");
|
|
26
|
+
var _createLogger = require("./createLogger.js");
|
|
27
|
+
var _createEventManager = require("./createEventManager.js");
|
|
28
|
+
var _createCookieTransfer = require("./createCookieTransfer.js");
|
|
29
|
+
var _injectShouldTransferCookie = require("./injectShouldTransferCookie.js");
|
|
30
|
+
var _index2 = require("../utils/request/index.js");
|
|
31
|
+
var _injectSendEdgeNetworkRequest = require("./edgeNetwork/injectSendEdgeNetworkRequest.js");
|
|
32
|
+
var _injectProcessWarningsAndErrors = require("./edgeNetwork/injectProcessWarningsAndErrors.js");
|
|
33
|
+
var _injectGetLocationHint = require("./edgeNetwork/injectGetLocationHint.js");
|
|
34
|
+
var _isRequestRetryable = require("./network/isRequestRetryable.js");
|
|
35
|
+
var _getRequestRetryDelay = require("./network/getRequestRetryDelay.js");
|
|
36
|
+
var _injectApplyResponse = require("./edgeNetwork/injectApplyResponse.js");
|
|
37
|
+
/*
|
|
38
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
39
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
40
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
41
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
42
|
+
|
|
43
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
44
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
45
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
46
|
+
governing permissions and limitations under the License.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
var createNamespacedStorage = (0, _index.injectStorage)(window);
|
|
50
|
+
var _window = window,
|
|
51
|
+
console = _window.console,
|
|
52
|
+
fetch = _window.fetch,
|
|
53
|
+
navigator = _window.navigator,
|
|
54
|
+
XMLHttpRequest = _window.XMLHttpRequest;
|
|
55
|
+
|
|
56
|
+
// set this up as a function so that monitors can be added at anytime
|
|
57
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
58
|
+
var getMonitors = function getMonitors() {
|
|
59
|
+
return window.__alloyMonitors || [];
|
|
60
|
+
};
|
|
61
|
+
var coreConfigValidators = (0, _createCoreConfigs.default)();
|
|
62
|
+
var apexDomain = (0, _index.getApexDomain)(window, _index.cookieJar);
|
|
63
|
+
var sendFetchRequest = (0, _index.isFunction)(fetch) ? (0, _injectSendFetchRequest.default)({
|
|
64
|
+
fetch: fetch
|
|
65
|
+
}) : (0, _injectSendXhrRequest.default)({
|
|
66
|
+
XMLHttpRequest: XMLHttpRequest
|
|
67
|
+
});
|
|
68
|
+
var fireReferrerHideableImage = (0, _index.injectFireReferrerHideableImage)();
|
|
69
|
+
var getAssuranceValidationTokenParams = (0, _index2.createGetAssuranceValidationTokenParams)({
|
|
70
|
+
window: window,
|
|
71
|
+
createNamespacedStorage: createNamespacedStorage
|
|
72
|
+
});
|
|
73
|
+
var createExecuteCommand = exports.createExecuteCommand = function createExecuteCommand(_ref) {
|
|
74
|
+
var instanceName = _ref.instanceName,
|
|
75
|
+
_ref$logController = _ref.logController,
|
|
76
|
+
setDebugEnabled = _ref$logController.setDebugEnabled,
|
|
77
|
+
logger = _ref$logController.logger,
|
|
78
|
+
createComponentLogger = _ref$logController.createComponentLogger;
|
|
79
|
+
var componentRegistry = (0, _createComponentRegistry.default)();
|
|
80
|
+
var lifecycle = (0, _createLifecycle.default)(componentRegistry);
|
|
81
|
+
var setDebugCommand = function setDebugCommand(options) {
|
|
82
|
+
setDebugEnabled(options.enabled, {
|
|
83
|
+
fromConfig: false
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
var loggingCookieJar = (0, _index.createLoggingCookieJar)({
|
|
87
|
+
logger: logger,
|
|
88
|
+
cookieJar: _index.cookieJar
|
|
89
|
+
});
|
|
90
|
+
var configureCommand = function configureCommand(options) {
|
|
91
|
+
var config = (0, _buildAndValidateConfig.default)({
|
|
92
|
+
options: options,
|
|
93
|
+
componentCreators: _componentCreators.default,
|
|
94
|
+
coreConfigValidators: coreConfigValidators,
|
|
95
|
+
createConfig: _createConfig.default,
|
|
96
|
+
logger: logger,
|
|
97
|
+
setDebugEnabled: setDebugEnabled
|
|
98
|
+
});
|
|
99
|
+
var orgId = config.orgId,
|
|
100
|
+
targetMigrationEnabled = config.targetMigrationEnabled;
|
|
101
|
+
var shouldTransferCookie = (0, _injectShouldTransferCookie.default)({
|
|
102
|
+
orgId: orgId,
|
|
103
|
+
targetMigrationEnabled: targetMigrationEnabled
|
|
104
|
+
});
|
|
105
|
+
var cookieTransfer = (0, _createCookieTransfer.default)({
|
|
106
|
+
cookieJar: loggingCookieJar,
|
|
107
|
+
shouldTransferCookie: shouldTransferCookie,
|
|
108
|
+
apexDomain: apexDomain,
|
|
109
|
+
dateProvider: function dateProvider() {
|
|
110
|
+
return new Date();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
var sendBeaconRequest = (0, _index.isFunction)(navigator.sendBeacon) ? (0, _injectSendBeaconRequest.default)({
|
|
114
|
+
// Without the bind(), the browser will complain about an
|
|
115
|
+
// illegal invocation.
|
|
116
|
+
sendBeacon: navigator.sendBeacon.bind(navigator),
|
|
117
|
+
sendFetchRequest: sendFetchRequest,
|
|
118
|
+
logger: logger
|
|
119
|
+
}) : sendFetchRequest;
|
|
120
|
+
var sendNetworkRequest = (0, _injectSendNetworkRequest.default)({
|
|
121
|
+
logger: logger,
|
|
122
|
+
sendFetchRequest: sendFetchRequest,
|
|
123
|
+
sendBeaconRequest: sendBeaconRequest,
|
|
124
|
+
isRequestRetryable: _isRequestRetryable.default,
|
|
125
|
+
getRequestRetryDelay: _getRequestRetryDelay.default
|
|
126
|
+
});
|
|
127
|
+
var processWarningsAndErrors = (0, _injectProcessWarningsAndErrors.default)({
|
|
128
|
+
logger: logger
|
|
129
|
+
});
|
|
130
|
+
var extractEdgeInfo = (0, _injectExtractEdgeInfo.default)({
|
|
131
|
+
logger: logger
|
|
132
|
+
});
|
|
133
|
+
var createResponse = (0, _injectCreateResponse.default)({
|
|
134
|
+
extractEdgeInfo: extractEdgeInfo
|
|
135
|
+
});
|
|
136
|
+
var getLocationHint = (0, _injectGetLocationHint.default)({
|
|
137
|
+
orgId: orgId,
|
|
138
|
+
cookieJar: _index.cookieJar
|
|
139
|
+
});
|
|
140
|
+
var sendEdgeNetworkRequest = (0, _injectSendEdgeNetworkRequest.default)({
|
|
141
|
+
config: config,
|
|
142
|
+
lifecycle: lifecycle,
|
|
143
|
+
cookieTransfer: cookieTransfer,
|
|
144
|
+
sendNetworkRequest: sendNetworkRequest,
|
|
145
|
+
createResponse: createResponse,
|
|
146
|
+
processWarningsAndErrors: processWarningsAndErrors,
|
|
147
|
+
getLocationHint: getLocationHint,
|
|
148
|
+
getAssuranceValidationTokenParams: getAssuranceValidationTokenParams
|
|
149
|
+
});
|
|
150
|
+
var applyResponse = (0, _injectApplyResponse.default)({
|
|
151
|
+
lifecycle: lifecycle,
|
|
152
|
+
cookieTransfer: cookieTransfer,
|
|
153
|
+
createResponse: createResponse,
|
|
154
|
+
processWarningsAndErrors: processWarningsAndErrors
|
|
155
|
+
});
|
|
156
|
+
var generalConsentState = (0, _createConsentStateMachine.default)({
|
|
157
|
+
logger: logger
|
|
158
|
+
});
|
|
159
|
+
var consent = (0, _createConsent.default)({
|
|
160
|
+
generalConsentState: generalConsentState,
|
|
161
|
+
logger: logger
|
|
162
|
+
});
|
|
163
|
+
var eventManager = (0, _createEventManager.default)({
|
|
164
|
+
config: config,
|
|
165
|
+
logger: logger,
|
|
166
|
+
lifecycle: lifecycle,
|
|
167
|
+
consent: consent,
|
|
168
|
+
createEvent: _createEvent.default,
|
|
169
|
+
createDataCollectionRequestPayload: _index2.createDataCollectionRequestPayload,
|
|
170
|
+
createDataCollectionRequest: _index2.createDataCollectionRequest,
|
|
171
|
+
sendEdgeNetworkRequest: sendEdgeNetworkRequest,
|
|
172
|
+
applyResponse: applyResponse
|
|
173
|
+
});
|
|
174
|
+
return (0, _initializeComponents.default)({
|
|
175
|
+
componentCreators: _componentCreators.default,
|
|
176
|
+
lifecycle: lifecycle,
|
|
177
|
+
componentRegistry: componentRegistry,
|
|
178
|
+
getImmediatelyAvailableTools: function getImmediatelyAvailableTools(componentName) {
|
|
179
|
+
var componentLogger = createComponentLogger(componentName);
|
|
180
|
+
return {
|
|
181
|
+
config: config,
|
|
182
|
+
componentRegistry: componentRegistry,
|
|
183
|
+
consent: consent,
|
|
184
|
+
eventManager: eventManager,
|
|
185
|
+
fireReferrerHideableImage: fireReferrerHideableImage,
|
|
186
|
+
logger: componentLogger,
|
|
187
|
+
lifecycle: lifecycle,
|
|
188
|
+
sendEdgeNetworkRequest: sendEdgeNetworkRequest,
|
|
189
|
+
handleError: (0, _injectHandleError.default)({
|
|
190
|
+
errorPrefix: "[" + instanceName + "] [" + componentName + "]",
|
|
191
|
+
logger: componentLogger
|
|
192
|
+
}),
|
|
193
|
+
createNamespacedStorage: createNamespacedStorage,
|
|
194
|
+
apexDomain: apexDomain
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
var handleError = (0, _injectHandleError.default)({
|
|
200
|
+
errorPrefix: "[" + instanceName + "]",
|
|
201
|
+
logger: logger
|
|
202
|
+
});
|
|
203
|
+
var executeCommand = (0, _injectExecuteCommand.default)({
|
|
204
|
+
logger: logger,
|
|
205
|
+
configureCommand: configureCommand,
|
|
206
|
+
setDebugCommand: setDebugCommand,
|
|
207
|
+
handleError: handleError,
|
|
208
|
+
validateCommandOptions: _validateCommandOptions.default
|
|
209
|
+
});
|
|
210
|
+
return executeCommand;
|
|
211
|
+
};
|
|
212
|
+
var _default = exports.default = function _default() {
|
|
213
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
214
|
+
var instanceNames = window.__alloyNS;
|
|
215
|
+
if (instanceNames) {
|
|
216
|
+
instanceNames.forEach(function (instanceName) {
|
|
217
|
+
var logController = (0, _createLogController.default)({
|
|
218
|
+
console: console,
|
|
219
|
+
locationSearch: window.location.search,
|
|
220
|
+
createLogger: _createLogger.default,
|
|
221
|
+
instanceName: instanceName,
|
|
222
|
+
createNamespacedStorage: createNamespacedStorage,
|
|
223
|
+
getMonitors: getMonitors
|
|
224
|
+
});
|
|
225
|
+
var executeCommand = createExecuteCommand({
|
|
226
|
+
instanceName: instanceName,
|
|
227
|
+
logController: logController
|
|
228
|
+
});
|
|
229
|
+
var instance = (0, _createInstanceFunction.default)(executeCommand);
|
|
230
|
+
var queue = window[instanceName].q;
|
|
231
|
+
queue.push = instance;
|
|
232
|
+
logController.logger.logOnInstanceCreated({
|
|
233
|
+
instance: instance
|
|
234
|
+
});
|
|
235
|
+
queue.forEach(instance);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _index = require("../utils/index.js");
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var _default = exports.default = function _default(_ref) {
|
|
17
|
+
var componentCreators = _ref.componentCreators,
|
|
18
|
+
lifecycle = _ref.lifecycle,
|
|
19
|
+
componentRegistry = _ref.componentRegistry,
|
|
20
|
+
getImmediatelyAvailableTools = _ref.getImmediatelyAvailableTools;
|
|
21
|
+
componentCreators.forEach(function (createComponent) {
|
|
22
|
+
var namespace = createComponent.namespace;
|
|
23
|
+
// TO-DOCUMENT: Helpers that we inject into factories.
|
|
24
|
+
var tools = getImmediatelyAvailableTools(namespace);
|
|
25
|
+
var component;
|
|
26
|
+
try {
|
|
27
|
+
component = createComponent(tools);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
throw (0, _index.stackError)({
|
|
30
|
+
error: error,
|
|
31
|
+
message: "[" + namespace + "] An error occurred during component creation."
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
componentRegistry.register(namespace, component);
|
|
35
|
+
});
|
|
36
|
+
return lifecycle.onComponentsRegistered({
|
|
37
|
+
lifecycle: lifecycle
|
|
38
|
+
}).then(function () {
|
|
39
|
+
return componentRegistry;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _index = require("../utils/index.js");
|
|
5
|
+
var _httpHeaderNames = require("../constants/httpHeaderNames.js");
|
|
6
|
+
/*
|
|
7
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
8
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
+
governing permissions and limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Creates a representation of a gateway response with the addition of
|
|
19
|
+
* helper methods.
|
|
20
|
+
* @returns Response
|
|
21
|
+
*/
|
|
22
|
+
var _default = exports.default = function _default(_ref) {
|
|
23
|
+
var extractEdgeInfo = _ref.extractEdgeInfo;
|
|
24
|
+
return function (_ref2) {
|
|
25
|
+
var _ref2$content = _ref2.content,
|
|
26
|
+
content = _ref2$content === void 0 ? {} : _ref2$content,
|
|
27
|
+
getHeader = _ref2.getHeader;
|
|
28
|
+
var _content$handle = content.handle,
|
|
29
|
+
handle = _content$handle === void 0 ? [] : _content$handle,
|
|
30
|
+
_content$errors = content.errors,
|
|
31
|
+
errors = _content$errors === void 0 ? [] : _content$errors,
|
|
32
|
+
_content$warnings = content.warnings,
|
|
33
|
+
warnings = _content$warnings === void 0 ? [] : _content$warnings;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Response object.
|
|
37
|
+
* @typedef {Object} Response
|
|
38
|
+
*/
|
|
39
|
+
return {
|
|
40
|
+
/**
|
|
41
|
+
* Returns matching fragments of the response by type.
|
|
42
|
+
* @param {String} type A string with the current format: <namespace:action>
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* getPayloadsByType("identity:persist")
|
|
46
|
+
*/
|
|
47
|
+
getPayloadsByType: function getPayloadsByType(type) {
|
|
48
|
+
return (0, _index.flatMap)(handle.filter(function (fragment) {
|
|
49
|
+
return fragment.type === type;
|
|
50
|
+
}), function (fragment) {
|
|
51
|
+
return fragment.payload;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Returns all errors.
|
|
56
|
+
*/
|
|
57
|
+
getErrors: function getErrors() {
|
|
58
|
+
return errors;
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Returns all warnings.
|
|
62
|
+
*/
|
|
63
|
+
getWarnings: function getWarnings() {
|
|
64
|
+
return warnings;
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Returns an object containing the regionId from the x-adobe-edge header
|
|
68
|
+
*/
|
|
69
|
+
getEdge: function getEdge() {
|
|
70
|
+
return extractEdgeInfo(getHeader(_httpHeaderNames.ADOBE_EDGE));
|
|
71
|
+
},
|
|
72
|
+
toJSON: function toJSON() {
|
|
73
|
+
return content;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|