@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,170 @@
|
|
|
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 2019 Adobe. All rights reserved.
|
|
12
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
var getXdmPropositions = function getXdmPropositions(xdm) {
|
|
22
|
+
return xdm &&
|
|
23
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
24
|
+
xdm._experience &&
|
|
25
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
26
|
+
xdm._experience.decisioning &&
|
|
27
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
28
|
+
(0, _index.isNonEmptyArray)(xdm._experience.decisioning.propositions) ?
|
|
29
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
30
|
+
xdm._experience.decisioning.propositions : [];
|
|
31
|
+
};
|
|
32
|
+
var _default = exports.default = function _default() {
|
|
33
|
+
var content = {};
|
|
34
|
+
var userXdm;
|
|
35
|
+
var userData;
|
|
36
|
+
var _documentMayUnload = false;
|
|
37
|
+
var isFinalized = false;
|
|
38
|
+
var shouldSendEvent = true;
|
|
39
|
+
var throwIfEventFinalized = function throwIfEventFinalized(methodName) {
|
|
40
|
+
if (isFinalized) {
|
|
41
|
+
throw new Error(methodName + " cannot be called after event is finalized.");
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var event = {
|
|
45
|
+
hasQuery: function hasQuery() {
|
|
46
|
+
return Object.prototype.hasOwnProperty.call(this.getContent(), "query");
|
|
47
|
+
},
|
|
48
|
+
getContent: function getContent() {
|
|
49
|
+
var currentContent = JSON.parse(JSON.stringify(content));
|
|
50
|
+
if (userXdm) {
|
|
51
|
+
(0, _index.deepAssign)(currentContent, {
|
|
52
|
+
xdm: userXdm
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (userData) {
|
|
56
|
+
(0, _index.deepAssign)(currentContent, {
|
|
57
|
+
data: userData
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return currentContent;
|
|
61
|
+
},
|
|
62
|
+
setUserXdm: function setUserXdm(value) {
|
|
63
|
+
throwIfEventFinalized("setUserXdm");
|
|
64
|
+
userXdm = value;
|
|
65
|
+
},
|
|
66
|
+
setUserData: function setUserData(value) {
|
|
67
|
+
throwIfEventFinalized("setUserData");
|
|
68
|
+
userData = value;
|
|
69
|
+
},
|
|
70
|
+
mergeXdm: function mergeXdm(xdm) {
|
|
71
|
+
throwIfEventFinalized("mergeXdm");
|
|
72
|
+
if (xdm) {
|
|
73
|
+
(0, _index.deepAssign)(content, {
|
|
74
|
+
xdm: xdm
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
mergeData: function mergeData(data) {
|
|
79
|
+
throwIfEventFinalized("mergeData");
|
|
80
|
+
if (data) {
|
|
81
|
+
(0, _index.deepAssign)(content, {
|
|
82
|
+
data: data
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
mergeMeta: function mergeMeta(meta) {
|
|
87
|
+
throwIfEventFinalized("mergeMeta");
|
|
88
|
+
if (meta) {
|
|
89
|
+
(0, _index.deepAssign)(content, {
|
|
90
|
+
meta: meta
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
mergeQuery: function mergeQuery(query) {
|
|
95
|
+
throwIfEventFinalized("mergeQuery");
|
|
96
|
+
if (query) {
|
|
97
|
+
(0, _index.deepAssign)(content, {
|
|
98
|
+
query: query
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
documentMayUnload: function documentMayUnload() {
|
|
103
|
+
_documentMayUnload = true;
|
|
104
|
+
},
|
|
105
|
+
finalize: function finalize(onBeforeEventSend) {
|
|
106
|
+
if (isFinalized) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
var newPropositions = (0, _index.deduplicateArray)([].concat(_toConsumableArray(getXdmPropositions(userXdm)), _toConsumableArray(getXdmPropositions(content.xdm))), function (a, b) {
|
|
110
|
+
return a === b || a.id && b.id && a.id === b.id && a.scope && b.scope && a.scope === b.scope;
|
|
111
|
+
});
|
|
112
|
+
if (userXdm) {
|
|
113
|
+
this.mergeXdm(userXdm);
|
|
114
|
+
}
|
|
115
|
+
if (newPropositions.length > 0) {
|
|
116
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
117
|
+
content.xdm._experience.decisioning.propositions = newPropositions;
|
|
118
|
+
}
|
|
119
|
+
if (userData) {
|
|
120
|
+
event.mergeData(userData);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// the event should already be considered finalized in case onBeforeEventSend throws an error
|
|
124
|
+
isFinalized = true;
|
|
125
|
+
if (onBeforeEventSend) {
|
|
126
|
+
// assume that the onBeforeEventSend callback will fail (in-case of an error)
|
|
127
|
+
shouldSendEvent = false;
|
|
128
|
+
|
|
129
|
+
// this allows the user to replace the xdm and data properties
|
|
130
|
+
// on the object passed to the callback
|
|
131
|
+
var tempContent = {
|
|
132
|
+
xdm: content.xdm || {},
|
|
133
|
+
data: content.data || {}
|
|
134
|
+
};
|
|
135
|
+
var result = onBeforeEventSend(tempContent);
|
|
136
|
+
shouldSendEvent = result !== false;
|
|
137
|
+
content.xdm = tempContent.xdm || {};
|
|
138
|
+
content.data = tempContent.data || {};
|
|
139
|
+
if ((0, _index.isEmptyObject)(content.xdm)) {
|
|
140
|
+
delete content.xdm;
|
|
141
|
+
}
|
|
142
|
+
if ((0, _index.isEmptyObject)(content.data)) {
|
|
143
|
+
delete content.data;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
getDocumentMayUnload: function getDocumentMayUnload() {
|
|
148
|
+
return _documentMayUnload;
|
|
149
|
+
},
|
|
150
|
+
isEmpty: function isEmpty() {
|
|
151
|
+
return (0, _index.isEmptyObject)(content) && (!userXdm || (0, _index.isEmptyObject)(userXdm)) && (!userData || (0, _index.isEmptyObject)(userData));
|
|
152
|
+
},
|
|
153
|
+
shouldSend: function shouldSend() {
|
|
154
|
+
return shouldSendEvent;
|
|
155
|
+
},
|
|
156
|
+
getViewName: function getViewName() {
|
|
157
|
+
if (!userXdm || !userXdm.web || !userXdm.web.webPageDetails) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
return userXdm.web.webPageDetails.viewName;
|
|
161
|
+
},
|
|
162
|
+
toJSON: function toJSON() {
|
|
163
|
+
if (!isFinalized) {
|
|
164
|
+
throw new Error("toJSON called before finalize");
|
|
165
|
+
}
|
|
166
|
+
return content;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return event;
|
|
170
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _pageWideScope = require("../constants/pageWideScope.js");
|
|
6
|
+
var _index = require("../utils/index.js");
|
|
7
|
+
var _index2 = require("../utils/request/index.js");
|
|
8
|
+
var _excluded = ["edgeConfigOverrides"];
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
27
|
+
var EVENT_CANCELLATION_MESSAGE = "Event was canceled because the onBeforeEventSend callback returned false.";
|
|
28
|
+
var _default = exports.default = function _default(_ref) {
|
|
29
|
+
var config = _ref.config,
|
|
30
|
+
logger = _ref.logger,
|
|
31
|
+
lifecycle = _ref.lifecycle,
|
|
32
|
+
consent = _ref.consent,
|
|
33
|
+
createEvent = _ref.createEvent,
|
|
34
|
+
createDataCollectionRequestPayload = _ref.createDataCollectionRequestPayload,
|
|
35
|
+
createDataCollectionRequest = _ref.createDataCollectionRequest,
|
|
36
|
+
sendEdgeNetworkRequest = _ref.sendEdgeNetworkRequest,
|
|
37
|
+
_applyResponse = _ref.applyResponse;
|
|
38
|
+
var onBeforeEventSend = config.onBeforeEventSend,
|
|
39
|
+
globalConfigOverrides = config.edgeConfigOverrides;
|
|
40
|
+
return {
|
|
41
|
+
createEvent: createEvent,
|
|
42
|
+
/**
|
|
43
|
+
* Sends an event. This includes running the event and payload through the
|
|
44
|
+
* appropriate lifecycle hooks, sending the request to the server, and
|
|
45
|
+
* handling the response.
|
|
46
|
+
* @param {Object} event This will be JSON stringified and used inside the
|
|
47
|
+
* request payload.
|
|
48
|
+
* @param {Object} [options] Options to pass on to the onBeforeEvent
|
|
49
|
+
* lifecycle method
|
|
50
|
+
* @param {Object} [options.edgeConfigOverrides] Settings that take
|
|
51
|
+
* precedence over the global datastream configuration, including which
|
|
52
|
+
* datastream to use.
|
|
53
|
+
* @returns {*}
|
|
54
|
+
*/
|
|
55
|
+
sendEvent: function sendEvent(event) {
|
|
56
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
57
|
+
var localConfigOverrides = options.edgeConfigOverrides,
|
|
58
|
+
otherOptions = _objectWithoutProperties(options, _excluded);
|
|
59
|
+
var requestParams = (0, _index2.createRequestParams)({
|
|
60
|
+
payload: createDataCollectionRequestPayload(),
|
|
61
|
+
localConfigOverrides: localConfigOverrides,
|
|
62
|
+
globalConfigOverrides: globalConfigOverrides
|
|
63
|
+
});
|
|
64
|
+
var request = createDataCollectionRequest(requestParams);
|
|
65
|
+
var onResponseCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
66
|
+
var onRequestFailureCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
67
|
+
return lifecycle.onBeforeEvent(_objectSpread(_objectSpread({}, otherOptions), {}, {
|
|
68
|
+
event: event,
|
|
69
|
+
onResponse: onResponseCallbackAggregator.add,
|
|
70
|
+
onRequestFailure: onRequestFailureCallbackAggregator.add
|
|
71
|
+
})).then(function () {
|
|
72
|
+
requestParams.payload.addEvent(event);
|
|
73
|
+
return consent.awaitConsent();
|
|
74
|
+
}).then(function () {
|
|
75
|
+
try {
|
|
76
|
+
// NOTE: this calls onBeforeEventSend callback (if configured)
|
|
77
|
+
event.finalize(onBeforeEventSend);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
var throwError = function throwError() {
|
|
80
|
+
throw error;
|
|
81
|
+
};
|
|
82
|
+
onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure);
|
|
83
|
+
return onRequestFailureCallbackAggregator.call({
|
|
84
|
+
error: error
|
|
85
|
+
}).then(throwError, throwError);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// if the callback returns false, the event should not be sent
|
|
89
|
+
if (!event.shouldSend()) {
|
|
90
|
+
onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure);
|
|
91
|
+
logger.info(EVENT_CANCELLATION_MESSAGE);
|
|
92
|
+
var error = new Error(EVENT_CANCELLATION_MESSAGE);
|
|
93
|
+
return onRequestFailureCallbackAggregator.call({
|
|
94
|
+
error: error
|
|
95
|
+
}).then(function () {
|
|
96
|
+
// Ensure the promise gets resolved with undefined instead
|
|
97
|
+
// of an array of return values from the callbacks.
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return sendEdgeNetworkRequest({
|
|
101
|
+
request: request,
|
|
102
|
+
runOnResponseCallbacks: onResponseCallbackAggregator.call,
|
|
103
|
+
runOnRequestFailureCallbacks: onRequestFailureCallbackAggregator.call
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
applyResponse: function applyResponse(event) {
|
|
108
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
109
|
+
var _options$renderDecisi = options.renderDecisions,
|
|
110
|
+
renderDecisions = _options$renderDecisi === void 0 ? false : _options$renderDecisi,
|
|
111
|
+
_options$decisionCont = options.decisionContext,
|
|
112
|
+
decisionContext = _options$decisionCont === void 0 ? {} : _options$decisionCont,
|
|
113
|
+
_options$responseHead = options.responseHeaders,
|
|
114
|
+
responseHeaders = _options$responseHead === void 0 ? {} : _options$responseHead,
|
|
115
|
+
_options$responseBody = options.responseBody,
|
|
116
|
+
responseBody = _options$responseBody === void 0 ? {
|
|
117
|
+
handle: []
|
|
118
|
+
} : _options$responseBody,
|
|
119
|
+
personalization = options.personalization;
|
|
120
|
+
var payload = createDataCollectionRequestPayload();
|
|
121
|
+
var request = createDataCollectionRequest({
|
|
122
|
+
payload: payload
|
|
123
|
+
});
|
|
124
|
+
var onResponseCallbackAggregator = (0, _index.createCallbackAggregator)();
|
|
125
|
+
return lifecycle.onBeforeEvent({
|
|
126
|
+
event: event,
|
|
127
|
+
renderDecisions: renderDecisions,
|
|
128
|
+
decisionContext: decisionContext,
|
|
129
|
+
decisionScopes: [_pageWideScope.default],
|
|
130
|
+
personalization: personalization,
|
|
131
|
+
onResponse: onResponseCallbackAggregator.add,
|
|
132
|
+
onRequestFailure: _index.noop
|
|
133
|
+
}).then(function () {
|
|
134
|
+
payload.addEvent(event);
|
|
135
|
+
return _applyResponse({
|
|
136
|
+
request: request,
|
|
137
|
+
responseHeaders: responseHeaders,
|
|
138
|
+
responseBody: responseBody,
|
|
139
|
+
runOnResponseCallbacks: onResponseCallbackAggregator.call
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
var _default = exports.default = function _default(executeCommand) {
|
|
16
|
+
return function (args) {
|
|
17
|
+
// Would use destructuring, but destructuring doesn't work on IE
|
|
18
|
+
// without polyfilling Symbol.
|
|
19
|
+
// https://github.com/babel/babel/issues/7597
|
|
20
|
+
var resolve = args[0];
|
|
21
|
+
var reject = args[1];
|
|
22
|
+
var userProvidedArgs = args[2];
|
|
23
|
+
var commandName = userProvidedArgs[0];
|
|
24
|
+
var options = userProvidedArgs[1];
|
|
25
|
+
executeCommand(commandName, options).then(resolve, reject);
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// TO-DOCUMENT: Lifecycle hooks and their params.
|
|
17
|
+
var hookNames = [
|
|
18
|
+
// Called after all components have been registered.
|
|
19
|
+
"onComponentsRegistered",
|
|
20
|
+
// Called before an event is sent on a data collection request
|
|
21
|
+
"onBeforeEvent",
|
|
22
|
+
// Called before each request is made to the edge.
|
|
23
|
+
"onBeforeRequest",
|
|
24
|
+
// Called after each response is returned from the edge with a successful
|
|
25
|
+
// status code
|
|
26
|
+
"onResponse",
|
|
27
|
+
// Called after a network request to the edge fails. Either the request
|
|
28
|
+
// didn't make it to the edge, didn't make it to Konductor, or Konductor
|
|
29
|
+
// failed to return a regularly-structured response. (In this case { error }
|
|
30
|
+
// is passed as the parameter)
|
|
31
|
+
// Also called when the respone returns a 400 or 500 error. (In this case
|
|
32
|
+
// { response } is passed as the parameter)
|
|
33
|
+
"onRequestFailure",
|
|
34
|
+
// A user clicked on an element.
|
|
35
|
+
"onClick",
|
|
36
|
+
// Called by DecisioningEngine when a ruleset is satisfied with a list of
|
|
37
|
+
// propositions
|
|
38
|
+
"onDecision"];
|
|
39
|
+
var createHook = function createHook(componentRegistry, hookName) {
|
|
40
|
+
return function () {
|
|
41
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
+
args[_key] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
return Promise.all(componentRegistry.getLifecycleCallbacks(hookName).map(function (callback) {
|
|
45
|
+
return new Promise(function (resolve) {
|
|
46
|
+
resolve(callback.apply(void 0, args));
|
|
47
|
+
});
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* This ensures that if a component's lifecycle method X
|
|
54
|
+
* attempts to execute lifecycle method Y, that all X methods on all components
|
|
55
|
+
* will have been called before any of their Y methods are called. It does
|
|
56
|
+
* this by kicking the call to the Y method to the next JavaScript tick.
|
|
57
|
+
* @returns {function}
|
|
58
|
+
*/
|
|
59
|
+
var guardHook = function guardHook(fn) {
|
|
60
|
+
return function () {
|
|
61
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
62
|
+
args[_key2] = arguments[_key2];
|
|
63
|
+
}
|
|
64
|
+
return Promise.resolve().then(function () {
|
|
65
|
+
return fn.apply(void 0, args);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var _default = exports.default = function _default(componentRegistry) {
|
|
70
|
+
return hookNames.reduce(function (memo, hookName) {
|
|
71
|
+
memo[hookName] = guardHook(createHook(componentRegistry, hookName));
|
|
72
|
+
return memo;
|
|
73
|
+
}, {});
|
|
74
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var _index = require("../utils/index.js");
|
|
5
|
+
var _debugQueryParam = require("../constants/debugQueryParam.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
|
+
var _default = exports.default = function _default(_ref) {
|
|
18
|
+
var console = _ref.console,
|
|
19
|
+
locationSearch = _ref.locationSearch,
|
|
20
|
+
createLogger = _ref.createLogger,
|
|
21
|
+
instanceName = _ref.instanceName,
|
|
22
|
+
createNamespacedStorage = _ref.createNamespacedStorage,
|
|
23
|
+
getMonitors = _ref.getMonitors;
|
|
24
|
+
var parsedQueryString = _index.queryString.parse(locationSearch);
|
|
25
|
+
var storage = createNamespacedStorage("instance." + instanceName + ".");
|
|
26
|
+
var debugSessionValue = storage.session.getItem("debug");
|
|
27
|
+
var debugEnabled = debugSessionValue === "true";
|
|
28
|
+
var debugEnabledWritableFromConfig = debugSessionValue === null;
|
|
29
|
+
var getDebugEnabled = function getDebugEnabled() {
|
|
30
|
+
return debugEnabled;
|
|
31
|
+
};
|
|
32
|
+
var setDebugEnabled = function setDebugEnabled(value, _ref2) {
|
|
33
|
+
var fromConfig = _ref2.fromConfig;
|
|
34
|
+
if (!fromConfig || debugEnabledWritableFromConfig) {
|
|
35
|
+
debugEnabled = value;
|
|
36
|
+
}
|
|
37
|
+
if (!fromConfig) {
|
|
38
|
+
// Web storage only allows strings, so we explicitly convert to string.
|
|
39
|
+
storage.session.setItem("debug", value.toString());
|
|
40
|
+
debugEnabledWritableFromConfig = false;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
if (parsedQueryString[_debugQueryParam.default] !== undefined) {
|
|
44
|
+
setDebugEnabled((0, _index.stringToBoolean)(parsedQueryString[_debugQueryParam.default]), {
|
|
45
|
+
fromConfig: false
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
setDebugEnabled: setDebugEnabled,
|
|
50
|
+
logger: createLogger({
|
|
51
|
+
getDebugEnabled: getDebugEnabled,
|
|
52
|
+
context: {
|
|
53
|
+
instanceName: instanceName
|
|
54
|
+
},
|
|
55
|
+
getMonitors: getMonitors,
|
|
56
|
+
console: console
|
|
57
|
+
}),
|
|
58
|
+
createComponentLogger: function createComponentLogger(componentName) {
|
|
59
|
+
return createLogger({
|
|
60
|
+
getDebugEnabled: getDebugEnabled,
|
|
61
|
+
context: {
|
|
62
|
+
instanceName: instanceName,
|
|
63
|
+
componentName: componentName
|
|
64
|
+
},
|
|
65
|
+
getMonitors: getMonitors,
|
|
66
|
+
console: console
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
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 getDebugEnabled = _ref.getDebugEnabled,
|
|
18
|
+
console = _ref.console,
|
|
19
|
+
getMonitors = _ref.getMonitors,
|
|
20
|
+
context = _ref.context;
|
|
21
|
+
var prefix = "[" + context.instanceName + "]";
|
|
22
|
+
if (context.componentName) {
|
|
23
|
+
prefix += " [" + context.componentName + "]";
|
|
24
|
+
}
|
|
25
|
+
var notifyMonitors = function notifyMonitors(method, data) {
|
|
26
|
+
var monitors = getMonitors();
|
|
27
|
+
if (monitors.length > 0) {
|
|
28
|
+
var dataWithContext = (0, _index.assign)({}, context, data);
|
|
29
|
+
monitors.forEach(function (monitor) {
|
|
30
|
+
if (monitor[method]) {
|
|
31
|
+
monitor[method](dataWithContext);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var log = function log(level) {
|
|
37
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
38
|
+
rest[_key - 1] = arguments[_key];
|
|
39
|
+
}
|
|
40
|
+
notifyMonitors("onBeforeLog", {
|
|
41
|
+
level: level,
|
|
42
|
+
arguments: rest
|
|
43
|
+
});
|
|
44
|
+
if (getDebugEnabled()) {
|
|
45
|
+
console[level].apply(console, [prefix].concat(rest));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
get enabled() {
|
|
50
|
+
return getMonitors().length > 0 || getDebugEnabled();
|
|
51
|
+
},
|
|
52
|
+
logOnInstanceCreated: function logOnInstanceCreated(data) {
|
|
53
|
+
notifyMonitors("onInstanceCreated", data);
|
|
54
|
+
log("info", "Instance initialized.");
|
|
55
|
+
},
|
|
56
|
+
logOnInstanceConfigured: function logOnInstanceConfigured(data) {
|
|
57
|
+
notifyMonitors("onInstanceConfigured", data);
|
|
58
|
+
log("info", "Instance configured. Computed configuration:", data.config);
|
|
59
|
+
},
|
|
60
|
+
logOnBeforeCommand: function logOnBeforeCommand(data) {
|
|
61
|
+
notifyMonitors("onBeforeCommand", data);
|
|
62
|
+
log("info", "Executing " + data.commandName + " command. Options:", data.options);
|
|
63
|
+
},
|
|
64
|
+
logOnCommandResolved: function logOnCommandResolved(data) {
|
|
65
|
+
notifyMonitors("onCommandResolved", data);
|
|
66
|
+
log("info", data.commandName + " command resolved. Result:", data.result);
|
|
67
|
+
},
|
|
68
|
+
logOnCommandRejected: function logOnCommandRejected(data) {
|
|
69
|
+
notifyMonitors("onCommandRejected", data);
|
|
70
|
+
log("error", data.commandName + " command was rejected. Error:", data.error);
|
|
71
|
+
},
|
|
72
|
+
logOnBeforeNetworkRequest: function logOnBeforeNetworkRequest(data) {
|
|
73
|
+
notifyMonitors("onBeforeNetworkRequest", data);
|
|
74
|
+
log("info", "Request " + data.requestId + ": Sending request.", data.payload);
|
|
75
|
+
},
|
|
76
|
+
logOnNetworkResponse: function logOnNetworkResponse(data) {
|
|
77
|
+
notifyMonitors("onNetworkResponse", data);
|
|
78
|
+
var messagesSuffix = data.parsedBody || data.body ? "response body:" : "no response body.";
|
|
79
|
+
log("info", "Request " + data.requestId + ": Received response with status code " + data.statusCode + " and " + messagesSuffix, data.parsedBody || data.body);
|
|
80
|
+
},
|
|
81
|
+
logOnNetworkError: function logOnNetworkError(data) {
|
|
82
|
+
notifyMonitors("onNetworkError", data);
|
|
83
|
+
log("error", "Request " + data.requestId + ": Network request failed.", data.error);
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Outputs informational message to the web console. In some
|
|
87
|
+
* browsers a small "i" icon is displayed next to these items
|
|
88
|
+
* in the web console's log.
|
|
89
|
+
* @param {...*} arg Any argument to be logged.
|
|
90
|
+
*/
|
|
91
|
+
info: log.bind(null, "info"),
|
|
92
|
+
/**
|
|
93
|
+
* Outputs a warning message to the web console.
|
|
94
|
+
* @param {...*} arg Any argument to be logged.
|
|
95
|
+
*/
|
|
96
|
+
warn: log.bind(null, "warn"),
|
|
97
|
+
/**
|
|
98
|
+
* Outputs an error message to the web console.
|
|
99
|
+
* @param {...*} arg Any argument to be logged.
|
|
100
|
+
*/
|
|
101
|
+
error: log.bind(null, "error")
|
|
102
|
+
};
|
|
103
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2023 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(onRequestFailureCallbackAggregator) {
|
|
16
|
+
return function (error) {
|
|
17
|
+
// Regardless of whether the network call failed, an unexpected status
|
|
18
|
+
// code was returned, or the response body was malformed, we want to call
|
|
19
|
+
// the onRequestFailure callbacks, but still throw the exception.
|
|
20
|
+
var throwError = function throwError() {
|
|
21
|
+
throw error;
|
|
22
|
+
};
|
|
23
|
+
return onRequestFailureCallbackAggregator.call({
|
|
24
|
+
error: error
|
|
25
|
+
}).then(throwError, throwError);
|
|
26
|
+
};
|
|
27
|
+
};
|