@adobe/alloy 2.20.0-alpha.0 → 2.20.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libEs5/baseCode/index.js +2 -3
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +2 -3
- package/libEs5/components/ActivityCollector/configValidators.js +3 -5
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +2 -3
- package/libEs5/components/ActivityCollector/createLinkClick.js +2 -3
- package/libEs5/components/ActivityCollector/getLinkName.js +2 -3
- package/libEs5/components/ActivityCollector/getLinkRegion.js +2 -3
- package/libEs5/components/ActivityCollector/index.js +1 -2
- package/libEs5/components/ActivityCollector/utils.js +11 -21
- package/libEs5/components/Audiences/index.js +1 -2
- package/libEs5/components/Audiences/injectProcessDestinations.js +18 -16
- package/libEs5/components/Audiences/injectProcessResponse.js +2 -3
- package/libEs5/components/Context/createComponent.js +2 -3
- package/libEs5/components/Context/implementationDetails.js +2 -3
- package/libEs5/components/Context/index.js +17 -15
- package/libEs5/components/Context/injectDevice.js +2 -3
- package/libEs5/components/Context/injectEnvironment.js +6 -7
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +15 -16
- package/libEs5/components/Context/injectPlaceContext.js +2 -3
- package/libEs5/components/Context/injectTimestamp.js +2 -3
- package/libEs5/components/Context/injectWeb.js +2 -3
- package/libEs5/components/DataCollector/index.js +1 -2
- package/libEs5/components/DataCollector/validateApplyResponse.js +2 -3
- package/libEs5/components/DataCollector/validateUserEventOptions.js +2 -3
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +2 -3
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +2 -3
- package/libEs5/components/DecisioningEngine/constants.js +4 -7
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +2 -3
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -16
- package/libEs5/components/DecisioningEngine/createContextProvider.js +18 -16
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +2 -3
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +2 -3
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +18 -16
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +2 -3
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +20 -20
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +18 -16
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +18 -16
- package/libEs5/components/DecisioningEngine/index.js +19 -19
- package/libEs5/components/DecisioningEngine/utils.js +10 -18
- package/libEs5/components/EventMerge/createComponent.js +2 -3
- package/libEs5/components/EventMerge/createEventMergeId.js +2 -3
- package/libEs5/components/EventMerge/index.js +1 -2
- package/libEs5/components/Identity/addEcidQueryToPayload.js +2 -3
- package/libEs5/components/Identity/addEcidToPayload.js +2 -3
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +2 -3
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +4 -5
- package/libEs5/components/Identity/configValidators.js +1 -2
- package/libEs5/components/Identity/constants/authState.js +3 -6
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +1 -2
- package/libEs5/components/Identity/createComponent.js +2 -3
- package/libEs5/components/Identity/createLegacyIdentity.js +8 -6
- package/libEs5/components/Identity/getEcidFromResponse.js +2 -3
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +2 -3
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +2 -3
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +2 -3
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +2 -3
- package/libEs5/components/Identity/index.js +3 -3
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +2 -3
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +18 -15
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +9 -14
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +8 -6
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +2 -3
- package/libEs5/components/Identity/injectProcessIdSyncs.js +2 -3
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +2 -3
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +2 -3
- package/libEs5/components/Identity/visitorService/getVisitor.js +2 -3
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +2 -3
- package/libEs5/components/LegacyMediaAnalytics/{media → constants}/constants.js +15 -25
- package/libEs5/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +3 -5
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +246 -0
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +157 -158
- package/libEs5/components/LegacyMediaAnalytics/index.js +43 -20
- package/libEs5/components/LibraryInfo/index.js +21 -17
- package/libEs5/components/MachineLearning/index.js +1 -2
- package/libEs5/components/MachineLearning/processResponse.js +2 -3
- package/libEs5/components/Personalization/constants/loggerMessage.js +2 -4
- package/libEs5/components/Personalization/constants/scopeType.js +3 -6
- package/libEs5/components/Personalization/constants/surface.js +4 -8
- package/libEs5/components/Personalization/createActionsProvider.js +2 -3
- package/libEs5/components/Personalization/createApplyPropositions.js +19 -17
- package/libEs5/components/Personalization/createClickStorage.js +8 -6
- package/libEs5/components/Personalization/createCollect.js +2 -3
- package/libEs5/components/Personalization/createComponent.js +7 -4
- package/libEs5/components/Personalization/createFetchDataHandler.js +28 -20
- package/libEs5/components/Personalization/createGetPageLocation.js +2 -3
- package/libEs5/{utils/debounce.js → components/Personalization/createHandleConsentFlicker.js} +13 -14
- package/libEs5/components/Personalization/createNotificationHandler.js +10 -5
- package/libEs5/components/Personalization/createOnClickHandler.js +2 -3
- package/libEs5/components/Personalization/createOnDecisionHandler.js +3 -4
- package/libEs5/components/Personalization/createPersonalizationDetails.js +13 -14
- package/libEs5/components/Personalization/createPreprocessors.js +16 -14
- package/libEs5/components/Personalization/createSetTargetMigration.js +2 -3
- package/libEs5/components/Personalization/createViewCacheManager.js +2 -3
- package/libEs5/components/Personalization/createViewChangeHandler.js +2 -3
- package/libEs5/components/Personalization/dom-actions/action.js +2 -3
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +2 -3
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +3 -4
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +2 -3
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +3 -5
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +3 -5
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +16 -19
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +2 -3
- package/libEs5/components/Personalization/dom-actions/images.js +4 -7
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +2 -3
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +2 -3
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +2 -3
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +2 -3
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +2 -3
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +2 -3
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/scripts.js +22 -24
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +2 -3
- package/libEs5/components/Personalization/dom-actions/setHtml.js +2 -3
- package/libEs5/components/Personalization/dom-actions/setStyles.js +2 -3
- package/libEs5/components/Personalization/dom-actions/setText.js +2 -3
- package/libEs5/components/Personalization/dom-actions/swapImage.js +2 -3
- package/libEs5/components/Personalization/event.js +19 -18
- package/libEs5/components/Personalization/flicker/index.js +21 -22
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +8 -6
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +2 -3
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +18 -16
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +3 -4
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +2 -4
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +24 -22
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +2 -3
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +25 -29
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +2 -3
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +3 -5
- package/libEs5/components/Personalization/index.js +31 -22
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +2 -3
- package/libEs5/components/Personalization/utils/createAsyncArray.js +2 -3
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +2 -3
- package/libEs5/components/Personalization/utils/surfaceUtils.js +4 -7
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +3 -5
- package/libEs5/components/Privacy/computeConsentHash.js +13 -14
- package/libEs5/components/Privacy/createComponent.js +16 -14
- package/libEs5/components/Privacy/createConsentHashStore.js +2 -3
- package/libEs5/components/Privacy/createConsentRequest.js +2 -3
- package/libEs5/components/Privacy/createConsentRequestPayload.js +2 -3
- package/libEs5/components/Privacy/createStoredConsent.js +2 -3
- package/libEs5/components/Privacy/index.js +1 -2
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +2 -3
- package/libEs5/components/Privacy/parseConsentCookie.js +4 -5
- package/libEs5/components/Privacy/validateSetConsentOptions.js +2 -3
- package/libEs5/components/{MediaCollection/createMediaRequestPayload.js → StreamingMedia/configValidators.js} +11 -16
- package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
- package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
- package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaEventManager.js +46 -53
- package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaRequest.js +2 -3
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
- package/libEs5/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +23 -27
- 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/{MediaCollection → StreamingMedia}/validateMediaSessionOptions.js +3 -4
- package/libEs5/constants/apiVersion.js +1 -2
- package/libEs5/constants/browser.js +7 -14
- package/libEs5/constants/consentPurpose.js +1 -2
- package/libEs5/constants/consentStatus.js +3 -6
- package/libEs5/constants/contentType.js +2 -4
- package/libEs5/constants/cookieNameKey.js +3 -6
- package/libEs5/constants/cookieNamePrefix.js +1 -2
- package/libEs5/constants/coreCommands.js +2 -4
- package/libEs5/constants/debugQueryParam.js +1 -2
- package/libEs5/constants/decisionProvider.js +1 -2
- package/libEs5/constants/domain.js +2 -4
- package/libEs5/constants/ecidNamespace.js +1 -2
- package/libEs5/constants/edgeBasePath.js +1 -2
- package/libEs5/constants/elementAttribute.js +1 -2
- package/libEs5/constants/eventType.js +5 -10
- package/libEs5/constants/handle.js +1 -2
- package/libEs5/constants/highEntropyUserAgentClientHints.js +1 -2
- package/libEs5/constants/httpHeaderNames.js +2 -4
- package/libEs5/constants/httpStatusCode.js +5 -10
- package/libEs5/constants/identityMapAuthenticatedState.js +3 -6
- package/libEs5/constants/legacyCookies.js +3 -6
- package/libEs5/constants/libraryName.js +1 -2
- package/libEs5/constants/libraryVersion.js +1 -2
- package/libEs5/constants/namespace.js +1 -2
- package/libEs5/constants/pageWideScope.js +1 -2
- package/libEs5/constants/propositionEventType.js +20 -21
- package/libEs5/constants/queryStringIdentityParam.js +1 -2
- package/libEs5/constants/schema.js +10 -20
- package/libEs5/constants/shadowSeparator.js +1 -2
- package/libEs5/constants/tagName.js +7 -14
- package/libEs5/core/buildAndValidateConfig.js +19 -17
- package/libEs5/core/componentCreators.js +9 -4
- package/libEs5/core/config/createConfig.js +1 -2
- package/libEs5/core/config/createCoreConfigs.js +2 -3
- package/libEs5/core/consent/createConsent.js +5 -3
- package/libEs5/core/consent/createConsentStateMachine.js +41 -13
- package/libEs5/core/createComponentRegistry.js +5 -3
- package/libEs5/core/createCookieTransfer.js +2 -3
- package/libEs5/core/createEvent.js +13 -14
- package/libEs5/core/createEventManager.js +8 -6
- package/libEs5/core/createInstanceFunction.js +2 -3
- package/libEs5/core/createLifecycle.js +2 -3
- package/libEs5/core/createLogController.js +2 -3
- package/libEs5/core/createLogger.js +2 -3
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +2 -3
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +2 -3
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +2 -3
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +2 -3
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +2 -3
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +2 -3
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +13 -14
- package/libEs5/core/index.js +3 -5
- package/libEs5/core/initializeComponents.js +2 -3
- package/libEs5/core/injectCreateResponse.js +2 -3
- package/libEs5/core/injectExecuteCommand.js +2 -3
- package/libEs5/core/injectHandleError.js +2 -3
- package/libEs5/core/injectShouldTransferCookie.js +2 -3
- package/libEs5/core/network/getRequestRetryDelay.js +2 -3
- package/libEs5/core/network/injectSendNetworkRequest.js +18 -16
- package/libEs5/core/network/isRequestRetryable.js +2 -3
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +2 -3
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +2 -3
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +2 -3
- package/libEs5/core/validateCommandOptions.js +2 -3
- package/libEs5/index.js +2 -3
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +2 -3
- package/libEs5/utils/assign.js +1 -2
- package/libEs5/utils/assignConcatArrayValues.js +13 -14
- package/libEs5/utils/assignIf.js +2 -3
- package/libEs5/utils/clone.js +2 -3
- package/libEs5/utils/cookieJar.js +2 -3
- package/libEs5/utils/crc32.js +1 -2
- package/libEs5/utils/createCallbackAggregator.js +2 -3
- package/libEs5/utils/createLoggingCookieJar.js +8 -6
- package/libEs5/utils/createMerger.js +2 -3
- package/libEs5/utils/createSubscription.js +12 -13
- package/libEs5/utils/createTaskQueue.js +2 -3
- package/libEs5/utils/deduplicateArray.js +2 -3
- package/libEs5/utils/deepAssign.js +2 -3
- package/libEs5/utils/defer.js +2 -3
- package/libEs5/utils/dom/appendNode.js +2 -3
- package/libEs5/utils/dom/awaitSelector.js +7 -13
- package/libEs5/utils/dom/createNode.js +2 -3
- package/libEs5/utils/dom/isShadowSelector.js +2 -3
- package/libEs5/utils/dom/matchesSelector.js +2 -3
- package/libEs5/utils/dom/querySelectorAll.js +2 -3
- package/libEs5/utils/dom/removeNode.js +2 -3
- package/libEs5/utils/dom/selectNodes.js +2 -3
- package/libEs5/utils/dom/selectNodesWithShadow.js +2 -3
- package/libEs5/utils/endsWith.js +2 -3
- package/libEs5/utils/filterObject.js +17 -15
- package/libEs5/utils/find.js +2 -3
- package/libEs5/utils/fireImage.js +2 -3
- package/libEs5/utils/flatMap.js +2 -3
- package/libEs5/utils/flattenArray.js +2 -3
- package/libEs5/utils/flattenObject.js +4 -5
- package/libEs5/utils/getApexDomain.js +2 -3
- package/libEs5/utils/getBrowser.js +17 -16
- package/libEs5/utils/getLastArrayItems.js +2 -3
- package/libEs5/utils/getNamespacedCookieName.js +2 -3
- package/libEs5/utils/groupBy.js +2 -3
- package/libEs5/utils/includes.js +2 -3
- package/libEs5/utils/injectDoesIdentityCookieExist.js +2 -3
- package/libEs5/utils/injectFireReferrerHideableImage.js +14 -15
- package/libEs5/utils/injectStorage.js +2 -3
- package/libEs5/utils/intersection.js +2 -3
- package/libEs5/utils/isBlankString.js +2 -3
- package/libEs5/utils/isBoolean.js +2 -3
- package/libEs5/utils/isEmptyObject.js +2 -3
- package/libEs5/utils/isFunction.js +2 -3
- package/libEs5/utils/isInteger.js +2 -3
- package/libEs5/utils/isNamespacedCookieName.js +2 -3
- package/libEs5/utils/isNil.js +2 -3
- package/libEs5/utils/isNonEmptyArray.js +2 -3
- package/libEs5/utils/isNonEmptyString.js +2 -3
- package/libEs5/utils/isNumber.js +2 -3
- package/libEs5/utils/isObject.js +13 -14
- package/libEs5/utils/isString.js +2 -3
- package/libEs5/utils/isUnique.js +2 -3
- package/libEs5/utils/isValidRegExp.js +2 -3
- package/libEs5/utils/memoize.js +2 -3
- package/libEs5/utils/noop.js +1 -2
- package/libEs5/utils/padStart.js +2 -3
- package/libEs5/utils/parseUrl.js +17 -15
- package/libEs5/utils/prepareConfigOverridesForEdge.js +13 -14
- package/libEs5/utils/querystring.js +1 -2
- package/libEs5/utils/request/createAddIdentity.js +2 -3
- package/libEs5/utils/request/createDataCollectionRequest.js +2 -3
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +2 -3
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +2 -3
- package/libEs5/utils/request/createHasIdentity.js +2 -3
- package/libEs5/utils/request/createRequest.js +2 -3
- package/libEs5/utils/request/createRequestParams.js +2 -3
- package/libEs5/utils/request/createRequestPayload.js +2 -3
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
- package/libEs5/utils/stackError.js +2 -3
- package/libEs5/utils/startsWith.js +2 -3
- package/libEs5/utils/stringToBoolean.js +2 -3
- package/libEs5/utils/toArray.js +2 -3
- package/libEs5/utils/toError.js +2 -3
- package/libEs5/utils/toISOStringLocal.js +2 -3
- package/libEs5/utils/toInteger.js +2 -3
- package/libEs5/utils/updateErrorMessage.js +2 -3
- package/libEs5/utils/uuid.js +1 -2
- package/libEs5/utils/validateConfigOverride.js +1 -2
- package/libEs5/utils/validateIdentityMap.js +2 -3
- package/libEs5/utils/validation/booleanValidator.js +2 -3
- package/libEs5/utils/validation/callbackValidator.js +2 -3
- package/libEs5/utils/validation/createAnyOfValidator.js +2 -3
- package/libEs5/utils/validation/createArrayOfValidator.js +2 -3
- package/libEs5/utils/validation/createDefaultValidator.js +2 -3
- package/libEs5/utils/validation/createDeprecatedValidator.js +18 -19
- package/libEs5/utils/validation/createLiteralValidator.js +2 -3
- package/libEs5/utils/validation/createMapOfValuesValidator.js +2 -3
- package/libEs5/utils/validation/createMaximumValidator.js +2 -3
- package/libEs5/utils/validation/createMinimumValidator.js +2 -3
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +2 -3
- package/libEs5/utils/validation/createNonEmptyValidator.js +2 -3
- package/libEs5/utils/validation/createObjectOfValidator.js +2 -3
- package/libEs5/utils/validation/createUniqueItemsValidator.js +2 -3
- package/libEs5/utils/validation/createUniqueValidator.js +2 -3
- package/libEs5/utils/validation/domainValidator.js +2 -3
- package/libEs5/utils/validation/index.js +90 -93
- package/libEs5/utils/validation/integerValidator.js +2 -3
- package/{libEs6/components/MediaCollection/createMediaRequestPayload.js → libEs5/utils/validation/matchesRegexpValidator.js} +9 -14
- package/libEs5/utils/validation/numberValidator.js +2 -3
- package/libEs5/utils/validation/regexpValidator.js +2 -3
- package/libEs5/utils/validation/requiredValidator.js +2 -3
- package/libEs5/utils/validation/stringValidator.js +2 -3
- package/libEs5/utils/validation/utils.js +5 -9
- package/libEs5/utils/values.js +2 -3
- package/libEs6/components/ActivityCollector/index.js +0 -1
- package/libEs6/components/Identity/index.js +2 -1
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +5 -1
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +7 -11
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +4 -3
- package/libEs6/components/LegacyMediaAnalytics/{media → constants}/constants.js +11 -10
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +240 -0
- package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +157 -150
- package/libEs6/components/LegacyMediaAnalytics/index.js +40 -18
- package/libEs6/components/LibraryInfo/index.js +3 -1
- package/libEs6/components/Personalization/createComponent.js +5 -1
- package/libEs6/components/Personalization/createFetchDataHandler.js +16 -6
- package/libEs6/components/{MediaCollection/createUpdateMediaSessionState.js → Personalization/createHandleConsentFlicker.js} +14 -24
- package/libEs6/components/Personalization/createNotificationHandler.js +6 -2
- package/libEs6/components/Personalization/createOnDecisionHandler.js +1 -1
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +0 -1
- package/libEs6/components/Personalization/index.js +11 -3
- 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/{MediaCollection → StreamingMedia}/createMediaEventManager.js +44 -44
- package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
- package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaSessionCacheManager.js +17 -21
- 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/{MediaCollection → StreamingMedia}/validateMediaEventOptions.js +4 -3
- package/libEs6/components/{MediaCollection → StreamingMedia}/validateMediaSessionOptions.js +1 -1
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/componentCreators.js +19 -3
- package/libEs6/core/consent/createConsent.js +3 -0
- package/libEs6/core/consent/createConsentStateMachine.js +34 -0
- package/libEs6/core/createComponentRegistry.js +3 -0
- package/libEs6/utils/validation/index.js +6 -1
- package/libEs6/utils/{debounce.js → validation/matchesRegexpValidator.js} +5 -10
- package/package.json +19 -4
- package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -272
- package/libEs5/components/MediaCollection/createHeartbeatEngine.js +0 -55
- package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +0 -35
- package/libEs5/components/MediaCollection/index.js +0 -159
- package/libEs5/components/MediaCollection/mediaConstants/mediaEvents.js +0 -13
- package/libEs5/components/MediaCollection/validateMediaEventOptions.js +0 -35
- package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -276
- package/libEs6/components/MediaCollection/createHeartbeatEngine.js +0 -57
- package/libEs6/components/MediaCollection/index.js +0 -158
- package/libEs6/components/MediaCollection/mediaConstants/mediaEvents.js +0 -9
- /package/libEs6/components/LegacyMediaAnalytics/{media → constants}/mediaKeysToXdmConverter.js +0 -0
- /package/libEs6/components/{MediaCollection → StreamingMedia}/createMediaRequest.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { noop } from "../../utils";
|
|
13
|
+
import validateSessionOptions from "./validateMediaSessionOptions";
|
|
14
|
+
import validateMediaEventOptions from "./validateMediaEventOptions";
|
|
15
|
+
export default (({
|
|
16
|
+
config,
|
|
17
|
+
trackMediaEvent,
|
|
18
|
+
trackMediaSession,
|
|
19
|
+
mediaResponseHandler
|
|
20
|
+
}) => {
|
|
21
|
+
return {
|
|
22
|
+
lifecycle: {
|
|
23
|
+
onBeforeEvent({
|
|
24
|
+
mediaOptions,
|
|
25
|
+
onResponse = noop
|
|
26
|
+
}) {
|
|
27
|
+
if (!mediaOptions) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const {
|
|
31
|
+
legacy,
|
|
32
|
+
playerId,
|
|
33
|
+
getPlayerDetails
|
|
34
|
+
} = mediaOptions;
|
|
35
|
+
if (legacy) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
onResponse(({
|
|
39
|
+
response
|
|
40
|
+
}) => {
|
|
41
|
+
return mediaResponseHandler({
|
|
42
|
+
playerId,
|
|
43
|
+
getPlayerDetails,
|
|
44
|
+
response
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
commands: {
|
|
50
|
+
createMediaSession: {
|
|
51
|
+
optionsValidator: options => validateSessionOptions({
|
|
52
|
+
options
|
|
53
|
+
}),
|
|
54
|
+
run: trackMediaSession
|
|
55
|
+
},
|
|
56
|
+
sendMediaEvent: {
|
|
57
|
+
optionsValidator: options => validateMediaEventOptions({
|
|
58
|
+
options
|
|
59
|
+
}),
|
|
60
|
+
run: options => {
|
|
61
|
+
if (!config.streamingMedia) {
|
|
62
|
+
return Promise.reject(new Error("Streaming media is not configured."));
|
|
63
|
+
}
|
|
64
|
+
return trackMediaEvent(options);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import MediaEvents from "./constants/eventTypes";
|
|
13
|
+
const getContentState = (eventType, sessionContentState) => {
|
|
14
|
+
if (eventType === MediaEvents.AD_START || eventType === MediaEvents.Ad_BREAK_START || eventType === MediaEvents.AD_SKIP || eventType === MediaEvents.AD_COMPLETE) {
|
|
15
|
+
return "ad";
|
|
16
|
+
}
|
|
17
|
+
if (eventType === MediaEvents.AD_BREAK_COMPLETE || eventType === MediaEvents.CHAPTER_COMPLETE || eventType === MediaEvents.CHAPTER_START || eventType === MediaEvents.CHAPTER_SKIP || eventType === MediaEvents.SESSION_START) {
|
|
18
|
+
return "main";
|
|
19
|
+
}
|
|
20
|
+
if (eventType === MediaEvents.SESSION_END || eventType === MediaEvents.SESSION_COMPLETE) {
|
|
21
|
+
return "completed";
|
|
22
|
+
}
|
|
23
|
+
return sessionContentState;
|
|
24
|
+
};
|
|
25
|
+
export default (({
|
|
26
|
+
mediaEventManager,
|
|
27
|
+
mediaSessionCacheManager,
|
|
28
|
+
config
|
|
29
|
+
}) => {
|
|
30
|
+
const sendMediaEvent = options => {
|
|
31
|
+
const event = mediaEventManager.createMediaEvent({
|
|
32
|
+
options
|
|
33
|
+
});
|
|
34
|
+
const {
|
|
35
|
+
playerId,
|
|
36
|
+
xdm
|
|
37
|
+
} = options;
|
|
38
|
+
const eventType = xdm.eventType;
|
|
39
|
+
const action = eventType.split(".")[1];
|
|
40
|
+
const {
|
|
41
|
+
getPlayerDetails,
|
|
42
|
+
sessionPromise,
|
|
43
|
+
playbackState
|
|
44
|
+
} = mediaSessionCacheManager.getSession(playerId);
|
|
45
|
+
return sessionPromise.then(result => {
|
|
46
|
+
mediaEventManager.augmentMediaEvent({
|
|
47
|
+
event,
|
|
48
|
+
eventType,
|
|
49
|
+
playerId,
|
|
50
|
+
getPlayerDetails,
|
|
51
|
+
sessionID: result.sessionId
|
|
52
|
+
});
|
|
53
|
+
return mediaEventManager.trackMediaEvent({
|
|
54
|
+
event,
|
|
55
|
+
action
|
|
56
|
+
}).then(() => {
|
|
57
|
+
if (playerId) {
|
|
58
|
+
if (eventType === MediaEvents.SESSION_COMPLETE || eventType === MediaEvents.SESSION_END) {
|
|
59
|
+
mediaSessionCacheManager.stopPing({
|
|
60
|
+
playerId
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
const sessionPlaybackState = getContentState(eventType, playbackState);
|
|
64
|
+
if (sessionPlaybackState === "completed") {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const interval = sessionPlaybackState === "ad" ? config.streamingMedia.adPingInterval : config.streamingMedia.mainPingInterval;
|
|
68
|
+
const pingId = setTimeout(() => {
|
|
69
|
+
const pingOptions = {
|
|
70
|
+
playerId,
|
|
71
|
+
xdm: {
|
|
72
|
+
eventType: MediaEvents.PING
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
sendMediaEvent(pingOptions);
|
|
76
|
+
}, interval * 1000);
|
|
77
|
+
mediaSessionCacheManager.savePing({
|
|
78
|
+
playerId,
|
|
79
|
+
pingId,
|
|
80
|
+
playbackState: sessionPlaybackState
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return options => sendMediaEvent(options);
|
|
88
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import PlaybackState from "./constants/playbackState";
|
|
13
|
+
export default (({
|
|
14
|
+
config,
|
|
15
|
+
mediaEventManager,
|
|
16
|
+
mediaSessionCacheManager,
|
|
17
|
+
legacy = false
|
|
18
|
+
}) => {
|
|
19
|
+
return options => {
|
|
20
|
+
if (!config.streamingMedia) {
|
|
21
|
+
return Promise.reject(new Error("Streaming media is not configured."));
|
|
22
|
+
}
|
|
23
|
+
const {
|
|
24
|
+
playerId,
|
|
25
|
+
getPlayerDetails
|
|
26
|
+
} = options;
|
|
27
|
+
const event = mediaEventManager.createMediaSession(options);
|
|
28
|
+
mediaEventManager.augmentMediaEvent({
|
|
29
|
+
event,
|
|
30
|
+
playerId,
|
|
31
|
+
getPlayerDetails
|
|
32
|
+
});
|
|
33
|
+
const sessionPromise = mediaEventManager.trackMediaSession({
|
|
34
|
+
event,
|
|
35
|
+
mediaOptions: {
|
|
36
|
+
playerId,
|
|
37
|
+
getPlayerDetails,
|
|
38
|
+
legacy
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
mediaSessionCacheManager.storeSession({
|
|
42
|
+
playerId,
|
|
43
|
+
sessionDetails: {
|
|
44
|
+
sessionPromise,
|
|
45
|
+
getPlayerDetails,
|
|
46
|
+
playbackState: PlaybackState.MAIN
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return sessionPromise;
|
|
50
|
+
};
|
|
51
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/* eslint-disable import/no-restricted-paths */
|
|
13
|
+
import createMediaSessionCacheManager from "./createMediaSessionCacheManager";
|
|
14
|
+
import createMediaEventManager from "./createMediaEventManager";
|
|
15
|
+
import createTrackMediaEvent from "./createTrackMediaEvent";
|
|
16
|
+
import configValidators from "./configValidators";
|
|
17
|
+
import createStreamingMediaComponent from "./createStreamingMediaComponent";
|
|
18
|
+
import createTrackMediaSession from "./createTrackMediaSession";
|
|
19
|
+
import createMediaResponseHandler from "./createMediaResponseHandler";
|
|
20
|
+
import injectTimestamp from "../Context/injectTimestamp";
|
|
21
|
+
const createStreamingMedia = ({
|
|
22
|
+
config,
|
|
23
|
+
logger,
|
|
24
|
+
eventManager,
|
|
25
|
+
sendEdgeNetworkRequest,
|
|
26
|
+
consent
|
|
27
|
+
}) => {
|
|
28
|
+
const mediaSessionCacheManager = createMediaSessionCacheManager({
|
|
29
|
+
config
|
|
30
|
+
});
|
|
31
|
+
const mediaEventManager = createMediaEventManager({
|
|
32
|
+
config,
|
|
33
|
+
eventManager,
|
|
34
|
+
logger,
|
|
35
|
+
consent,
|
|
36
|
+
sendEdgeNetworkRequest,
|
|
37
|
+
setTimestamp: injectTimestamp(() => new Date())
|
|
38
|
+
});
|
|
39
|
+
const trackMediaEvent = createTrackMediaEvent({
|
|
40
|
+
mediaSessionCacheManager,
|
|
41
|
+
mediaEventManager,
|
|
42
|
+
config
|
|
43
|
+
});
|
|
44
|
+
const trackMediaSession = createTrackMediaSession({
|
|
45
|
+
config,
|
|
46
|
+
mediaEventManager,
|
|
47
|
+
mediaSessionCacheManager
|
|
48
|
+
});
|
|
49
|
+
const mediaResponseHandler = createMediaResponseHandler({
|
|
50
|
+
mediaSessionCacheManager,
|
|
51
|
+
config,
|
|
52
|
+
trackMediaEvent
|
|
53
|
+
});
|
|
54
|
+
return createStreamingMediaComponent({
|
|
55
|
+
config,
|
|
56
|
+
trackMediaEvent,
|
|
57
|
+
mediaEventManager,
|
|
58
|
+
mediaResponseHandler,
|
|
59
|
+
trackMediaSession
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
createStreamingMedia.namespace = "Streaming media";
|
|
63
|
+
createStreamingMedia.configValidators = configValidators;
|
|
64
|
+
export default createStreamingMedia;
|
|
@@ -9,19 +9,20 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { anyOf, anything, number, objectOf, string } from "../../utils/validation";
|
|
12
|
+
import { anyOf, anything, enumOf, number, objectOf, string } from "../../utils/validation";
|
|
13
|
+
import EventTypes from "./constants/eventTypes";
|
|
13
14
|
export default (({
|
|
14
15
|
options
|
|
15
16
|
}) => {
|
|
16
17
|
const validator = anyOf([objectOf({
|
|
17
18
|
playerId: string().required(),
|
|
18
19
|
xdm: objectOf({
|
|
19
|
-
eventType:
|
|
20
|
+
eventType: enumOf(...Object.values(EventTypes)).required(),
|
|
20
21
|
mediaCollection: objectOf(anything())
|
|
21
22
|
}).required()
|
|
22
23
|
}).required(), objectOf({
|
|
23
24
|
xdm: objectOf({
|
|
24
|
-
eventType:
|
|
25
|
+
eventType: enumOf(...Object.values(EventTypes)).required(),
|
|
25
26
|
mediaCollection: objectOf({
|
|
26
27
|
playhead: number().integer().required(),
|
|
27
28
|
sessionID: string().required()
|
|
@@ -16,7 +16,7 @@ export default (({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const sessionValidator = anyOf([objectOf({
|
|
18
18
|
playerId: string().required(),
|
|
19
|
-
|
|
19
|
+
getPlayerDetails: callback().required(),
|
|
20
20
|
xdm: objectOf({
|
|
21
21
|
mediaCollection: objectOf({
|
|
22
22
|
sessionDetails: objectOf(anything()).required()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
3
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -9,23 +9,39 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
|
|
12
13
|
// This is the only place where core is allowed to import from components.
|
|
13
14
|
// This makes sure that each component could be removed without breaking the library
|
|
15
|
+
|
|
14
16
|
/* eslint-disable import/no-restricted-paths */
|
|
17
|
+
|
|
15
18
|
import createDataCollector from "../components/DataCollector";
|
|
19
|
+
|
|
20
|
+
/* @skipwhen ENV.alloy_activitycollector === false */
|
|
16
21
|
import createActivityCollector from "../components/ActivityCollector";
|
|
17
22
|
import createIdentity from "../components/Identity";
|
|
23
|
+
|
|
24
|
+
/* @skipwhen ENV.alloy_audiences === false */
|
|
18
25
|
import createAudiences from "../components/Audiences";
|
|
26
|
+
|
|
27
|
+
/* @skipwhen ENV.alloy_personalization === false */
|
|
19
28
|
import createPersonalization from "../components/Personalization";
|
|
20
29
|
import createContext from "../components/Context";
|
|
21
30
|
import createPrivacy from "../components/Privacy";
|
|
31
|
+
|
|
32
|
+
/* @skipwhen ENV.alloy_eventmerge === false */
|
|
22
33
|
import createEventMerge from "../components/EventMerge";
|
|
23
34
|
import createLibraryInfo from "../components/LibraryInfo";
|
|
35
|
+
|
|
36
|
+
/* @skipwhen ENV.alloy_decisioningengine === false */
|
|
24
37
|
import createDecisioningEngine from "../components/DecisioningEngine";
|
|
38
|
+
|
|
39
|
+
/* @skipwhen ENV.alloy_machinelearning === false */
|
|
25
40
|
import createMachineLearning from "../components/MachineLearning";
|
|
26
|
-
import
|
|
41
|
+
import createStreamingMedia from "../components/StreamingMedia";
|
|
27
42
|
import createLegacyMediaAnalytics from "../components/LegacyMediaAnalytics";
|
|
28
43
|
|
|
29
44
|
// TODO: Register the Components here statically for now. They might be registered differently.
|
|
30
45
|
// TODO: Figure out how sub-components will be made available/registered
|
|
31
|
-
|
|
46
|
+
|
|
47
|
+
export default [createDataCollector, createActivityCollector, createIdentity, createAudiences, createPersonalization, createContext, createPrivacy, createEventMerge, createLibraryInfo, createMachineLearning, createDecisioningEngine, createLegacyMediaAnalytics, createStreamingMedia];
|
|
@@ -86,6 +86,40 @@ export default (({
|
|
|
86
86
|
awaitConsent: awaitInitial,
|
|
87
87
|
withConsent() {
|
|
88
88
|
return this.awaitConsent(true);
|
|
89
|
+
},
|
|
90
|
+
current() {
|
|
91
|
+
switch (this.awaitConsent) {
|
|
92
|
+
case awaitInDefault:
|
|
93
|
+
return {
|
|
94
|
+
state: "in",
|
|
95
|
+
wasSet: false
|
|
96
|
+
};
|
|
97
|
+
case awaitIn:
|
|
98
|
+
return {
|
|
99
|
+
state: "in",
|
|
100
|
+
wasSet: true
|
|
101
|
+
};
|
|
102
|
+
case awaitOutDefault:
|
|
103
|
+
return {
|
|
104
|
+
state: "out",
|
|
105
|
+
wasSet: false
|
|
106
|
+
};
|
|
107
|
+
case awaitOut:
|
|
108
|
+
return {
|
|
109
|
+
state: "out",
|
|
110
|
+
wasSet: true
|
|
111
|
+
};
|
|
112
|
+
case awaitPending:
|
|
113
|
+
return {
|
|
114
|
+
state: "pending",
|
|
115
|
+
wasSet: false
|
|
116
|
+
};
|
|
117
|
+
default:
|
|
118
|
+
return {
|
|
119
|
+
state: "in",
|
|
120
|
+
wasSet: false
|
|
121
|
+
};
|
|
122
|
+
}
|
|
89
123
|
}
|
|
90
124
|
};
|
|
91
125
|
});
|
|
@@ -90,6 +90,7 @@ import numberValidator from "./numberValidator";
|
|
|
90
90
|
import regexpValidator from "./regexpValidator";
|
|
91
91
|
import requiredValidator from "./requiredValidator";
|
|
92
92
|
import stringValidator from "./stringValidator";
|
|
93
|
+
import matchesRegexpValidator from "./matchesRegexpValidator";
|
|
93
94
|
|
|
94
95
|
// The base validator does no validation and just returns the value unchanged
|
|
95
96
|
const base = value => value;
|
|
@@ -134,6 +135,9 @@ const nonEmptyObject = function nonEmptyObject() {
|
|
|
134
135
|
const regexp = function regexp() {
|
|
135
136
|
return nullSafeChain(this, regexpValidator);
|
|
136
137
|
};
|
|
138
|
+
const matches = function matches(regexpPattern) {
|
|
139
|
+
return nullSafeChain(this, matchesRegexpValidator(regexpPattern));
|
|
140
|
+
};
|
|
137
141
|
const unique = function createUnique() {
|
|
138
142
|
return nullSafeChain(this, createUniqueValidator());
|
|
139
143
|
};
|
|
@@ -206,7 +210,8 @@ const string = function string() {
|
|
|
206
210
|
regexp,
|
|
207
211
|
domain,
|
|
208
212
|
nonEmpty: nonEmptyString,
|
|
209
|
-
unique
|
|
213
|
+
unique,
|
|
214
|
+
matches
|
|
210
215
|
});
|
|
211
216
|
};
|
|
212
217
|
const boundAnyOf = anyOf.bind(base);
|
|
@@ -9,14 +9,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
timer = setTimeout(() => {
|
|
19
|
-
fn(...args);
|
|
20
|
-
}, delay);
|
|
21
|
-
};
|
|
12
|
+
|
|
13
|
+
import { assertValid } from "./utils";
|
|
14
|
+
export default (regexp => (value, path) => {
|
|
15
|
+
assertValid(regexp.test(value), value, path, `does not match the ${regexp.toString()}`);
|
|
16
|
+
return value;
|
|
22
17
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/alloy",
|
|
3
|
-
"version": "2.20.0-
|
|
3
|
+
"version": "2.20.0-beta.0",
|
|
4
4
|
"description": "Adobe Experience Platform Web SDK",
|
|
5
5
|
"main": "libEs5/index.js",
|
|
6
6
|
"module": "libEs6/index.js",
|
|
@@ -19,19 +19,23 @@
|
|
|
19
19
|
"test:unit:saucelabs:local": "karma start karma.saucelabs.conf.js --single-run",
|
|
20
20
|
"test:unit:coverage": "karma start --single-run --reporters spec,coverage",
|
|
21
21
|
"test:functional": "EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" testcafe chrome",
|
|
22
|
-
"test:functional:
|
|
22
|
+
"test:functional:custom": "node scripts/helpers/runFunctionalTests.js",
|
|
23
|
+
"test:functional:saucelabs:dev": "NPM_PACKAGE_VERSION=$(npm pkg get version | tr -d '\"') EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" saucectl run --config ./.sauce/dev.yml",
|
|
23
24
|
"test:functional:watch": "EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" ./scripts/watchFunctionalTests.js --browsers chrome",
|
|
24
25
|
"test:functional:debug": "EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" testcafe --inspect-brk chrome",
|
|
25
26
|
"test:functional:build:int": "rollup -c --environment BASE_CODE_MIN,STANDALONE,NPM_PACKAGE_LOCAL",
|
|
26
27
|
"test:functional:build:prod": "rollup -c --environment BASE_CODE_MIN,NPM_PACKAGE_PROD",
|
|
27
28
|
"test:scripts": "jasmine --config=scripts/specs/jasmine.json",
|
|
28
29
|
"sandbox:build": "rollup -c --environment SANDBOX && cd sandbox && npm run build",
|
|
30
|
+
"sandbox:build:custom": "SANDBOX=true npm run build:custom -- --exclude personalization && cd sandbox && npm run build && npm run start",
|
|
29
31
|
"dev": "concurrently --names build,sandbox \"rollup -c -w --environment SANDBOX\" \"cd sandbox && export REACT_APP_NONCE=321 && npm start\"",
|
|
30
32
|
"build": "npm run format && npm run lint && npm run clean && rollup -c --environment BASE_CODE_MIN,STANDALONE,STANDALONE_MIN && echo \"Base Code:\" && cat distTest/baseCode.min.js",
|
|
33
|
+
"build:custom": "npm run clean && rollup -c --environment BASE_CODE_MIN,NPM_PACKAGE_LOCAL && node scripts/helpers/customBuild.js",
|
|
31
34
|
"prepare": "husky install && cd sandbox && npm install",
|
|
32
35
|
"prepublishOnly": "rimraf libEs5 libEs6 && babel src -d libEs5 --env-name npmEs5 && babel src -d libEs6 --env-name npmEs6",
|
|
33
36
|
"checkthattestfilesexist": "./scripts/checkThatTestFilesExist.js",
|
|
34
|
-
"add-license": "./scripts/add-license.js"
|
|
37
|
+
"add-license": "./scripts/add-license.js",
|
|
38
|
+
"preinstall": "npx force-resolutions"
|
|
35
39
|
},
|
|
36
40
|
"lint-staged": {
|
|
37
41
|
"./*.js": [
|
|
@@ -70,16 +74,21 @@
|
|
|
70
74
|
"uuid": "^3.3.2"
|
|
71
75
|
},
|
|
72
76
|
"devDependencies": {
|
|
73
|
-
"@adobe/alloy": "^2.19.
|
|
77
|
+
"@adobe/alloy": "^2.19.2",
|
|
74
78
|
"@babel/cli": "^7.12.8",
|
|
75
79
|
"@babel/core": "^7.2.2",
|
|
76
80
|
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|
|
77
81
|
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
78
82
|
"@babel/plugin-transform-template-literals": "^7.4.4",
|
|
79
83
|
"@babel/preset-env": "^7.4.5",
|
|
84
|
+
"@babel/types": "^7.23.0",
|
|
80
85
|
"@octokit/rest": "^18.3.5",
|
|
86
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
87
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
88
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
81
89
|
"babel-plugin-version": "^0.2.3",
|
|
82
90
|
"bundlesize": "^0.18.0",
|
|
91
|
+
"chai": "^5.0.0",
|
|
83
92
|
"chalk": "^2.4.2",
|
|
84
93
|
"concurrently": "^6.5.0",
|
|
85
94
|
"date-fns": "^2.23.0",
|
|
@@ -91,6 +100,7 @@
|
|
|
91
100
|
"eslint-plugin-import": "^2.28.1",
|
|
92
101
|
"eslint-plugin-prettier": "^3.0.1",
|
|
93
102
|
"eslint-plugin-testcafe": "^0.2.1",
|
|
103
|
+
"force-resolutions": "^1.0.11",
|
|
94
104
|
"glob": "^7.1.3",
|
|
95
105
|
"handlebars": "^4.7.7",
|
|
96
106
|
"husky": "^6.0.0",
|
|
@@ -134,5 +144,10 @@
|
|
|
134
144
|
"url-exists-nodejs": "^0.1.0",
|
|
135
145
|
"url-parse": "^1.4.7",
|
|
136
146
|
"yargs": "^16.2.0"
|
|
147
|
+
},
|
|
148
|
+
"overrides": {
|
|
149
|
+
"karma-sauce-launcher": {
|
|
150
|
+
"webdriverio": "^8.35.1"
|
|
151
|
+
}
|
|
137
152
|
}
|
|
138
153
|
}
|