@adobe/alloy 2.20.0-alpha.1 → 2.20.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +83 -65
- package/libEs5/baseCode/index.js +0 -62
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +0 -54
- package/libEs5/components/ActivityCollector/configValidators.js +0 -24
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +0 -69
- package/libEs5/components/ActivityCollector/createLinkClick.js +0 -39
- package/libEs5/components/ActivityCollector/getLinkName.js +0 -140
- package/libEs5/components/ActivityCollector/getLinkRegion.js +0 -62
- package/libEs5/components/ActivityCollector/index.js +0 -79
- package/libEs5/components/ActivityCollector/utils.js +0 -114
- package/libEs5/components/Audiences/index.js +0 -50
- package/libEs5/components/Audiences/injectProcessDestinations.js +0 -65
- package/libEs5/components/Audiences/injectProcessResponse.js +0 -39
- package/libEs5/components/Context/createComponent.js +0 -40
- package/libEs5/components/Context/implementationDetails.js +0 -28
- package/libEs5/components/Context/index.js +0 -57
- package/libEs5/components/Context/injectDevice.js +0 -67
- package/libEs5/components/Context/injectEnvironment.js +0 -41
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +0 -59
- package/libEs5/components/Context/injectPlaceContext.js +0 -33
- package/libEs5/components/Context/injectTimestamp.js +0 -24
- package/libEs5/components/Context/injectWeb.js +0 -31
- package/libEs5/components/DataCollector/index.js +0 -111
- package/libEs5/components/DataCollector/validateApplyResponse.js +0 -36
- package/libEs5/components/DataCollector/validateUserEventOptions.js +0 -51
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +0 -32
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +0 -25
- package/libEs5/components/DecisioningEngine/constants.js +0 -31
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +0 -36
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +0 -29
- package/libEs5/components/DecisioningEngine/createContextProvider.js +0 -93
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +0 -28
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +0 -51
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +0 -80
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +0 -49
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +0 -130
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +0 -46
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +0 -87
- package/libEs5/components/DecisioningEngine/index.js +0 -119
- package/libEs5/components/DecisioningEngine/utils.js +0 -90
- package/libEs5/components/EventMerge/createComponent.js +0 -25
- package/libEs5/components/EventMerge/createEventMergeId.js +0 -21
- package/libEs5/components/EventMerge/index.js +0 -25
- package/libEs5/components/Identity/addEcidQueryToPayload.js +0 -23
- package/libEs5/components/Identity/addEcidToPayload.js +0 -21
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +0 -26
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +0 -46
- package/libEs5/components/Identity/configValidators.js +0 -22
- package/libEs5/components/Identity/constants/authState.js +0 -21
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +0 -16
- package/libEs5/components/Identity/createComponent.js +0 -98
- package/libEs5/components/Identity/createLegacyIdentity.js +0 -70
- package/libEs5/components/Identity/getEcidFromResponse.js +0 -24
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +0 -36
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +0 -30
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +0 -30
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +0 -28
- package/libEs5/components/Identity/index.js +0 -129
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +0 -32
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +0 -65
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +0 -57
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +0 -98
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +0 -21
- package/libEs5/components/Identity/injectProcessIdSyncs.js +0 -42
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +0 -34
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +0 -35
- package/libEs5/components/Identity/visitorService/getVisitor.js +0 -20
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +0 -50
- package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -272
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +0 -188
- package/libEs5/components/LegacyMediaAnalytics/index.js +0 -48
- package/libEs5/components/LegacyMediaAnalytics/media/constants.js +0 -154
- package/libEs5/components/LegacyMediaAnalytics/media/mediaKeysToXdmConverter.js +0 -51
- package/libEs5/components/LibraryInfo/index.js +0 -64
- package/libEs5/components/MachineLearning/index.js +0 -27
- package/libEs5/components/MachineLearning/processResponse.js +0 -20
- package/libEs5/components/MediaCollection/constants/eventTypes.js +0 -25
- package/libEs5/components/MediaCollection/createHeartbeatEngine.js +0 -63
- package/libEs5/components/MediaCollection/createMediaEventManager.js +0 -109
- package/libEs5/components/MediaCollection/createMediaRequest.js +0 -30
- package/libEs5/components/MediaCollection/createMediaSessionCacheManager.js +0 -62
- package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +0 -31
- package/libEs5/components/MediaCollection/index.js +0 -165
- package/libEs5/components/MediaCollection/validateMediaEventOptions.js +0 -35
- package/libEs5/components/MediaCollection/validateMediaSessionOptions.js +0 -36
- package/libEs5/components/Personalization/constants/loggerMessage.js +0 -18
- package/libEs5/components/Personalization/constants/scopeType.js +0 -21
- package/libEs5/components/Personalization/constants/surface.js +0 -23
- package/libEs5/components/Personalization/createActionsProvider.js +0 -72
- package/libEs5/components/Personalization/createApplyPropositions.js +0 -113
- package/libEs5/components/Personalization/createClickStorage.js +0 -62
- package/libEs5/components/Personalization/createCollect.js +0 -54
- package/libEs5/components/Personalization/createComponent.js +0 -142
- package/libEs5/components/Personalization/createFetchDataHandler.js +0 -84
- package/libEs5/components/Personalization/createGetPageLocation.js +0 -21
- package/libEs5/components/Personalization/createNotificationHandler.js +0 -33
- package/libEs5/components/Personalization/createOnClickHandler.js +0 -52
- package/libEs5/components/Personalization/createOnDecisionHandler.js +0 -44
- package/libEs5/components/Personalization/createPersonalizationDetails.js +0 -105
- package/libEs5/components/Personalization/createPreprocessors.js +0 -21
- package/libEs5/components/Personalization/createSetTargetMigration.js +0 -29
- package/libEs5/components/Personalization/createViewCacheManager.js +0 -91
- package/libEs5/components/Personalization/createViewChangeHandler.js +0 -46
- package/libEs5/components/Personalization/dom-actions/action.js +0 -121
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +0 -42
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +0 -33
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +0 -109
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +0 -26
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +0 -30
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +0 -22
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +0 -23
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +0 -23
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +0 -25
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +0 -37
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +0 -26
- package/libEs5/components/Personalization/dom-actions/dom/index.js +0 -100
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +0 -26
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +0 -25
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +0 -38
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +0 -107
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +0 -18
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +0 -24
- package/libEs5/components/Personalization/dom-actions/images.js +0 -39
- package/libEs5/components/Personalization/dom-actions/index.js +0 -9
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +0 -36
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +0 -32
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +0 -32
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +0 -46
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +0 -33
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +0 -37
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +0 -55
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +0 -21
- package/libEs5/components/Personalization/dom-actions/scripts.js +0 -92
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +0 -21
- package/libEs5/components/Personalization/dom-actions/setHtml.js +0 -28
- package/libEs5/components/Personalization/dom-actions/setStyles.js +0 -26
- package/libEs5/components/Personalization/dom-actions/setText.js +0 -18
- package/libEs5/components/Personalization/dom-actions/swapImage.js +0 -32
- package/libEs5/components/Personalization/event.js +0 -48
- package/libEs5/components/Personalization/flicker/index.js +0 -87
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +0 -69
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +0 -44
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +0 -76
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +0 -195
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +0 -46
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +0 -116
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +0 -21
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +0 -288
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +0 -23
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +0 -53
- package/libEs5/components/Personalization/index.js +0 -153
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +0 -25
- package/libEs5/components/Personalization/utils/createAsyncArray.js +0 -39
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +0 -19
- package/libEs5/components/Personalization/utils/surfaceUtils.js +0 -102
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +0 -36
- package/libEs5/components/Privacy/computeConsentHash.js +0 -34
- package/libEs5/components/Privacy/createComponent.js +0 -86
- package/libEs5/components/Privacy/createConsentHashStore.js +0 -60
- package/libEs5/components/Privacy/createConsentRequest.js +0 -30
- package/libEs5/components/Privacy/createConsentRequestPayload.js +0 -34
- package/libEs5/components/Privacy/createStoredConsent.js +0 -32
- package/libEs5/components/Privacy/index.js +0 -64
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +0 -48
- package/libEs5/components/Privacy/parseConsentCookie.js +0 -38
- package/libEs5/components/Privacy/validateSetConsentOptions.js +0 -22
- package/libEs5/constants/apiVersion.js +0 -16
- package/libEs5/constants/browser.js +0 -29
- package/libEs5/constants/consentPurpose.js +0 -17
- package/libEs5/constants/consentStatus.js +0 -21
- package/libEs5/constants/contentType.js +0 -18
- package/libEs5/constants/cookieNameKey.js +0 -21
- package/libEs5/constants/cookieNamePrefix.js +0 -17
- package/libEs5/constants/coreCommands.js +0 -19
- package/libEs5/constants/debugQueryParam.js +0 -16
- package/libEs5/constants/decisionProvider.js +0 -16
- package/libEs5/constants/domain.js +0 -19
- package/libEs5/constants/ecidNamespace.js +0 -16
- package/libEs5/constants/edgeBasePath.js +0 -16
- package/libEs5/constants/elementAttribute.js +0 -17
- package/libEs5/constants/eventType.js +0 -25
- package/libEs5/constants/handle.js +0 -16
- package/libEs5/constants/highEntropyUserAgentClientHints.js +0 -16
- package/libEs5/constants/httpHeaderNames.js +0 -19
- package/libEs5/constants/httpStatusCode.js +0 -25
- package/libEs5/constants/identityMapAuthenticatedState.js +0 -20
- package/libEs5/constants/legacyCookies.js +0 -21
- package/libEs5/constants/libraryName.js +0 -16
- package/libEs5/constants/libraryVersion.js +0 -18
- package/libEs5/constants/namespace.js +0 -16
- package/libEs5/constants/pageWideScope.js +0 -16
- package/libEs5/constants/propositionEventType.js +0 -33
- package/libEs5/constants/queryStringIdentityParam.js +0 -16
- package/libEs5/constants/schema.js +0 -35
- package/libEs5/constants/shadowSeparator.js +0 -16
- package/libEs5/constants/tagName.js +0 -29
- package/libEs5/core/buildAndValidateConfig.js +0 -113
- package/libEs5/core/componentCreators.js +0 -34
- package/libEs5/core/config/createConfig.js +0 -21
- package/libEs5/core/config/createCoreConfigs.js +0 -32
- package/libEs5/core/consent/createConsent.js +0 -59
- package/libEs5/core/consent/createConsentStateMachine.js +0 -109
- package/libEs5/core/createComponentRegistry.js +0 -84
- package/libEs5/core/createCookieTransfer.js +0 -81
- package/libEs5/core/createEvent.js +0 -171
- package/libEs5/core/createEventManager.js +0 -142
- package/libEs5/core/createInstanceFunction.js +0 -28
- package/libEs5/core/createLifecycle.js +0 -75
- package/libEs5/core/createLogController.js +0 -71
- package/libEs5/core/createLogger.js +0 -104
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +0 -28
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +0 -67
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +0 -43
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +0 -36
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +0 -43
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +0 -100
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +0 -29
- package/libEs5/core/index.js +0 -240
- package/libEs5/core/initializeComponents.js +0 -42
- package/libEs5/core/injectCreateResponse.js +0 -78
- package/libEs5/core/injectExecuteCommand.js +0 -105
- package/libEs5/core/injectHandleError.js +0 -37
- package/libEs5/core/injectShouldTransferCookie.js +0 -29
- package/libEs5/core/network/getRequestRetryDelay.js +0 -74
- package/libEs5/core/network/injectSendNetworkRequest.js +0 -100
- package/libEs5/core/network/isRequestRetryable.js +0 -28
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +0 -40
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +0 -45
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +0 -51
- package/libEs5/core/validateCommandOptions.js +0 -35
- package/libEs5/index.js +0 -60
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +0 -25
- package/libEs5/utils/assign.js +0 -17
- package/libEs5/utils/assignConcatArrayValues.js +0 -49
- package/libEs5/utils/assignIf.js +0 -22
- package/libEs5/utils/clone.js +0 -23
- package/libEs5/utils/cookieJar.js +0 -22
- package/libEs5/utils/crc32.js +0 -37
- package/libEs5/utils/createCallbackAggregator.js +0 -39
- package/libEs5/utils/createLoggingCookieJar.js +0 -31
- package/libEs5/utils/createMerger.js +0 -34
- package/libEs5/utils/createSubscription.js +0 -91
- package/libEs5/utils/createTaskQueue.js +0 -51
- package/libEs5/utils/debounce.js +0 -30
- package/libEs5/utils/deduplicateArray.js +0 -32
- package/libEs5/utils/deepAssign.js +0 -49
- package/libEs5/utils/defer.js +0 -27
- package/libEs5/utils/dom/appendNode.js +0 -18
- package/libEs5/utils/dom/awaitSelector.js +0 -111
- package/libEs5/utils/dom/createNode.js +0 -48
- package/libEs5/utils/dom/index.js +0 -58
- package/libEs5/utils/dom/isShadowSelector.js +0 -19
- package/libEs5/utils/dom/matchesSelector.js +0 -29
- package/libEs5/utils/dom/querySelectorAll.js +0 -33
- package/libEs5/utils/dom/removeNode.js +0 -22
- package/libEs5/utils/dom/selectNodes.js +0 -31
- package/libEs5/utils/dom/selectNodesWithShadow.js +0 -67
- package/libEs5/utils/endsWith.js +0 -24
- package/libEs5/utils/filterObject.js +0 -53
- package/libEs5/utils/find.js +0 -31
- package/libEs5/utils/fireImage.js +0 -39
- package/libEs5/utils/flatMap.js +0 -18
- package/libEs5/utils/flattenArray.js +0 -37
- package/libEs5/utils/flattenObject.js +0 -43
- package/libEs5/utils/getApexDomain.js +0 -46
- package/libEs5/utils/getBrowser.js +0 -34
- package/libEs5/utils/getLastArrayItems.js +0 -24
- package/libEs5/utils/getNamespacedCookieName.js +0 -20
- package/libEs5/utils/groupBy.js +0 -32
- package/libEs5/utils/includes.js +0 -24
- package/libEs5/utils/index.js +0 -408
- package/libEs5/utils/injectDoesIdentityCookieExist.js +0 -28
- package/libEs5/utils/injectFireReferrerHideableImage.js +0 -76
- package/libEs5/utils/injectStorage.js +0 -75
- package/libEs5/utils/intersection.js +0 -27
- package/libEs5/utils/isBlankString.js +0 -24
- package/libEs5/utils/isBoolean.js +0 -23
- package/libEs5/utils/isEmptyObject.js +0 -24
- package/libEs5/utils/isFunction.js +0 -23
- package/libEs5/utils/isInteger.js +0 -25
- package/libEs5/utils/isNamespacedCookieName.js +0 -27
- package/libEs5/utils/isNil.js +0 -23
- package/libEs5/utils/isNonEmptyArray.js +0 -23
- package/libEs5/utils/isNonEmptyString.js +0 -24
- package/libEs5/utils/isNumber.js +0 -24
- package/libEs5/utils/isObject.js +0 -24
- package/libEs5/utils/isString.js +0 -23
- package/libEs5/utils/isUnique.js +0 -31
- package/libEs5/utils/isValidRegExp.js +0 -27
- package/libEs5/utils/memoize.js +0 -37
- package/libEs5/utils/noop.js +0 -19
- package/libEs5/utils/padStart.js +0 -28
- package/libEs5/utils/parseUrl.js +0 -70
- package/libEs5/utils/prepareConfigOverridesForEdge.js +0 -53
- package/libEs5/utils/querystring.js +0 -17
- package/libEs5/utils/request/createAddIdentity.js +0 -23
- package/libEs5/utils/request/createDataCollectionRequest.js +0 -69
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +0 -36
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +0 -45
- package/libEs5/utils/request/createHasIdentity.js +0 -20
- package/libEs5/utils/request/createRequest.js +0 -63
- package/libEs5/utils/request/createRequestParams.js +0 -45
- package/libEs5/utils/request/createRequestPayload.js +0 -37
- package/libEs5/utils/request/index.js +0 -58
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +0 -18
- package/libEs5/utils/stackError.js +0 -35
- package/libEs5/utils/startsWith.js +0 -24
- package/libEs5/utils/stringToBoolean.js +0 -19
- package/libEs5/utils/toArray.js +0 -24
- package/libEs5/utils/toError.js +0 -24
- package/libEs5/utils/toISOStringLocal.js +0 -40
- package/libEs5/utils/toInteger.js +0 -32
- package/libEs5/utils/updateErrorMessage.js +0 -25
- package/libEs5/utils/uuid.js +0 -17
- package/libEs5/utils/validateConfigOverride.js +0 -17
- package/libEs5/utils/validateIdentityMap.js +0 -26
- package/libEs5/utils/validation/booleanValidator.js +0 -21
- package/libEs5/utils/validation/callbackValidator.js +0 -21
- package/libEs5/utils/validation/createAnyOfValidator.js +0 -33
- package/libEs5/utils/validation/createArrayOfValidator.js +0 -35
- package/libEs5/utils/validation/createDefaultValidator.js +0 -23
- package/libEs5/utils/validation/createDeprecatedValidator.js +0 -45
- package/libEs5/utils/validation/createLiteralValidator.js +0 -22
- package/libEs5/utils/validation/createMapOfValuesValidator.js +0 -41
- package/libEs5/utils/validation/createMaximumValidator.js +0 -22
- package/libEs5/utils/validation/createMinimumValidator.js +0 -22
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +0 -30
- package/libEs5/utils/validation/createNonEmptyValidator.js +0 -28
- package/libEs5/utils/validation/createObjectOfValidator.js +0 -49
- package/libEs5/utils/validation/createUniqueItemsValidator.js +0 -22
- package/libEs5/utils/validation/createUniqueValidator.js +0 -24
- package/libEs5/utils/validation/domainValidator.js +0 -22
- package/libEs5/utils/validation/index.js +0 -247
- package/libEs5/utils/validation/integerValidator.js +0 -21
- package/libEs5/utils/validation/matchesRegexpValidator.js +0 -22
- package/libEs5/utils/validation/numberValidator.js +0 -21
- package/libEs5/utils/validation/regexpValidator.js +0 -21
- package/libEs5/utils/validation/requiredValidator.js +0 -21
- package/libEs5/utils/validation/stringValidator.js +0 -21
- package/libEs5/utils/validation/utils.js +0 -141
- package/libEs5/utils/values.js +0 -26
- package/libEs6/baseCode/index.js +0 -61
- package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +0 -52
- package/libEs6/components/ActivityCollector/configValidators.js +0 -19
- package/libEs6/components/ActivityCollector/createGetLinkDetails.js +0 -70
- package/libEs6/components/ActivityCollector/createLinkClick.js +0 -37
- package/libEs6/components/ActivityCollector/getLinkName.js +0 -136
- package/libEs6/components/ActivityCollector/getLinkRegion.js +0 -58
- package/libEs6/components/ActivityCollector/index.js +0 -81
- package/libEs6/components/ActivityCollector/utils.js +0 -104
- package/libEs6/components/Audiences/index.js +0 -47
- package/libEs6/components/Audiences/injectProcessDestinations.js +0 -60
- package/libEs6/components/Audiences/injectProcessResponse.js +0 -38
- package/libEs6/components/Context/createComponent.js +0 -34
- package/libEs6/components/Context/implementationDetails.js +0 -24
- package/libEs6/components/Context/index.js +0 -52
- package/libEs6/components/Context/injectDevice.js +0 -70
- package/libEs6/components/Context/injectEnvironment.js +0 -42
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +0 -45
- package/libEs6/components/Context/injectPlaceContext.js +0 -29
- package/libEs6/components/Context/injectTimestamp.js +0 -21
- package/libEs6/components/Context/injectWeb.js +0 -28
- package/libEs6/components/DataCollector/index.js +0 -106
- package/libEs6/components/DataCollector/validateApplyResponse.js +0 -33
- package/libEs6/components/DataCollector/validateUserEventOptions.js +0 -49
- package/libEs6/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +0 -30
- package/libEs6/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +0 -24
- package/libEs6/components/DecisioningEngine/constants.js +0 -25
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +0 -31
- package/libEs6/components/DecisioningEngine/createConsequenceAdapter.js +0 -29
- package/libEs6/components/DecisioningEngine/createContextProvider.js +0 -95
- package/libEs6/components/DecisioningEngine/createDecisionHistory.js +0 -25
- package/libEs6/components/DecisioningEngine/createDecisionProvider.js +0 -41
- package/libEs6/components/DecisioningEngine/createEvaluableRulesetPayload.js +0 -79
- package/libEs6/components/DecisioningEngine/createEvaluateRulesetsCommand.js +0 -45
- package/libEs6/components/DecisioningEngine/createEventRegistry.js +0 -120
- package/libEs6/components/DecisioningEngine/createOnResponseHandler.js +0 -45
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +0 -79
- package/libEs6/components/DecisioningEngine/index.js +0 -124
- package/libEs6/components/DecisioningEngine/utils.js +0 -83
- package/libEs6/components/EventMerge/createComponent.js +0 -23
- package/libEs6/components/EventMerge/createEventMergeId.js +0 -18
- package/libEs6/components/EventMerge/index.js +0 -21
- package/libEs6/components/Identity/addEcidQueryToPayload.js +0 -20
- package/libEs6/components/Identity/addEcidToPayload.js +0 -18
- package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +0 -23
- package/libEs6/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +0 -31
- package/libEs6/components/Identity/configValidators.js +0 -18
- package/libEs6/components/Identity/constants/authState.js +0 -15
- package/libEs6/components/Identity/constants/defaultIdSyncTtlMinutes.js +0 -13
- package/libEs6/components/Identity/createComponent.js +0 -97
- package/libEs6/components/Identity/createLegacyIdentity.js +0 -69
- package/libEs6/components/Identity/getEcidFromResponse.js +0 -19
- package/libEs6/components/Identity/getIdentity/createGetIdentity.js +0 -34
- package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +0 -28
- package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +0 -27
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +0 -25
- package/libEs6/components/Identity/index.js +0 -124
- package/libEs6/components/Identity/injectAddLegacyEcidToPayload.js +0 -30
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +0 -55
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +0 -56
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +0 -97
- package/libEs6/components/Identity/injectHandleResponseForIdSyncs.js +0 -19
- package/libEs6/components/Identity/injectProcessIdSyncs.js +0 -34
- package/libEs6/components/Identity/injectSetDomainForInitialIdentityPayload.js +0 -32
- package/libEs6/components/Identity/visitorService/awaitVisitorOptIn.js +0 -33
- package/libEs6/components/Identity/visitorService/getVisitor.js +0 -17
- package/libEs6/components/Identity/visitorService/injectGetEcidFromVisitor.js +0 -48
- package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +0 -276
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +0 -186
- package/libEs6/components/LegacyMediaAnalytics/index.js +0 -45
- package/libEs6/components/LegacyMediaAnalytics/media/constants.js +0 -140
- package/libEs6/components/LegacyMediaAnalytics/media/mediaKeysToXdmConverter.js +0 -46
- package/libEs6/components/LibraryInfo/index.js +0 -57
- package/libEs6/components/MachineLearning/index.js +0 -23
- package/libEs6/components/MachineLearning/processResponse.js +0 -18
- package/libEs6/components/MediaCollection/constants/eventTypes.js +0 -21
- package/libEs6/components/MediaCollection/createHeartbeatEngine.js +0 -64
- package/libEs6/components/MediaCollection/createMediaEventManager.js +0 -115
- package/libEs6/components/MediaCollection/createMediaRequest.js +0 -28
- package/libEs6/components/MediaCollection/createMediaSessionCacheManager.js +0 -63
- package/libEs6/components/MediaCollection/createUpdateMediaSessionState.js +0 -30
- package/libEs6/components/MediaCollection/index.js +0 -164
- package/libEs6/components/MediaCollection/validateMediaEventOptions.js +0 -32
- package/libEs6/components/MediaCollection/validateMediaSessionOptions.js +0 -34
- package/libEs6/components/Personalization/constants/loggerMessage.js +0 -13
- package/libEs6/components/Personalization/constants/scopeType.js +0 -15
- package/libEs6/components/Personalization/constants/surface.js +0 -16
- package/libEs6/components/Personalization/createActionsProvider.js +0 -70
- package/libEs6/components/Personalization/createApplyPropositions.js +0 -103
- package/libEs6/components/Personalization/createClickStorage.js +0 -58
- package/libEs6/components/Personalization/createCollect.js +0 -48
- package/libEs6/components/Personalization/createComponent.js +0 -129
- package/libEs6/components/Personalization/createFetchDataHandler.js +0 -74
- package/libEs6/components/Personalization/createGetPageLocation.js +0 -17
- package/libEs6/components/Personalization/createNotificationHandler.js +0 -29
- package/libEs6/components/Personalization/createOnClickHandler.js +0 -52
- package/libEs6/components/Personalization/createOnDecisionHandler.js +0 -42
- package/libEs6/components/Personalization/createPersonalizationDetails.js +0 -94
- package/libEs6/components/Personalization/createPreprocessors.js +0 -19
- package/libEs6/components/Personalization/createSetTargetMigration.js +0 -27
- package/libEs6/components/Personalization/createViewCacheManager.js +0 -81
- package/libEs6/components/Personalization/createViewChangeHandler.js +0 -47
- package/libEs6/components/Personalization/dom-actions/action.js +0 -49
- package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +0 -36
- package/libEs6/components/Personalization/dom-actions/appendHtml.js +0 -30
- package/libEs6/components/Personalization/dom-actions/clicks/collectClicks.js +0 -91
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +0 -18
- package/libEs6/components/Personalization/dom-actions/createRedirect.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/createFragment.js +0 -19
- package/libEs6/components/Personalization/dom-actions/dom/getAttribute.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/getChildNodes.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/getChildren.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/getElementById.js +0 -21
- package/libEs6/components/Personalization/dom-actions/dom/getFirstChild.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/getNextSibling.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/getNonce.js +0 -33
- package/libEs6/components/Personalization/dom-actions/dom/getParent.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/helperForEq.js +0 -19
- package/libEs6/components/Personalization/dom-actions/dom/index.js +0 -26
- package/libEs6/components/Personalization/dom-actions/dom/insertAfter.js +0 -23
- package/libEs6/components/Personalization/dom-actions/dom/insertBefore.js +0 -22
- package/libEs6/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +0 -35
- package/libEs6/components/Personalization/dom-actions/dom/removeAttribute.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +0 -102
- package/libEs6/components/Personalization/dom-actions/dom/setAttribute.js +0 -15
- package/libEs6/components/Personalization/dom-actions/dom/setStyle.js +0 -21
- package/libEs6/components/Personalization/dom-actions/images.js +0 -31
- package/libEs6/components/Personalization/dom-actions/index.js +0 -13
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +0 -33
- package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +0 -29
- package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +0 -29
- package/libEs6/components/Personalization/dom-actions/prependHtml.js +0 -45
- package/libEs6/components/Personalization/dom-actions/rearrangeChildren.js +0 -31
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +0 -34
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +0 -51
- package/libEs6/components/Personalization/dom-actions/replaceHtml.js +0 -18
- package/libEs6/components/Personalization/dom-actions/scripts.js +0 -85
- package/libEs6/components/Personalization/dom-actions/setAttributes.js +0 -18
- package/libEs6/components/Personalization/dom-actions/setHtml.js +0 -24
- package/libEs6/components/Personalization/dom-actions/setStyles.js +0 -22
- package/libEs6/components/Personalization/dom-actions/setText.js +0 -15
- package/libEs6/components/Personalization/dom-actions/swapImage.js +0 -29
- package/libEs6/components/Personalization/event.js +0 -45
- package/libEs6/components/Personalization/flicker/index.js +0 -82
- package/libEs6/components/Personalization/handlers/createProcessDomAction.js +0 -61
- package/libEs6/components/Personalization/handlers/createProcessHtmlContent.js +0 -40
- package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +0 -77
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +0 -175
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +0 -42
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +0 -110
- package/libEs6/components/Personalization/handlers/processDefaultContent.js +0 -17
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +0 -291
- package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +0 -17
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +0 -49
- package/libEs6/components/Personalization/index.js +0 -159
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +0 -21
- package/libEs6/components/Personalization/utils/createAsyncArray.js +0 -35
- package/libEs6/components/Personalization/utils/isAuthoringModeEnabled.js +0 -15
- package/libEs6/components/Personalization/utils/surfaceUtils.js +0 -74
- package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +0 -31
- package/libEs6/components/Privacy/computeConsentHash.js +0 -30
- package/libEs6/components/Privacy/createComponent.js +0 -85
- package/libEs6/components/Privacy/createConsentHashStore.js +0 -57
- package/libEs6/components/Privacy/createConsentRequest.js +0 -28
- package/libEs6/components/Privacy/createConsentRequestPayload.js +0 -31
- package/libEs6/components/Privacy/createStoredConsent.js +0 -30
- package/libEs6/components/Privacy/index.js +0 -63
- package/libEs6/components/Privacy/injectSendSetConsentRequest.js +0 -45
- package/libEs6/components/Privacy/parseConsentCookie.js +0 -26
- package/libEs6/components/Privacy/validateSetConsentOptions.js +0 -18
- package/libEs6/constants/apiVersion.js +0 -12
- package/libEs6/constants/browser.js +0 -19
- package/libEs6/constants/consentPurpose.js +0 -13
- package/libEs6/constants/consentStatus.js +0 -15
- package/libEs6/constants/contentType.js +0 -13
- package/libEs6/constants/cookieNameKey.js +0 -15
- package/libEs6/constants/cookieNamePrefix.js +0 -14
- package/libEs6/constants/coreCommands.js +0 -14
- package/libEs6/constants/debugQueryParam.js +0 -13
- package/libEs6/constants/decisionProvider.js +0 -12
- package/libEs6/constants/domain.js +0 -14
- package/libEs6/constants/ecidNamespace.js +0 -13
- package/libEs6/constants/edgeBasePath.js +0 -12
- package/libEs6/constants/elementAttribute.js +0 -13
- package/libEs6/constants/eventType.js +0 -17
- package/libEs6/constants/handle.js +0 -12
- package/libEs6/constants/highEntropyUserAgentClientHints.js +0 -13
- package/libEs6/constants/httpHeaderNames.js +0 -14
- package/libEs6/constants/httpStatusCode.js +0 -17
- package/libEs6/constants/identityMapAuthenticatedState.js +0 -14
- package/libEs6/constants/legacyCookies.js +0 -15
- package/libEs6/constants/libraryName.js +0 -13
- package/libEs6/constants/libraryVersion.js +0 -16
- package/libEs6/constants/namespace.js +0 -13
- package/libEs6/constants/pageWideScope.js +0 -13
- package/libEs6/constants/propositionEventType.js +0 -33
- package/libEs6/constants/queryStringIdentityParam.js +0 -13
- package/libEs6/constants/schema.js +0 -22
- package/libEs6/constants/shadowSeparator.js +0 -13
- package/libEs6/constants/tagName.js +0 -19
- package/libEs6/core/buildAndValidateConfig.js +0 -94
- package/libEs6/core/componentCreators.js +0 -31
- package/libEs6/core/config/createConfig.js +0 -17
- package/libEs6/core/config/createCoreConfigs.js +0 -27
- package/libEs6/core/consent/createConsent.js +0 -57
- package/libEs6/core/consent/createConsentStateMachine.js +0 -91
- package/libEs6/core/createComponentRegistry.js +0 -80
- package/libEs6/core/createCookieTransfer.js +0 -78
- package/libEs6/core/createEvent.js +0 -161
- package/libEs6/core/createEventManager.js +0 -135
- package/libEs6/core/createInstanceFunction.js +0 -25
- package/libEs6/core/createLifecycle.js +0 -65
- package/libEs6/core/createLogController.js +0 -68
- package/libEs6/core/createLogger.js +0 -99
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +0 -24
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +0 -58
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +0 -39
- package/libEs6/core/edgeNetwork/injectGetLocationHint.js +0 -32
- package/libEs6/core/edgeNetwork/injectProcessWarningsAndErrors.js +0 -42
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +0 -100
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +0 -21
- package/libEs6/core/index.js +0 -236
- package/libEs6/core/initializeComponents.js +0 -40
- package/libEs6/core/injectCreateResponse.js +0 -70
- package/libEs6/core/injectExecuteCommand.js +0 -100
- package/libEs6/core/injectHandleError.js +0 -33
- package/libEs6/core/injectShouldTransferCookie.js +0 -25
- package/libEs6/core/network/getRequestRetryDelay.js +0 -72
- package/libEs6/core/network/injectSendNetworkRequest.js +0 -96
- package/libEs6/core/network/isRequestRetryable.js +0 -25
- package/libEs6/core/network/requestMethods/injectSendBeaconRequest.js +0 -38
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +0 -41
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +0 -49
- package/libEs6/core/validateCommandOptions.js +0 -33
- package/libEs6/index.js +0 -55
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +0 -20
- package/libEs6/utils/assign.js +0 -14
- package/libEs6/utils/assignConcatArrayValues.js +0 -36
- package/libEs6/utils/assignIf.js +0 -19
- package/libEs6/utils/clone.js +0 -18
- package/libEs6/utils/cookieJar.js +0 -19
- package/libEs6/utils/crc32.js +0 -33
- package/libEs6/utils/createCallbackAggregator.js +0 -31
- package/libEs6/utils/createLoggingCookieJar.js +0 -28
- package/libEs6/utils/createMerger.js +0 -30
- package/libEs6/utils/createSubscription.js +0 -70
- package/libEs6/utils/createTaskQueue.js +0 -48
- package/libEs6/utils/debounce.js +0 -22
- package/libEs6/utils/deduplicateArray.js +0 -23
- package/libEs6/utils/deepAssign.js +0 -40
- package/libEs6/utils/defer.js +0 -24
- package/libEs6/utils/dom/appendNode.js +0 -15
- package/libEs6/utils/dom/awaitSelector.js +0 -98
- package/libEs6/utils/dom/createNode.js +0 -38
- package/libEs6/utils/dom/index.js +0 -20
- package/libEs6/utils/dom/isShadowSelector.js +0 -14
- package/libEs6/utils/dom/matchesSelector.js +0 -26
- package/libEs6/utils/dom/querySelectorAll.js +0 -29
- package/libEs6/utils/dom/removeNode.js +0 -19
- package/libEs6/utils/dom/selectNodes.js +0 -28
- package/libEs6/utils/dom/selectNodesWithShadow.js +0 -63
- package/libEs6/utils/endsWith.js +0 -19
- package/libEs6/utils/filterObject.js +0 -55
- package/libEs6/utils/find.js +0 -28
- package/libEs6/utils/fireImage.js +0 -37
- package/libEs6/utils/flatMap.js +0 -14
- package/libEs6/utils/flattenArray.js +0 -26
- package/libEs6/utils/flattenObject.js +0 -28
- package/libEs6/utils/getApexDomain.js +0 -42
- package/libEs6/utils/getBrowser.js +0 -65
- package/libEs6/utils/getLastArrayItems.js +0 -19
- package/libEs6/utils/getNamespacedCookieName.js +0 -15
- package/libEs6/utils/groupBy.js +0 -29
- package/libEs6/utils/includes.js +0 -21
- package/libEs6/utils/index.js +0 -71
- package/libEs6/utils/injectDoesIdentityCookieExist.js +0 -24
- package/libEs6/utils/injectFireReferrerHideableImage.js +0 -65
- package/libEs6/utils/injectStorage.js +0 -69
- package/libEs6/utils/intersection.js +0 -21
- package/libEs6/utils/isBlankString.js +0 -20
- package/libEs6/utils/isBoolean.js +0 -18
- package/libEs6/utils/isEmptyObject.js +0 -20
- package/libEs6/utils/isFunction.js +0 -18
- package/libEs6/utils/isInteger.js +0 -23
- package/libEs6/utils/isNamespacedCookieName.js +0 -23
- package/libEs6/utils/isNil.js +0 -18
- package/libEs6/utils/isNonEmptyArray.js +0 -18
- package/libEs6/utils/isNonEmptyString.js +0 -20
- package/libEs6/utils/isNumber.js +0 -19
- package/libEs6/utils/isObject.js +0 -20
- package/libEs6/utils/isString.js +0 -18
- package/libEs6/utils/isUnique.js +0 -27
- package/libEs6/utils/isValidRegExp.js +0 -24
- package/libEs6/utils/memoize.js +0 -34
- package/libEs6/utils/noop.js +0 -16
- package/libEs6/utils/padStart.js +0 -25
- package/libEs6/utils/parseUrl.js +0 -62
- package/libEs6/utils/prepareConfigOverridesForEdge.js +0 -50
- package/libEs6/utils/querystring.js +0 -14
- package/libEs6/utils/request/createAddIdentity.js +0 -19
- package/libEs6/utils/request/createDataCollectionRequest.js +0 -69
- package/libEs6/utils/request/createDataCollectionRequestPayload.js +0 -30
- package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +0 -42
- package/libEs6/utils/request/createHasIdentity.js +0 -15
- package/libEs6/utils/request/createRequest.js +0 -63
- package/libEs6/utils/request/createRequestParams.js +0 -40
- package/libEs6/utils/request/createRequestPayload.js +0 -35
- package/libEs6/utils/request/index.js +0 -20
- package/libEs6/utils/sanitizeOrgIdForCookieName.js +0 -13
- package/libEs6/utils/stackError.js +0 -34
- package/libEs6/utils/startsWith.js +0 -19
- package/libEs6/utils/stringToBoolean.js +0 -15
- package/libEs6/utils/toArray.js +0 -21
- package/libEs6/utils/toError.js +0 -21
- package/libEs6/utils/toISOStringLocal.js +0 -37
- package/libEs6/utils/toInteger.js +0 -30
- package/libEs6/utils/updateErrorMessage.js +0 -23
- package/libEs6/utils/uuid.js +0 -14
- package/libEs6/utils/validateConfigOverride.js +0 -14
- package/libEs6/utils/validateIdentityMap.js +0 -23
- package/libEs6/utils/validation/booleanValidator.js +0 -18
- package/libEs6/utils/validation/callbackValidator.js +0 -17
- package/libEs6/utils/validation/createAnyOfValidator.js +0 -26
- package/libEs6/utils/validation/createArrayOfValidator.js +0 -28
- package/libEs6/utils/validation/createDefaultValidator.js +0 -18
- package/libEs6/utils/validation/createDeprecatedValidator.js +0 -37
- package/libEs6/utils/validation/createLiteralValidator.js +0 -16
- package/libEs6/utils/validation/createMapOfValuesValidator.js +0 -35
- package/libEs6/utils/validation/createMaximumValidator.js +0 -16
- package/libEs6/utils/validation/createMinimumValidator.js +0 -16
- package/libEs6/utils/validation/createNoUnknownFieldsValidator.js +0 -25
- package/libEs6/utils/validation/createNonEmptyValidator.js +0 -23
- package/libEs6/utils/validation/createObjectOfValidator.js +0 -43
- package/libEs6/utils/validation/createUniqueItemsValidator.js +0 -18
- package/libEs6/utils/validation/createUniqueValidator.js +0 -21
- package/libEs6/utils/validation/domainValidator.js +0 -17
- package/libEs6/utils/validation/index.js +0 -232
- package/libEs6/utils/validation/integerValidator.js +0 -18
- package/libEs6/utils/validation/matchesRegexpValidator.js +0 -17
- package/libEs6/utils/validation/numberValidator.js +0 -18
- package/libEs6/utils/validation/regexpValidator.js +0 -18
- package/libEs6/utils/validation/requiredValidator.js +0 -18
- package/libEs6/utils/validation/stringValidator.js +0 -17
- package/libEs6/utils/validation/utils.js +0 -127
- package/libEs6/utils/values.js +0 -21
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.string = exports.objectOf = exports.number = exports.mapOfValues = exports.literal = exports.enumOf = exports.callback = exports.boolean = exports.arrayOf = exports.anything = exports.anyOf = void 0;
|
|
4
|
-
var _utils = require("./utils");
|
|
5
|
-
var _booleanValidator = require("./booleanValidator");
|
|
6
|
-
var _callbackValidator = require("./callbackValidator");
|
|
7
|
-
var _createArrayOfValidator = require("./createArrayOfValidator");
|
|
8
|
-
var _createDefaultValidator = require("./createDefaultValidator");
|
|
9
|
-
var _createDeprecatedValidator = require("./createDeprecatedValidator");
|
|
10
|
-
var _createLiteralValidator = require("./createLiteralValidator");
|
|
11
|
-
var _createMapOfValuesValidator = require("./createMapOfValuesValidator");
|
|
12
|
-
var _createMinimumValidator = require("./createMinimumValidator");
|
|
13
|
-
var _createMaximumValidator = require("./createMaximumValidator");
|
|
14
|
-
var _createNoUnknownFieldsValidator = require("./createNoUnknownFieldsValidator");
|
|
15
|
-
var _createNonEmptyValidator = require("./createNonEmptyValidator");
|
|
16
|
-
var _createObjectOfValidator = require("./createObjectOfValidator");
|
|
17
|
-
var _createAnyOfValidator = require("./createAnyOfValidator");
|
|
18
|
-
var _createUniqueValidator = require("./createUniqueValidator");
|
|
19
|
-
var _createUniqueItemsValidator = require("./createUniqueItemsValidator");
|
|
20
|
-
var _domainValidator = require("./domainValidator");
|
|
21
|
-
var _integerValidator = require("./integerValidator");
|
|
22
|
-
var _numberValidator = require("./numberValidator");
|
|
23
|
-
var _regexpValidator = require("./regexpValidator");
|
|
24
|
-
var _requiredValidator = require("./requiredValidator");
|
|
25
|
-
var _stringValidator = require("./stringValidator");
|
|
26
|
-
var _matchesRegexpValidator = require("./matchesRegexpValidator");
|
|
27
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /*
|
|
30
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
31
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
32
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
33
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
-
|
|
35
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
36
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
37
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
38
|
-
governing permissions and limitations under the License.
|
|
39
|
-
*/ /**
|
|
40
|
-
* Validators are functions of two parameters (value and path) that return the
|
|
41
|
-
* computed value if the input is valid, or throw an exception if the input is
|
|
42
|
-
* invalid. In most cases the returned value is the same as the input value;
|
|
43
|
-
* however, reference createDefaultValidator.js to see an example where the
|
|
44
|
-
* computed value is different from the input. Additionally, if we ever wanted
|
|
45
|
-
* to coerce types (i.e. parse string values into integers) as part of the
|
|
46
|
-
* validation process we could use the computed value to accomplish that.
|
|
47
|
-
*
|
|
48
|
-
* The path parameter is used to generate informative error messages. It is
|
|
49
|
-
* created by the objectOf, and arrayOf validators so that any error message can
|
|
50
|
-
* describe which key within the object or array is invalid.
|
|
51
|
-
*
|
|
52
|
-
* The validators also have methods to chain additional validation logic. For
|
|
53
|
-
* example, when you call `string()` to start a validator chain, it returns a
|
|
54
|
-
* validator function but it also has methods like `required` and `nonEmpty`.
|
|
55
|
-
* Here you can see that these methods are actually calling `chain`.
|
|
56
|
-
* Specifically in this function, the leftValidator is called first and then the
|
|
57
|
-
* return value of that is sent to the rightValidator. For example, when calling
|
|
58
|
-
* `string().nonEmpty().required()` the following chain is built up:
|
|
59
|
-
* ```
|
|
60
|
-
* *
|
|
61
|
-
* / \
|
|
62
|
-
* * required
|
|
63
|
-
* / \
|
|
64
|
-
* * nonEmpty
|
|
65
|
-
* / \
|
|
66
|
-
* base string
|
|
67
|
-
* ```
|
|
68
|
-
* Where every * is a call to chain where the two are combined. The individual
|
|
69
|
-
* validators are called from left to right in the above tree. The base
|
|
70
|
-
* validator is simply the identity function `value => value`, representing an
|
|
71
|
-
* optional value.
|
|
72
|
-
*
|
|
73
|
-
* After combining the validators, the new validator function is then augmented
|
|
74
|
-
* with the methods from the leftValidator and from the additionalMethods
|
|
75
|
-
* parameter. For example, when the string() function is called it chains to the
|
|
76
|
-
* base validator, but also adds additional methods like (`regexp`, `domain`,
|
|
77
|
-
* `nonEmpty`, and `unique`). When `nonEmpty` is called, which calls chain
|
|
78
|
-
* again, the additional methods are carried forward because they are already
|
|
79
|
-
* defined on the leftValidator.
|
|
80
|
-
*
|
|
81
|
-
* The base validator also contains the two methods `required` and `default`, so
|
|
82
|
-
* these can be used anywhere after any of the exposed validator functions are
|
|
83
|
-
* called.
|
|
84
|
-
*
|
|
85
|
-
* For most validators, we want the validation to be optional (i.e. allow null
|
|
86
|
-
* or undefined values). To accomplish this, the validator needs to have a check
|
|
87
|
-
* at the begining of the function, short circuiting the validation logic and
|
|
88
|
-
* returning value if value is null or undefined. `default` and `required` do
|
|
89
|
-
* not want this null check though. Indeed, `default` should return the default
|
|
90
|
-
* value if value is null, and `required` should throw an error if value is
|
|
91
|
-
* null.
|
|
92
|
-
*
|
|
93
|
-
* So to keep from having to have a null check in front of most validators,
|
|
94
|
-
* nullSafeChain allows you to chain a validator in a null-safe way.
|
|
95
|
-
*/
|
|
96
|
-
// The base validator does no validation and just returns the value unchanged
|
|
97
|
-
var base = function base(value) {
|
|
98
|
-
return value;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// The 'default', 'required', and 'deprecated' methods are available after any
|
|
102
|
-
// data-type method. Don't use the nullSafeChain on 'default' or 'required'
|
|
103
|
-
// because they need to handle the null or undefined case
|
|
104
|
-
base.default = function _default(defaultValue) {
|
|
105
|
-
return (0, _utils.chain)(this, (0, _createDefaultValidator.default)(defaultValue));
|
|
106
|
-
};
|
|
107
|
-
base.required = function required() {
|
|
108
|
-
return (0, _utils.chain)(this, _requiredValidator.default);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// helper validators
|
|
112
|
-
var domain = function domain() {
|
|
113
|
-
return (0, _utils.nullSafeChain)(this, _domainValidator.default);
|
|
114
|
-
};
|
|
115
|
-
var minimumInteger = function minimumInteger(minValue) {
|
|
116
|
-
return (0, _utils.nullSafeChain)(this, (0, _createMinimumValidator.default)("an integer", minValue));
|
|
117
|
-
};
|
|
118
|
-
var minimumNumber = function minimumNumber(minValue) {
|
|
119
|
-
return (0, _utils.nullSafeChain)(this, (0, _createMinimumValidator.default)("a number", minValue));
|
|
120
|
-
};
|
|
121
|
-
var maximumNumber = function maximumNumber(maxValue) {
|
|
122
|
-
return (0, _utils.nullSafeChain)(this, (0, _createMaximumValidator.default)("a number", maxValue));
|
|
123
|
-
};
|
|
124
|
-
var integer = function integer() {
|
|
125
|
-
return (0, _utils.nullSafeChain)(this, _integerValidator.default, {
|
|
126
|
-
minimum: minimumInteger
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
var nonEmptyString = function nonEmptyString() {
|
|
130
|
-
return (0, _utils.nullSafeChain)(this, (0, _createNonEmptyValidator.default)("a non-empty string"));
|
|
131
|
-
};
|
|
132
|
-
var nonEmptyArray = function nonEmptyArray() {
|
|
133
|
-
return (0, _utils.nullSafeChain)(this, (0, _createNonEmptyValidator.default)("a non-empty array"));
|
|
134
|
-
};
|
|
135
|
-
var nonEmptyObject = function nonEmptyObject() {
|
|
136
|
-
return (0, _utils.nullSafeChain)(this, (0, _createNonEmptyValidator.default)("a non-empty object"));
|
|
137
|
-
};
|
|
138
|
-
var regexp = function regexp() {
|
|
139
|
-
return (0, _utils.nullSafeChain)(this, _regexpValidator.default);
|
|
140
|
-
};
|
|
141
|
-
var matches = function matches(regexpPattern) {
|
|
142
|
-
return (0, _utils.nullSafeChain)(this, (0, _matchesRegexpValidator.default)(regexpPattern));
|
|
143
|
-
};
|
|
144
|
-
var unique = function createUnique() {
|
|
145
|
-
return (0, _utils.nullSafeChain)(this, (0, _createUniqueValidator.default)());
|
|
146
|
-
};
|
|
147
|
-
var uniqueItems = function createUniqueItems() {
|
|
148
|
-
return (0, _utils.nullSafeChain)(this, (0, _createUniqueItemsValidator.default)());
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
// top-level validators. These are the first functions that are called to create a validator.
|
|
152
|
-
var anyOf = function anyOf(validators, message) {
|
|
153
|
-
// use chain here because we don't want to accept null or undefined unless at least
|
|
154
|
-
// one of the validators accept null or undefined.
|
|
155
|
-
return (0, _utils.chain)(this, (0, _createAnyOfValidator.default)(validators, message));
|
|
156
|
-
};
|
|
157
|
-
var anything = function anything() {
|
|
158
|
-
return this;
|
|
159
|
-
};
|
|
160
|
-
var arrayOf = function arrayOf(elementValidator) {
|
|
161
|
-
return (0, _utils.nullSafeChain)(this, (0, _createArrayOfValidator.default)(elementValidator), {
|
|
162
|
-
nonEmpty: nonEmptyArray,
|
|
163
|
-
uniqueItems: uniqueItems
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
var boolean = function boolean() {
|
|
167
|
-
return (0, _utils.nullSafeChain)(this, _booleanValidator.default);
|
|
168
|
-
};
|
|
169
|
-
var callback = function callback() {
|
|
170
|
-
return (0, _utils.nullSafeChain)(this, _callbackValidator.default);
|
|
171
|
-
};
|
|
172
|
-
var literal = function literal(literalValue) {
|
|
173
|
-
return (0, _utils.nullSafeChain)(this, (0, _createLiteralValidator.default)(literalValue));
|
|
174
|
-
};
|
|
175
|
-
var number = function number() {
|
|
176
|
-
return (0, _utils.nullSafeChain)(this, _numberValidator.default, {
|
|
177
|
-
minimum: minimumNumber,
|
|
178
|
-
maximum: maximumNumber,
|
|
179
|
-
integer: integer,
|
|
180
|
-
unique: unique
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
var mapOfValues = function mapOfValues(valuesValidator) {
|
|
184
|
-
return (0, _utils.nullSafeChain)(this, (0, _createMapOfValuesValidator.default)(valuesValidator), {
|
|
185
|
-
nonEmpty: nonEmptyObject
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
var createObjectOfAdditionalProperties = function createObjectOfAdditionalProperties(schema) {
|
|
189
|
-
return {
|
|
190
|
-
noUnknownFields: function noUnknownFields() {
|
|
191
|
-
return (0, _utils.nullSafeChain)(this, (0, _createNoUnknownFieldsValidator.default)(schema));
|
|
192
|
-
},
|
|
193
|
-
nonEmpty: nonEmptyObject,
|
|
194
|
-
concat: function concat(otherObjectOfValidator) {
|
|
195
|
-
// combine the schema so that noUnknownFields, and concat have the combined schema
|
|
196
|
-
var newSchema = _objectSpread(_objectSpread({}, schema), otherObjectOfValidator.schema);
|
|
197
|
-
return (0, _utils.nullSafeChain)(this, otherObjectOfValidator, createObjectOfAdditionalProperties(newSchema));
|
|
198
|
-
},
|
|
199
|
-
deprecated: function deprecated(oldField, oldSchema, newField) {
|
|
200
|
-
// Run the deprecated validator first so that the deprecated field is removed
|
|
201
|
-
// before the objectOf validator runs.
|
|
202
|
-
return (0, _utils.reverseNullSafeChainJoinErrors)(this, (0, _createDeprecatedValidator.default)(oldField, oldSchema, newField));
|
|
203
|
-
},
|
|
204
|
-
schema: schema
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
var objectOf = function objectOf(schema) {
|
|
208
|
-
return (0, _utils.nullSafeChain)(this, (0, _createObjectOfValidator.default)(schema), createObjectOfAdditionalProperties(schema));
|
|
209
|
-
};
|
|
210
|
-
var string = function string() {
|
|
211
|
-
return (0, _utils.nullSafeChain)(this, _stringValidator.default, {
|
|
212
|
-
regexp: regexp,
|
|
213
|
-
domain: domain,
|
|
214
|
-
nonEmpty: nonEmptyString,
|
|
215
|
-
unique: unique,
|
|
216
|
-
matches: matches
|
|
217
|
-
});
|
|
218
|
-
};
|
|
219
|
-
var boundAnyOf = anyOf.bind(base);
|
|
220
|
-
exports.anyOf = boundAnyOf;
|
|
221
|
-
var boundAnything = anything.bind(base);
|
|
222
|
-
exports.anything = boundAnything;
|
|
223
|
-
var boundArrayOf = arrayOf.bind(base);
|
|
224
|
-
exports.arrayOf = boundArrayOf;
|
|
225
|
-
var boundBoolean = boolean.bind(base);
|
|
226
|
-
exports.boolean = boundBoolean;
|
|
227
|
-
var boundCallback = callback.bind(base);
|
|
228
|
-
exports.callback = boundCallback;
|
|
229
|
-
var boundLiteral = literal.bind(base);
|
|
230
|
-
exports.literal = boundLiteral;
|
|
231
|
-
var boundNumber = number.bind(base);
|
|
232
|
-
exports.number = boundNumber;
|
|
233
|
-
var boundMapOfValues = mapOfValues.bind(base);
|
|
234
|
-
exports.mapOfValues = boundMapOfValues;
|
|
235
|
-
var boundObjectOf = objectOf.bind(base);
|
|
236
|
-
exports.objectOf = boundObjectOf;
|
|
237
|
-
var boundString = string.bind(base);
|
|
238
|
-
|
|
239
|
-
// compound validators
|
|
240
|
-
exports.string = boundString;
|
|
241
|
-
var boundEnumOf = function boundEnumOf() {
|
|
242
|
-
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
243
|
-
values[_key] = arguments[_key];
|
|
244
|
-
}
|
|
245
|
-
return boundAnyOf(values.map(boundLiteral), "one of these values: [" + JSON.stringify(values) + "]");
|
|
246
|
-
};
|
|
247
|
-
exports.enumOf = boundEnumOf;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _isInteger = require("../isInteger");
|
|
5
|
-
var _utils = require("./utils");
|
|
6
|
-
/*
|
|
7
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
8
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var _default = function _default(value, path) {
|
|
18
|
-
(0, _utils.assertValid)((0, _isInteger.default)(value), value, path, "an integer");
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
exports.default = _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _utils = require("./utils");
|
|
5
|
-
/*
|
|
6
|
-
Copyright 2023 Adobe. All rights reserved.
|
|
7
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
-
governing permissions and limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var _default = function _default(regexp) {
|
|
17
|
-
return function (value, path) {
|
|
18
|
-
(0, _utils.assertValid)(regexp.test(value), value, path, "does not match the " + regexp.toString());
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
exports.default = _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _isNumber = require("../isNumber");
|
|
5
|
-
var _utils = require("./utils");
|
|
6
|
-
/*
|
|
7
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
8
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var _default = function _default(value, path) {
|
|
18
|
-
(0, _utils.assertValid)((0, _isNumber.default)(value), value, path, "a number");
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
exports.default = _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _utils = require("./utils");
|
|
5
|
-
var _isValidRegExp = require("../isValidRegExp");
|
|
6
|
-
/*
|
|
7
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
8
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var _default = function _default(value, path) {
|
|
18
|
-
(0, _utils.assertValid)((0, _isValidRegExp.default)(value), value, path, "a regular expression");
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
exports.default = _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2020 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
var _default = function _default(value, path) {
|
|
16
|
-
if (value == null) {
|
|
17
|
-
throw new Error("'" + path + "' is a required option");
|
|
18
|
-
}
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
exports.default = _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _isString = require("../isString");
|
|
5
|
-
var _utils = require("./utils");
|
|
6
|
-
/*
|
|
7
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
8
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var _default = function _default(value, path) {
|
|
18
|
-
(0, _utils.assertValid)((0, _isString.default)(value), value, path, "a string");
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
exports.default = _default;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.reverseNullSafeChainJoinErrors = exports.nullSafeChain = exports.chain = exports.assertValid = void 0;
|
|
4
|
-
var _assign = require("../assign");
|
|
5
|
-
/*
|
|
6
|
-
Copyright 2023 Adobe. All rights reserved.
|
|
7
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
-
governing permissions and limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// This is used to add methods onto a function.
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Wraps a validator returning the value if it is null or undefined, otherwise
|
|
21
|
-
* it will call the original validator and return the result.
|
|
22
|
-
*
|
|
23
|
-
* @param {function} validator - the validator to call if the value is not null
|
|
24
|
-
*/
|
|
25
|
-
var skipIfNull = function skipIfNull(validator) {
|
|
26
|
-
return function skipIfNullValidator(value, path) {
|
|
27
|
-
return value == null ? value : validator.call(this, value, path);
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Returns a new validator that calls the first validator and then calls the second
|
|
33
|
-
* validator with the result of the first validator. The result of the second validator
|
|
34
|
-
* is returned.
|
|
35
|
-
*
|
|
36
|
-
* @param {function} firstValidator - validator to call first
|
|
37
|
-
* @param {function} secondValidator - validator to call second
|
|
38
|
-
* @returns {function} - a new validator that calls the first and second validators
|
|
39
|
-
*/
|
|
40
|
-
var callSequentially = function callSequentially(firstValidator, secondValidator) {
|
|
41
|
-
return function callSequentiallyValidator(value, path) {
|
|
42
|
-
return secondValidator.call(this, firstValidator.call(this, value, path), path);
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Just like callSequentially, but if either validator throws an error, the errors
|
|
48
|
-
* are collected and thrown at the end.
|
|
49
|
-
*
|
|
50
|
-
* @param {function} firstValidator
|
|
51
|
-
* @param {function} secondValidator
|
|
52
|
-
* @returns {function}
|
|
53
|
-
*/
|
|
54
|
-
var callSequentiallyJoinErrors = function callSequentiallyJoinErrors(firstValidator, secondValidator) {
|
|
55
|
-
return function callSequentiallyJoinErrorsValidator(value, path) {
|
|
56
|
-
var _this = this;
|
|
57
|
-
var errors = [];
|
|
58
|
-
var newValue = [firstValidator, secondValidator].reduce(function (memo, validator) {
|
|
59
|
-
try {
|
|
60
|
-
return validator.call(_this, memo, path);
|
|
61
|
-
} catch (e) {
|
|
62
|
-
errors.push(e);
|
|
63
|
-
return memo;
|
|
64
|
-
}
|
|
65
|
-
}, value);
|
|
66
|
-
if (errors.length) {
|
|
67
|
-
throw new Error(errors.join("\n"));
|
|
68
|
-
}
|
|
69
|
-
return newValue;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Chains two validators together. In addition to calling the validators in
|
|
75
|
-
* sequence, this will also copy over methods from the base validator to the
|
|
76
|
-
* resulting validator and include any additional methods.
|
|
77
|
-
*
|
|
78
|
-
* @param {function} baseValidator - This validator will be called first, and its
|
|
79
|
-
* methods will be copied over to the returned validator.
|
|
80
|
-
* @param {function} newValidator - This validator will be called second.
|
|
81
|
-
* @param {object} additionalMethods - Additional methods to include on the returned
|
|
82
|
-
* validator.
|
|
83
|
-
* @returns {function}
|
|
84
|
-
*/
|
|
85
|
-
var chain = function chain(baseValidator, newValidator, additionalMethods) {
|
|
86
|
-
return (0, _assign.default)(callSequentially(baseValidator, newValidator), baseValidator, additionalMethods);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Chains two validators together, but skips the second validator if the value
|
|
91
|
-
* is null. In addition to calling the validators in sequence, this will also
|
|
92
|
-
* copy over methods from the base validator to the resulting validator and
|
|
93
|
-
* include any additional methods.
|
|
94
|
-
*
|
|
95
|
-
* @param {function} baseValidator - This validator will be called first, and its
|
|
96
|
-
* methods will be copied over to the returned validator.
|
|
97
|
-
* @param {function} newValidator - This validator will be called second. If the value
|
|
98
|
-
* is null after the first validator is called, this validator will not be
|
|
99
|
-
* called.
|
|
100
|
-
* @param {object} additionalMethods - Additional methods to include on the returned
|
|
101
|
-
* validator.
|
|
102
|
-
* @returns {function}
|
|
103
|
-
*/
|
|
104
|
-
exports.chain = chain;
|
|
105
|
-
var nullSafeChain = function nullSafeChain(baseValidator, newValidator, additionalMethods) {
|
|
106
|
-
return (0, _assign.default)(callSequentially(baseValidator, skipIfNull(newValidator)), baseValidator, additionalMethods);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Same as nullSafeChain, but calls the new validator first.
|
|
111
|
-
*
|
|
112
|
-
* @param {function} baseValidator - This validator will be called second, and its
|
|
113
|
-
* methods will be copied over to the returned validator.
|
|
114
|
-
* @param {function} newValidator - This validator will be called first. If the value
|
|
115
|
-
* is null, this validator will not be called.
|
|
116
|
-
* @param {function} additionalMethods - Additional methods to include on the returned
|
|
117
|
-
* validator.
|
|
118
|
-
* @returns {function}
|
|
119
|
-
*/
|
|
120
|
-
exports.nullSafeChain = nullSafeChain;
|
|
121
|
-
var reverseNullSafeChainJoinErrors = function reverseNullSafeChainJoinErrors(baseValidator, newValidator, additionalMethods) {
|
|
122
|
-
return (0, _assign.default)(callSequentiallyJoinErrors(skipIfNull(newValidator), baseValidator), baseValidator, additionalMethods);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Throws an error if the value is not valid.
|
|
127
|
-
*
|
|
128
|
-
* @param {boolean} isValid - Whether or not the value is valid.
|
|
129
|
-
* @param {*} value - The value to validate.
|
|
130
|
-
* @param {string} path - The path to the value.
|
|
131
|
-
* @param {string} message - The expected part of the error message.
|
|
132
|
-
* @throws {Error} - Throws an error if the value is not valid.
|
|
133
|
-
* @returns {void}
|
|
134
|
-
*/
|
|
135
|
-
exports.reverseNullSafeChainJoinErrors = reverseNullSafeChainJoinErrors;
|
|
136
|
-
var assertValid = function assertValid(isValid, value, path, message) {
|
|
137
|
-
if (!isValid) {
|
|
138
|
-
throw new Error("'" + path + "': Expected " + message + ", but got " + JSON.stringify(value) + ".");
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
exports.assertValid = assertValid;
|
package/libEs5/utils/values.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
/*
|
|
5
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
6
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
-
governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Returns an array whose items are the provided object's own enumerable
|
|
17
|
-
* property values.
|
|
18
|
-
* @param {Object} obj
|
|
19
|
-
* @returns {Array}
|
|
20
|
-
*/
|
|
21
|
-
var _default = function _default(obj) {
|
|
22
|
-
return Object.keys(obj).map(function (key) {
|
|
23
|
-
return obj[key];
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.default = _default;
|
package/libEs6/baseCode/index.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* eslint no-param-reassign: 0 */
|
|
14
|
-
/* eslint no-underscore-dangle: 0 */
|
|
15
|
-
/* eslint prefer-rest-params: 0 */
|
|
16
|
-
/* eslint no-var: 0 */
|
|
17
|
-
/* eslint-disable func-names */
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This is the code, once minified, that an Alloy consumer copies and pastes
|
|
21
|
-
* into their website's HTML. It sets up any global functions the consumer will
|
|
22
|
-
* use to interact with Alloy. It also provides a queuing mechanism whereby
|
|
23
|
-
* any function calls made by the consumer before the Alloy library file
|
|
24
|
-
* loads will be enqueued and later processed by Alloy once the Alloy library
|
|
25
|
-
* file has loaded. Because each call may be asynchronously processed, a promise
|
|
26
|
-
* will always be returned to the consumer any time the consumer attempts to
|
|
27
|
-
* execute a command.
|
|
28
|
-
*
|
|
29
|
-
* Along with this base code, a script tag (not shown here) will also be added
|
|
30
|
-
* to the consumer website's HTML that will load the Alloy library file.
|
|
31
|
-
*
|
|
32
|
-
* Take particular care to write well-minifiable code, as consumers are
|
|
33
|
-
* particularly sensitive to base code size.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
export default ((window, instanceNames) => {
|
|
37
|
-
instanceNames.forEach(function (instanceName) {
|
|
38
|
-
if (!window[instanceName]) {
|
|
39
|
-
// __alloyNS stores a name of each "instance", or in other words, each
|
|
40
|
-
// global function created that the consumer will use. This array is
|
|
41
|
-
// what the Alloy library will consult once it is loaded to determine
|
|
42
|
-
// which global functions have been set up so that is can connect them to
|
|
43
|
-
// the library's command processing pipeline.
|
|
44
|
-
(window.__alloyNS = window.__alloyNS || []).push(instanceName);
|
|
45
|
-
window[instanceName] = function () {
|
|
46
|
-
var userProvidedArgs = arguments;
|
|
47
|
-
// Always return a promise, because the command may be executed
|
|
48
|
-
// asynchronously, especially if the Alloy library has not yet loaded.
|
|
49
|
-
return new Promise(function (resolve, reject) {
|
|
50
|
-
// Push required call information into the queue. Once the Alloy
|
|
51
|
-
// library is loaded, it will process this queue and resolve/reject
|
|
52
|
-
// the promise we just returned to the consumer. If the Alloy
|
|
53
|
-
// library has already loaded, then it will have already overridden
|
|
54
|
-
// q.push and will therefore process the call immediately.
|
|
55
|
-
window[instanceName].q.push([resolve, reject, userProvidedArgs]);
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
window[instanceName].q = [];
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
});
|