@adobe/alloy 2.21.1 → 2.22.0-alpha.1
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/babel.config.cjs +0 -1
- package/libEs5/baseCode/index.js +3 -2
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +23 -20
- package/libEs5/components/ActivityCollector/configValidators.js +2 -2
- package/libEs5/components/ActivityCollector/createClickActivityStorage.js +11 -9
- package/libEs5/components/ActivityCollector/createClickedElementProperties.js +39 -32
- package/libEs5/components/ActivityCollector/createGetClickedElementProperties.js +28 -20
- package/libEs5/components/ActivityCollector/createInjectClickedElementProperties.js +24 -21
- package/libEs5/components/ActivityCollector/createRecallAndInjectClickedElementProperties.js +10 -8
- package/libEs5/components/ActivityCollector/createStorePageViewProperties.js +6 -4
- package/libEs5/components/ActivityCollector/getLinkName.js +19 -18
- package/libEs5/components/ActivityCollector/getLinkRegion.js +10 -9
- package/libEs5/components/ActivityCollector/index.js +61 -45
- package/libEs5/components/ActivityCollector/utils/activityMapExtensionEnabled.js +3 -5
- package/libEs5/components/ActivityCollector/utils/createTransientStorage.js +7 -6
- package/libEs5/components/ActivityCollector/utils/determineLinkType.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/elementHasClickHandler.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/extractDomain.js +5 -4
- package/libEs5/components/ActivityCollector/utils/dom/findClickableElement.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/getAbsoluteUrlFromAnchorElement.js +11 -8
- package/libEs5/components/ActivityCollector/utils/dom/isButtonSubmitElement.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/isDownloadLink.js +6 -5
- package/libEs5/components/ActivityCollector/utils/dom/isExitLink.js +6 -5
- package/libEs5/components/ActivityCollector/utils/dom/isInputSubmitElement.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/isSupportedAnchorElement.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/isSupportedTextNode.js +4 -3
- package/libEs5/components/ActivityCollector/utils/hasPageName.js +4 -3
- package/libEs5/components/ActivityCollector/utils/isDifferentDomains.js +5 -4
- package/libEs5/components/ActivityCollector/utils/trimQueryFromUrl.js +5 -4
- package/libEs5/components/ActivityCollector/utils/truncateWhiteSpace.js +3 -2
- package/libEs5/components/ActivityCollector/utils/urlStartsWithScheme.js +3 -2
- package/libEs5/components/Audiences/index.js +13 -12
- package/libEs5/components/Audiences/injectProcessDestinations.js +32 -35
- package/libEs5/components/Audiences/injectProcessResponse.js +19 -16
- package/libEs5/components/Context/createComponent.js +10 -13
- package/libEs5/components/Context/implementationDetails.js +5 -4
- package/libEs5/components/Context/index.js +24 -28
- package/libEs5/components/Context/injectDevice.js +23 -15
- package/libEs5/components/Context/injectEnvironment.js +17 -12
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +12 -21
- package/libEs5/components/Context/injectPlaceContext.js +8 -7
- package/libEs5/components/Context/injectTimestamp.js +6 -5
- package/libEs5/components/Context/injectWeb.js +6 -5
- package/libEs5/components/DataCollector/index.js +37 -38
- package/libEs5/components/DataCollector/validateApplyResponse.js +6 -4
- package/libEs5/components/DataCollector/validateUserEventOptions.js +6 -4
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +11 -8
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +10 -7
- package/libEs5/components/DecisioningEngine/constants.js +3 -3
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +15 -15
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -13
- package/libEs5/components/DecisioningEngine/createContextProvider.js +48 -44
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +7 -5
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +16 -21
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +39 -37
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +21 -19
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +63 -67
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +23 -22
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +100 -55
- package/libEs5/components/DecisioningEngine/index.js +83 -54
- package/libEs5/components/DecisioningEngine/utils.js +43 -38
- package/libEs5/components/EventMerge/createComponent.js +5 -3
- package/libEs5/components/EventMerge/createEventMergeId.js +3 -2
- package/libEs5/components/EventMerge/index.js +1 -1
- package/libEs5/components/Identity/addEcidQueryToPayload.js +3 -2
- package/libEs5/components/Identity/addEcidToPayload.js +3 -2
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +13 -23
- package/libEs5/components/Identity/configValidators.js +1 -1
- package/libEs5/components/Identity/constants/authState.js +3 -3
- package/libEs5/components/Identity/createComponent.js +39 -33
- package/libEs5/components/Identity/createLegacyIdentity.js +29 -29
- package/libEs5/components/Identity/getEcidFromResponse.js +5 -7
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +17 -15
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +10 -8
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +5 -4
- package/libEs5/components/Identity/index.js +61 -62
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +8 -6
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +46 -52
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +14 -11
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +25 -24
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +6 -4
- package/libEs5/components/Identity/injectProcessIdSyncs.js +20 -22
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +7 -5
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +8 -6
- package/libEs5/components/Identity/visitorService/getVisitor.js +4 -3
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +15 -13
- package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +9 -9
- package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +2 -2
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +61 -63
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +38 -37
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +54 -52
- package/libEs5/components/LegacyMediaAnalytics/index.js +32 -33
- package/libEs5/components/LibraryInfo/index.js +23 -30
- package/libEs5/components/MachineLearning/index.js +1 -1
- package/libEs5/components/MachineLearning/processResponse.js +5 -3
- package/libEs5/components/Personalization/constants/loggerMessage.js +2 -2
- package/libEs5/components/Personalization/constants/scopeType.js +3 -3
- package/libEs5/components/Personalization/constants/surface.js +4 -4
- package/libEs5/components/Personalization/createActionsProvider.js +37 -32
- package/libEs5/components/Personalization/createApplyPropositions.js +71 -81
- package/libEs5/components/Personalization/createClickStorage.js +30 -32
- package/libEs5/components/Personalization/createComponent.js +65 -74
- package/libEs5/components/Personalization/createFetchDataHandler.js +83 -52
- package/libEs5/components/Personalization/createGetPageLocation.js +6 -6
- package/libEs5/components/Personalization/createHandleConsentFlicker.js +15 -14
- package/libEs5/components/Personalization/createInteractionStorage.js +25 -39
- package/libEs5/components/Personalization/createNotificationHandler.js +9 -10
- package/libEs5/components/Personalization/createOnClickHandler.js +29 -25
- package/libEs5/components/Personalization/createOnDecisionHandler.js +23 -21
- package/libEs5/components/Personalization/createPersonalizationDetails.js +39 -45
- package/libEs5/components/Personalization/createPreprocessors.js +7 -7
- package/libEs5/components/Personalization/createSetTargetMigration.js +6 -4
- package/libEs5/components/Personalization/createViewCacheManager.js +29 -32
- package/libEs5/components/Personalization/createViewChangeHandler.js +35 -20
- package/libEs5/components/Personalization/dom-actions/action.js +24 -25
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +12 -13
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +8 -7
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +28 -33
- package/libEs5/components/Personalization/dom-actions/clicks/collectInteractions.js +37 -40
- package/libEs5/components/Personalization/dom-actions/collectInteractions.js +3 -2
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +10 -11
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +11 -13
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +6 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +6 -3
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +3 -3
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +7 -6
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +7 -7
- package/libEs5/components/Personalization/dom-actions/dom/index.js +14 -14
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +4 -3
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +4 -3
- package/libEs5/components/Personalization/dom-actions/dom/isDomElement.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +6 -5
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +39 -38
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +4 -3
- package/libEs5/components/Personalization/dom-actions/images.js +10 -9
- package/libEs5/components/Personalization/dom-actions/index.js +1 -1
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +40 -25
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +9 -8
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +8 -7
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +13 -10
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +9 -7
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +14 -9
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +16 -14
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +4 -3
- package/libEs5/components/Personalization/dom-actions/scripts.js +58 -38
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +4 -3
- package/libEs5/components/Personalization/dom-actions/setHtml.js +5 -4
- package/libEs5/components/Personalization/dom-actions/setStyles.js +8 -8
- package/libEs5/components/Personalization/dom-actions/setText.js +3 -2
- package/libEs5/components/Personalization/dom-actions/swapImage.js +3 -2
- package/libEs5/components/Personalization/flicker/index.js +66 -49
- package/libEs5/components/Personalization/handlers/createDecorateProposition.js +16 -13
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +45 -50
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +30 -29
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +35 -31
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +109 -105
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +38 -28
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +59 -67
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +3 -2
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +140 -121
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +4 -5
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +23 -19
- package/libEs5/components/Personalization/index.js +120 -103
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +10 -10
- package/libEs5/components/Personalization/utils/createAsyncArray.js +10 -9
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +3 -3
- package/libEs5/components/Personalization/utils/metaUtils.js +14 -19
- package/libEs5/components/Personalization/utils/surfaceUtils.js +27 -46
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +8 -6
- package/libEs5/components/Privacy/computeConsentHash.js +9 -9
- package/libEs5/components/Privacy/createComponent.js +32 -32
- package/libEs5/components/Privacy/createConsentHashStore.js +27 -24
- package/libEs5/components/Privacy/createConsentRequest.js +10 -8
- package/libEs5/components/Privacy/createConsentRequestPayload.js +9 -8
- package/libEs5/components/Privacy/createStoredConsent.js +11 -9
- package/libEs5/components/Privacy/index.js +26 -23
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +30 -29
- package/libEs5/components/Privacy/parseConsentCookie.js +6 -14
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +59 -45
- package/libEs5/components/StreamingMedia/createMediaRequest.js +8 -6
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +22 -17
- package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +22 -18
- package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +30 -29
- package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +41 -36
- package/libEs5/components/StreamingMedia/createTrackMediaSession.js +25 -22
- package/libEs5/components/StreamingMedia/index.js +33 -34
- package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +9 -12
- package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +6 -4
- package/libEs5/constants/browser.js +7 -7
- package/libEs5/constants/consentPurpose.js +1 -1
- package/libEs5/constants/consentStatus.js +3 -3
- package/libEs5/constants/contentType.js +2 -2
- package/libEs5/constants/cookieNameKey.js +3 -3
- package/libEs5/constants/coreCommands.js +2 -2
- package/libEs5/constants/decisionProvider.js +4 -3
- package/libEs5/constants/domain.js +2 -2
- package/libEs5/constants/elementAttribute.js +1 -1
- package/libEs5/constants/eventType.js +5 -5
- package/libEs5/constants/handle.js +1 -1
- package/libEs5/constants/httpHeaderNames.js +2 -2
- package/libEs5/constants/httpStatusCode.js +5 -5
- package/libEs5/constants/identityMapAuthenticatedState.js +3 -3
- package/libEs5/constants/legacyCookies.js +3 -3
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/constants/propositionEventType.js +18 -12
- package/libEs5/constants/propositionInteractionType.js +4 -4
- package/libEs5/constants/schema.js +11 -11
- package/libEs5/constants/sessionDataKeys.js +1 -1
- package/libEs5/constants/tagName.js +7 -7
- package/libEs5/core/buildAndValidateConfig.js +55 -69
- package/libEs5/core/componentCreators.js +70 -41
- package/libEs5/core/config/createConfig.js +4 -3
- package/libEs5/core/config/createCoreConfigs.js +11 -12
- package/libEs5/core/consent/createConsent.js +16 -14
- package/libEs5/core/consent/createConsentStateMachine.js +27 -35
- package/libEs5/core/createComponentRegistry.js +28 -27
- package/libEs5/core/createCookieTransfer.js +18 -18
- package/libEs5/core/createEvent.js +39 -44
- package/libEs5/core/createEventManager.js +64 -69
- package/libEs5/core/createInstanceFunction.js +4 -11
- package/libEs5/core/createLifecycle.js +14 -19
- package/libEs5/core/createLogController.js +30 -29
- package/libEs5/core/createLogger.js +41 -27
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +6 -5
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +29 -32
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +19 -25
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +11 -11
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +20 -16
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +42 -38
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +8 -12
- package/libEs5/core/index.js +137 -133
- package/libEs5/core/initializeComponents.js +17 -15
- package/libEs5/core/injectCreateResponse.js +47 -53
- package/libEs5/core/injectExecuteCommand.js +39 -40
- package/libEs5/core/injectHandleError.js +19 -19
- package/libEs5/core/injectShouldTransferCookie.js +12 -12
- package/libEs5/core/network/getRequestRetryDelay.js +20 -18
- package/libEs5/core/network/injectSendNetworkRequest.js +46 -49
- package/libEs5/core/network/isRequestRetryable.js +9 -8
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +10 -8
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +18 -19
- package/libEs5/core/requiredComponentCreators.js +23 -0
- package/libEs5/core/validateCommandOptions.js +14 -11
- package/libEs5/index.js +43 -22
- package/libEs5/standalone.js +6 -1
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +3 -5
- package/libEs5/utils/assignConcatArrayValues.js +9 -18
- package/libEs5/utils/clone.js +2 -3
- package/libEs5/utils/cookieJar.js +4 -4
- package/libEs5/utils/crc32.js +8 -8
- package/libEs5/utils/createCallbackAggregator.js +7 -11
- package/libEs5/utils/createCollect.js +52 -0
- package/libEs5/utils/createLoggingCookieJar.js +14 -16
- package/libEs5/utils/createMerger.js +9 -10
- package/libEs5/utils/createSubscription.js +48 -48
- package/libEs5/utils/createTaskQueue.js +8 -7
- package/libEs5/utils/deduplicateArray.js +7 -11
- package/libEs5/utils/deepAssign.js +7 -11
- package/libEs5/utils/defer.js +5 -4
- package/libEs5/utils/dom/appendNode.js +3 -2
- package/libEs5/utils/dom/awaitSelector.js +36 -34
- package/libEs5/utils/dom/createNode.js +10 -15
- package/libEs5/utils/dom/index.js +8 -8
- package/libEs5/utils/dom/isShadowSelector.js +2 -3
- package/libEs5/utils/dom/matchesSelector.js +3 -2
- package/libEs5/utils/dom/querySelectorAll.js +5 -13
- package/libEs5/utils/dom/removeNode.js +4 -3
- package/libEs5/utils/dom/selectNodes.js +3 -3
- package/libEs5/utils/dom/selectNodesWithShadow.js +14 -23
- package/libEs5/utils/event.js +49 -0
- package/libEs5/utils/filterObject.js +14 -12
- package/libEs5/utils/fireImage.js +10 -9
- package/libEs5/utils/flattenArray.js +4 -11
- package/libEs5/utils/flattenObject.js +8 -18
- package/libEs5/utils/getApexDomain.js +7 -6
- package/libEs5/utils/getBrowser.js +45 -12
- package/libEs5/utils/getLastArrayItems.js +2 -3
- package/libEs5/utils/getNamespacedCookieName.js +2 -3
- package/libEs5/utils/groupBy.js +6 -5
- package/libEs5/utils/index.js +50 -113
- package/libEs5/utils/injectDoesIdentityCookieExist.js +7 -7
- package/libEs5/utils/injectFireReferrerHideableImage.js +28 -34
- package/libEs5/utils/injectStorage.js +13 -15
- package/libEs5/utils/intersection.js +2 -6
- 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 +4 -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 -4
- package/libEs5/utils/isObject.js +3 -4
- package/libEs5/utils/isString.js +2 -3
- package/libEs5/utils/isUnique.js +6 -5
- package/libEs5/utils/isValidRegExp.js +3 -2
- package/libEs5/utils/memoize.js +7 -6
- package/libEs5/utils/noop.js +2 -1
- package/libEs5/utils/parseUrl.js +19 -25
- package/libEs5/utils/prepareConfigOverridesForEdge.js +6 -5
- package/libEs5/utils/request/createAddIdentity.js +4 -3
- package/libEs5/utils/request/createDataCollectionRequest.js +15 -11
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +9 -10
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +17 -15
- package/libEs5/utils/request/createHasIdentity.js +4 -5
- package/libEs5/utils/request/createRequest.js +26 -23
- package/libEs5/utils/request/createRequestParams.js +13 -13
- package/libEs5/utils/request/createRequestPayload.js +13 -12
- package/libEs5/utils/request/index.js +8 -8
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
- package/libEs5/utils/stackError.js +8 -6
- package/libEs5/utils/stringToBoolean.js +3 -2
- package/libEs5/utils/toArray.js +3 -2
- package/libEs5/utils/toError.js +3 -2
- package/libEs5/utils/toISOStringLocal.js +29 -14
- package/libEs5/utils/toInteger.js +5 -5
- package/libEs5/utils/updateErrorMessage.js +6 -4
- package/libEs5/utils/validation/booleanValidator.js +3 -2
- package/libEs5/utils/validation/callbackValidator.js +3 -2
- package/libEs5/utils/validation/createAnyOfValidator.js +14 -17
- package/libEs5/utils/validation/createArrayOfValidator.js +16 -18
- package/libEs5/utils/validation/createDefaultValidator.js +7 -8
- package/libEs5/utils/validation/createDeprecatedValidator.js +12 -14
- package/libEs5/utils/validation/createLiteralValidator.js +5 -6
- package/libEs5/utils/validation/createMapOfValuesValidator.js +20 -22
- package/libEs5/utils/validation/createMaximumValidator.js +5 -6
- package/libEs5/utils/validation/createMinimumValidator.js +5 -6
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +13 -14
- package/libEs5/utils/validation/createNonEmptyValidator.js +9 -10
- package/libEs5/utils/validation/createObjectOfValidator.js +27 -29
- package/libEs5/utils/validation/createRenamedValidator.js +24 -27
- package/libEs5/utils/validation/createUniqueItemsValidator.js +4 -3
- package/libEs5/utils/validation/createUniqueValidator.js +5 -4
- package/libEs5/utils/validation/domainValidator.js +4 -3
- package/libEs5/utils/validation/index.js +66 -72
- package/libEs5/utils/validation/integerValidator.js +3 -2
- package/libEs5/utils/validation/matchesRegexpValidator.js +5 -6
- package/libEs5/utils/validation/numberValidator.js +3 -2
- package/libEs5/utils/validation/regexpValidator.js +3 -2
- package/libEs5/utils/validation/requiredValidator.js +3 -2
- package/libEs5/utils/validation/stringValidator.js +3 -2
- package/libEs5/utils/validation/utils.js +29 -35
- package/libEs6/components/ActivityCollector/index.js +18 -8
- package/libEs6/components/Context/createComponent.js +1 -3
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +1 -1
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +78 -28
- package/libEs6/components/DecisioningEngine/index.js +22 -2
- package/libEs6/components/DecisioningEngine/utils.js +2 -9
- package/libEs6/components/Identity/createComponent.js +4 -2
- package/libEs6/components/Identity/getEcidFromResponse.js +1 -3
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +2 -2
- package/libEs6/components/LibraryInfo/index.js +4 -5
- package/libEs6/components/Personalization/createActionsProvider.js +4 -2
- package/libEs6/components/Personalization/createComponent.js +2 -2
- package/libEs6/components/Personalization/createFetchDataHandler.js +35 -1
- package/libEs6/components/Personalization/createPersonalizationDetails.js +6 -6
- package/libEs6/components/Personalization/createViewCacheManager.js +5 -2
- package/libEs6/components/Personalization/createViewChangeHandler.js +11 -1
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +5 -2
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +1 -3
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +6 -4
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +3 -2
- package/libEs6/components/Personalization/dom-actions/scripts.js +18 -2
- package/libEs6/components/Personalization/flicker/index.js +44 -30
- package/libEs6/components/Personalization/handlers/createDecorateProposition.js +2 -2
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +29 -9
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +9 -0
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +0 -3
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +8 -5
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +2 -2
- package/libEs6/components/Personalization/index.js +9 -5
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +4 -4
- package/libEs6/components/Personalization/utils/surfaceUtils.js +3 -3
- package/libEs6/constants/decisionProvider.js +1 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/constants/schema.js +1 -1
- package/libEs6/core/buildAndValidateConfig.js +8 -5
- package/libEs6/core/componentCreators.js +14 -43
- package/libEs6/core/config/createConfig.js +3 -2
- package/libEs6/core/createCookieTransfer.js +1 -3
- package/libEs6/core/createInstanceFunction.js +1 -9
- package/libEs6/core/createLogger.js +17 -2
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +1 -7
- package/libEs6/core/index.js +11 -10
- package/libEs6/core/injectCreateResponse.js +1 -3
- package/libEs6/core/network/isRequestRetryable.js +1 -2
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +1 -2
- package/libEs6/{utils/assignIf.js → core/requiredComponentCreators.js} +4 -8
- package/libEs6/index.js +26 -6
- package/libEs6/standalone.js +7 -1
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +1 -2
- package/libEs6/utils/assignConcatArrayValues.js +1 -2
- package/libEs6/utils/cookieJar.js +4 -4
- package/libEs6/{components/Personalization → utils}/createCollect.js +3 -3
- package/libEs6/utils/createSubscription.js +20 -3
- package/libEs6/utils/dom/querySelectorAll.js +1 -10
- package/libEs6/utils/dom/selectNodesWithShadow.js +2 -12
- package/libEs6/{components/Personalization → utils}/event.js +1 -1
- package/libEs6/utils/index.js +1 -10
- package/libEs6/utils/injectStorage.js +1 -2
- package/libEs6/utils/intersection.js +1 -4
- package/libEs6/utils/isNumber.js +1 -2
- package/libEs6/utils/toISOStringLocal.js +14 -1
- package/libEs6/utils/toInteger.js +1 -2
- package/libEs6/utils/validation/createAnyOfValidator.js +1 -2
- package/libEs6/utils/validation/utils.js +3 -6
- package/package.json +35 -37
- package/rollup.config.js +115 -7
- package/scripts/alloyBuilder.js +89 -55
- package/scripts/helpers/entryPointGeneratorBabelPlugin.js +39 -0
- package/libEs5/components/Personalization/createCollect.js +0 -53
- package/libEs5/components/Personalization/event.js +0 -49
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +0 -50
- package/libEs5/utils/assign.js +0 -16
- package/libEs5/utils/assignIf.js +0 -21
- package/libEs5/utils/endsWith.js +0 -23
- package/libEs5/utils/find.js +0 -30
- package/libEs5/utils/flatMap.js +0 -17
- package/libEs5/utils/includes.js +0 -23
- package/libEs5/utils/padStart.js +0 -27
- package/libEs5/utils/startsWith.js +0 -23
- package/libEs5/utils/values.js +0 -25
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +0 -49
- package/libEs6/utils/assign.js +0 -14
- package/libEs6/utils/endsWith.js +0 -19
- package/libEs6/utils/find.js +0 -28
- package/libEs6/utils/flatMap.js +0 -14
- package/libEs6/utils/includes.js +0 -21
- package/libEs6/utils/padStart.js +0 -25
- package/libEs6/utils/startsWith.js +0 -19
- package/libEs6/utils/values.js +0 -21
- package/scripts/helpers/alloyComponents.js +0 -63
- package/scripts/helpers/conditionalBuildBabelPlugin.js +0 -57
|
@@ -12,8 +12,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
15
|
+
var _default = content => namespaceCode => {
|
|
16
|
+
return (content.xdm && content.xdm.identityMap && content.xdm.identityMap[namespaceCode]) !== undefined;
|
|
17
|
+
};
|
|
18
|
+
exports.default = _default;
|
|
@@ -14,49 +14,52 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
// This provides the base functionality that all types of requests share.
|
|
17
|
-
var _default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
var _default = options => {
|
|
18
|
+
const {
|
|
19
|
+
payload,
|
|
20
|
+
getAction,
|
|
21
|
+
getUseSendBeacon,
|
|
22
|
+
datastreamIdOverride,
|
|
23
|
+
edgeSubPath
|
|
24
|
+
} = options;
|
|
25
|
+
const id = (0, _index.uuid)();
|
|
26
|
+
let shouldUseThirdPartyDomain = false;
|
|
27
|
+
let isIdentityEstablished = false;
|
|
26
28
|
return {
|
|
27
|
-
getId
|
|
29
|
+
getId() {
|
|
28
30
|
return id;
|
|
29
31
|
},
|
|
30
|
-
getPayload
|
|
32
|
+
getPayload() {
|
|
31
33
|
return payload;
|
|
32
34
|
},
|
|
33
|
-
getAction
|
|
34
|
-
return
|
|
35
|
-
isIdentityEstablished
|
|
35
|
+
getAction() {
|
|
36
|
+
return getAction({
|
|
37
|
+
isIdentityEstablished
|
|
36
38
|
});
|
|
37
39
|
},
|
|
38
|
-
getDatastreamIdOverride
|
|
40
|
+
getDatastreamIdOverride() {
|
|
39
41
|
return datastreamIdOverride;
|
|
40
42
|
},
|
|
41
|
-
getUseSendBeacon
|
|
42
|
-
return
|
|
43
|
-
isIdentityEstablished
|
|
43
|
+
getUseSendBeacon() {
|
|
44
|
+
return getUseSendBeacon({
|
|
45
|
+
isIdentityEstablished
|
|
44
46
|
});
|
|
45
47
|
},
|
|
46
|
-
getEdgeSubPath
|
|
48
|
+
getEdgeSubPath() {
|
|
47
49
|
if (edgeSubPath) {
|
|
48
50
|
return edgeSubPath;
|
|
49
51
|
}
|
|
50
52
|
return "";
|
|
51
53
|
},
|
|
52
|
-
getUseIdThirdPartyDomain
|
|
54
|
+
getUseIdThirdPartyDomain() {
|
|
53
55
|
return shouldUseThirdPartyDomain;
|
|
54
56
|
},
|
|
55
|
-
setUseIdThirdPartyDomain
|
|
57
|
+
setUseIdThirdPartyDomain() {
|
|
56
58
|
shouldUseThirdPartyDomain = true;
|
|
57
59
|
},
|
|
58
|
-
setIsIdentityEstablished
|
|
60
|
+
setIsIdentityEstablished() {
|
|
59
61
|
isIdentityEstablished = true;
|
|
60
62
|
}
|
|
61
63
|
};
|
|
62
|
-
};
|
|
64
|
+
};
|
|
65
|
+
exports.default = _default;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _excluded = ["datastreamId"];
|
|
5
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
7
4
|
/*
|
|
8
5
|
Copyright 2023 Adobe. All rights reserved.
|
|
9
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -25,20 +22,23 @@ governing permissions and limitations under the License.
|
|
|
25
22
|
* @param {RequestPayload} params.payload
|
|
26
23
|
* @returns {{ payload: RequestPayload, datastreamIdOverride: string }}
|
|
27
24
|
*/
|
|
28
|
-
var _default =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
var _default = ({
|
|
26
|
+
localConfigOverrides,
|
|
27
|
+
globalConfigOverrides,
|
|
28
|
+
payload
|
|
29
|
+
}) => {
|
|
30
|
+
const requestParams = {
|
|
31
|
+
payload
|
|
34
32
|
};
|
|
35
|
-
|
|
36
|
-
datastreamId
|
|
37
|
-
localConfigOverridesWithoutDatastreamId
|
|
33
|
+
const {
|
|
34
|
+
datastreamId,
|
|
35
|
+
...localConfigOverridesWithoutDatastreamId
|
|
36
|
+
} = localConfigOverrides || {};
|
|
38
37
|
if (datastreamId) {
|
|
39
38
|
requestParams.datastreamIdOverride = datastreamId;
|
|
40
39
|
}
|
|
41
40
|
payload.mergeConfigOverride(globalConfigOverrides);
|
|
42
41
|
payload.mergeConfigOverride(localConfigOverridesWithoutDatastreamId);
|
|
43
42
|
return requestParams;
|
|
44
|
-
};
|
|
43
|
+
};
|
|
44
|
+
exports.default = _default;
|
|
@@ -15,22 +15,23 @@ governing permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
// This provides the base functionality that all types of
|
|
17
17
|
// request payloads share.
|
|
18
|
-
var _default =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
var _default = options => {
|
|
19
|
+
const {
|
|
20
|
+
content,
|
|
21
|
+
addIdentity,
|
|
22
|
+
hasIdentity
|
|
23
|
+
} = options;
|
|
24
|
+
const mergeConfigOverride = (0, _index.createMerger)(content, "meta.configOverrides");
|
|
23
25
|
return {
|
|
24
26
|
mergeMeta: (0, _index.createMerger)(content, "meta"),
|
|
25
27
|
mergeState: (0, _index.createMerger)(content, "meta.state"),
|
|
26
28
|
mergeQuery: (0, _index.createMerger)(content, "query"),
|
|
27
|
-
mergeConfigOverride:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
hasIdentity: hasIdentity,
|
|
32
|
-
toJSON: function toJSON() {
|
|
29
|
+
mergeConfigOverride: updates => mergeConfigOverride((0, _index.prepareConfigOverridesForEdge)(updates)),
|
|
30
|
+
addIdentity,
|
|
31
|
+
hasIdentity,
|
|
32
|
+
toJSON() {
|
|
33
33
|
return content;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
|
@@ -2,49 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "createAddIdentity", {
|
|
4
4
|
enumerable: true,
|
|
5
|
-
get: function
|
|
5
|
+
get: function () {
|
|
6
6
|
return _createAddIdentity.default;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
Object.defineProperty(exports, "createDataCollectionRequest", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function
|
|
11
|
+
get: function () {
|
|
12
12
|
return _createDataCollectionRequest.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "createDataCollectionRequestPayload", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function
|
|
17
|
+
get: function () {
|
|
18
18
|
return _createDataCollectionRequestPayload.default;
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "createGetAssuranceValidationTokenParams", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function
|
|
23
|
+
get: function () {
|
|
24
24
|
return _createGetAssuranceValidationTokenParams.default;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "createHasIdentity", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function
|
|
29
|
+
get: function () {
|
|
30
30
|
return _createHasIdentity.default;
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "createRequest", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function
|
|
35
|
+
get: function () {
|
|
36
36
|
return _createRequest.default;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "createRequestParams", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function
|
|
41
|
+
get: function () {
|
|
42
42
|
return _createRequestParams.default;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "createRequestPayload", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function
|
|
47
|
+
get: function () {
|
|
48
48
|
return _createRequestPayload.default;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
@@ -12,6 +12,5 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
|
|
17
|
-
};
|
|
15
|
+
var _default = orgId => orgId.replace("@", "_");
|
|
16
|
+
exports.default = _default;
|
|
@@ -21,14 +21,16 @@ governing permissions and limitations under the License.
|
|
|
21
21
|
* this is used as the basis for the message of a newly created Error instance.
|
|
22
22
|
* @returns {*}
|
|
23
23
|
*/
|
|
24
|
-
var _default =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
var _default = ({
|
|
25
|
+
error,
|
|
26
|
+
message
|
|
27
|
+
}) => {
|
|
28
|
+
const errorToStack = (0, _toError.default)(error);
|
|
29
|
+
const newMessage = message + "\nCaused by: " + errorToStack.message;
|
|
29
30
|
(0, _updateErrorMessage.default)({
|
|
30
31
|
error: errorToStack,
|
|
31
32
|
message: newMessage
|
|
32
33
|
});
|
|
33
34
|
return errorToStack;
|
|
34
|
-
};
|
|
35
|
+
};
|
|
36
|
+
exports.default = _default;
|
|
@@ -13,6 +13,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
16
|
+
var _default = str => {
|
|
17
17
|
return (0, _isString.default)(str) && str.toLowerCase() === "true";
|
|
18
|
-
};
|
|
18
|
+
};
|
|
19
|
+
exports.default = _default;
|
package/libEs5/utils/toArray.js
CHANGED
|
@@ -12,7 +12,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
15
|
+
var _default = value => {
|
|
16
16
|
if (Array.isArray(value)) {
|
|
17
17
|
return value;
|
|
18
18
|
}
|
|
@@ -20,4 +20,5 @@ var _default = exports.default = function _default(value) {
|
|
|
20
20
|
return [];
|
|
21
21
|
}
|
|
22
22
|
return [].slice.call(value);
|
|
23
|
-
};
|
|
23
|
+
};
|
|
24
|
+
exports.default = _default;
|
package/libEs5/utils/toError.js
CHANGED
|
@@ -18,6 +18,7 @@ governing permissions and limitations under the License.
|
|
|
18
18
|
* @param {*} value
|
|
19
19
|
* @returns {Error}
|
|
20
20
|
*/
|
|
21
|
-
var _default =
|
|
21
|
+
var _default = value => {
|
|
22
22
|
return value instanceof Error ? value : new Error(value);
|
|
23
|
-
};
|
|
23
|
+
};
|
|
24
|
+
exports.default = _default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _padStart = require("./padStart.js");
|
|
5
4
|
var _toInteger = require("./toInteger.js");
|
|
6
5
|
/*
|
|
7
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -14,26 +13,42 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
14
|
governing permissions and limitations under the License.
|
|
16
15
|
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Add padString to the start of the string until it reaches the target length
|
|
19
|
+
*
|
|
20
|
+
* Different from String.prototype.padStart because this function coerces the
|
|
21
|
+
* input to a string before padding.
|
|
22
|
+
* @param {any} string
|
|
23
|
+
* @param {number} targetLength
|
|
24
|
+
* @param {string} padString
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
const padStart = (string, targetLength, padString) => {
|
|
28
|
+
return ("" + string).padStart(targetLength, padString);
|
|
29
|
+
};
|
|
30
|
+
|
|
17
31
|
/**
|
|
18
32
|
* Formats the date into an ISO date-time string in the local timezone
|
|
19
33
|
* @param {Date} date
|
|
20
34
|
* @returns {string}
|
|
21
35
|
*/
|
|
22
|
-
var _default =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
var _default = date => {
|
|
37
|
+
const YYYY = date.getFullYear();
|
|
38
|
+
const MM = padStart(date.getMonth() + 1, 2, "0");
|
|
39
|
+
const DD = padStart(date.getDate(), 2, "0");
|
|
40
|
+
const hh = padStart(date.getHours(), 2, "0");
|
|
41
|
+
const mm = padStart(date.getMinutes(), 2, "0");
|
|
42
|
+
const ss = padStart(date.getSeconds(), 2, "0");
|
|
43
|
+
const mmm = padStart(date.getMilliseconds(), 3, "0");
|
|
30
44
|
|
|
31
45
|
// The time-zone offset is the difference, in minutes, from local time to UTC. Note that this
|
|
32
46
|
// means that the offset is positive if the local timezone is behind UTC and negative if it is
|
|
33
47
|
// ahead. For example, for time zone UTC+10:00, -600 will be returned.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
const timezoneOffset = (0, _toInteger.default)(date.getTimezoneOffset(), 0);
|
|
49
|
+
const ts = timezoneOffset > 0 ? "-" : "+";
|
|
50
|
+
const th = padStart(Math.floor(Math.abs(timezoneOffset) / 60), 2, "0");
|
|
51
|
+
const tm = padStart(Math.abs(timezoneOffset) % 60, 2, "0");
|
|
38
52
|
return YYYY + "-" + MM + "-" + DD + "T" + hh + ":" + mm + ":" + ss + "." + mmm + ts + th + ":" + tm;
|
|
39
|
-
};
|
|
53
|
+
};
|
|
54
|
+
exports.default = _default;
|
|
@@ -19,13 +19,13 @@ governing permissions and limitations under the License.
|
|
|
19
19
|
*
|
|
20
20
|
* The coersion is attempted if value is a number or string.
|
|
21
21
|
*/
|
|
22
|
-
var _default =
|
|
22
|
+
var _default = (value, defaultValue) => {
|
|
23
23
|
if ((0, _isNumber.default)(value) || (0, _isString.default)(value)) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!isNaN(n)) {
|
|
24
|
+
const n = Math.round(Number(value));
|
|
25
|
+
if (!Number.isNaN(n)) {
|
|
27
26
|
return n;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
return defaultValue;
|
|
31
|
-
};
|
|
30
|
+
};
|
|
31
|
+
exports.default = _default;
|
|
@@ -12,13 +12,15 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
var _default = ({
|
|
16
|
+
error,
|
|
17
|
+
message
|
|
18
|
+
}) => {
|
|
18
19
|
try {
|
|
19
20
|
error.message = message;
|
|
20
21
|
} catch (e) {
|
|
21
22
|
// We'll set a new message when we can, but some errors, like DOMException,
|
|
22
23
|
// have a read-only message property, which limits our options.
|
|
23
24
|
}
|
|
24
|
-
};
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
@@ -14,7 +14,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var _default =
|
|
17
|
+
var _default = (value, path) => {
|
|
18
18
|
(0, _utils.assertValid)((0, _isBoolean.default)(value), value, path, "true or false");
|
|
19
19
|
return value;
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -14,7 +14,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var _default =
|
|
17
|
+
var _default = (value, path) => {
|
|
18
18
|
(0, _utils.assertValid)((0, _isFunction.default)(value), value, path, "a function");
|
|
19
19
|
return value;
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
var _utils = require("./utils.js");
|
|
5
|
-
var _find = require("../find.js");
|
|
6
5
|
/*
|
|
7
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
8
7
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,19 +13,17 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
14
|
governing permissions and limitations under the License.
|
|
16
15
|
*/
|
|
17
|
-
var _default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
};
|
|
16
|
+
var _default = (validators, message) => function anyOf(value, path) {
|
|
17
|
+
let newValue;
|
|
18
|
+
const valid = validators.find(validator => {
|
|
19
|
+
try {
|
|
20
|
+
newValue = validator.call(this, value, path);
|
|
21
|
+
return true;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
(0, _utils.assertValid)(valid, value, path, message);
|
|
27
|
+
return newValue;
|
|
28
|
+
};
|
|
29
|
+
exports.default = _default;
|
|
@@ -13,22 +13,20 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
errors.push(e.message);
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
if (errors.length) {
|
|
30
|
-
throw new Error(errors.join("\n"));
|
|
16
|
+
var _default = elementValidator => function arrayOf(value, path) {
|
|
17
|
+
(0, _utils.assertValid)(Array.isArray(value), value, path, "an array");
|
|
18
|
+
const errors = [];
|
|
19
|
+
const validatedArray = value.map((subValue, i) => {
|
|
20
|
+
try {
|
|
21
|
+
return elementValidator.call(this, subValue, path + "[" + i + "]", value);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
errors.push(e.message);
|
|
24
|
+
return undefined;
|
|
31
25
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
});
|
|
27
|
+
if (errors.length) {
|
|
28
|
+
throw new Error(errors.join("\n"));
|
|
29
|
+
}
|
|
30
|
+
return validatedArray;
|
|
31
|
+
};
|
|
32
|
+
exports.default = _default;
|
|
@@ -12,11 +12,10 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
15
|
+
var _default = defaultValue => value => {
|
|
16
|
+
if (value == null) {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -12,18 +12,16 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (path) {
|
|
21
|
-
message = "'" + path + "': " + message;
|
|
22
|
-
}
|
|
23
|
-
if (this && this.logger) {
|
|
24
|
-
this.logger.warn(message);
|
|
25
|
-
}
|
|
15
|
+
var _default = (warning = "This field has been deprecated") => function deprecated(value, path) {
|
|
16
|
+
let message = warning;
|
|
17
|
+
if (value !== undefined) {
|
|
18
|
+
if (path) {
|
|
19
|
+
message = "'" + path + "': " + message;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
21
|
+
if (this && this.logger) {
|
|
22
|
+
this.logger.warn(message);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
};
|
|
27
|
+
exports.default = _default;
|
|
@@ -13,9 +13,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
16
|
+
var _default = literalValue => (value, path) => {
|
|
17
|
+
(0, _utils.assertValid)(value === literalValue, value, path, "" + literalValue);
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
@@ -14,27 +14,25 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var _default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (validatedValue !== undefined) {
|
|
29
|
-
validatedObject[subKey] = validatedValue;
|
|
30
|
-
}
|
|
31
|
-
} catch (e) {
|
|
32
|
-
errors.push(e.message);
|
|
17
|
+
var _default = valueValidator => function mapOfValues(value, path) {
|
|
18
|
+
(0, _utils.assertValid)((0, _isObject.default)(value), value, path, "an object");
|
|
19
|
+
const errors = [];
|
|
20
|
+
const validatedObject = {};
|
|
21
|
+
Object.keys(value).forEach(subKey => {
|
|
22
|
+
const subValue = value[subKey];
|
|
23
|
+
const subPath = path ? path + "." + subKey : subKey;
|
|
24
|
+
try {
|
|
25
|
+
const validatedValue = valueValidator.call(this, subValue, subPath);
|
|
26
|
+
if (validatedValue !== undefined) {
|
|
27
|
+
validatedObject[subKey] = validatedValue;
|
|
33
28
|
}
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
throw new Error(errors.join("\n"));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
errors.push(e.message);
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
});
|
|
33
|
+
if (errors.length) {
|
|
34
|
+
throw new Error(errors.join("\n"));
|
|
35
|
+
}
|
|
36
|
+
return validatedObject;
|
|
37
|
+
};
|
|
38
|
+
exports.default = _default;
|
|
@@ -13,9 +13,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
16
|
+
var _default = (typeName, maximum) => (value, path) => {
|
|
17
|
+
(0, _utils.assertValid)(value <= maximum, value, path, typeName + " less than or equal to " + maximum);
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|