diff --git a/.ci/pipeline-library/README.md b/.ci/pipeline-library/README.md new file mode 100644 index 0000000000000..71d7c39e37f4f --- /dev/null +++ b/.ci/pipeline-library/README.md @@ -0,0 +1,8 @@ +# Kibana Jenkins Pipeline Library + +## Running tests + +```bash +cd .ci/pipeline-library +./gradlew test +``` \ No newline at end of file diff --git a/.ci/pipeline-library/build.gradle b/.ci/pipeline-library/build.gradle new file mode 100644 index 0000000000000..2753750871ad5 --- /dev/null +++ b/.ci/pipeline-library/build.gradle @@ -0,0 +1,45 @@ +plugins { + id 'groovy' + id 'idea' +} + +group = 'co.elastic.kibana.pipeline' +version = '0.0.1' + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +repositories { + maven { url 'https://repo.jenkins-ci.org/releases/' } + maven { url 'https://repo.maven.apache.org/maven2' } +} + +dependencies { + implementation 'org.codehaus.groovy:groovy-all:2.4.12' + implementation 'org.jenkins-ci.main:jenkins-core:2.23' + implementation 'org.jenkins-ci.plugins.workflow:workflow-step-api:2.19@jar' + testImplementation 'com.lesfurets:jenkins-pipeline-unit:1.4' + testImplementation 'junit:junit:4.12' + testImplementation 'org.assertj:assertj-core:3.15+' // Temporary https://github.com/jenkinsci/JenkinsPipelineUnit/issues/209 +} + +sourceSets { + main { + groovy { + srcDirs = ['vars'] + } + } + + test { + groovy { + srcDirs = ['src/test'] + } + } +} + +test { + testLogging { + events 'passed', 'skipped', 'failed' + exceptionFormat = 'full' + } +} diff --git a/.ci/pipeline-library/gradle/wrapper/gradle-wrapper.jar b/.ci/pipeline-library/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000..62d4c053550b9 Binary files /dev/null and b/.ci/pipeline-library/gradle/wrapper/gradle-wrapper.jar differ diff --git a/.ci/pipeline-library/gradle/wrapper/gradle-wrapper.properties b/.ci/pipeline-library/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000..a4f0001d203b2 --- /dev/null +++ b/.ci/pipeline-library/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/.ci/pipeline-library/gradlew b/.ci/pipeline-library/gradlew new file mode 100755 index 0000000000000..fbd7c515832da --- /dev/null +++ b/.ci/pipeline-library/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/.ci/pipeline-library/gradlew.bat b/.ci/pipeline-library/gradlew.bat new file mode 100644 index 0000000000000..a9f778a7a964b --- /dev/null +++ b/.ci/pipeline-library/gradlew.bat @@ -0,0 +1,104 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/.ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy b/.ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy new file mode 100644 index 0000000000000..23282089ab76c --- /dev/null +++ b/.ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy @@ -0,0 +1,106 @@ +import com.lesfurets.jenkins.unit.* +import org.junit.Before + +class KibanaBasePipelineTest extends BasePipelineTest { + Map env = [:] + Map params = [:] + + public def Mocks = [ + TEST_FAILURE_URL: 'https://localhost/', + TEST_FAILURE_NAME: 'Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/fake/test·ts.Fake test should & pass &', + ] + + @Before + void setUp() { + super.setUp() + + env.BRANCH_NAME = 'master' + env.BUILD_ID = '1' + env.BUILD_DISPLAY_NAME = "#${env.BUILD_ID}" + + env.JENKINS_URL = 'http://jenkins.localhost:8080' + env.BUILD_URL = "${env.JENKINS_URL}/job/elastic+kibana+${env.BRANCH_NAME}/${env.BUILD_ID}/" + + env.JOB_BASE_NAME = "elastic / kibana # ${env.BRANCH_NAME}" + env.JOB_NAME = env.JOB_BASE_NAME + + env.WORKSPACE = 'WS' + + props([ + buildUtils: [ + getBuildStatus: { 'SUCCESS' }, + printStacktrace: { ex -> print ex }, + ], + jenkinsApi: [ getFailedSteps: { [] } ], + testUtils: [ getFailures: { [] } ], + ]) + + vars([ + env: env, + params: params, + ]) + + // Some wrappers that can just be mocked to immediately call the closure passed in + [ + 'catchError', + 'catchErrors', + 'timestamps', + 'withGithubCredentials', + ].each { + helper.registerAllowedMethod(it, [Closure.class], null) + } + } + + void props(Map properties) { + properties.each { + binding.setProperty(it.key, it.value) + } + } + + void prop(String propertyName, Object propertyValue) { + binding.setProperty(propertyName, propertyValue) + } + + void vars(Map variables) { + variables.each { + binding.setVariable(it.key, it.value) + } + } + + void var(String variableName, Object variableValue) { + binding.setVariable(variableName, variableValue) + } + + def fnMock(String name) { + return helper.callStack.find { it.methodName == name } + } + + void mockFailureBuild() { + props([ + buildUtils: [ + getBuildStatus: { 'FAILURE' }, + printStacktrace: { ex -> print ex }, + ], + jenkinsApi: [ getFailedSteps: { [ + [ + displayName: 'Check out from version control', + logs: 'http://jenkins.localhost:8080', + ], + [ + displayName: 'Execute test task', + logs: 'http://jenkins.localhost:8080', + ], + ] } ], + testUtils: [ + getFailures: { + return [ + [ + url: Mocks.TEST_FAILURE_URL, + fullDisplayName: Mocks.TEST_FAILURE_NAME, + ] + ] + }, + ], + ]) + } +} diff --git a/.ci/pipeline-library/src/test/prChanges.groovy b/.ci/pipeline-library/src/test/prChanges.groovy new file mode 100644 index 0000000000000..0fb750d6ff64e --- /dev/null +++ b/.ci/pipeline-library/src/test/prChanges.groovy @@ -0,0 +1,87 @@ +import org.junit.* +import static groovy.test.GroovyAssert.* + +class PrChangesTest extends KibanaBasePipelineTest { + def prChanges + + @Before + void setUp() { + super.setUp() + + env.ghprbPullId = '1' + + props([ + githubPr: [ + isPr: { true }, + ], + ]) + + prChanges = loadScript("vars/prChanges.groovy") + } + + @Test + void 'areChangesSkippable() with no changes'() { + props([ + githubPrs: [ + getChanges: { [] }, + ], + ]) + + assertTrue(prChanges.areChangesSkippable()) + } + + @Test + void 'areChangesSkippable() with skippable changes'() { + props([ + githubPrs: [ + getChanges: { [ + [filename: 'docs/test/a-fake-doc.asciidoc'], + [filename: 'README.md'], + ] }, + ], + ]) + + assertTrue(prChanges.areChangesSkippable()) + } + + @Test + void 'areChangesSkippable() with skippable renames'() { + props([ + githubPrs: [ + getChanges: { [ + [ filename: 'docs/test/a-fake-doc.asciidoc', previousFilename: 'docs/test/a-different-fake-doc.asciidoc' ], + [ filename: 'README.md', previousFilename: 'README-old.md' ], + ] }, + ], + ]) + + assertTrue(prChanges.areChangesSkippable()) + } + + @Test + void 'areChangesSkippable() with unskippable changes'() { + props([ + githubPrs: [ + getChanges: { [ + [filename: 'src/core/index.ts'], + ] }, + ], + ]) + + assertFalse(prChanges.areChangesSkippable()) + } + + @Test + void 'areChangesSkippable() with skippable and unskippable changes'() { + props([ + githubPrs: [ + getChanges: { [ + [filename: 'README.md'], + [filename: 'src/core/index.ts'], + ] }, + ], + ]) + + assertFalse(prChanges.areChangesSkippable()) + } +} diff --git a/.ci/pipeline-library/src/test/slackNotifications.groovy b/.ci/pipeline-library/src/test/slackNotifications.groovy new file mode 100644 index 0000000000000..467e4a0e5f520 --- /dev/null +++ b/.ci/pipeline-library/src/test/slackNotifications.groovy @@ -0,0 +1,62 @@ +import org.junit.* +import static groovy.test.GroovyAssert.* + +class SlackNotificationsTest extends KibanaBasePipelineTest { + def slackNotifications + + @Before + void setUp() { + super.setUp() + + helper.registerAllowedMethod('slackSend', [Map.class], null) + slackNotifications = loadScript('vars/slackNotifications.groovy') + } + + @Test + void 'getTestFailures() should properly format failure steps'() { + mockFailureBuild() + + def failureMessage = slackNotifications.getTestFailures() + + assertEquals( + "*Test Failures*\n• <${Mocks.TEST_FAILURE_URL}|x-pack/test/functional/apps/fake/test·ts.Fake test <Component> should & pass &>", + failureMessage + ) + } + + @Test + void 'sendFailedBuild() should call slackSend() with message'() { + mockFailureBuild() + + slackNotifications.sendFailedBuild() + + def args = fnMock('slackSend').args[0] + + def expected = [ + channel: '#kibana-operations-alerts', + username: 'Kibana Operations', + iconEmoji: ':jenkins:', + color: 'danger', + message: ':broken_heart: elastic / kibana # master #1', + ] + + expected.each { + assertEquals(it.value.toString(), args[it.key].toString()) + } + + assertEquals( + ":broken_heart: **", + args.blocks[0].text.text.toString() + ) + + assertEquals( + "*Failed Steps*\n• ", + args.blocks[1].text.text.toString() + ) + + assertEquals( + "*Test Failures*\n• ", + args.blocks[2].text.text.toString() + ) + } +} diff --git a/.ci/pipeline-library/vars b/.ci/pipeline-library/vars new file mode 120000 index 0000000000000..8559d2e08fc22 --- /dev/null +++ b/.ci/pipeline-library/vars @@ -0,0 +1 @@ +../../vars \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 3cac46e7d2605..9657719f0f526 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -197,9 +197,12 @@ module.exports = { errorMessage: `Plugins may only import from src/core/server and src/core/public.`, }, { - target: ['(src|x-pack)/plugins/*/public/**/*'], - from: ['(src|x-pack)/plugins/*/server/**/*'], - errorMessage: `Public code can not import from server, use a common directory.`, + target: [ + '(src|x-pack)/plugins/*/server/**/*', + '!x-pack/plugins/apm/**/*', // https://github.com/elastic/kibana/issues/67210 + ], + from: ['(src|x-pack)/plugins/*/public/**/*'], + errorMessage: `Server code can not import from public, use a common directory.`, }, { target: ['(src|x-pack)/plugins/*/common/**/*'], @@ -589,8 +592,11 @@ module.exports = { * Security Solution overrides */ { - // front end typescript and javascript files only - files: ['x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}'], + // front end and common typescript and javascript files only + files: [ + 'x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}', + 'x-pack/plugins/security_solution/common/**/*.{js,ts,tsx}', + ], rules: { 'import/no-nodejs-modules': 'error', 'no-restricted-imports': [ @@ -766,6 +772,23 @@ module.exports = { /** * Lists overrides */ + { + // front end and common typescript and javascript files only + files: [ + 'x-pack/plugins/lists/public/**/*.{js,ts,tsx}', + 'x-pack/plugins/lists/common/**/*.{js,ts,tsx}', + ], + rules: { + 'import/no-nodejs-modules': 'error', + 'no-restricted-imports': [ + 'error', + { + // prevents UI code from importing server side code and then webpack including it when doing builds + patterns: ['**/server/*'], + }, + ], + }, + }, { // typescript and javascript for front and back end files: ['x-pack/plugins/lists/**/*.{js,ts,tsx}'], diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 472d29ed29413..07546fa54ce4f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -222,8 +222,7 @@ /x-pack/plugins/endpoint/ @elastic/endpoint-app-team @elastic/siem /x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team @elastic/siem /x-pack/test/endpoint_api_integration_no_ingest/ @elastic/endpoint-app-team @elastic/siem -/x-pack/test/functional_endpoint/ @elastic/endpoint-app-team @elastic/siem -/x-pack/test/functional_endpoint_ingest_failure/ @elastic/endpoint-app-team @elastic/siem +/x-pack/test/security_solution_endpoint/ @elastic/endpoint-app-team @elastic/siem /x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team @elastic/siem /x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team @elastic/siem /x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem diff --git a/.gitignore b/.gitignore index b3911d0f8d0c2..c7c80fc48264d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /.es .DS_Store .node_binaries +.native_modules node_modules !/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules !/src/dev/notice/__fixtures__/node_modules @@ -45,6 +46,8 @@ package-lock.json npm-debug.log* .tern-project .nyc_output +.ci/pipeline-library/build/ +.gradle # apm plugin /x-pack/plugins/apm/tsconfig.json diff --git a/docs/apm/api.asciidoc b/docs/apm/api.asciidoc index 7411f37d3c692..54159b642dd1a 100644 --- a/docs/apm/api.asciidoc +++ b/docs/apm/api.asciidoc @@ -15,8 +15,39 @@ Some APM app features are provided via a REST API: [[apm-api-example]] === Using the APIs -Users interacting with APM APIs must have <>. -In addition, there are request headers to be aware of, like `kbn-xsrf: true`, and `Content-Type: applicaton/json`. +// The following content is reused throughout the API docs +// tag::using-the-APIs[] +Interact with APM APIs using cURL or another API tool. +All APM APIs are Kibana APIs, not Elasticsearch APIs; +because of this, the Kibana dev tools console cannot be used to interact with APM APIs. + +For all APM APIs, you must use a request header. +Supported headers are `Authorization`, `kbn-xsrf`, and `Content-Type`. + +`Authorization: ApiKey {credentials}`:: +Kibana supports token-based authentication with the Elasticsearch API key service. +The API key returned by the {ref}/security-api-create-api-key.html[Elasticsearch create API key API] +can be used by sending a request with an `Authorization` header that has a value of `ApiKey` followed by the `{credentials}`, +where `{credentials}` is the base64 encoding of `id` and `api_key` joined by a colon. ++ +Alternatively, you can create a user and use their username and password to authenticate API access: `-u $USER:$PASSWORD`. ++ +Whether using `Authorization: ApiKey {credentials}`, or `-u $USER:$PASSWORD`, +users interacting with APM APIs must have <>. + +`kbn-xsrf: true`:: + By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios: + +* The API endpoint uses the `GET` or `HEAD` operations +* The path is whitelisted using the <> setting +* XSRF protections are disabled using the `server.xsrf.disableProtection` setting + +`Content-Type: application/json`:: + Applicable only when you send a payload in the API request. + {kib} API requests and responses use JSON. + Typically, if you include the `kbn-xsrf` header, you must also include the `Content-Type` header. +// end::using-the-APIs[] + Here's an example CURL request that adds an annotation to the APM app: [source,curl] @@ -38,9 +69,6 @@ curl -X POST \ }' ---- -The Kibana <> provides additional information on how to use Kibana APIs, -required request headers, and token-based authentication options. - //// ******************************************************* //// @@ -59,7 +87,15 @@ The following Agent configuration APIs are available: * <> to list all Agent configurations. * <> to search for an Agent configuration. -See <> for information on the privileges required to use this API endpoint. +[float] +[[use-agent-config-api]] +==== How to use APM APIs + +.Expand for required headers, privileges, and usage details +[%collapsible%closed] +====== +include::api.asciidoc[tag=using-the-APIs] +====== //// ******************************************************* @@ -100,7 +136,7 @@ See <> for information on the privileges required to [[apm-update-config-example]] ===== Example -[source,console] +[source,curl] -------------------------------------------------- PUT /api/apm/settings/agent-configuration { @@ -150,7 +186,7 @@ PUT /api/apm/settings/agent-configuration [[apm-delete-config-example]] ===== Example -[source,console] +[source,curl] -------------------------------------------------- DELETE /api/apm/settings/agent-configuration { @@ -228,7 +264,7 @@ DELETE /api/apm/settings/agent-configuration [[apm-list-config-example]] ===== Example -[source,console] +[source,curl] -------------------------------------------------- GET /api/apm/settings/agent-configuration -------------------------------------------------- @@ -293,7 +329,7 @@ GET /api/apm/settings/agent-configuration [[apm-search-config-example]] ===== Example -[source,console] +[source,curl] -------------------------------------------------- POST /api/apm/settings/agent-configuration/search { @@ -317,6 +353,9 @@ POST /api/apm/settings/agent-configuration/search The Annotation API allows you to annotate visualizations in the APM app with significant events, like deployments, allowing you to easily see how these events are impacting the performance of your existing applications. +By default, annotations are stored in a newly created `observability-annotations` index. +The name of this index can be changed in your `config.yml` by editing `xpack.observability.annotations.index`. + The following APIs are available: * <> to create an annotation for APM. @@ -324,10 +363,15 @@ The following APIs are available: // * <> GET /api/observability/annotation/:id // * <> DELETE /api/observability/annotation/:id -By default, annotations are stored in a newly created `observability-annotations` index. -The name of this index can be changed in your `config.yml` by editing `xpack.observability.annotations.index`. +[float] +[[use-annotation-api]] +==== How to use APM APIs -See <> for information on the privileges required to use this API endpoint. +.Expand for required headers, privileges, and usage details +[%collapsible%closed] +====== +include::api.asciidoc[tag=using-the-APIs] +====== //// ******************************************************* @@ -374,19 +418,20 @@ While you can add additional tags, you cannot remove the `apm` tag. The following example creates an annotation for a service named `opbeans-java`. -[source,console] +[source,curl] -------------------------------------------------- -POST /api/apm/services/opbeans-java/annotation -{ - "@timestamp": "2020-05-08T10:31:30.452Z", - "service": { - "version": "1.2" - }, - "message": "Deployment 1.2", - "tags": [ - "elastic.co", "customer" - ] -} +curl -X POST \ + http://localhost:5601/api/apm/services/opbeans-java/annotation \ +-H 'Content-Type: application/json' \ +-H 'kbn-xsrf: true' \ +-H 'Authorization: Basic YhUlubWZhM0FDbnlQeE6WRtaW49FQmSGZ4RUWXdX' \ +-d '{ + "@timestamp": "2020-05-08T10:31:30.452Z", + "service": { + "version": "1.2" + }, + "message": "Deployment 1.2" + }' -------------------------------------------------- [[apm-annotation-config-body]] diff --git a/docs/apm/deployment-annotations.asciidoc b/docs/apm/deployment-annotations.asciidoc index 142b0c0193d74..53fd963a81f73 100644 --- a/docs/apm/deployment-annotations.asciidoc +++ b/docs/apm/deployment-annotations.asciidoc @@ -18,7 +18,7 @@ Alternatively, you can explicitly create deployment annotations with our annotat The API can integrate into your CI/CD pipeline, so that each time you deploy, a POST request is sent to the annotation API endpoint: -[source,console] +[source,curl] ---- curl -X POST \ http://localhost:5601/api/apm/services/${SERVICE_NAME}/annotation \ <1> diff --git a/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md b/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md index b382d57a856a2..e1f08c7b38133 100644 --- a/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md +++ b/docs/development/core/public/kibana-plugin-core-public.applicationstart.navigatetoapp.md @@ -9,10 +9,7 @@ Navigate to a given app Signature: ```typescript -navigateToApp(appId: string, options?: { - path?: string; - state?: any; - }): Promise; +navigateToApp(appId: string, options?: NavigateToAppOptions): Promise; ``` ## Parameters @@ -20,7 +17,7 @@ navigateToApp(appId: string, options?: { | Parameter | Type | Description | | --- | --- | --- | | appId | string | | -| options | {
path?: string;
state?: any;
} | | +| options | NavigateToAppOptions | navigation options | Returns: diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md index 7c7c9729504de..dda6b6ac0c60a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.md +++ b/docs/development/core/public/kibana-plugin-core-public.md @@ -94,6 +94,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [LegacyCoreSetup](./kibana-plugin-core-public.legacycoresetup.md) | Setup interface exposed to the legacy platform via the ui/new_platform module. | | [LegacyCoreStart](./kibana-plugin-core-public.legacycorestart.md) | Start interface exposed to the legacy platform via the ui/new_platform module. | | [LegacyNavLink](./kibana-plugin-core-public.legacynavlink.md) | | +| [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) | Options for the [navigateToApp API](./kibana-plugin-core-public.applicationstart.navigatetoapp.md) | | [NotificationsSetup](./kibana-plugin-core-public.notificationssetup.md) | | | [NotificationsStart](./kibana-plugin-core-public.notificationsstart.md) | | | [OverlayBannersStart](./kibana-plugin-core-public.overlaybannersstart.md) | | diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md new file mode 100644 index 0000000000000..aa51e5706e3d7 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) + +## NavigateToAppOptions interface + +Options for the [navigateToApp API](./kibana-plugin-core-public.applicationstart.navigatetoapp.md) + +Signature: + +```typescript +export interface NavigateToAppOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.appbase.defaultpath.md)\` as default. | +| [replace](./kibana-plugin-core-public.navigatetoappoptions.replace.md) | boolean | if true, will not create a new history entry when navigating (using replace instead of push) | +| [state](./kibana-plugin-core-public.navigatetoappoptions.state.md) | unknown | optional state to forward to the application | + diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md new file mode 100644 index 0000000000000..58ce7e02d8dd8 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) > [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) + +## NavigateToAppOptions.path property + +optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.appbase.defaultpath.md)\` as default. + +Signature: + +```typescript +path?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.replace.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.replace.md new file mode 100644 index 0000000000000..9530d03486299 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.replace.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) > [replace](./kibana-plugin-core-public.navigatetoappoptions.replace.md) + +## NavigateToAppOptions.replace property + +if true, will not create a new history entry when navigating (using `replace` instead of `push`) + +Signature: + +```typescript +replace?: boolean; +``` + +## Remarks + +This option not be used when navigating from and/or to legacy applications. + diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.state.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.state.md new file mode 100644 index 0000000000000..ccb76f7bbf18e --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.state.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) > [state](./kibana-plugin-core-public.navigatetoappoptions.state.md) + +## NavigateToAppOptions.state property + +optional state to forward to the application + +Signature: + +```typescript +state?: unknown; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkcreate.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkcreate.md index 1fc52a49f85d6..66975e1e6f352 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkcreate.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkcreate.md @@ -9,5 +9,5 @@ Creates multiple documents at once Signature: ```typescript -bulkCreate: (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise>; +bulkCreate: (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise>; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkget.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkget.md index 1a939c3868706..ed3f11f99b106 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkget.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkget.md @@ -9,10 +9,10 @@ Returns an array of objects by id Signature: ```typescript -bulkGet: (objects?: { +bulkGet: (objects?: Array<{ id: string; type: string; - }[]) => Promise>; + }>) => Promise>; ``` ## Example diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.delete.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.delete.md index d0269d2dd7833..3b5f5630e8060 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.delete.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.delete.md @@ -9,5 +9,5 @@ Deletes an object Signature: ```typescript -delete: (type: string, id: string) => Promise<{}>; +delete: (type: string, id: string) => ReturnType; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.find.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.find.md index ebb59cd8db168..ddd8b207e3d78 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.find.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.find.md @@ -9,5 +9,5 @@ Search for objects Signature: ```typescript -find: (options: Pick) => Promise>; +find: (options: SavedObjectsFindOptions) => Promise>; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md index 889340728ed6e..904b9cce09d4e 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md @@ -20,11 +20,11 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | (objects?: SavedObjectsBulkCreateObject<unknown>[], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>> | Creates multiple documents at once | -| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | (objects?: {
id: string;
type: string;
}[]) => Promise<SavedObjectsBatchResponse<unknown>> | Returns an array of objects by id | +| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>> | Creates multiple documents at once | +| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | (objects?: Array<{
id: string;
type: string;
}>) => Promise<SavedObjectsBatchResponse<unknown>> | Returns an array of objects by id | | [create](./kibana-plugin-core-public.savedobjectsclient.create.md) | | <T = unknown>(type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise<SimpleSavedObject<T>> | Persists an object | -| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | (type: string, id: string) => Promise<{}> | Deletes an object | -| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <T = unknown>(options: Pick<SavedObjectFindOptionsServer, "search" | "filter" | "type" | "page" | "perPage" | "sortField" | "fields" | "searchFields" | "hasReference" | "defaultSearchOperator">) => Promise<SavedObjectsFindResponsePublic<T>> | Search for objects | +| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | (type: string, id: string) => ReturnType<SavedObjectsApi['delete']> | Deletes an object | +| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <T = unknown>(options: SavedObjectsFindOptions) => Promise<SavedObjectsFindResponsePublic<T>> | Search for objects | | [get](./kibana-plugin-core-public.savedobjectsclient.get.md) | | <T = unknown>(type: string, id: string) => Promise<SimpleSavedObject<T>> | Fetches a single object | ## Methods diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md index 366e82f2ef07b..5f33d62382818 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md @@ -21,6 +21,7 @@ export interface SavedObjectsFindOptions extends SavedObjectsBaseOptions | [hasReference](./kibana-plugin-core-public.savedobjectsfindoptions.hasreference.md) | {
type: string;
id: string;
} | | | [page](./kibana-plugin-core-public.savedobjectsfindoptions.page.md) | number | | | [perPage](./kibana-plugin-core-public.savedobjectsfindoptions.perpage.md) | number | | +| [preference](./kibana-plugin-core-public.savedobjectsfindoptions.preference.md) | string | An optional ES preference value to be used for the query \* | | [search](./kibana-plugin-core-public.savedobjectsfindoptions.search.md) | string | Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String query argument for more information | | [searchFields](./kibana-plugin-core-public.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | | [sortField](./kibana-plugin-core-public.savedobjectsfindoptions.sortfield.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.preference.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.preference.md new file mode 100644 index 0000000000000..8a30cb99c57bc --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.preference.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsFindOptions](./kibana-plugin-core-public.savedobjectsfindoptions.md) > [preference](./kibana-plugin-core-public.savedobjectsfindoptions.preference.md) + +## SavedObjectsFindOptions.preference property + +An optional ES preference value to be used for the query \* + +Signature: + +```typescript +preference?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.createhref.md b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.createhref.md index 6bbab43ff6ffc..5ab31c0ba6ff2 100644 --- a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.createhref.md +++ b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.createhref.md @@ -11,5 +11,5 @@ Creates an href (string) to the location. If `prependBasePath` is true (default) ```typescript createHref: (location: LocationDescriptorObject, { prependBasePath }?: { prependBasePath?: boolean | undefined; - }) => string; + }) => Href; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md index fa29b32c0bafc..1818d2bc0851d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md +++ b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.md @@ -28,7 +28,7 @@ export declare class ScopedHistory implements Hi | --- | --- | --- | --- | | [action](./kibana-plugin-core-public.scopedhistory.action.md) | | Action | The last action dispatched on the history stack. | | [block](./kibana-plugin-core-public.scopedhistory.block.md) | | (prompt?: string | boolean | History.TransitionPromptHook<HistoryLocationState> | undefined) => UnregisterCallback | Not supported. Use [AppMountParameters.onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md). | -| [createHref](./kibana-plugin-core-public.scopedhistory.createhref.md) | | (location: LocationDescriptorObject<HistoryLocationState>, { prependBasePath }?: {
prependBasePath?: boolean | undefined;
}) => string | Creates an href (string) to the location. If prependBasePath is true (default), it will prepend the location's path with the scoped history basePath. | +| [createHref](./kibana-plugin-core-public.scopedhistory.createhref.md) | | (location: LocationDescriptorObject<HistoryLocationState>, { prependBasePath }?: {
prependBasePath?: boolean | undefined;
}) => Href | Creates an href (string) to the location. If prependBasePath is true (default), it will prepend the location's path with the scoped history basePath. | | [createSubHistory](./kibana-plugin-core-public.scopedhistory.createsubhistory.md) | | <SubHistoryLocationState = unknown>(basePath: string) => ScopedHistory<SubHistoryLocationState> | Creates a ScopedHistory for a subpath of this ScopedHistory. Useful for applications that may have sub-apps that do not need access to the containing application's history. | | [go](./kibana-plugin-core-public.scopedhistory.go.md) | | (n: number) => void | Send the user forward or backwards in the history stack. | | [goBack](./kibana-plugin-core-public.scopedhistory.goback.md) | | () => void | Send the user one location back in the history stack. Equivalent to calling [ScopedHistory.go(-1)](./kibana-plugin-core-public.scopedhistory.go.md). If no more entries are available backwards, this is a no-op. | @@ -36,6 +36,6 @@ export declare class ScopedHistory implements Hi | [length](./kibana-plugin-core-public.scopedhistory.length.md) | | number | The number of entries in the history stack, including all entries forwards and backwards from the current location. | | [listen](./kibana-plugin-core-public.scopedhistory.listen.md) | | (listener: (location: Location<HistoryLocationState>, action: Action) => void) => UnregisterCallback | Adds a listener for location updates. | | [location](./kibana-plugin-core-public.scopedhistory.location.md) | | Location<HistoryLocationState> | The current location of the history stack. | -| [push](./kibana-plugin-core-public.scopedhistory.push.md) | | (pathOrLocation: string | LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState | undefined) => void | Pushes a new location onto the history stack. If there are forward entries in the stack, they will be removed. | -| [replace](./kibana-plugin-core-public.scopedhistory.replace.md) | | (pathOrLocation: string | LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState | undefined) => void | Replaces the current location in the history stack. Does not remove forward or backward entries. | +| [push](./kibana-plugin-core-public.scopedhistory.push.md) | | (pathOrLocation: Path | LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState | undefined) => void | Pushes a new location onto the history stack. If there are forward entries in the stack, they will be removed. | +| [replace](./kibana-plugin-core-public.scopedhistory.replace.md) | | (pathOrLocation: Path | LocationDescriptorObject<HistoryLocationState>, state?: HistoryLocationState | undefined) => void | Replaces the current location in the history stack. Does not remove forward or backward entries. | diff --git a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.push.md b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.push.md index 64001be0713a0..226203502c5e0 100644 --- a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.push.md +++ b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.push.md @@ -9,5 +9,5 @@ Pushes a new location onto the history stack. If there are forward entries in th Signature: ```typescript -push: (pathOrLocation: string | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; +push: (pathOrLocation: Path | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.replace.md b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.replace.md index b42f563b9c0cb..545c81ead0984 100644 --- a/docs/development/core/public/kibana-plugin-core-public.scopedhistory.replace.md +++ b/docs/development/core/public/kibana-plugin-core-public.scopedhistory.replace.md @@ -9,5 +9,5 @@ Replaces the current location in the history stack. Does not remove forward or b Signature: ```typescript -replace: (pathOrLocation: string | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; +replace: (pathOrLocation: Path | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.basepath.get.md b/docs/development/core/server/kibana-plugin-core-server.basepath.get.md index 8977a9355b692..f1e71616d4d17 100644 --- a/docs/development/core/server/kibana-plugin-core-server.basepath.get.md +++ b/docs/development/core/server/kibana-plugin-core-server.basepath.get.md @@ -9,5 +9,5 @@ returns `basePath` value, specific for an incoming request. Signature: ```typescript -get: (request: LegacyRequest | KibanaRequest) => string; +get: (request: KibanaRequest | LegacyRequest) => string; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.basepath.md b/docs/development/core/server/kibana-plugin-core-server.basepath.md index 459130a90eb35..a5e09e34759a8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.basepath.md +++ b/docs/development/core/server/kibana-plugin-core-server.basepath.md @@ -20,9 +20,9 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [get](./kibana-plugin-core-server.basepath.get.md) | | (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>) => string | returns basePath value, specific for an incoming request. | +| [get](./kibana-plugin-core-server.basepath.get.md) | | (request: KibanaRequest | LegacyRequest) => string | returns basePath value, specific for an incoming request. | | [prepend](./kibana-plugin-core-server.basepath.prepend.md) | | (path: string) => string | Prepends path with the basePath. | | [remove](./kibana-plugin-core-server.basepath.remove.md) | | (path: string) => string | Removes the prepended basePath from the path. | | [serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md) | | string | returns the server's basePathSee [BasePath.get](./kibana-plugin-core-server.basepath.get.md) for getting the basePath value for a specific request | -| [set](./kibana-plugin-core-server.basepath.set.md) | | (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>, requestSpecificBasePath: string) => void | sets basePath value, specific for an incoming request. | +| [set](./kibana-plugin-core-server.basepath.set.md) | | (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void | sets basePath value, specific for an incoming request. | diff --git a/docs/development/core/server/kibana-plugin-core-server.basepath.set.md b/docs/development/core/server/kibana-plugin-core-server.basepath.set.md index 0c5da785a327f..eb355f134d562 100644 --- a/docs/development/core/server/kibana-plugin-core-server.basepath.set.md +++ b/docs/development/core/server/kibana-plugin-core-server.basepath.set.md @@ -9,5 +9,5 @@ sets `basePath` value, specific for an incoming request. Signature: ```typescript -set: (request: LegacyRequest | KibanaRequest, requestSpecificBasePath: string) => void; +set: (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md index 7421f4282ec93..6db16d979f1fe 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md @@ -21,6 +21,7 @@ export interface SavedObjectsFindOptions extends SavedObjectsBaseOptions | [hasReference](./kibana-plugin-core-server.savedobjectsfindoptions.hasreference.md) | {
type: string;
id: string;
} | | | [page](./kibana-plugin-core-server.savedobjectsfindoptions.page.md) | number | | | [perPage](./kibana-plugin-core-server.savedobjectsfindoptions.perpage.md) | number | | +| [preference](./kibana-plugin-core-server.savedobjectsfindoptions.preference.md) | string | An optional ES preference value to be used for the query \* | | [search](./kibana-plugin-core-server.savedobjectsfindoptions.search.md) | string | Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String query argument for more information | | [searchFields](./kibana-plugin-core-server.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | | [sortField](./kibana-plugin-core-server.savedobjectsfindoptions.sortfield.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.preference.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.preference.md new file mode 100644 index 0000000000000..c9e1c168e7a1b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.preference.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsFindOptions](./kibana-plugin-core-server.savedobjectsfindoptions.md) > [preference](./kibana-plugin-core-server.savedobjectsfindoptions.preference.md) + +## SavedObjectsFindOptions.preference property + +An optional ES preference value to be used for the query \* + +Signature: + +```typescript +preference?: string; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md index 22222061b3077..8b89c802ec9ce 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.find.md @@ -7,14 +7,14 @@ Signature: ```typescript -find({ search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, }: SavedObjectsFindOptions): Promise>; +find({ search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, preference, }: SavedObjectsFindOptions): Promise>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| { search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, } | SavedObjectsFindOptions | | +| { search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, preference, } | SavedObjectsFindOptions | | Returns: diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.md index bd86ff3abbe9b..b9a92561f29fb 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsrepository.md @@ -23,7 +23,7 @@ export declare class SavedObjectsRepository | [delete(type, id, options)](./kibana-plugin-core-server.savedobjectsrepository.delete.md) | | Deletes an object | | [deleteByNamespace(namespace, options)](./kibana-plugin-core-server.savedobjectsrepository.deletebynamespace.md) | | Deletes all objects from the provided namespace. | | [deleteFromNamespaces(type, id, namespaces, options)](./kibana-plugin-core-server.savedobjectsrepository.deletefromnamespaces.md) | | Removes one or more namespaces from a given multi-namespace saved object. If no namespaces remain, the saved object is deleted entirely. This method and \[addToNamespaces\][SavedObjectsRepository.addToNamespaces()](./kibana-plugin-core-server.savedobjectsrepository.addtonamespaces.md) are the only ways to change which Spaces a multi-namespace saved object is shared to. | -| [find({ search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, })](./kibana-plugin-core-server.savedobjectsrepository.find.md) | | | +| [find({ search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, preference, })](./kibana-plugin-core-server.savedobjectsrepository.find.md) | | | | [get(type, id, options)](./kibana-plugin-core-server.savedobjectsrepository.get.md) | | Gets a single object | | [incrementCounter(type, id, counterFieldName, options)](./kibana-plugin-core-server.savedobjectsrepository.incrementcounter.md) | | Increases a counter field by one. Creates the document if one doesn't exist for the given id. | | [update(type, id, attributes, options)](./kibana-plugin-core-server.savedobjectsrepository.update.md) | | Updates an object | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.agggrouplabels.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.agggrouplabels.md index 6684ba8546f85..ccb386eb7bfff 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.agggrouplabels.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.agggrouplabels.md @@ -8,8 +8,8 @@ ```typescript AggGroupLabels: { - [AggGroupNames.Buckets]: string; - [AggGroupNames.Metrics]: string; - [AggGroupNames.None]: string; + buckets: string; + metrics: string; + none: string; } ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md index d7257cfe61011..a3914a54decb3 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md @@ -9,5 +9,5 @@ Get the KbnFieldType name for an esType string Signature: ```typescript -castEsToKbnFieldTypeName: (esType: string) => KBN_FIELD_TYPES +castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md index 005201735ed4b..a6731e5ef8de1 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.connecttoquerystate.md @@ -9,24 +9,9 @@ Helper to setup two-way syncing of global data and a state container Signature: ```typescript -connectToQueryState: ({ timefilter: { timefilter }, filterManager, state$, }: Pick<{ - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: QueryStateChange; - state: QueryState; - }>; - savedQueries: import("..").SavedQueryService; -} | { - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: QueryStateChange; - state: QueryState; - }>; -}, "state$" | "timefilter" | "filterManager">, stateContainer: BaseStateContainer, syncConfig: { - time?: boolean | undefined; - refreshInterval?: boolean | undefined; - filters?: boolean | FilterStateStore | undefined; +connectToQueryState: ({ timefilter: { timefilter }, filterManager, state$, }: Pick, stateContainer: BaseStateContainer, syncConfig: { + time?: boolean; + refreshInterval?: boolean; + filters?: FilterStateStore | boolean; }) => () => void ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md index c23d37dfecf90..694f7e3628dd1 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.createsavedqueryservice.md @@ -7,5 +7,5 @@ Signature: ```typescript -createSavedQueryService: (savedObjectsClient: Pick) => SavedQueryService +createSavedQueryService: (savedObjectsClient: SavedObjectsClientContract) => SavedQueryService ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.expandshorthand.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.expandshorthand.md new file mode 100644 index 0000000000000..6c8594b7eeffd --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.expandshorthand.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [expandShorthand](./kibana-plugin-plugins-data-public.expandshorthand.md) + +## expandShorthand variable + + +Signature: + +```typescript +expandShorthand: (sh: Record) => MappingObject +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.extractsearchsourcereferences.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.extractsearchsourcereferences.md index cd051cfeca6b0..565369699ea5e 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.extractsearchsourcereferences.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.extractsearchsourcereferences.md @@ -8,6 +8,6 @@ ```typescript extractReferences: (state: SearchSourceFields) => [SearchSourceFields & { - indexRefName?: string | undefined; + indexRefName?: string; }, SavedObjectReference[]] ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md new file mode 100644 index 0000000000000..3e8b0abec529c --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) > [\_deserialize](./kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md) + +## FieldMappingSpec.\_deserialize property + +Signature: + +```typescript +_deserialize?: (mapping: string) => any | undefined; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md new file mode 100644 index 0000000000000..d0aaf7ddd0c17 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) > [\_serialize](./kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md) + +## FieldMappingSpec.\_serialize property + +Signature: + +```typescript +_serialize?: (mapping: any) => string | undefined; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec.md new file mode 100644 index 0000000000000..38ebe60df99a1 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) + +## FieldMappingSpec interface + + +Signature: + +```typescript +export interface FieldMappingSpec +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [\_deserialize](./kibana-plugin-plugins-data-public.fieldmappingspec._deserialize.md) | (mapping: string) => any | undefined | | +| [\_serialize](./kibana-plugin-plugins-data-public.fieldmappingspec._serialize.md) | (mapping: any) => string | undefined | | +| [type](./kibana-plugin-plugins-data-public.fieldmappingspec.type.md) | ES_FIELD_TYPES | | + diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec.type.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec.type.md new file mode 100644 index 0000000000000..73cff623dc7f2 --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.fieldmappingspec.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) > [type](./kibana-plugin-plugins-data-public.fieldmappingspec.type.md) + +## FieldMappingSpec.type property + +Signature: + +```typescript +type: ES_FIELD_TYPES; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getindexpatternfieldlistcreator.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getindexpatternfieldlistcreator.md index 60302286cbd72..880acdc8956d4 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getindexpatternfieldlistcreator.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getindexpatternfieldlistcreator.md @@ -7,5 +7,5 @@ Signature: ```typescript -getIndexPatternFieldListCreator: ({ fieldFormats, toastNotifications, }: FieldListDependencies) => CreateIndexPatternFieldList +getIndexPatternFieldListCreator: ({ fieldFormats, onNotification, }: FieldListDependencies) => CreateIndexPatternFieldList ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md index 6256709e2ee36..c6359fc268882 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md @@ -9,7 +9,7 @@ Constructs a new instance of the `IndexPattern` class Signature: ```typescript -constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache); +constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache, fieldFormats: FieldFormatsStartCommon, onNotification: OnNotification, onError: OnError); ``` ## Parameters @@ -21,4 +21,7 @@ constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObj | savedObjectsClient | SavedObjectsClientContract | | | apiClient | IIndexPatternsApiClient | | | patternCache | PatternCache | | +| fieldFormats | FieldFormatsStartCommon | | +| onNotification | OnNotification | | +| onError | OnError | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md index 60cbfd30e667d..3e67b96cb80ce 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.md @@ -14,7 +14,7 @@ export declare class IndexPattern implements IIndexPattern | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(id, getConfig, savedObjectsClient, apiClient, patternCache)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the IndexPattern class | +| [(constructor)(id, getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError)](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the IndexPattern class | ## Properties diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md index 8ee9acc684fb1..e1e0d58ce38c1 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md @@ -9,15 +9,15 @@ Constructs a new instance of the `Field` class Signature: ```typescript -constructor(indexPattern: IndexPattern, spec: FieldSpec | Field, shortDotsEnable: boolean, { fieldFormats, toastNotifications }: FieldDependencies); +constructor(indexPattern: IIndexPattern, spec: FieldSpec | Field, shortDotsEnable: boolean, { fieldFormats, onNotification }: FieldDependencies); ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| indexPattern | IndexPattern | | +| indexPattern | IIndexPattern | | | spec | FieldSpec | Field | | | shortDotsEnable | boolean | | -| { fieldFormats, toastNotifications } | FieldDependencies | | +| { fieldFormats, onNotification } | FieldDependencies | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md index d1a1ee0905c6e..4acaaa8c0dc2c 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md @@ -7,5 +7,5 @@ Signature: ```typescript -indexPattern?: IndexPattern; +indexPattern?: IIndexPattern; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md index 1d3cfa9305c18..8fa1ee0d72e54 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md @@ -14,7 +14,7 @@ export declare class Field implements IFieldType | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(indexPattern, spec, shortDotsEnable, { fieldFormats, toastNotifications })](./kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md) | | Constructs a new instance of the Field class | +| [(constructor)(indexPattern, spec, shortDotsEnable, { fieldFormats, onNotification })](./kibana-plugin-plugins-data-public.indexpatternfield._constructor_.md) | | Constructs a new instance of the Field class | ## Properties @@ -28,7 +28,7 @@ export declare class Field implements IFieldType | [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) | | string[] | | | [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) | | boolean | | | [format](./kibana-plugin-plugins-data-public.indexpatternfield.format.md) | | any | | -| [indexPattern](./kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md) | | IndexPattern | | +| [indexPattern](./kibana-plugin-plugins-data-public.indexpatternfield.indexpattern.md) | | IIndexPattern | | | [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | string | | | [name](./kibana-plugin-plugins-data-public.indexpatternfield.name.md) | | string | | | [readFromDocValues](./kibana-plugin-plugins-data-public.indexpatternfield.readfromdocvalues.md) | | boolean | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.mappingobject.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.mappingobject.md new file mode 100644 index 0000000000000..b1f33c8e8546d --- /dev/null +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.mappingobject.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [MappingObject](./kibana-plugin-plugins-data-public.mappingobject.md) + +## MappingObject type + + +Signature: + +```typescript +export declare type MappingObject = Record; +``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md index bc1eb9100e85c..f62479f02926e 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md @@ -54,6 +54,7 @@ | [EsQueryConfig](./kibana-plugin-plugins-data-public.esqueryconfig.md) | | | [FetchOptions](./kibana-plugin-plugins-data-public.fetchoptions.md) | | | [FieldFormatConfig](./kibana-plugin-plugins-data-public.fieldformatconfig.md) | | +| [FieldMappingSpec](./kibana-plugin-plugins-data-public.fieldmappingspec.md) | | | [Filter](./kibana-plugin-plugins-data-public.filter.md) | | | [IDataPluginServices](./kibana-plugin-plugins-data-public.idatapluginservices.md) | | | [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) | | @@ -101,6 +102,7 @@ | [esFilters](./kibana-plugin-plugins-data-public.esfilters.md) | | | [esKuery](./kibana-plugin-plugins-data-public.eskuery.md) | | | [esQuery](./kibana-plugin-plugins-data-public.esquery.md) | | +| [expandShorthand](./kibana-plugin-plugins-data-public.expandshorthand.md) | | | [extractSearchSourceReferences](./kibana-plugin-plugins-data-public.extractsearchsourcereferences.md) | | | [fieldFormats](./kibana-plugin-plugins-data-public.fieldformats.md) | | | [FilterBar](./kibana-plugin-plugins-data-public.filterbar.md) | | @@ -141,6 +143,7 @@ | [ISearch](./kibana-plugin-plugins-data-public.isearch.md) | | | [ISearchGeneric](./kibana-plugin-plugins-data-public.isearchgeneric.md) | | | [ISearchSource](./kibana-plugin-plugins-data-public.isearchsource.md) | \* | +| [MappingObject](./kibana-plugin-plugins-data-public.mappingobject.md) | | | [MatchAllFilter](./kibana-plugin-plugins-data-public.matchallfilter.md) | | | [ParsedInterval](./kibana-plugin-plugins-data-public.parsedinterval.md) | | | [PhraseFilter](./kibana-plugin-plugins-data-public.phrasefilter.md) | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md index aa1a54bcb6257..f6f8bed8cb914 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.syncquerystatewithurl.md @@ -9,22 +9,7 @@ Helper to setup syncing of global data with the URL Signature: ```typescript -syncQueryStateWithUrl: (query: Pick<{ - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: import("./types").QueryStateChange; - state: QueryState; - }>; - savedQueries: import("..").SavedQueryService; -} | { - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: import("./types").QueryStateChange; - state: QueryState; - }>; -}, "state$" | "timefilter" | "filterManager">, kbnUrlStateStorage: IKbnUrlStateStorage) => { +syncQueryStateWithUrl: (query: Pick, kbnUrlStateStorage: IKbnUrlStateStorage) => { stop: () => void; hasInheritedQueryFromUrl: boolean; } diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md index 68851503ae53c..ea009601acdff 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md @@ -9,5 +9,5 @@ Get the KbnFieldType name for an esType string Signature: ```typescript -castEsToKbnFieldTypeName: (esType: string) => KBN_FIELD_TYPES +castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES ``` diff --git a/docs/infrastructure/infra-ui.asciidoc b/docs/infrastructure/infra-ui.asciidoc index 96550b4ed5758..9e7459da743a4 100644 --- a/docs/infrastructure/infra-ui.asciidoc +++ b/docs/infrastructure/infra-ui.asciidoc @@ -103,7 +103,7 @@ You can: * Select *View Metrics* to <>. -* Select *View Logs* to <> in the *Logs* app. +* Select *View Logs* to {logs-guide}/inspect-log-events.html[view the logs] in the *Logs* app. Depending on the features you have installed and configured, you may also be able to: diff --git a/docs/ingest_manager/images/ingest-manager-start.png b/docs/ingest_manager/images/ingest-manager-start.png new file mode 100644 index 0000000000000..89174686a9768 Binary files /dev/null and b/docs/ingest_manager/images/ingest-manager-start.png differ diff --git a/docs/ingest_manager/index-templates.asciidoc b/docs/ingest_manager/index-templates.asciidoc deleted file mode 100644 index e19af63c3116f..0000000000000 --- a/docs/ingest_manager/index-templates.asciidoc +++ /dev/null @@ -1,7 +0,0 @@ -# Elasticsearch Index Templates - -## Generation - -* Index templates are generated from `YAML` files contained in the package. -* There is one index template per dataset. -* For the generation of an index template, all `yml` files contained in the package subdirectory `dataset/DATASET_NAME/fields/` are used. diff --git a/docs/ingest_manager/index.asciidoc b/docs/ingest_manager/index.asciidoc index 1728309f3dfd9..f719c774c7739 100644 --- a/docs/ingest_manager/index.asciidoc +++ b/docs/ingest_manager/index.asciidoc @@ -1,208 +1,14 @@ +[chapter] [role="xpack"] -[[epm]] -== Ingest Manager +[[xpack-ingest-manager]] += Ingest Manager -These are the docs for the Ingest Manager. +The {ingest-manager} app in Kibana enables you to add and manage integrations for popular services and platforms, as well as manage {elastic-agent} installations in standalone or {fleet} mode. +[role="screenshot"] +image::ingest_manager/images/ingest-manager-start.png[Ingest Manager App in Kibana] -=== Configuration +[float] +=== Get started -The Elastic Package Manager by default access `epr.elastic.co` to retrieve the package. The url can be configured with: - -``` -xpack.epm.registryUrl: 'http://localhost:8080' -``` - -=== API - -The Package Manager offers an API. Here an example on how they can be used. - -List installed packages: - -``` -curl localhost:5601/api/ingest_manager/epm/packages -``` - -Install a package: - -``` -curl -X POST localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4 -``` - -Delete a package: - -``` -curl -X DELETE localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4 -``` - -=== Definitions - -This section is to define terms used across ingest management. - -==== Data Source - -A data source is a definition on how to collect data from a service, for example `nginx`. A data source contains -definitions for one or multiple inputs and each input can contain one or multiple streams. - -With the example of the nginx Data Source, it contains to inputs: `logs` and `nginx/metrics`. Logs and metrics are collected -differently. The `logs` input contains two streams, `access` and `error`, the `nginx/metrics` input contains the stubstatus stream. - - -==== Data Stream - -Data Streams are a [new concept](https://github.com/elastic/elasticsearch/issues/53100) in Elasticsearch which simplify -ingesting data and the setup of Elasticsearch. - -==== Elastic Agent - -A single, unified agent that users can deploy to hosts or containers. It controls which data is collected from the host or containers and where the data is sent. It will run Beats, Endpoint or other monitoring programs as needed. It can operate standalone or pull a configuration policy from Fleet. - - -==== Elastic Package Registry - -The Elastic Package Registry (EPR) is a service which runs under [https://epr.elastic.co]. It serves the packages through its API. -More details about the registry can be found [here](https://github.com/elastic/package-registry). - -==== Fleet - -Fleet is the part of the Ingest Manager UI in Kibana that handles the part of enrolling Elastic Agents, -managing agents and sending configurations to the Elastic Agent. - -==== Indexing Strategy - -Ingest Management + Elastic Agent follow a strict new indexing strategy: `{type}-{dataset}-{namespace}`. An example -for this is `logs-nginx.access-default`. More details about it can be found in the Index Strategy below. All data of -the index strategy is sent to Data Streams. - -==== Input - -An input is the configuration unit in an Agent Config that defines the options on how to collect data from -an endpoint. This could be username / password which are need to authenticate with a service or a host url -as an example. - -An input is part of a Data Source and contains streams. - -==== Integration - -An integration is a package with the type integration. An integration package has at least 1 data source -and usually collects data from / about a service. - - -==== Namespace - -A user-specified string that will be used to part of the index name in Elasticsearch. It helps users identify logs coming from a specific environment (like prod or test), an application, or other identifiers. - - -==== Package - -A package contains all the assets for the Elastic Stack. A more detailed definition of a -package can be found under https://github.com/elastic/package-registry. - -Besides the assets, a package contains the data source definitions with its inputs and streams. - -==== Stream - -A stream is a configuration unit in the Elastic Agent config. A stream is part of an input and defines how the data -fetched by this input should be processed and which Data Stream to send it to. - -== Indexing Strategy - -Ingest Management enforces an indexing strategy to allow the system to automatically detect indices and run queries on it. In short the indexing strategy looks as following: - -``` -{dataset.type}-{dataset.name}-{dataset.namespace} -``` - -The `{dataset.type}` can be `logs` or `metrics`. The `{dataset.namespace}` is the part where the user can use free form. The only two requirement are that it has only characters allowed in an Elasticsearch index name and does NOT contain a `-`. The `dataset` is defined by the data that is indexed. The same requirements as for the namespace apply. It is expected that the fields for type, namespace and dataset are part of each event and are constant keywords. If there is a dataset or a namespace with a `-` inside, it is recommended to replace it either by a `.` or a `_`. - -Note: More `{dataset.type}`s might be added in the future like `traces`. - -This indexing strategy has a few advantages: - -* Each index contains only the fields which are relevant for the dataset. This leads to more dense indices and better field completion. -* ILM policies can be applied per namespace per dataset. -* Rollups can be specified per namespace per dataset. -* Having the namespace user configurable makes setting security permissions possible. -* Having a global metrics and logs template, allows to create new indices on demand which still follow the convention. This is common in the case of k8s as an example. -* Constant keywords allow to narrow down the indices we need to access for querying very efficiently. This is especially relevant in environments which a large number of indices or with indices on slower nodes. - -Overall it creates smaller indices in size, makes querying more efficient and allows users to define their own naming parts in namespace and still benefiting from all features that can be built on top of the indexing startegy. - -=== Ingest Pipeline - -The ingest pipelines for a specific dataset will have the following naming scheme: - -``` -{dataset.type}-{dataset.name}-{package.version} -``` - -As an example, the ingest pipeline for the Nginx access logs is called `logs-nginx.access-3.4.1`. The same ingest pipeline is used for all namespaces. It is possible that a dataset has multiple ingest pipelines in which case a suffix is added to the name. - -The version is included in each pipeline to allow upgrades. The pipeline itself is listed in the index template and is automatically applied at ingest time. - -=== Templates & ILM Policies - -To make the above strategy possible, alias templates are required. For each type there is a basic alias template with a default ILM policy. These default templates apply to all indices which follow the indexing strategy and do not have a more specific dataset alias template. - -The `metrics` and `logs` alias template contain all the basic fields from ECS. - -Each type template contains an ILM policy. Modifying this default ILM policy will affect all data covered by the default templates. - -The templates for a dataset are called as following: - -``` -{dataset.type}-{dataset.name} -``` - -The pattern used inside the index template is `{type}-{dataset}-*` to match all namespaces. - -=== Defaults - -If the Elastic Agent is used to ingest data and only the type is specified, `default` for the namespace is used and `generic` for the dataset. - -=== Data filtering - -Filtering for data in queries for example in visualizations or dashboards should always be done on the constant keyword fields. Visualizations needing data for the nginx.access dataset should query on `type:logs AND dataset:nginx.access`. As these are constant keywords the prefiltering is very efficient. - -=== Security permissions - -Security permissions can be set on different levels. To set special permissions for the access on the prod namespace, use the following index pattern: - -``` -/(logs|metrics)-[^-]+-prod-$/ -``` - -To set specific permissions on the logs index, the following can be used: - -``` -/^(logs|metrics)-.*/ -``` - -Todo: The above queries need to be tested. - - - -== Package Manager - -=== Package Upgrades - -When upgrading a package between a bugfix or a minor version, no breaking changes should happen. Upgrading a package has the following effect: - -* Removal of existing dashboards -* Installation of new dashboards -* Write new ingest pipelines with the version -* Write new Elasticsearch alias templates -* Trigger a rollover for all the affected indices - -The new ingest pipeline is expected to still work with the data coming from older configurations. In most cases this means some of the fields can be missing. For this to work, each event must contain the version of config / package it is coming from to make such a decision. - -In case of a breaking change in the data structure, the new ingest pipeline is also expected to deal with this change. In case there are breaking changes which cannot be dealt with in an ingest pipeline, a new package has to be created. - -Each package lists its minimal required agent version. In case there are agents enrolled with an older version, the user is notified to upgrade these agents as otherwise the new configs cannot be rolled out. - -=== Generated assets - -When a package is installed or upgraded, certain Kibana and Elasticsearch assets are generated from . These follow the naming conventions explained above (see "indexing strategy") and contain configuration for the elastic stack that makes ingesting and displaying data work with as little user interaction as possible. - -* link:index-templates.asciidoc[Elasticsearch Index Templates] -* Kibana Index Patterns +To get started with Ingest Management, refer to the LINK_TO_INGEST_MANAGEMENT_GUIDE[Ingest Management Guide]. \ No newline at end of file diff --git a/docs/logs/configuring.asciidoc b/docs/logs/configuring.asciidoc deleted file mode 100644 index 6b54721f92e89..0000000000000 --- a/docs/logs/configuring.asciidoc +++ /dev/null @@ -1,46 +0,0 @@ -[role="xpack"] -[[xpack-logs-configuring]] - -:ecs-base-link: {ecs-ref}/ecs-base.html[base] - -== Configuring the Logs data - -The default source configuration for logs is specified in the {kibana-ref}/logs-ui-settings-kb.html[Logs app settings] in the {kibana-ref}/settings.html[Kibana configuration file]. -The default configuration uses the `filebeat-*` index pattern to query the data. -The default configuration also defines field settings for things like timestamps and container names, and the default columns to show in the logs stream. - -If your logs have custom index patterns, use non-default field settings, or contain parsed fields which you want to expose as individual columns, you can override the default configuration settings. - -To change the configuration settings, click the *Settings* tab. - -NOTE: These settings are shared with metrics. Changes you make here may also affect the settings used by the *Metrics* app. - -In the *Settings* tab, you can change the values in these sections: - -* *Name*: the name of the source configuration -* *Indices*: the index pattern or patterns in the Elasticsearch indices to read metrics data and log data from -* *Fields*: the names of specific fields in the indices that are used to query and interpret the data correctly -* *Log columns*: the columns that are shown in the logs stream - -By default the logs stream shows following columns: - -* *Timestamp*: The timestamp of the log entry from the `timestamp` field. -* *Message*: The message extracted from the document. -The content of this field depends on the type of log message. -If no special log message type is detected, the Elastic Common Schema (ECS) {ecs-base-link} field, `message`, is used. - -To add a new column to the logs stream, in the *Settings* tab, click *Add column*. -In the list of available fields, select the field you want to add. -You can start typing a field name in the search box to filter the field list by that name. - -To remove an existing column, click the *Remove this column* icon -image:logs/images/logs-configure-source-dialog-remove-column-button.png[Remove column]. - -When you have completed your changes, click *Apply*. - -If the fields are greyed out and cannot be edited, you may not have sufficient privileges to change the source configuration. -For more information see <>. - -TIP: If <> are enabled in your Kibana instance, any configuration changes you make here are specific to the current space. -You can make different subsets of data available by creating multiple spaces with different data source configurations. - diff --git a/docs/logs/getting-started.asciidoc b/docs/logs/getting-started.asciidoc deleted file mode 100644 index ca09bb34c0e56..0000000000000 --- a/docs/logs/getting-started.asciidoc +++ /dev/null @@ -1,11 +0,0 @@ -[role="xpack"] -[[xpack-logs-getting-started]] -== Getting started with logs monitoring - -To get started with the Logs app in Kibana, you need to start collecting logs data for your infrastructure. - -Kibana provides step-by-step instructions to help you add logs data. -The {logs-guide}[Logs Monitoring Guide] is a good source for more detailed information and instructions. - -[role="screenshot"] -image::logs/images/logs-add-data.png[Screenshot showing Add logging data in Kibana] diff --git a/docs/logs/images/alert-actions-menu.png b/docs/logs/images/alert-actions-menu.png deleted file mode 100644 index 3f96a700a0ac1..0000000000000 Binary files a/docs/logs/images/alert-actions-menu.png and /dev/null differ diff --git a/docs/logs/images/alert-flyout.png b/docs/logs/images/alert-flyout.png deleted file mode 100644 index 30c8857758a8b..0000000000000 Binary files a/docs/logs/images/alert-flyout.png and /dev/null differ diff --git a/docs/logs/images/analysis-tab-create-ml-job.png b/docs/logs/images/analysis-tab-create-ml-job.png deleted file mode 100644 index 0f4115bb93f4c..0000000000000 Binary files a/docs/logs/images/analysis-tab-create-ml-job.png and /dev/null differ diff --git a/docs/logs/images/log-rate-anomalies.png b/docs/logs/images/log-rate-anomalies.png deleted file mode 100644 index 74ce8d682e1cc..0000000000000 Binary files a/docs/logs/images/log-rate-anomalies.png and /dev/null differ diff --git a/docs/logs/images/log-rate-entries.png b/docs/logs/images/log-rate-entries.png deleted file mode 100644 index efa693a2ac529..0000000000000 Binary files a/docs/logs/images/log-rate-entries.png and /dev/null differ diff --git a/docs/logs/images/log-time-filter.png b/docs/logs/images/log-time-filter.png deleted file mode 100644 index ffba6f972aeb7..0000000000000 Binary files a/docs/logs/images/log-time-filter.png and /dev/null differ diff --git a/docs/logs/images/logs-action-menu.png b/docs/logs/images/logs-action-menu.png deleted file mode 100644 index f1c79b6fa88d1..0000000000000 Binary files a/docs/logs/images/logs-action-menu.png and /dev/null differ diff --git a/docs/logs/images/logs-add-data.png b/docs/logs/images/logs-add-data.png deleted file mode 100644 index 176c71466aa38..0000000000000 Binary files a/docs/logs/images/logs-add-data.png and /dev/null differ diff --git a/docs/logs/images/logs-configure-source-dialog-remove-column-button.png b/docs/logs/images/logs-configure-source-dialog-remove-column-button.png deleted file mode 100644 index 995b7ac1f538d..0000000000000 Binary files a/docs/logs/images/logs-configure-source-dialog-remove-column-button.png and /dev/null differ diff --git a/docs/logs/images/logs-time-selector.png b/docs/logs/images/logs-time-selector.png deleted file mode 100644 index 5e6a9b7222c54..0000000000000 Binary files a/docs/logs/images/logs-time-selector.png and /dev/null differ diff --git a/docs/logs/images/logs-view-event-with-filter.png b/docs/logs/images/logs-view-event-with-filter.png deleted file mode 100644 index 4e378af39ab05..0000000000000 Binary files a/docs/logs/images/logs-view-event-with-filter.png and /dev/null differ diff --git a/docs/logs/images/logs-view-event.png b/docs/logs/images/logs-view-event.png deleted file mode 100644 index 29dff68e3fdba..0000000000000 Binary files a/docs/logs/images/logs-view-event.png and /dev/null differ diff --git a/docs/logs/images/logs-view-in-context.png b/docs/logs/images/logs-view-in-context.png deleted file mode 100644 index 09a9e89fc3042..0000000000000 Binary files a/docs/logs/images/logs-view-in-context.png and /dev/null differ diff --git a/docs/logs/index.asciidoc b/docs/logs/index.asciidoc index 0d225e5e89c17..45d4321f40556 100644 --- a/docs/logs/index.asciidoc +++ b/docs/logs/index.asciidoc @@ -1,9 +1,8 @@ +[chapter] [role="xpack"] [[xpack-logs]] = Logs -[partintro] --- The Logs app in Kibana enables you to explore logs for common servers, containers, and services. The Logs app has a compact, console-like display that you can customize. @@ -13,23 +12,10 @@ You can open the Logs app from the *Logs* tab in Kibana. You can also open the Logs app directly from a component in the Metrics app. In this case, you will only see the logs for the selected component. -* <> -* <> -* <> -* <> -* <> - [role="screenshot"] -image::logs/images/logs-console.png[Log Console in Kibana] - --- - -include::getting-started.asciidoc[] - -include::using.asciidoc[] - -include::configuring.asciidoc[] +image::logs/images/logs-console.png[Logs Console in Kibana] -include::log-rate.asciidoc[] +[float] +=== Get started -include::logs-alerting.asciidoc[] +To get started with Elastic Logs, refer to {logs-guide}/install-logs-monitoring.html[Install Logs]. diff --git a/docs/logs/log-rate.asciidoc b/docs/logs/log-rate.asciidoc deleted file mode 100644 index 56284a1c76219..0000000000000 --- a/docs/logs/log-rate.asciidoc +++ /dev/null @@ -1,94 +0,0 @@ -[role="xpack"] -[[xpack-logs-analysis]] -== Detecting and inspecting log anomalies - -beta::[] - -When the {ml} {anomaly-detect} features are enabled, -you can use the **Log rate** page in the Logs app. -**Log rate** helps you to detect and inspect log anomalies and the log partitions where the log anomalies occur. -This means you can easily spot anomalous behavior without significant human intervention -- -no more manually sampling log data, calculating rates, and determining if rates are normal. - -*Log rate* automatically highlights periods of time where the log rate is outside expected bounds, -and therefore may be anomalous. -You can use this information as a basis for further investigations. -For example: - -* A significant drop in the log rate might suggest that a piece of infrastructure stopped responding, -and thus we're serving less requests. -* A spike in the log rate could denote a DDoS attack. -This may lead to an investigation of IP addresses from incoming requests. - -You can also view log anomalies directly in the <>. - -[float] -[[logs-analysis-create-ml-job]] -=== Enable log rate analysis and anomaly detection - -Create a machine learning job to enable log rate analysis and anomaly detection. - -[role="screenshot"] -image::logs/images/analysis-tab-create-ml-job.png[Create machine learning job] - -1. To enable log rate analysis and anomaly detection, -you must first create your own {kibana-ref}/xpack-spaces.html[space]. -2. Within a space, navigate to the Logs app and select *Log rate*. -Here, you'll be prompted to create a machine learning job which will carry out the log rate analysis. -3. Choose a time range for the machine learning analysis. -4. Add the Indices that contain the logs you want to analyze. -5. Click *Create ML job*. -6. You're now ready to analyze your log partitions. - -Even though the machine learning job's time range is fixed, -you can still use the time filter to adjust the results that are shown in your analysis. - -[role="screenshot"] -image::logs/images/log-time-filter.png[Log rate time filter] - -[float] -[[logs-analysis-entries-chart]] -=== Log entries chart - -The log entries chart shows an overall, color-coded visualization of the log entry rate, -partitioned according to the value of the Elastic Common Schema (ECS) -{ecs-ref}/ecs-event.html[`event.dataset`] field. -This chart helps you quickly spot increases or decreases in each partition's log rate. - -[role="screenshot"] -image::logs/images/log-rate-entries.png[Log rate entries chart] - -If you have a lot of log partitions, use the following to filter your data: - -* Hover over a time range to see the log rate for each partition. -* Click or hover on a partition name to show, hide, or highlight the partition values. - -[float] -[[logs-analysis-anomalies-chart]] -=== Anomalies charts - -The Anomalies chart shows the time range where anomalies were detected. -The typical rate values are shown in grey, while the anomalous regions are color-coded and superimposed on top. - -[role="screenshot"] -image::logs/images/log-rate-anomalies.png[Log rate entries chart] - -When a time range is flagged as anomalous, -the machine learning algorithms have detected unusual log rate activity. -This might be because: - -* The log rate is significantly higher than usual. -* The log rate is significantly lower than usual. -* Other anomalous behavior has been detected. -For example, the log rate is within bounds, but not fluctuating when it is expected to. - -The level of anomaly detected in a time period is color-coded, from red, orange, yellow, to blue. -Red indicates a critical anomaly level, while blue is a warning level. - -To help you further drill down into a potential anomaly, -you can view an anomaly chart for each individual partition: - -Anomaly scores range from 0 (no anomalies) to 100 (critical). - -To analyze the anomalies in more detail, click *Analyze in ML*, which opens the -{kibana-ref}/xpack-ml.html[Anomaly Explorer in Machine Learning]. diff --git a/docs/logs/logs-alerting.asciidoc b/docs/logs/logs-alerting.asciidoc deleted file mode 100644 index f08a09187a0c8..0000000000000 --- a/docs/logs/logs-alerting.asciidoc +++ /dev/null @@ -1,27 +0,0 @@ -[role="xpack"] -[[xpack-logs-alerting]] -== Logs alerting - -[float] -=== Overview - -To use the alerting functionality you need to {kibana-ref}/alerting-getting-started.html#alerting-setup-prerequisites[set up alerting]. - -You can then select the *Create alert* option, from the *Alerts* actions dropdown. - -[role="screenshot"] -image::logs/images/alert-actions-menu.png[Screenshot showing alerts menu] - -Within the alert flyout you can configure your logs alert: - -[role="screenshot"] -image::logs/images/alert-flyout.png[Screenshot showing alerts flyout] - -[float] -=== Fields and comparators - -The comparators available for conditions depend on the chosen field. The combinations available are: - -- Numeric fields: *more than*, *more than or equals*, *less than*, *less than or equals*, *equals*, and *does not equal*. -- Aggregatable fields: *is* and *is not*. -- Non-aggregatable fields: *matches*, *does not match*, *matches phrase*, *does not match phrase*. diff --git a/docs/logs/using.asciidoc b/docs/logs/using.asciidoc deleted file mode 100644 index eb3025f88ce1b..0000000000000 --- a/docs/logs/using.asciidoc +++ /dev/null @@ -1,100 +0,0 @@ -[role="xpack"] -[[xpack-logs-using]] -== Using the Logs app -Use the Logs app in {kib} to explore and filter your logs in real time. - -You can customize the output to focus on the data you want to see and to control how you see it. -You can also view related application traces or uptime information where available. - -[role="screenshot"] -image::logs/images/logs-console.png[Logs Console in Kibana] - -[float] -[[logs-search]] -=== Use the power of search - -Use the search bar to perform ad hoc searches for specific text. -You can also create structured queries using {kibana-ref}/kuery-query.html[Kibana Query Language]. -For example, enter `host.hostname : "host1"` to see only the information for `host1`. -// ++ this isn't quite the same as the corresponding metrics description now. - -[float] -[[logs-configure-source]] -=== Configure the data to use for your logs -Are you using a custom index pattern to store the log entries? -Do you want to limit the entries shown or change the fields displayed in the columns? -If so, <> to change the index pattern and other settings. - -[float] -[[logs-time]] -=== Specify the time and date - -Click image:images/time-filter-calendar.png[time filter calendar], then choose the time range for the logs. - -Log entries for the specified time appear in the middle of the page. To quickly jump to a nearby point in time, click the minimap timeline to the right. -// ++ what's this thing called? It's minimap in the UI. Would timeline be better? - -[float] -[[logs-customize]] -=== Customize your view -Click *Customize* to customize the view. -Here, you can choose whether to wrap long lines, and choose your preferred text size. - -[float] -=== Configuring the data to use for your logs - -If your logs have custom index patterns, use non-default field settings, or contain parsed fields which you want to expose as individual columns, you can <>. - -[float] -[[logs-stream]] -=== Stream or pause logs -Click *Stream live* to start streaming live log data, or click *Stop streaming* to focus on historical data. - -When you are viewing historical data, you can scroll back through the entries as far as there is data available. - -When you are streaming live data, the most recent log appears at the bottom of the page. -In live streaming mode, you are not able to choose a different time in the time selector or use the minimap timeline. -To do either of these things, you need to stop live streaming first. -// ++ Not sure whether this is correct or not. And what about just scrolling through the display? -// ++ There may be a bug here, (I managed to get future logs) see https://github.com/elastic/kibana/issues/43361 - -[float] -[[logs-highlight]] -=== Highlight a phrase in the logs stream -To highlight a word or phrase in the logs stream, click *Highlights* and enter your search phrase. -// ++ Is search case sensitive? -// ++ Can you search for multiple phrases together, if so, what's the separator? -// ++ What about special characters? For example, I notice that when searching for "Mozilla/4.0" which appears as written in my logs, "Mozilla" is highlighted, as is "4.0" but "/" isn't. The string "-" (which appears in the logs as written, quotes and all, isn't found at all. Any significance? - -[float] -[[logs-event-inspector]] -=== Inspect a log event -To inspect a log event, hover over it, then click the *View actions for line* icon image:logs/images/logs-action-menu.png[View actions for line icon]. On the menu that opens, select *View details*. This opens the *Log event document details* fly-out that shows the fields associated with the log event. - -To quickly filter the logs stream by one of the field values, in the log event details, click the *View event with filter* icon image:logs/images/logs-view-event-with-filter.png[View event icon] beside the field. -This automatically adds a search filter to the logs stream to filter the entries by this field and value. - -[float] -[[log-view-in-context]] -=== View log line in context -To view a certain line in its context (for example, with other log lines from the same file, or the same cloud container), hover over it, then click the *View actions for line* image:logs/images/logs-action-menu.png[View actions for line icon]. On the menu that opens, select *View in context*. This opens the *View log in context* modal, that shows the log line in its context. - -[role="screenshot"] -image::logs/images/logs-view-in-context.png[View a log line in context] - -[float] -[[view-log-anomalies]] -=== View log anomalies - -When the machine learning anomaly detection features are enabled, click *Log rate*, which allows you to -<> in your log data. - -[float] -[[logs-integrations]] -=== Logs app integrations - -To see other actions related to the event, click *Actions* in the log event details. -Depending on the event and the features you have configured, you may also be able to: - -* Select *View status in Uptime* to {uptime-guide}/uptime-app-overview.html[view related uptime information] in the *Uptime* app. -* Select *View in APM* to <> in the *APM* app. diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc index 85d580de9475f..04959b2627a78 100644 --- a/docs/redirects.asciidoc +++ b/docs/redirects.asciidoc @@ -33,7 +33,7 @@ This page has moved. Please see <>. [role="exclude",id="logs-read-only-access"] == Configure source read-only access -This page has moved. Please see <>. +This page has moved. Please see {logs-guide}/configure-logs-source.html[logs configuration]. [role="exclude",id="extend"] == Extend your use case @@ -80,3 +80,28 @@ This page was deleted. See <>. == Developing Visualizations This page was deleted. See <>. + +[role="exclude",id="xpack-logs-getting-started"] +== Getting started with logs monitoring + +This page has moved. Please see the new section in the {logs-guide}/install-logs-monitoring.html[Logs Monitoring Guide]. + +[role="exclude",id="xpack-logs-using"] +== Using the Logs app + +This page has moved. Please see the new section in the {logs-guide}/logs-app-overview.html[Logs Monitoring Guide]. + +[role="exclude",id="xpack-logs-configuring"] +== Configuring the Logs data + +This page has moved. Please see the new section in the {logs-guide}/configure-logs-source.html[Logs Monitoring Guide]. + +[role="exclude",id="xpack-logs-analysis"] +== Detecting and inspecting log anomalies + +This page has moved. Please see the new section in the {logs-guide}/detect-log-anomalies.html[Logs Monitoring Guide] + +[role="exclude",id="xpack-logs-alerting"] +== Logs alerting + +This page has moved. Please see the new section in the {logs-guide}/create-log-alert.html[Logs Monitoring Guide] diff --git a/docs/settings/ingest-manager-settings.asciidoc b/docs/settings/ingest-manager-settings.asciidoc index 15f64e344d7c6..0c3427b034ae2 100644 --- a/docs/settings/ingest-manager-settings.asciidoc +++ b/docs/settings/ingest-manager-settings.asciidoc @@ -5,8 +5,11 @@ {ingest-manager} settings ++++ +experimental[] + You can configure `xpack.ingestManager` settings in your `kibana.yml`. -By default, {ingest-manager} is not enabled. You need to enable it. To use {fleet}, you also need to configure {kib} and {es} hosts. +By default, {ingest-manager} is not enabled. You need to enable it. To use +{fleet}, you also need to configure {kib} and {es} hosts. [[general-ingest-manager-settings-kb]] ==== General {ingest-manager} settings @@ -15,16 +18,8 @@ By default, {ingest-manager} is not enabled. You need to enable it. To use {flee |=== | `xpack.ingestManager.enabled` {ess-icon} | Set to `true` to enable {ingest-manager}. -|=== - -[cols="2*<"] -|=== | `xpack.ingestManager.epm.enabled` {ess-icon} | Set to `true` (default) to enable {package-manager}. -|=== - -[cols="2*<"] -|=== | `xpack.ingestManager.fleet.enabled` {ess-icon} | Set to `true` (default) to enable {fleet}. |=== @@ -45,16 +40,8 @@ By default, {ingest-manager} is not enabled. You need to enable it. To use {flee |=== | `xpack.ingestManager.fleet.kibana.host` | The hostname used by {agent} for accessing {kib}. -|=== - -[cols="2*<"] -|=== | `xpack.ingestManager.fleet.elasticsearch.host` | The hostname used by {agent} for accessing {es}. -|=== - -[cols="2*<"] -|=== | `xpack.ingestManager.fleet.tlsCheckDisabled` | Set to `true` to allow {fleet} to run on a {kib} instance without TLS enabled. |=== diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index 62f4a615a86c7..01a9e96484965 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -633,9 +633,10 @@ include::{kib-repo-dir}/settings/alert-action-settings.asciidoc[] include::{kib-repo-dir}/settings/apm-settings.asciidoc[] include::{kib-repo-dir}/settings/dev-settings.asciidoc[] include::{kib-repo-dir}/settings/graph-settings.asciidoc[] -include::{kib-repo-dir}/settings/infrastructure-ui-settings.asciidoc[] +include::{kib-repo-dir}/settings/ingest-manager-settings.asciidoc[] include::{kib-repo-dir}/settings/i18n-settings.asciidoc[] include::{kib-repo-dir}/settings/logs-ui-settings.asciidoc[] +include::{kib-repo-dir}/settings/infrastructure-ui-settings.asciidoc[] include::{kib-repo-dir}/settings/ml-settings.asciidoc[] include::{kib-repo-dir}/settings/monitoring-settings.asciidoc[] include::{kib-repo-dir}/settings/reporting-settings.asciidoc[] @@ -643,4 +644,3 @@ include::secure-settings.asciidoc[] include::{kib-repo-dir}/settings/security-settings.asciidoc[] include::{kib-repo-dir}/settings/spaces-settings.asciidoc[] include::{kib-repo-dir}/settings/telemetry-settings.asciidoc[] -include::{docdir}/settings/ingest-manager-settings.asciidoc[] diff --git a/docs/visualize/vega.asciidoc b/docs/visualize/vega.asciidoc index e0d9955f0c3db..efe9094a14922 100644 --- a/docs/visualize/vega.asciidoc +++ b/docs/visualize/vega.asciidoc @@ -172,12 +172,19 @@ except that the time range is shifted back by 10 minutes: // the auto-generated "MUST-NOT" clause "%dashboard_context-must_not_clause%" ] + filter: [ + // This string will be replaced + // with the auto-generated "FILTER" clause + "%dashboard_context-filter_clause%" + ] } } } } ---- +NOTE: When using `"%context%": true` or defining a value for "%timefield%"` the body cannot contain a query. To customize the query within the VEGA specification (e.g. add an additional filter, or shift the timefilter), define your query and use the placeholders as in the example above. The placeholders will be replaced by the actual context of the dashboard or visualization once parsed. + The `"%timefilter%"` can also be used to specify a single min or max value. The date_histogram's `extended_bounds` can be set with two values - min and max. Instead of hardcoding a value, you may diff --git a/package.json b/package.json index 419edcf268356..fc1ec2d021a32 100644 --- a/package.json +++ b/package.json @@ -81,13 +81,13 @@ }, "resolutions": { "**/@types/node": ">=10.17.17 <10.20.0", - "**/@types/react": "^16.9.19", + "**/@types/react": "^16.9.36", "**/@types/react-router": "^5.1.3", "**/@types/hapi": "^17.0.18", "**/@types/angular": "^1.6.56", "**/@types/hoist-non-react-statics": "^3.3.1", "**/@types/chai": "^4.2.11", - "**/typescript": "3.7.2", + "**/typescript": "3.9.5", "**/graphql-toolkit/lodash": "^4.17.13", "**/hoist-non-react-statics": "^3.3.2", "**/isomorphic-git/**/base64-js": "^1.2.1", @@ -120,13 +120,13 @@ ] }, "dependencies": { - "@babel/core": "^7.9.0", - "@babel/plugin-transform-modules-commonjs": "^7.9.0", - "@babel/register": "^7.9.0", + "@babel/core": "^7.10.2", + "@babel/plugin-transform-modules-commonjs": "^7.10.1", + "@babel/register": "^7.10.1", "@elastic/apm-rum": "^5.1.1", "@elastic/charts": "19.2.0", "@elastic/datemath": "5.0.3", - "@elastic/ems-client": "7.8.0", + "@elastic/ems-client": "7.9.3", "@elastic/eui": "24.1.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", @@ -236,6 +236,7 @@ "pug": "^2.0.4", "query-string": "5.1.1", "raw-loader": "3.1.0", + "re2": "1.14.0", "react": "^16.12.0", "react-color": "^2.13.8", "react-dom": "^16.12.0", @@ -273,7 +274,7 @@ "tinygradient": "0.4.3", "tinymath": "1.2.1", "topojson-client": "3.0.0", - "tslib": "^1.9.3", + "tslib": "^2.0.0", "type-detect": "^4.0.8", "ui-select": "0.19.8", "url-loader": "2.2.0", @@ -292,8 +293,8 @@ "yauzl": "2.10.0" }, "devDependencies": { - "@babel/parser": "^7.9.3", - "@babel/types": "^7.9.0", + "@babel/parser": "^7.10.2", + "@babel/types": "^7.10.2", "@elastic/elasticsearch": "^7.4.0", "@elastic/eslint-config-kibana": "0.15.0", "@elastic/eslint-plugin-eui": "0.0.2", @@ -371,8 +372,8 @@ "@types/podium": "^1.0.0", "@types/prop-types": "^15.5.3", "@types/reach__router": "^1.2.6", - "@types/react": "^16.9.19", - "@types/react-dom": "^16.9.5", + "@types/react": "^16.9.36", + "@types/react-dom": "^16.9.8", "@types/react-grid-layout": "^0.16.7", "@types/react-redux": "^7.1.7", "@types/react-resize-detector": "^4.0.1", @@ -395,8 +396,8 @@ "@types/uuid": "^3.4.4", "@types/vinyl-fs": "^2.4.11", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "^2.33.0", - "@typescript-eslint/parser": "^2.33.0", + "@typescript-eslint/eslint-plugin": "^2.34.0", + "@typescript-eslint/parser": "^2.34.0", "angular-mocks": "^1.7.9", "archiver": "^3.1.1", "axe-core": "^3.4.1", @@ -496,7 +497,7 @@ "supertest-as-promised": "^4.0.2", "tape": "^4.13.0", "tree-kill": "^1.2.2", - "typescript": "3.7.2", + "typescript": "3.9.5", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.3", "xml2js": "^0.4.22", @@ -507,4 +508,4 @@ "node": "10.21.0", "yarn": "^1.21.1" } -} +} \ No newline at end of file diff --git a/packages/elastic-datemath/package.json b/packages/elastic-datemath/package.json index 331b5494581cd..15040a6243ff2 100644 --- a/packages/elastic-datemath/package.json +++ b/packages/elastic-datemath/package.json @@ -11,13 +11,13 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "@babel/cli": "^7.8.4", - "@babel/preset-env": "^7.9.0", + "@babel/cli": "^7.10.1", + "@babel/preset-env": "^7.10.2", "babel-plugin-add-module-exports": "^1.0.2", "moment": "^2.24.0" }, "dependencies": { - "tslib": "^1.9.3" + "tslib": "^2.0.0" }, "peerDependencies": { "moment": "^2.24.0" diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index d9aef63c0115c..9bc8ed3019e54 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,8 +15,8 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^2.33.0", - "@typescript-eslint/parser": "^2.33.0", + "@typescript-eslint/eslint-plugin": "^2.34.0", + "@typescript-eslint/parser": "^2.34.0", "babel-eslint": "^10.0.3", "eslint": "^6.8.0", "eslint-plugin-babel": "^5.3.0", diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index b7a719e5595e6..bd3f5832b7140 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -14,9 +14,9 @@ "kbn:watch": "node scripts/build --source-maps --watch" }, "devDependencies": { - "@babel/cli": "^7.8.4", + "@babel/cli": "^7.10.1", "@kbn/dev-utils": "1.0.0", "@kbn/babel-preset": "1.0.0", - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/packages/kbn-babel-code-parser/package.json b/packages/kbn-babel-code-parser/package.json index 4321cd6ee762c..6f42c086ecaab 100755 --- a/packages/kbn-babel-code-parser/package.json +++ b/packages/kbn-babel-code-parser/package.json @@ -15,12 +15,12 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "@babel/cli": "^7.8.4" + "@babel/cli": "^7.10.1" }, "dependencies": { "@kbn/babel-preset": "1.0.0", - "@babel/parser": "^7.9.3", - "@babel/traverse": "^7.9.0", + "@babel/parser": "^7.10.2", + "@babel/traverse": "^7.10.1", "lodash": "^4.17.15" } } diff --git a/packages/kbn-babel-preset/common_babel_parser_options.js b/packages/kbn-babel-preset/common_babel_parser_options.js index 4004230171a4f..eec31329d96be 100644 --- a/packages/kbn-babel-preset/common_babel_parser_options.js +++ b/packages/kbn-babel-preset/common_babel_parser_options.js @@ -24,6 +24,8 @@ module.exports = { plugins: [ 'asyncGenerators', 'classProperties', + 'classPrivateProperties', + 'classPrivateMethods', 'dynamicImport', 'exportDefaultFrom', 'exportNamespaceFrom', diff --git a/packages/kbn-babel-preset/common_preset.js b/packages/kbn-babel-preset/common_preset.js index ea099aeda7408..8e2f1d207f3f4 100644 --- a/packages/kbn-babel-preset/common_preset.js +++ b/packages/kbn-babel-preset/common_preset.js @@ -34,6 +34,14 @@ const plugins = [ // Nullish coalescing proposal is stage 3 (https://github.com/tc39/proposal-nullish-coalescing) // Need this since we are using TypeScript 3.7+ require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + + // Proposal is on stage 4 (https://github.com/tc39/proposal-export-ns-from) + // Need this since we are using TypeScript 3.8+ + require.resolve('@babel/plugin-proposal-export-namespace-from'), + + // Proposal is on stage 4 (https://github.com/tc39/proposal-export-ns-from) + // Need this since we are using TypeScript 3.9+ + require.resolve('@babel/plugin-proposal-private-methods'), ]; module.exports = { diff --git a/packages/kbn-babel-preset/package.json b/packages/kbn-babel-preset/package.json index ab0d875430d01..83530beffd2b2 100644 --- a/packages/kbn-babel-preset/package.json +++ b/packages/kbn-babel-preset/package.json @@ -4,12 +4,14 @@ "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@babel/plugin-proposal-class-properties": "^7.8.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-proposal-optional-chaining": "^7.9.0", - "@babel/preset-env": "^7.9.0", - "@babel/preset-react": "^7.9.1", - "@babel/preset-typescript": "^7.9.0", + "@babel/plugin-proposal-class-properties": "^7.10.1", + "@babel/plugin-proposal-export-namespace-from": "^7.10.1", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1", + "@babel/plugin-proposal-optional-chaining": "^7.10.1", + "@babel/plugin-proposal-private-methods": "^7.10.1", + "@babel/preset-env": "^7.10.2", + "@babel/preset-react": "^7.10.1", + "@babel/preset-typescript": "^7.10.1", "babel-plugin-add-module-exports": "^1.0.2", "babel-plugin-filter-imports": "^3.0.0", "babel-plugin-styled-components": "^1.10.7", diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index 06342127b0d89..015dca128ce91 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -10,7 +10,7 @@ "kbn:bootstrap": "yarn build" }, "devDependencies": { - "typescript": "3.7.2", + "typescript": "3.9.5", "tsd": "^0.7.4" }, "peerDependencies": { diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 5000d8b7490be..dedc2707f5b5b 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -20,10 +20,10 @@ "moment": "^2.24.0", "rxjs": "^6.5.3", "tree-kill": "^1.2.2", - "tslib": "^1.9.3" + "tslib": "^2.0.0" }, "devDependencies": { - "typescript": "3.7.2", + "typescript": "3.9.5", "@kbn/expect": "1.0.0", "chance": "1.0.18" } diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index a2b5a2c692645..c5da144688c3c 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -12,8 +12,8 @@ "kbn:watch": "node scripts/build --watch --source-maps" }, "devDependencies": { - "@babel/cli": "^7.8.4", - "@babel/core": "^7.9.0", + "@babel/cli": "^7.10.1", + "@babel/core": "^7.10.2", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "@types/intl-relativeformat": "^2.1.0", @@ -21,7 +21,7 @@ "del": "^5.1.0", "getopts": "^2.2.4", "supports-color": "^7.0.0", - "typescript": "3.7.2" + "typescript": "3.9.5" }, "dependencies": { "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-interpreter/package.json b/packages/kbn-interpreter/package.json index 5528511e2f566..7124cf4773e54 100644 --- a/packages/kbn-interpreter/package.json +++ b/packages/kbn-interpreter/package.json @@ -9,17 +9,17 @@ "kbn:watch": "node scripts/build --dev --watch" }, "dependencies": { - "@babel/runtime": "^7.9.2", + "@babel/runtime": "^7.10.2", "@kbn/i18n": "1.0.0", "lodash": "npm:@elastic/lodash@3.10.1-kibana4", "lodash.clone": "^4.5.0", "uuid": "3.3.2" }, "devDependencies": { - "@babel/cli": "^7.8.4", - "@babel/core": "^7.9.0", - "@babel/plugin-transform-modules-commonjs": "^7.9.0", - "@babel/plugin-transform-runtime": "^7.9.0", + "@babel/cli": "^7.10.1", + "@babel/core": "^7.10.2", + "@babel/plugin-transform-modules-commonjs": "^7.10.1", + "@babel/plugin-transform-runtime": "^7.10.1", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "babel-loader": "^8.0.6", diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json index 170c014e6e326..3e5a3cd216225 100644 --- a/packages/kbn-monaco/package.json +++ b/packages/kbn-monaco/package.json @@ -20,7 +20,7 @@ "del": "^5.1.0", "raw-loader": "3.1.0", "supports-color": "^7.0.0", - "typescript": "3.7.2", + "typescript": "3.9.5", "webpack": "^4.41.5", "webpack-cli": "^3.3.10" } diff --git a/packages/kbn-optimizer/package.json b/packages/kbn-optimizer/package.json index 7bd7a236a43aa..8272f91e22134 100644 --- a/packages/kbn-optimizer/package.json +++ b/packages/kbn-optimizer/package.json @@ -10,7 +10,7 @@ "kbn:watch": "yarn build --watch" }, "dependencies": { - "@babel/cli": "^7.8.4", + "@babel/cli": "^7.10.1", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "@kbn/ui-shared-deps": "1.0.0", @@ -49,4 +49,4 @@ "webpack": "^4.41.5", "webpack-merge": "^4.2.2" } -} \ No newline at end of file +} diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index 362e8302c3bec..f370265876df3 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -12,7 +12,7 @@ "plugin-helpers": "bin/plugin-helpers.js" }, "dependencies": { - "@babel/core": "^7.9.0", + "@babel/core": "^7.10.2", "argv-split": "^2.0.1", "commander": "^3.0.0", "del": "^5.1.0", @@ -37,7 +37,7 @@ "@types/through2": "^2.0.35", "@types/through2-map": "^3.0.0", "@types/vinyl": "^2.0.4", - "typescript": "3.7.2" + "typescript": "3.9.5" }, "peerDependencies": { "@kbn/babel-preset": "1.0.0" diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index ef2b7e7c06a25..5c9d1c269111d 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -94,21 +94,21 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _cli__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "run", function() { return _cli__WEBPACK_IMPORTED_MODULE_0__["run"]; }); -/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(697); +/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(698); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["buildProductionProjects"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); -/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(502); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(503); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getProjects", function() { return _utils_projects__WEBPACK_IMPORTED_MODULE_2__["getProjects"]; }); -/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(517); +/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(518); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return _utils_project__WEBPACK_IMPORTED_MODULE_3__["Project"]; }); -/* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(573); +/* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(574); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__["copyWorkspacePackages"]; }); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(574); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(575); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getProjectPaths", function() { return _config__WEBPACK_IMPORTED_MODULE_5__["getProjectPaths"]; }); /* @@ -151,9 +151,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _kbn_dev_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5); /* harmony import */ var _kbn_dev_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_kbn_dev_utils__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(488); -/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(689); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(500); +/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(489); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(690); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(501); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -566,35 +566,35 @@ module.exports = require("path"); Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = __webpack_require__(6); var proc_runner_1 = __webpack_require__(7); -exports.withProcRunner = proc_runner_1.withProcRunner; -exports.ProcRunner = proc_runner_1.ProcRunner; -tslib_1.__exportStar(__webpack_require__(400), exports); -var serializers_1 = __webpack_require__(405); -exports.createAbsolutePathSerializer = serializers_1.createAbsolutePathSerializer; -var certs_1 = __webpack_require__(430); -exports.CA_CERT_PATH = certs_1.CA_CERT_PATH; -exports.ES_KEY_PATH = certs_1.ES_KEY_PATH; -exports.ES_CERT_PATH = certs_1.ES_CERT_PATH; -exports.ES_P12_PATH = certs_1.ES_P12_PATH; -exports.ES_P12_PASSWORD = certs_1.ES_P12_PASSWORD; -exports.ES_EMPTYPASSWORD_P12_PATH = certs_1.ES_EMPTYPASSWORD_P12_PATH; -exports.ES_NOPASSWORD_P12_PATH = certs_1.ES_NOPASSWORD_P12_PATH; -exports.KBN_KEY_PATH = certs_1.KBN_KEY_PATH; -exports.KBN_CERT_PATH = certs_1.KBN_CERT_PATH; -exports.KBN_P12_PATH = certs_1.KBN_P12_PATH; -exports.KBN_P12_PASSWORD = certs_1.KBN_P12_PASSWORD; -var run_1 = __webpack_require__(431); -exports.run = run_1.run; -exports.createFailError = run_1.createFailError; -exports.createFlagError = run_1.createFlagError; -exports.combineErrors = run_1.combineErrors; -exports.isFailError = run_1.isFailError; -var repo_root_1 = __webpack_require__(407); -exports.REPO_ROOT = repo_root_1.REPO_ROOT; -var kbn_client_1 = __webpack_require__(436); -exports.KbnClient = kbn_client_1.KbnClient; -tslib_1.__exportStar(__webpack_require__(479), exports); -tslib_1.__exportStar(__webpack_require__(486), exports); +Object.defineProperty(exports, "withProcRunner", { enumerable: true, get: function () { return proc_runner_1.withProcRunner; } }); +Object.defineProperty(exports, "ProcRunner", { enumerable: true, get: function () { return proc_runner_1.ProcRunner; } }); +tslib_1.__exportStar(__webpack_require__(401), exports); +var serializers_1 = __webpack_require__(406); +Object.defineProperty(exports, "createAbsolutePathSerializer", { enumerable: true, get: function () { return serializers_1.createAbsolutePathSerializer; } }); +var certs_1 = __webpack_require__(431); +Object.defineProperty(exports, "CA_CERT_PATH", { enumerable: true, get: function () { return certs_1.CA_CERT_PATH; } }); +Object.defineProperty(exports, "ES_KEY_PATH", { enumerable: true, get: function () { return certs_1.ES_KEY_PATH; } }); +Object.defineProperty(exports, "ES_CERT_PATH", { enumerable: true, get: function () { return certs_1.ES_CERT_PATH; } }); +Object.defineProperty(exports, "ES_P12_PATH", { enumerable: true, get: function () { return certs_1.ES_P12_PATH; } }); +Object.defineProperty(exports, "ES_P12_PASSWORD", { enumerable: true, get: function () { return certs_1.ES_P12_PASSWORD; } }); +Object.defineProperty(exports, "ES_EMPTYPASSWORD_P12_PATH", { enumerable: true, get: function () { return certs_1.ES_EMPTYPASSWORD_P12_PATH; } }); +Object.defineProperty(exports, "ES_NOPASSWORD_P12_PATH", { enumerable: true, get: function () { return certs_1.ES_NOPASSWORD_P12_PATH; } }); +Object.defineProperty(exports, "KBN_KEY_PATH", { enumerable: true, get: function () { return certs_1.KBN_KEY_PATH; } }); +Object.defineProperty(exports, "KBN_CERT_PATH", { enumerable: true, get: function () { return certs_1.KBN_CERT_PATH; } }); +Object.defineProperty(exports, "KBN_P12_PATH", { enumerable: true, get: function () { return certs_1.KBN_P12_PATH; } }); +Object.defineProperty(exports, "KBN_P12_PASSWORD", { enumerable: true, get: function () { return certs_1.KBN_P12_PASSWORD; } }); +var run_1 = __webpack_require__(432); +Object.defineProperty(exports, "run", { enumerable: true, get: function () { return run_1.run; } }); +Object.defineProperty(exports, "createFailError", { enumerable: true, get: function () { return run_1.createFailError; } }); +Object.defineProperty(exports, "createFlagError", { enumerable: true, get: function () { return run_1.createFlagError; } }); +Object.defineProperty(exports, "combineErrors", { enumerable: true, get: function () { return run_1.combineErrors; } }); +Object.defineProperty(exports, "isFailError", { enumerable: true, get: function () { return run_1.isFailError; } }); +var repo_root_1 = __webpack_require__(408); +Object.defineProperty(exports, "REPO_ROOT", { enumerable: true, get: function () { return repo_root_1.REPO_ROOT; } }); +var kbn_client_1 = __webpack_require__(437); +Object.defineProperty(exports, "KbnClient", { enumerable: true, get: function () { return kbn_client_1.KbnClient; } }); +tslib_1.__exportStar(__webpack_require__(480), exports); +tslib_1.__exportStar(__webpack_require__(487), exports); /***/ }), @@ -611,10 +611,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); @@ -622,19 +624,21 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); /*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 +Copyright (c) Microsoft Corporation. -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ @@ -667,8 +671,10 @@ function __rest(s, e) { for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } return t; } @@ -688,10 +694,11 @@ function __metadata(metadataKey, metadataValue) { } function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } @@ -724,19 +731,28 @@ function __generator(thisArg, body) { } } +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); } function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); - return { + if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { @@ -762,6 +778,14 @@ function __spread() { return ar; } +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } @@ -797,17 +821,38 @@ function __makeTemplateObject(cooked, raw) { return cooked; }; +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } + +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} /***/ }), @@ -836,9 +881,9 @@ function __importDefault(mod) { */ Object.defineProperty(exports, "__esModule", { value: true }); var with_proc_runner_1 = __webpack_require__(8); -exports.withProcRunner = with_proc_runner_1.withProcRunner; +Object.defineProperty(exports, "withProcRunner", { enumerable: true, get: function () { return with_proc_runner_1.withProcRunner; } }); var proc_runner_1 = __webpack_require__(9); -exports.ProcRunner = proc_runner_1.ProcRunner; +Object.defineProperty(exports, "ProcRunner", { enumerable: true, get: function () { return proc_runner_1.ProcRunner; } }); /***/ }), @@ -866,6 +911,7 @@ exports.ProcRunner = proc_runner_1.ProcRunner; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.withProcRunner = void 0; const proc_runner_1 = __webpack_require__(9); /** * Create a ProcRunner and pass it to an async function. When @@ -913,13 +959,14 @@ exports.withProcRunner = withProcRunner; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProcRunner = void 0; const tslib_1 = __webpack_require__(6); const moment_1 = tslib_1.__importDefault(__webpack_require__(10)); const Rx = tslib_1.__importStar(__webpack_require__(140)); -const operators_1 = __webpack_require__(241); -const exit_hook_1 = tslib_1.__importDefault(__webpack_require__(339)); -const errors_1 = __webpack_require__(340); -const proc_1 = __webpack_require__(341); +const operators_1 = __webpack_require__(242); +const exit_hook_1 = tslib_1.__importDefault(__webpack_require__(340)); +const errors_1 = __webpack_require__(341); +const proc_1 = __webpack_require__(342); const SECOND = 1000; const MINUTE = 60 * SECOND; const noop = () => { }; @@ -18073,168 +18120,168 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; }); -/* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(157); +/* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; }); -/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(162); +/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(163); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; }); -/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(154); +/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(155); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; }); -/* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(158); +/* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(159); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; }); -/* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(163); +/* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(164); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; }); -/* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(164); +/* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(165); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; }); -/* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(181); +/* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(182); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; }); -/* harmony import */ var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(182); +/* harmony import */ var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(183); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; }); -/* harmony import */ var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(186); +/* harmony import */ var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(187); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; }); -/* harmony import */ var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(165); +/* harmony import */ var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(166); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; }); -/* harmony import */ var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(187); +/* harmony import */ var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(188); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; }); -/* harmony import */ var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(190); +/* harmony import */ var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(191); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; }); -/* harmony import */ var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(171); +/* harmony import */ var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(172); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; }); -/* harmony import */ var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(148); +/* harmony import */ var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(149); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; }); /* harmony import */ var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(143); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; }); -/* harmony import */ var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(173); +/* harmony import */ var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(174); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["NotificationKind"]; }); -/* harmony import */ var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(155); +/* harmony import */ var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(156); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; }); -/* harmony import */ var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(156); +/* harmony import */ var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(157); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; }); -/* harmony import */ var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(191); +/* harmony import */ var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(192); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; }); -/* harmony import */ var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(192); +/* harmony import */ var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(193); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; }); -/* harmony import */ var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(193); +/* harmony import */ var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(194); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; }); -/* harmony import */ var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(194); +/* harmony import */ var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(195); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; }); -/* harmony import */ var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(159); +/* harmony import */ var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(160); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; }); -/* harmony import */ var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(151); +/* harmony import */ var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(152); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; }); -/* harmony import */ var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(195); +/* harmony import */ var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(196); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; }); -/* harmony import */ var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(196); +/* harmony import */ var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(197); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; }); -/* harmony import */ var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(198); +/* harmony import */ var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(199); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; }); -/* harmony import */ var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(199); +/* harmony import */ var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(200); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; }); -/* harmony import */ var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(210); +/* harmony import */ var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(211); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; }); -/* harmony import */ var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(221); +/* harmony import */ var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(222); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; }); -/* harmony import */ var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(174); +/* harmony import */ var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(175); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; }); -/* harmony import */ var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(222); +/* harmony import */ var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(223); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; }); -/* harmony import */ var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(214); +/* harmony import */ var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(215); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; }); -/* harmony import */ var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(223); +/* harmony import */ var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(224); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; }); -/* harmony import */ var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(224); +/* harmony import */ var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(225); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; }); -/* harmony import */ var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(225); +/* harmony import */ var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(226); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; }); -/* harmony import */ var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(226); +/* harmony import */ var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(227); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; }); -/* harmony import */ var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(227); +/* harmony import */ var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(228); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; }); -/* harmony import */ var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(229); +/* harmony import */ var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(230); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; }); -/* harmony import */ var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(230); +/* harmony import */ var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(231); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; }); -/* harmony import */ var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(175); +/* harmony import */ var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(176); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; }); -/* harmony import */ var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(231); +/* harmony import */ var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(232); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; }); -/* harmony import */ var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(232); +/* harmony import */ var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(233); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; }); -/* harmony import */ var _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(233); +/* harmony import */ var _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(234); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__["partition"]; }); -/* harmony import */ var _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(236); +/* harmony import */ var _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(237); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__["race"]; }); -/* harmony import */ var _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(237); +/* harmony import */ var _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(238); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__["range"]; }); -/* harmony import */ var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(180); +/* harmony import */ var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(181); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__["throwError"]; }); -/* harmony import */ var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(238); +/* harmony import */ var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(239); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__["timer"]; }); -/* harmony import */ var _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(239); +/* harmony import */ var _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(240); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__["using"]; }); -/* harmony import */ var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(240); +/* harmony import */ var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(241); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__["zip"]; }); -/* harmony import */ var _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(215); +/* harmony import */ var _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(216); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scheduled", function() { return _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__["scheduled"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; }); -/* harmony import */ var _internal_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(146); +/* harmony import */ var _internal_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(147); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_52__["config"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ @@ -18304,10 +18351,10 @@ __webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; }); /* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(142); -/* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(153); -/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(154); -/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(155); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(146); +/* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(154); +/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(155); +/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(156); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(147); /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ @@ -18462,13 +18509,13 @@ function canReportError(observer) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SafeSubscriber", function() { return SafeSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(144); -/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(148); -/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(152); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(146); -/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(147); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(145); +/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(146); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(149); +/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(153); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(147); +/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(148); /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ @@ -18708,6 +18755,219 @@ var SafeSubscriber = /*@__PURE__*/ (function (_super) { /* 144 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + + +/***/ }), +/* 145 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); @@ -18719,14 +18979,14 @@ function isFunction(x) { /***/ }), -/* 145 */ +/* 146 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(146); -/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(147); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(147); +/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); /** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */ @@ -18747,7 +19007,7 @@ var empty = { /***/ }), -/* 146 */ +/* 147 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18775,7 +19035,7 @@ var config = { /***/ }), -/* 147 */ +/* 148 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18789,16 +19049,16 @@ function hostReportError(err) { /***/ }), -/* 148 */ +/* 149 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; }); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(149); -/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150); -/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(144); -/* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(151); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150); +/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(151); +/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145); +/* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(152); /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */ @@ -18938,7 +19198,7 @@ function flattenUnsubscriptionErrors(errors) { /***/ }), -/* 149 */ +/* 150 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18950,7 +19210,7 @@ var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) /***/ }), -/* 150 */ +/* 151 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18964,7 +19224,7 @@ function isObject(x) { /***/ }), -/* 151 */ +/* 152 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -18988,7 +19248,7 @@ var UnsubscriptionError = UnsubscriptionErrorImpl; /***/ }), -/* 152 */ +/* 153 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19006,15 +19266,15 @@ var $$rxSubscriber = rxSubscriber; /***/ }), -/* 153 */ +/* 154 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(143); -/* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(152); -/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145); +/* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(153); +/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(146); /** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */ @@ -19037,7 +19297,7 @@ function toSubscriber(nextOrObserver, error, complete) { /***/ }), -/* 154 */ +/* 155 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19049,14 +19309,14 @@ var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function /***/ }), -/* 155 */ +/* 156 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; }); -/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(156); +/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(157); /** PURE_IMPORTS_START _noop PURE_IMPORTS_END */ function pipe() { @@ -19081,7 +19341,7 @@ function pipeFromArray(fns) { /***/ }), -/* 156 */ +/* 157 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19093,19 +19353,19 @@ function noop() { } /***/ }), -/* 157 */ +/* 158 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(141); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(143); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(148); -/* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(161); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(149); +/* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(162); /** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */ @@ -19251,7 +19511,7 @@ var RefCountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 158 */ +/* 159 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19259,13 +19519,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(141); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(143); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(148); -/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(159); -/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(160); -/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(152); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(149); +/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(160); +/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(161); +/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(153); /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ @@ -19427,7 +19687,7 @@ var AnonymousSubject = /*@__PURE__*/ (function (_super) { /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -19449,14 +19709,14 @@ var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ @@ -19492,13 +19752,13 @@ var SubjectSubscription = /*@__PURE__*/ (function (_super) { /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -19561,18 +19821,18 @@ var RefCountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(141); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(158); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(159); /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */ @@ -19758,15 +20018,15 @@ var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) { /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(160); /** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */ @@ -19813,19 +20073,19 @@ var BehaviorSubject = /*@__PURE__*/ (function (_super) { /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(165); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(148); -/* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(172); -/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(159); -/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(160); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(166); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(149); +/* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173); +/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(160); +/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(161); /** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */ @@ -19946,14 +20206,14 @@ var ReplayEvent = /*@__PURE__*/ (function () { /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; }); -/* harmony import */ var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); -/* harmony import */ var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169); +/* harmony import */ var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167); +/* harmony import */ var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(170); /** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */ @@ -19962,14 +20222,14 @@ var queue = /*@__PURE__*/ new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["Queu /***/ }), -/* 166 */ +/* 167 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(167); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(168); /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */ @@ -20014,14 +20274,14 @@ var QueueAction = /*@__PURE__*/ (function (_super) { /***/ }), -/* 167 */ +/* 168 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(168); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169); /** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */ @@ -20120,14 +20380,14 @@ var AsyncAction = /*@__PURE__*/ (function (_super) { /***/ }), -/* 168 */ +/* 169 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ @@ -20149,14 +20409,14 @@ var Action = /*@__PURE__*/ (function (_super) { /***/ }), -/* 169 */ +/* 170 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(170); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ @@ -20172,14 +20432,14 @@ var QueueScheduler = /*@__PURE__*/ (function (_super) { /***/ }), -/* 170 */ +/* 171 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172); /** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */ @@ -20241,7 +20501,7 @@ var AsyncScheduler = /*@__PURE__*/ (function (_super) { /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20269,7 +20529,7 @@ var Scheduler = /*@__PURE__*/ (function () { /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20278,9 +20538,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(173); +/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */ @@ -20353,16 +20613,16 @@ var ObserveOnMessage = /*@__PURE__*/ (function () { /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return NotificationKind; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; }); -/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(174); -/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175); -/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); +/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(175); +/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176); +/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(181); /** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */ @@ -20442,7 +20702,7 @@ var Notification = /*@__PURE__*/ (function () { /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20463,15 +20723,15 @@ function emptyScheduled(scheduler) { /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return of; }); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176); -/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177); -/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(177); +/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178); +/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); /** PURE_IMPORTS_START _util_isScheduler,_fromArray,_scheduled_scheduleArray PURE_IMPORTS_END */ @@ -20494,7 +20754,7 @@ function of() { /***/ }), -/* 176 */ +/* 177 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20508,15 +20768,15 @@ function isScheduler(value) { /***/ }), -/* 177 */ +/* 178 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178); -/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179); +/* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179); +/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); /** PURE_IMPORTS_START _Observable,_util_subscribeToArray,_scheduled_scheduleArray PURE_IMPORTS_END */ @@ -20533,7 +20793,7 @@ function fromArray(input, scheduler) { /***/ }), -/* 178 */ +/* 179 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20552,14 +20812,14 @@ var subscribeToArray = function (array) { /***/ }), -/* 179 */ +/* 180 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleArray", function() { return scheduleArray; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */ @@ -20584,7 +20844,7 @@ function scheduleArray(input, scheduler) { /***/ }), -/* 180 */ +/* 181 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20609,15 +20869,15 @@ function dispatch(_a) { /***/ }), -/* 181 */ +/* 182 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); /** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */ @@ -20668,14 +20928,14 @@ var AsyncSubject = /*@__PURE__*/ (function (_super) { /***/ }), -/* 182 */ +/* 183 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; }); -/* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(183); -/* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185); +/* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(184); +/* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186); /** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */ @@ -20684,15 +20944,15 @@ var asap = /*@__PURE__*/ new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapSc /***/ }), -/* 183 */ +/* 184 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(184); -/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185); +/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(168); /** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */ @@ -20735,7 +20995,7 @@ var AsapAction = /*@__PURE__*/ (function (_super) { /***/ }), -/* 184 */ +/* 185 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -20765,14 +21025,14 @@ var Immediate = { /***/ }), -/* 185 */ +/* 186 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(170); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ @@ -20809,14 +21069,14 @@ var AsapScheduler = /*@__PURE__*/ (function (_super) { /***/ }), -/* 186 */ +/* 187 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "async", function() { return async; }); -/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(167); -/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(170); +/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(168); +/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ @@ -20825,14 +21085,14 @@ var async = /*@__PURE__*/ new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["Asyn /***/ }), -/* 187 */ +/* 188 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; }); -/* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(188); -/* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(189); +/* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(189); +/* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(190); /** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */ @@ -20841,14 +21101,14 @@ var animationFrame = /*@__PURE__*/ new _AnimationFrameScheduler__WEBPACK_IMPORTE /***/ }), -/* 188 */ +/* 189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(167); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(168); /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */ @@ -20890,14 +21150,14 @@ var AnimationFrameAction = /*@__PURE__*/ (function (_super) { /***/ }), -/* 189 */ +/* 190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(170); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ @@ -20934,16 +21194,16 @@ var AnimationFrameScheduler = /*@__PURE__*/ (function (_super) { /***/ }), -/* 190 */ +/* 191 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(167); -/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(170); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(168); +/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ @@ -21057,7 +21317,7 @@ var VirtualAction = /*@__PURE__*/ (function (_super) { /***/ }), -/* 191 */ +/* 192 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21071,7 +21331,7 @@ function identity(x) { /***/ }), -/* 192 */ +/* 193 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21087,7 +21347,7 @@ function isObservable(obj) { /***/ }), -/* 193 */ +/* 194 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21109,7 +21369,7 @@ var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl; /***/ }), -/* 194 */ +/* 195 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21131,7 +21391,7 @@ var EmptyError = EmptyErrorImpl; /***/ }), -/* 195 */ +/* 196 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21153,18 +21413,18 @@ var TimeoutError = TimeoutErrorImpl; /***/ }), -/* 196 */ +/* 197 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(181); -/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(197); +/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); +/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(142); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(149); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(150); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(177); /** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isArray,_util_isScheduler PURE_IMPORTS_END */ @@ -21273,14 +21533,14 @@ function dispatchError(state) { /***/ }), -/* 197 */ +/* 198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -21330,18 +21590,18 @@ var MapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 198 */ +/* 199 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(181); -/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(197); +/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); +/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(142); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(176); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(149); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(177); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(150); /** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isScheduler,_util_isArray PURE_IMPORTS_END */ @@ -21458,7 +21718,7 @@ function dispatchError(arg) { /***/ }), -/* 199 */ +/* 200 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21466,12 +21726,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(201); -/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(177); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202); +/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(178); /** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */ @@ -21576,13 +21836,13 @@ var CombineLatestSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 200 */ +/* 201 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -21608,14 +21868,14 @@ var OuterSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 201 */ +/* 202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; }); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(202); -/* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(203); +/* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(141); /** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo,_Observable PURE_IMPORTS_END */ @@ -21637,13 +21897,13 @@ function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, dest /***/ }), -/* 202 */ +/* 203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -21676,21 +21936,21 @@ var InnerSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 203 */ +/* 204 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; }); -/* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(178); -/* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204); -/* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(205); -/* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(207); -/* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(208); -/* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(209); -/* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(150); -/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(206); -/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(154); +/* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(179); +/* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(205); +/* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(206); +/* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208); +/* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(209); +/* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(210); +/* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(151); +/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(207); +/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(155); /** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */ @@ -21725,13 +21985,13 @@ var subscribeTo = function (result) { /***/ }), -/* 204 */ +/* 205 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; }); -/* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(147); +/* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148); /** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */ var subscribeToPromise = function (promise) { @@ -21750,13 +22010,13 @@ var subscribeToPromise = function (promise) { /***/ }), -/* 205 */ +/* 206 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; }); -/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(206); +/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(207); /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */ var subscribeToIterable = function (iterable) { @@ -21787,7 +22047,7 @@ var subscribeToIterable = function (iterable) { /***/ }), -/* 206 */ +/* 207 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21808,13 +22068,13 @@ var $$iterator = iterator; /***/ }), -/* 207 */ +/* 208 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; }); -/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(154); +/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(155); /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ var subscribeToObservable = function (obj) { @@ -21832,7 +22092,7 @@ var subscribeToObservable = function (obj) { /***/ }), -/* 208 */ +/* 209 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21844,7 +22104,7 @@ var isArrayLike = (function (x) { return x && typeof x.length === 'number' && ty /***/ }), -/* 209 */ +/* 210 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21858,14 +22118,14 @@ function isPromise(value) { /***/ }), -/* 210 */ +/* 211 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; }); -/* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(175); -/* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(211); +/* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176); +/* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(212); /** PURE_IMPORTS_START _of,_operators_concatAll PURE_IMPORTS_END */ @@ -21880,13 +22140,13 @@ function concat() { /***/ }), -/* 211 */ +/* 212 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; }); -/* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(212); +/* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213); /** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */ function concatAll() { @@ -21896,14 +22156,14 @@ function concatAll() { /***/ }), -/* 212 */ +/* 213 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; }); -/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213); -/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(191); +/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(214); +/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(192); /** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */ @@ -21917,7 +22177,7 @@ function mergeAll(concurrent) { /***/ }), -/* 213 */ +/* 214 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -21925,12 +22185,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); -/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(197); -/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(214); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(202); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(203); +/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(198); +/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(215); /** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */ @@ -22034,15 +22294,15 @@ var MergeMapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 214 */ +/* 215 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return from; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203); -/* harmony import */ var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(215); +/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204); +/* harmony import */ var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(216); /** PURE_IMPORTS_START _Observable,_util_subscribeTo,_scheduled_scheduled PURE_IMPORTS_END */ @@ -22062,20 +22322,20 @@ function from(input, scheduler) { /***/ }), -/* 215 */ +/* 216 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduled", function() { return scheduled; }); -/* harmony import */ var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(216); -/* harmony import */ var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(217); -/* harmony import */ var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179); -/* harmony import */ var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(218); -/* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(219); -/* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(209); -/* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(208); -/* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(220); +/* harmony import */ var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(217); +/* harmony import */ var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(218); +/* harmony import */ var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); +/* harmony import */ var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(219); +/* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(220); +/* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(210); +/* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(209); +/* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(221); /** PURE_IMPORTS_START _scheduleObservable,_schedulePromise,_scheduleArray,_scheduleIterable,_util_isInteropObservable,_util_isPromise,_util_isArrayLike,_util_isIterable PURE_IMPORTS_END */ @@ -22106,15 +22366,15 @@ function scheduled(input, scheduler) { /***/ }), -/* 216 */ +/* 217 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleObservable", function() { return scheduleObservable; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); -/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(154); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); +/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(155); /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable PURE_IMPORTS_END */ @@ -22137,14 +22397,14 @@ function scheduleObservable(input, scheduler) { /***/ }), -/* 217 */ +/* 218 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "schedulePromise", function() { return schedulePromise; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */ @@ -22168,15 +22428,15 @@ function schedulePromise(input, scheduler) { /***/ }), -/* 218 */ +/* 219 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleIterable", function() { return scheduleIterable; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); -/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(206); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); +/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(207); /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator PURE_IMPORTS_END */ @@ -22226,13 +22486,13 @@ function scheduleIterable(input, scheduler) { /***/ }), -/* 219 */ +/* 220 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; }); -/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(154); +/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(155); /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ function isInteropObservable(input) { @@ -22242,13 +22502,13 @@ function isInteropObservable(input) { /***/ }), -/* 220 */ +/* 221 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; }); -/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(206); +/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(207); /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */ function isIterable(input) { @@ -22258,15 +22518,15 @@ function isIterable(input) { /***/ }), -/* 221 */ +/* 222 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(214); -/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); +/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); +/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175); /** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */ @@ -22289,17 +22549,17 @@ function defer(observableFactory) { /***/ }), -/* 222 */ +/* 223 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); -/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(197); -/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(150); -/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(214); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150); +/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); +/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(151); +/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(215); /** PURE_IMPORTS_START _Observable,_util_isArray,_operators_map,_util_isObject,_from PURE_IMPORTS_END */ @@ -22372,16 +22632,16 @@ function forkJoinInternal(sources, keys) { /***/ }), -/* 223 */ +/* 224 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); -/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(144); -/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(197); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150); +/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145); +/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */ @@ -22448,16 +22708,16 @@ function isEventTarget(sourceObj) { /***/ }), -/* 224 */ +/* 225 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); -/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(144); -/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(197); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150); +/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(145); +/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */ @@ -22493,15 +22753,15 @@ function fromEventPattern(addHandler, removeHandler, resultSelector) { /***/ }), -/* 225 */ +/* 226 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(191); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(176); +/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(192); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(177); /** PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END */ @@ -22630,14 +22890,14 @@ function dispatch(state) { /***/ }), -/* 226 */ +/* 227 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; }); -/* harmony import */ var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221); -/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(174); +/* harmony import */ var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(222); +/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175); /** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */ @@ -22654,15 +22914,15 @@ function iif(condition, trueResult, falseResult) { /***/ }), -/* 227 */ +/* 228 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186); -/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(187); +/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229); /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */ @@ -22694,13 +22954,13 @@ function dispatch(state) { /***/ }), -/* 228 */ +/* 229 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; }); -/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(149); +/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150); /** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */ function isNumeric(val) { @@ -22710,16 +22970,16 @@ function isNumeric(val) { /***/ }), -/* 229 */ +/* 230 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176); -/* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(212); -/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(177); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177); +/* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(213); +/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(178); /** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */ @@ -22751,7 +23011,7 @@ function merge() { /***/ }), -/* 230 */ +/* 231 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -22759,7 +23019,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return never; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156); +/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(157); /** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */ @@ -22771,16 +23031,16 @@ function never() { /***/ }), -/* 231 */ +/* 232 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(214); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); -/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(174); +/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150); +/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /** PURE_IMPORTS_START _Observable,_from,_util_isArray,_empty PURE_IMPORTS_END */ @@ -22811,7 +23071,7 @@ function onErrorResumeNext() { /***/ }), -/* 232 */ +/* 233 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -22819,7 +23079,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */ @@ -22862,15 +23122,15 @@ function dispatch(state) { /***/ }), -/* 233 */ +/* 234 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; }); -/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(234); -/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203); -/* harmony import */ var _operators_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(235); +/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(235); +/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204); +/* harmony import */ var _operators_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(236); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(141); /** PURE_IMPORTS_START _util_not,_util_subscribeTo,_operators_filter,_Observable PURE_IMPORTS_END */ @@ -22887,7 +23147,7 @@ function partition(source, predicate, thisArg) { /***/ }), -/* 234 */ +/* 235 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -22906,13 +23166,13 @@ function not(pred, thisArg) { /***/ }), -/* 235 */ +/* 236 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -22960,7 +23220,7 @@ var FilterSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 236 */ +/* 237 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -22968,11 +23228,11 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); -/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(177); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150); +/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(178); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -23054,7 +23314,7 @@ var RaceSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 237 */ +/* 238 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -23113,16 +23373,16 @@ function dispatch(state) { /***/ }), -/* 238 */ +/* 239 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186); -/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(176); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(187); +/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(177); /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ @@ -23167,15 +23427,15 @@ function dispatch(state) { /***/ }), -/* 239 */ +/* 240 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return using; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(141); -/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(214); -/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); +/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); +/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175); /** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */ @@ -23212,7 +23472,7 @@ function using(resourceFactory, observableFactory) { /***/ }), -/* 240 */ +/* 241 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -23220,13 +23480,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(143); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(201); -/* harmony import */ var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(206); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(202); +/* harmony import */ var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(207); /** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */ @@ -23448,320 +23708,320 @@ var ZipBufferIterator = /*@__PURE__*/ (function (_super) { /***/ }), -/* 241 */ +/* 242 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(242); +/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(243); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; }); -/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(243); +/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(244); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; }); -/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(244); +/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(245); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; }); -/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(245); +/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(246); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; }); -/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(246); +/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(247); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; }); -/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(247); +/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(248); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; }); -/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(248); +/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(249); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; }); -/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(249); +/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(250); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; }); -/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(250); +/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(251); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; }); -/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(251); +/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(252); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; }); -/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(252); +/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(253); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; }); -/* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(211); +/* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(212); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; }); -/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(253); +/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(254); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; }); -/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(254); +/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(255); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; }); -/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(255); +/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(256); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; }); -/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(256); +/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(257); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; }); -/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(257); +/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(258); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; }); -/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(258); +/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(259); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; }); -/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(259); +/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(260); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; }); -/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(261); +/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(262); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; }); -/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(262); +/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(263); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; }); -/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(263); +/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(264); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; }); -/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(264); +/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(265); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; }); -/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(265); +/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(266); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; }); -/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(266); +/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(267); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; }); -/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(269); +/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(270); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; }); -/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(270); +/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(271); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; }); -/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(271); +/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(272); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; }); -/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(272); +/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(273); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; }); -/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(273); +/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(274); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; }); -/* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(235); +/* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(236); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; }); -/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(274); +/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(275); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; }); -/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(275); +/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(276); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; }); -/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(276); +/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(277); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; }); -/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(277); +/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(278); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; }); -/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(162); +/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(163); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; }); -/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(278); +/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(279); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; }); -/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(279); +/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(280); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; }); -/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(280); +/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(281); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; }); -/* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(197); +/* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(198); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; }); -/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(282); +/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(283); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; }); -/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(283); +/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(284); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; }); -/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(284); +/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(285); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; }); -/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(287); +/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(288); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; }); -/* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(212); +/* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(213); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__["mergeAll"]; }); -/* harmony import */ var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(213); +/* harmony import */ var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(214); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; }); -/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(288); +/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(289); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; }); -/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(289); +/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(290); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; }); -/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(290); +/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(291); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; }); -/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(291); +/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(292); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; }); -/* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(172); +/* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(173); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; }); -/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(292); +/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(293); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; }); -/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(293); +/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(294); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; }); -/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(294); +/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(295); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; }); -/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(295); +/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(296); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; }); -/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(296); +/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(297); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; }); -/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(297); +/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(298); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; }); -/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(298); +/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(299); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; }); -/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(299); +/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(300); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; }); -/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(300); +/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(301); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; }); -/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(285); +/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(286); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; }); -/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(301); +/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(302); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; }); -/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(302); +/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(303); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; }); -/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(303); +/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(304); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; }); -/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(304); +/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(305); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; }); -/* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(161); +/* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(162); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; }); -/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(305); +/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(306); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; }); -/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(306); +/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(307); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; }); -/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(286); +/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(287); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; }); -/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(307); +/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(308); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; }); -/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(308); +/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(309); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; }); -/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(309); +/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(310); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; }); -/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(310); +/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(311); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; }); -/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(311); +/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(312); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; }); -/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(312); +/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(313); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; }); -/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(313); +/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(314); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; }); -/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(314); +/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(315); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; }); -/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(315); +/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(316); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; }); -/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(316); +/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(317); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; }); -/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(318); +/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(319); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; }); -/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(319); +/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(320); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; }); -/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(320); +/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(321); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; }); -/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(268); +/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(269); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; }); -/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(281); +/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(282); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; }); -/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(321); +/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(322); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; }); -/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(322); +/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(323); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; }); -/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(323); +/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(324); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; }); -/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(324); +/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(325); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; }); -/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(325); +/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(326); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; }); -/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(267); +/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(268); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; }); -/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(326); +/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(327); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; }); -/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(327); +/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(328); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; }); -/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(328); +/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(329); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; }); -/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(329); +/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(330); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; }); -/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(330); +/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(331); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; }); -/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(331); +/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(332); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; }); -/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(332); +/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(333); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; }); -/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(333); +/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(334); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; }); -/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(334); +/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(335); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; }); -/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(335); +/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(336); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; }); -/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(336); +/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(337); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; }); -/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(337); +/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(338); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; }); -/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(338); +/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(339); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ @@ -23873,15 +24133,15 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 242 */ +/* 243 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -23954,15 +24214,15 @@ var AuditSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 243 */ +/* 244 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; }); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(186); -/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(242); -/* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(238); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(187); +/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(243); +/* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(239); /** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */ @@ -23977,15 +24237,15 @@ function auditTime(duration, scheduler) { /***/ }), -/* 244 */ +/* 245 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -24026,13 +24286,13 @@ var BufferSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 245 */ +/* 246 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -24127,16 +24387,16 @@ var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 246 */ +/* 247 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(187); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(143); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(176); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(177); /** PURE_IMPORTS_START tslib,_scheduler_async,_Subscriber,_util_isScheduler PURE_IMPORTS_END */ @@ -24288,16 +24548,16 @@ function dispatchBufferClose(arg) { /***/ }), -/* 247 */ +/* 248 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); /** PURE_IMPORTS_START tslib,_Subscription,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */ @@ -24408,16 +24668,16 @@ var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 248 */ +/* 249 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(149); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subscription,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -24503,16 +24763,16 @@ var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 249 */ +/* 250 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(203); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -24564,13 +24824,13 @@ var CatchSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 250 */ +/* 251 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; }); -/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(199); +/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(200); /** PURE_IMPORTS_START _observable_combineLatest PURE_IMPORTS_END */ function combineAll(project) { @@ -24580,15 +24840,15 @@ function combineAll(project) { /***/ }), -/* 251 */ +/* 252 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; }); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(149); -/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(199); -/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(214); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150); +/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); +/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(215); /** PURE_IMPORTS_START _util_isArray,_observable_combineLatest,_observable_from PURE_IMPORTS_END */ @@ -24612,13 +24872,13 @@ function combineLatest() { /***/ }), -/* 252 */ +/* 253 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; }); -/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); +/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(211); /** PURE_IMPORTS_START _observable_concat PURE_IMPORTS_END */ function concat() { @@ -24632,13 +24892,13 @@ function concat() { /***/ }), -/* 253 */ +/* 254 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; }); -/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213); +/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(214); /** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */ function concatMap(project, resultSelector) { @@ -24648,13 +24908,13 @@ function concatMap(project, resultSelector) { /***/ }), -/* 254 */ +/* 255 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; }); -/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(253); +/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(254); /** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */ function concatMapTo(innerObservable, resultSelector) { @@ -24664,13 +24924,13 @@ function concatMapTo(innerObservable, resultSelector) { /***/ }), -/* 255 */ +/* 256 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return count; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -24729,15 +24989,15 @@ var CountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 256 */ +/* 257 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -24817,15 +25077,15 @@ var DebounceSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 257 */ +/* 258 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(186); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */ @@ -24893,13 +25153,13 @@ function dispatchNext(subscriber) { /***/ }), -/* 258 */ +/* 259 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -24943,17 +25203,17 @@ var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 259 */ +/* 260 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186); -/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(260); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(187); +/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(261); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(143); -/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173); +/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(174); /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */ @@ -25050,7 +25310,7 @@ var DelayMessage = /*@__PURE__*/ (function () { /***/ }), -/* 260 */ +/* 261 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25064,17 +25324,17 @@ function isDate(value) { /***/ }), -/* 261 */ +/* 262 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(141); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(201); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -25210,13 +25470,13 @@ var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 262 */ +/* 263 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -25248,16 +25508,16 @@ var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 263 */ +/* 264 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -25326,13 +25586,13 @@ var DistinctSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 264 */ +/* 265 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -25397,13 +25657,13 @@ var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 265 */ +/* 266 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; }); -/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(264); +/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(265); /** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */ function distinctUntilKeyChanged(key, compare) { @@ -25413,17 +25673,17 @@ function distinctUntilKeyChanged(key, compare) { /***/ }), -/* 266 */ +/* 267 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; }); -/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(193); -/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); -/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(267); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(258); -/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(268); +/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194); +/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(236); +/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(268); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(259); +/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(269); /** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */ @@ -25445,14 +25705,14 @@ function elementAt(index, defaultValue) { /***/ }), -/* 267 */ +/* 268 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(195); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_util_EmptyError,_Subscriber PURE_IMPORTS_END */ @@ -25511,16 +25771,16 @@ function defaultErrorFactory() { /***/ }), -/* 268 */ +/* 269 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return take; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(193); -/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(174); +/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194); +/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */ @@ -25573,14 +25833,14 @@ var TakeSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 269 */ +/* 270 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return endWith; }); -/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); -/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175); +/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(211); +/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176); /** PURE_IMPORTS_START _observable_concat,_observable_of PURE_IMPORTS_END */ @@ -25595,13 +25855,13 @@ function endWith() { /***/ }), -/* 270 */ +/* 271 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -25657,15 +25917,15 @@ var EverySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 271 */ +/* 272 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -25714,18 +25974,18 @@ var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 272 */ +/* 273 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); -/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(197); -/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(214); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(203); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); +/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(198); +/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(215); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */ @@ -25811,7 +26071,7 @@ var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 273 */ +/* 274 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25819,9 +26079,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -25930,15 +26190,15 @@ var ExpandSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 274 */ +/* 275 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */ @@ -25968,7 +26228,7 @@ var FinallySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 275 */ +/* 276 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25976,7 +26236,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -26040,13 +26300,13 @@ var FindValueSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 276 */ +/* 277 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; }); -/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(275); +/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(276); /** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */ function findIndex(predicate, thisArg) { @@ -26056,18 +26316,18 @@ function findIndex(predicate, thisArg) { /***/ }), -/* 277 */ +/* 278 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194); -/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); -/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(268); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(258); -/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(267); -/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(191); +/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(195); +/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(236); +/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(269); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(259); +/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(268); +/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(192); /** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */ @@ -26083,13 +26343,13 @@ function first(predicate, defaultValue) { /***/ }), -/* 278 */ +/* 279 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -26120,13 +26380,13 @@ var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 279 */ +/* 280 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -26164,18 +26424,18 @@ var IsEmptySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 280 */ +/* 281 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; }); -/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194); -/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); -/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(281); -/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(267); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(258); -/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(191); +/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(195); +/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(236); +/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(282); +/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(268); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(259); +/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(192); /** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */ @@ -26191,16 +26451,16 @@ function last(predicate, defaultValue) { /***/ }), -/* 281 */ +/* 282 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(193); -/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(174); +/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194); +/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */ @@ -26268,13 +26528,13 @@ var TakeLastSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 282 */ +/* 283 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -26307,15 +26567,15 @@ var MapToSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 283 */ +/* 284 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(173); +/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */ @@ -26357,13 +26617,13 @@ var MaterializeSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 284 */ +/* 285 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; }); -/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(285); +/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(286); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function max(comparer) { @@ -26376,16 +26636,16 @@ function max(comparer) { /***/ }), -/* 285 */ +/* 286 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; }); -/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(286); -/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(281); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(258); -/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(155); +/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(287); +/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(282); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(259); +/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(156); /** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */ @@ -26405,13 +26665,13 @@ function reduce(accumulator, seed) { /***/ }), -/* 286 */ +/* 287 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -26487,13 +26747,13 @@ var ScanSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 287 */ +/* 288 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); -/* harmony import */ var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(229); +/* harmony import */ var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(230); /** PURE_IMPORTS_START _observable_merge PURE_IMPORTS_END */ function merge() { @@ -26507,13 +26767,13 @@ function merge() { /***/ }), -/* 288 */ +/* 289 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; }); -/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(213); +/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(214); /** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */ function mergeMapTo(innerObservable, resultSelector, concurrent) { @@ -26532,7 +26792,7 @@ function mergeMapTo(innerObservable, resultSelector, concurrent) { /***/ }), -/* 289 */ +/* 290 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -26540,10 +26800,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(202); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(203); /** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber PURE_IMPORTS_END */ @@ -26644,13 +26904,13 @@ var MergeScanSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 290 */ +/* 291 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; }); -/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(285); +/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(286); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function min(comparer) { @@ -26663,14 +26923,14 @@ function min(comparer) { /***/ }), -/* 291 */ +/* 292 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; }); -/* harmony import */ var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(157); +/* harmony import */ var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(158); /** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */ function multicast(subjectOrSubjectFactory, selector) { @@ -26712,19 +26972,19 @@ var MulticastOperator = /*@__PURE__*/ (function () { /***/ }), -/* 292 */ +/* 293 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(214); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(203); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -26803,13 +27063,13 @@ var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 293 */ +/* 294 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -26851,14 +27111,14 @@ var PairwiseSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 294 */ +/* 295 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; }); -/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(234); -/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); +/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(235); +/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(236); /** PURE_IMPORTS_START _util_not,_filter PURE_IMPORTS_END */ @@ -26874,13 +27134,13 @@ function partition(predicate, thisArg) { /***/ }), -/* 295 */ +/* 296 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; }); -/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(197); +/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(198); /** PURE_IMPORTS_START _map PURE_IMPORTS_END */ function pluck() { @@ -26914,14 +27174,14 @@ function plucker(props, length) { /***/ }), -/* 296 */ +/* 297 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; }); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(158); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(291); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(159); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(292); /** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */ @@ -26934,14 +27194,14 @@ function publish(selector) { /***/ }), -/* 297 */ +/* 298 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; }); -/* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(291); +/* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(164); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(292); /** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */ @@ -26952,14 +27212,14 @@ function publishBehavior(value) { /***/ }), -/* 298 */ +/* 299 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; }); -/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(181); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(291); +/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(182); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(292); /** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */ @@ -26970,14 +27230,14 @@ function publishLast() { /***/ }), -/* 299 */ +/* 300 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; }); -/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(164); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(291); +/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(165); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(292); /** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */ @@ -26993,14 +27253,14 @@ function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) { /***/ }), -/* 300 */ +/* 301 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; }); -/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(149); -/* harmony import */ var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(236); +/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150); +/* harmony import */ var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(237); /** PURE_IMPORTS_START _util_isArray,_observable_race PURE_IMPORTS_END */ @@ -27020,15 +27280,15 @@ function race() { /***/ }), -/* 301 */ +/* 302 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); +/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175); /** PURE_IMPORTS_START tslib,_Subscriber,_observable_empty PURE_IMPORTS_END */ @@ -27085,16 +27345,16 @@ var RepeatSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 302 */ +/* 303 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -27181,13 +27441,13 @@ var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 303 */ +/* 304 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -27234,16 +27494,16 @@ var RetrySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 304 */ +/* 305 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -27322,15 +27582,15 @@ var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 305 */ +/* 306 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -27379,15 +27639,15 @@ var SampleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 306 */ +/* 307 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(186); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */ @@ -27439,7 +27699,7 @@ function dispatchNotification(state) { /***/ }), -/* 307 */ +/* 308 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -27447,7 +27707,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -27562,15 +27822,15 @@ var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 308 */ +/* 309 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; }); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(291); -/* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(161); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(158); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(292); +/* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(162); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159); /** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */ @@ -27585,13 +27845,13 @@ function share() { /***/ }), -/* 309 */ +/* 310 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; }); -/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(164); +/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(165); /** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */ function shareReplay(configOrBufferSize, windowTime, scheduler) { @@ -27649,15 +27909,15 @@ function shareReplayOperator(_a) { /***/ }), -/* 310 */ +/* 311 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return single; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194); +/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(195); /** PURE_IMPORTS_START tslib,_Subscriber,_util_EmptyError PURE_IMPORTS_END */ @@ -27729,13 +27989,13 @@ var SingleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 311 */ +/* 312 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -27771,15 +28031,15 @@ var SkipSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 312 */ +/* 313 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(193); +/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194); /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError PURE_IMPORTS_END */ @@ -27833,16 +28093,16 @@ var SkipLastSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 313 */ +/* 314 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(203); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -27890,13 +28150,13 @@ var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 314 */ +/* 315 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -27946,14 +28206,14 @@ var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 315 */ +/* 316 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; }); -/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176); +/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(211); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177); /** PURE_IMPORTS_START _observable_concat,_util_isScheduler PURE_IMPORTS_END */ @@ -27975,13 +28235,13 @@ function startWith() { /***/ }), -/* 316 */ +/* 317 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; }); -/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(317); +/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(318); /** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */ function subscribeOn(scheduler, delay) { @@ -28006,16 +28266,16 @@ var SubscribeOnOperator = /*@__PURE__*/ (function () { /***/ }), -/* 317 */ +/* 318 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(141); -/* harmony import */ var _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182); -/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(228); +/* harmony import */ var _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(183); +/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(229); /** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */ @@ -28070,14 +28330,14 @@ var SubscribeOnObservable = /*@__PURE__*/ (function (_super) { /***/ }), -/* 318 */ +/* 319 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; }); -/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); -/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(191); +/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(320); +/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(192); /** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */ @@ -28088,18 +28348,18 @@ function switchAll() { /***/ }), -/* 319 */ +/* 320 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); -/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(197); -/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(214); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(203); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); +/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(198); +/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(215); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */ @@ -28179,13 +28439,13 @@ var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 320 */ +/* 321 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; }); -/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(320); /** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */ function switchMapTo(innerObservable, resultSelector) { @@ -28195,15 +28455,15 @@ function switchMapTo(innerObservable, resultSelector) { /***/ }), -/* 321 */ +/* 322 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -28245,13 +28505,13 @@ var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 322 */ +/* 323 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ @@ -28313,16 +28573,16 @@ var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 323 */ +/* 324 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(156); -/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(144); +/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(157); +/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(145); /** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */ @@ -28401,16 +28661,16 @@ var TapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 324 */ +/* 325 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -28505,16 +28765,16 @@ var ThrottleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 325 */ +/* 326 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(186); -/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(324); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187); +/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(325); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */ @@ -28603,17 +28863,17 @@ function dispatchNext(arg) { /***/ }), -/* 326 */ +/* 327 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; }); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(186); -/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(286); -/* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(221); -/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(197); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(187); +/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(287); +/* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(222); +/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */ @@ -28647,16 +28907,16 @@ var TimeInterval = /*@__PURE__*/ (function () { /***/ }), -/* 327 */ +/* 328 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; }); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(186); -/* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(195); -/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(328); -/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(180); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(187); +/* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(196); +/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(329); +/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(181); /** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */ @@ -28672,17 +28932,17 @@ function timeout(due, scheduler) { /***/ }), -/* 328 */ +/* 329 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186); -/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(260); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(187); +/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(261); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -28754,15 +29014,15 @@ var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 329 */ +/* 330 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; }); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(186); -/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(197); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(187); +/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(198); /** PURE_IMPORTS_START _scheduler_async,_map PURE_IMPORTS_END */ @@ -28784,13 +29044,13 @@ var Timestamp = /*@__PURE__*/ (function () { /***/ }), -/* 330 */ +/* 331 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; }); -/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(285); +/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(286); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function toArrayReducer(arr, item, index) { @@ -28807,16 +29067,16 @@ function toArray() { /***/ }), -/* 331 */ +/* 332 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return window; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -28887,15 +29147,15 @@ var WindowSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 332 */ +/* 333 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(143); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(158); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159); /** PURE_IMPORTS_START tslib,_Subscriber,_Subject PURE_IMPORTS_END */ @@ -28977,18 +29237,18 @@ var WindowCountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 333 */ +/* 334 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(186); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(143); -/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(228); -/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176); +/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(229); +/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(177); /** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ @@ -29147,17 +29407,17 @@ function dispatchWindowClose(state) { /***/ }), -/* 334 */ +/* 335 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subject,_Subscription,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -29290,16 +29550,16 @@ var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 335 */ +/* 336 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(159); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -29387,15 +29647,15 @@ var WindowSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 336 */ +/* 337 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); -/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(144); +/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); +/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -29482,13 +29742,13 @@ var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 337 */ +/* 338 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; }); -/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(240); +/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(241); /** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */ function zip() { @@ -29504,13 +29764,13 @@ function zip() { /***/ }), -/* 338 */ +/* 339 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; }); -/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(240); +/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(241); /** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */ function zipAll(project) { @@ -29520,7 +29780,7 @@ function zipAll(project) { /***/ }), -/* 339 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29570,7 +29830,7 @@ module.exports = callback => { /***/ }), -/* 340 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29594,6 +29854,7 @@ module.exports = callback => { * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.isCliError = exports.createCliError = void 0; const $isCliError = Symbol('isCliError'); function createCliError(message) { const error = new Error(message); @@ -29608,7 +29869,7 @@ exports.isCliError = isCliError; /***/ }), -/* 341 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29632,17 +29893,18 @@ exports.isCliError = isCliError; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.startProc = void 0; const tslib_1 = __webpack_require__(6); -const execa_1 = tslib_1.__importDefault(__webpack_require__(342)); -const fs_1 = __webpack_require__(349); +const execa_1 = tslib_1.__importDefault(__webpack_require__(343)); +const fs_1 = __webpack_require__(350); const Rx = tslib_1.__importStar(__webpack_require__(140)); -const operators_1 = __webpack_require__(241); -const chalk_1 = tslib_1.__importDefault(__webpack_require__(386)); -const tree_kill_1 = tslib_1.__importDefault(__webpack_require__(396)); -const util_1 = __webpack_require__(397); +const operators_1 = __webpack_require__(242); +const chalk_1 = tslib_1.__importDefault(__webpack_require__(387)); +const tree_kill_1 = tslib_1.__importDefault(__webpack_require__(397)); +const util_1 = __webpack_require__(398); const treeKillAsync = util_1.promisify((...args) => tree_kill_1.default(...args)); -const observe_lines_1 = __webpack_require__(398); -const errors_1 = __webpack_require__(340); +const observe_lines_1 = __webpack_require__(399); +const errors_1 = __webpack_require__(341); const SECOND = 1000; const STOP_TIMEOUT = 30 * SECOND; async function withTimeout(attempt, ms, onTimeout) { @@ -29743,23 +30005,23 @@ exports.startProc = startProc; /***/ }), -/* 342 */ +/* 343 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const childProcess = __webpack_require__(343); -const crossSpawn = __webpack_require__(344); -const stripFinalNewline = __webpack_require__(358); -const npmRunPath = __webpack_require__(359); -const onetime = __webpack_require__(360); -const makeError = __webpack_require__(362); -const normalizeStdio = __webpack_require__(368); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(369); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(374); -const {mergePromise, getSpawnedPromise} = __webpack_require__(384); -const {joinCommand, parseCommand} = __webpack_require__(385); +const childProcess = __webpack_require__(344); +const crossSpawn = __webpack_require__(345); +const stripFinalNewline = __webpack_require__(359); +const npmRunPath = __webpack_require__(360); +const onetime = __webpack_require__(361); +const makeError = __webpack_require__(363); +const normalizeStdio = __webpack_require__(369); +const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(370); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(375); +const {mergePromise, getSpawnedPromise} = __webpack_require__(385); +const {joinCommand, parseCommand} = __webpack_require__(386); const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; @@ -30006,21 +30268,21 @@ module.exports.node = (scriptPath, args, options = {}) => { /***/ }), -/* 343 */ +/* 344 */ /***/ (function(module, exports) { module.exports = require("child_process"); /***/ }), -/* 344 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const cp = __webpack_require__(343); -const parse = __webpack_require__(345); -const enoent = __webpack_require__(357); +const cp = __webpack_require__(344); +const parse = __webpack_require__(346); +const enoent = __webpack_require__(358); function spawn(command, args, options) { // Parse the arguments @@ -30058,16 +30320,16 @@ module.exports._enoent = enoent; /***/ }), -/* 345 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const resolveCommand = __webpack_require__(346); -const escape = __webpack_require__(353); -const readShebang = __webpack_require__(354); +const resolveCommand = __webpack_require__(347); +const escape = __webpack_require__(354); +const readShebang = __webpack_require__(355); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; @@ -30156,15 +30418,15 @@ module.exports = parse; /***/ }), -/* 346 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const which = __webpack_require__(347); -const pathKey = __webpack_require__(352)(); +const which = __webpack_require__(348); +const pathKey = __webpack_require__(353)(); function resolveCommandAttempt(parsed, withoutPathExt) { const cwd = process.cwd(); @@ -30214,7 +30476,7 @@ module.exports = resolveCommand; /***/ }), -/* 347 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { const isWindows = process.platform === 'win32' || @@ -30223,7 +30485,7 @@ const isWindows = process.platform === 'win32' || const path = __webpack_require__(4) const COLON = isWindows ? ';' : ':' -const isexe = __webpack_require__(348) +const isexe = __webpack_require__(349) const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) @@ -30345,15 +30607,15 @@ which.sync = whichSync /***/ }), -/* 348 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(349) +var fs = __webpack_require__(350) var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(350) -} else { core = __webpack_require__(351) +} else { + core = __webpack_require__(352) } module.exports = isexe @@ -30408,19 +30670,19 @@ function sync (path, options) { /***/ }), -/* 349 */ +/* 350 */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), -/* 350 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { module.exports = isexe isexe.sync = sync -var fs = __webpack_require__(349) +var fs = __webpack_require__(350) function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? @@ -30462,13 +30724,13 @@ function sync (path, options) { /***/ }), -/* 351 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { module.exports = isexe isexe.sync = sync -var fs = __webpack_require__(349) +var fs = __webpack_require__(350) function isexe (path, options, cb) { fs.stat(path, function (er, stat) { @@ -30509,7 +30771,7 @@ function checkMode (stat, options) { /***/ }), -/* 352 */ +/* 353 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30532,7 +30794,7 @@ module.exports.default = pathKey; /***/ }), -/* 353 */ +/* 354 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30584,14 +30846,14 @@ module.exports.argument = escapeArgument; /***/ }), -/* 354 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); -const shebangCommand = __webpack_require__(355); +const fs = __webpack_require__(350); +const shebangCommand = __webpack_require__(356); function readShebang(command) { // Read the first 150 bytes from the file @@ -30614,12 +30876,12 @@ module.exports = readShebang; /***/ }), -/* 355 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const shebangRegex = __webpack_require__(356); +const shebangRegex = __webpack_require__(357); module.exports = (string = '') => { const match = string.match(shebangRegex); @@ -30640,7 +30902,7 @@ module.exports = (string = '') => { /***/ }), -/* 356 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30649,7 +30911,7 @@ module.exports = /^#!(.*)/; /***/ }), -/* 357 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30715,7 +30977,7 @@ module.exports = { /***/ }), -/* 358 */ +/* 359 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30738,13 +31000,13 @@ module.exports = input => { /***/ }), -/* 359 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const pathKey = __webpack_require__(352); +const pathKey = __webpack_require__(353); const npmRunPath = options => { options = { @@ -30792,12 +31054,12 @@ module.exports.env = options => { /***/ }), -/* 360 */ +/* 361 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const mimicFn = __webpack_require__(361); +const mimicFn = __webpack_require__(362); const calledFunctions = new WeakMap(); @@ -30849,7 +31111,7 @@ module.exports.callCount = fn => { /***/ }), -/* 361 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30869,12 +31131,12 @@ module.exports.default = mimicFn; /***/ }), -/* 362 */ +/* 363 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {signalsByName} = __webpack_require__(363); +const {signalsByName} = __webpack_require__(364); const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { if (timedOut) { @@ -30962,14 +31224,14 @@ module.exports = makeError; /***/ }), -/* 363 */ +/* 364 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports,"__esModule",{value:true});exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(364); +Object.defineProperty(exports,"__esModule",{value:true});exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(365); -var _signals=__webpack_require__(365); -var _realtime=__webpack_require__(367); +var _signals=__webpack_require__(366); +var _realtime=__webpack_require__(368); @@ -31039,20 +31301,20 @@ const signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumb //# sourceMappingURL=main.js.map /***/ }), -/* 364 */ +/* 365 */ /***/ (function(module, exports) { module.exports = require("os"); /***/ }), -/* 365 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports,"__esModule",{value:true});exports.getSignals=void 0;var _os=__webpack_require__(364); +Object.defineProperty(exports,"__esModule",{value:true});exports.getSignals=void 0;var _os=__webpack_require__(365); -var _core=__webpack_require__(366); -var _realtime=__webpack_require__(367); +var _core=__webpack_require__(367); +var _realtime=__webpack_require__(368); @@ -31086,7 +31348,7 @@ return{name,number,description,supported,action,forced,standard}; //# sourceMappingURL=signals.js.map /***/ }), -/* 366 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31365,7 +31627,7 @@ standard:"other"}];exports.SIGNALS=SIGNALS; //# sourceMappingURL=core.js.map /***/ }), -/* 367 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31390,7 +31652,7 @@ const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; //# sourceMappingURL=realtime.js.map /***/ }), -/* 368 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31449,13 +31711,13 @@ module.exports.node = opts => { /***/ }), -/* 369 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); -const onExit = __webpack_require__(370); +const os = __webpack_require__(365); +const onExit = __webpack_require__(371); const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; @@ -31568,16 +31830,16 @@ module.exports = { /***/ }), -/* 370 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. -var assert = __webpack_require__(371) -var signals = __webpack_require__(372) +var assert = __webpack_require__(372) +var signals = __webpack_require__(373) -var EE = __webpack_require__(373) +var EE = __webpack_require__(374) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -31731,13 +31993,13 @@ function processEmit (ev, arg) { /***/ }), -/* 371 */ +/* 372 */ /***/ (function(module, exports) { module.exports = require("assert"); /***/ }), -/* 372 */ +/* 373 */ /***/ (function(module, exports) { // This is not the set of all possible signals. @@ -31796,20 +32058,20 @@ if (process.platform === 'linux') { /***/ }), -/* 373 */ +/* 374 */ /***/ (function(module, exports) { module.exports = require("events"); /***/ }), -/* 374 */ +/* 375 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const isStream = __webpack_require__(375); -const getStream = __webpack_require__(376); -const mergeStream = __webpack_require__(383); +const isStream = __webpack_require__(376); +const getStream = __webpack_require__(377); +const mergeStream = __webpack_require__(384); // `input` option const handleInput = (spawned, input) => { @@ -31906,7 +32168,7 @@ module.exports = { /***/ }), -/* 375 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31942,13 +32204,13 @@ module.exports = isStream; /***/ }), -/* 376 */ +/* 377 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pump = __webpack_require__(377); -const bufferStream = __webpack_require__(381); +const pump = __webpack_require__(378); +const bufferStream = __webpack_require__(382); class MaxBufferError extends Error { constructor() { @@ -32007,12 +32269,12 @@ module.exports.MaxBufferError = MaxBufferError; /***/ }), -/* 377 */ +/* 378 */ /***/ (function(module, exports, __webpack_require__) { -var once = __webpack_require__(378) -var eos = __webpack_require__(380) -var fs = __webpack_require__(349) // we only need fs to get the ReadStream and WriteStream prototypes +var once = __webpack_require__(379) +var eos = __webpack_require__(381) +var fs = __webpack_require__(350) // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) @@ -32095,10 +32357,10 @@ module.exports = pump /***/ }), -/* 378 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { -var wrappy = __webpack_require__(379) +var wrappy = __webpack_require__(380) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -32143,7 +32405,7 @@ function onceStrict (fn) { /***/ }), -/* 379 */ +/* 380 */ /***/ (function(module, exports) { // Returns a wrapper function that returns a wrapped callback @@ -32182,10 +32444,10 @@ function wrappy (fn, cb) { /***/ }), -/* 380 */ +/* 381 */ /***/ (function(module, exports, __webpack_require__) { -var once = __webpack_require__(378); +var once = __webpack_require__(379); var noop = function() {}; @@ -32275,12 +32537,12 @@ module.exports = eos; /***/ }), -/* 381 */ +/* 382 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {PassThrough: PassThroughStream} = __webpack_require__(382); +const {PassThrough: PassThroughStream} = __webpack_require__(383); module.exports = options => { options = {...options}; @@ -32334,19 +32596,19 @@ module.exports = options => { /***/ }), -/* 382 */ +/* 383 */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), -/* 383 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const { PassThrough } = __webpack_require__(382); +const { PassThrough } = __webpack_require__(383); module.exports = function (/*streams...*/) { var sources = [] @@ -32388,7 +32650,7 @@ module.exports = function (/*streams...*/) { /***/ }), -/* 384 */ +/* 385 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32441,7 +32703,7 @@ module.exports = { /***/ }), -/* 385 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32486,16 +32748,16 @@ module.exports = { /***/ }), -/* 386 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(387); -const ansiStyles = __webpack_require__(388); -const stdoutColor = __webpack_require__(393).stdout; +const escapeStringRegexp = __webpack_require__(388); +const ansiStyles = __webpack_require__(389); +const stdoutColor = __webpack_require__(394).stdout; -const template = __webpack_require__(395); +const template = __webpack_require__(396); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -32721,7 +32983,7 @@ module.exports.default = module.exports; // For TypeScript /***/ }), -/* 387 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32739,12 +33001,12 @@ module.exports = function (str) { /***/ }), -/* 388 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(389); +const colorConvert = __webpack_require__(390); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -32912,11 +33174,11 @@ Object.defineProperty(module, 'exports', { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11)(module))) /***/ }), -/* 389 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { -var conversions = __webpack_require__(390); -var route = __webpack_require__(392); +var conversions = __webpack_require__(391); +var route = __webpack_require__(393); var convert = {}; @@ -32996,11 +33258,11 @@ module.exports = convert; /***/ }), -/* 390 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { /* MIT license */ -var cssKeywords = __webpack_require__(391); +var cssKeywords = __webpack_require__(392); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -33863,7 +34125,7 @@ convert.rgb.gray = function (rgb) { /***/ }), -/* 391 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34022,10 +34284,10 @@ module.exports = { /***/ }), -/* 392 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { -var conversions = __webpack_require__(390); +var conversions = __webpack_require__(391); /* this function routes a model to all other models. @@ -34125,13 +34387,13 @@ module.exports = function (fromModel) { /***/ }), -/* 393 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); -const hasFlag = __webpack_require__(394); +const os = __webpack_require__(365); +const hasFlag = __webpack_require__(395); const env = process.env; @@ -34267,7 +34529,7 @@ module.exports = { /***/ }), -/* 394 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34282,7 +34544,7 @@ module.exports = (flag, argv) => { /***/ }), -/* 395 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34417,13 +34679,13 @@ module.exports = (chalk, tmp) => { /***/ }), -/* 396 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var childProcess = __webpack_require__(343); +var childProcess = __webpack_require__(344); var spawn = childProcess.spawn; var exec = childProcess.exec; @@ -34542,13 +34804,13 @@ function buildProcessTree (parentPid, tree, pidsToProcess, spawnChildProcessesLi /***/ }), -/* 397 */ +/* 398 */ /***/ (function(module, exports) { module.exports = require("util"); /***/ }), -/* 398 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34572,11 +34834,12 @@ module.exports = require("util"); * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.observeLines = void 0; const tslib_1 = __webpack_require__(6); const Rx = tslib_1.__importStar(__webpack_require__(140)); -const operators_1 = __webpack_require__(241); +const operators_1 = __webpack_require__(242); const SEP = /\r?\n/; -const observe_readable_1 = __webpack_require__(399); +const observe_readable_1 = __webpack_require__(400); /** * Creates an Observable from a Readable Stream that: * - splits data from `readable` into lines @@ -34617,7 +34880,7 @@ exports.observeLines = observeLines; /***/ }), -/* 399 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34641,9 +34904,10 @@ exports.observeLines = observeLines; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.observeReadable = void 0; const tslib_1 = __webpack_require__(6); const Rx = tslib_1.__importStar(__webpack_require__(140)); -const operators_1 = __webpack_require__(241); +const operators_1 = __webpack_require__(242); /** * Produces an Observable from a ReadableSteam that: * - completes on the first "end" event @@ -34656,7 +34920,7 @@ exports.observeReadable = observeReadable; /***/ }), -/* 400 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34680,19 +34944,19 @@ exports.observeReadable = observeReadable; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -var tooling_log_1 = __webpack_require__(401); -exports.ToolingLog = tooling_log_1.ToolingLog; -var tooling_log_text_writer_1 = __webpack_require__(402); -exports.ToolingLogTextWriter = tooling_log_text_writer_1.ToolingLogTextWriter; -var log_levels_1 = __webpack_require__(403); -exports.pickLevelFromFlags = log_levels_1.pickLevelFromFlags; -exports.parseLogLevel = log_levels_1.parseLogLevel; -var tooling_log_collecting_writer_1 = __webpack_require__(404); -exports.ToolingLogCollectingWriter = tooling_log_collecting_writer_1.ToolingLogCollectingWriter; +var tooling_log_1 = __webpack_require__(402); +Object.defineProperty(exports, "ToolingLog", { enumerable: true, get: function () { return tooling_log_1.ToolingLog; } }); +var tooling_log_text_writer_1 = __webpack_require__(403); +Object.defineProperty(exports, "ToolingLogTextWriter", { enumerable: true, get: function () { return tooling_log_text_writer_1.ToolingLogTextWriter; } }); +var log_levels_1 = __webpack_require__(404); +Object.defineProperty(exports, "pickLevelFromFlags", { enumerable: true, get: function () { return log_levels_1.pickLevelFromFlags; } }); +Object.defineProperty(exports, "parseLogLevel", { enumerable: true, get: function () { return log_levels_1.parseLogLevel; } }); +var tooling_log_collecting_writer_1 = __webpack_require__(405); +Object.defineProperty(exports, "ToolingLogCollectingWriter", { enumerable: true, get: function () { return tooling_log_collecting_writer_1.ToolingLogCollectingWriter; } }); /***/ }), -/* 401 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34716,9 +34980,10 @@ exports.ToolingLogCollectingWriter = tooling_log_collecting_writer_1.ToolingLogC * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.ToolingLog = void 0; const tslib_1 = __webpack_require__(6); const Rx = tslib_1.__importStar(__webpack_require__(140)); -const tooling_log_text_writer_1 = __webpack_require__(402); +const tooling_log_text_writer_1 = __webpack_require__(403); class ToolingLog { constructor(writerConfig) { this.identWidth = 0; @@ -34780,7 +35045,7 @@ exports.ToolingLog = ToolingLog; /***/ }), -/* 402 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34804,10 +35069,11 @@ exports.ToolingLog = ToolingLog; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.ToolingLogTextWriter = void 0; const tslib_1 = __webpack_require__(6); -const util_1 = __webpack_require__(397); -const chalk_1 = tslib_1.__importDefault(__webpack_require__(386)); -const log_levels_1 = __webpack_require__(403); +const util_1 = __webpack_require__(398); +const chalk_1 = tslib_1.__importDefault(__webpack_require__(387)); +const log_levels_1 = __webpack_require__(404); const { magentaBright, yellow, red, blue, green, dim } = chalk_1.default; const PREFIX_INDENT = ' '.repeat(6); const MSG_PREFIXES = { @@ -34874,7 +35140,7 @@ exports.ToolingLogTextWriter = ToolingLogTextWriter; /***/ }), -/* 403 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34898,6 +35164,7 @@ exports.ToolingLogTextWriter = ToolingLogTextWriter; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseLogLevel = exports.pickLevelFromFlags = void 0; const LEVELS = ['silent', 'error', 'warning', 'info', 'debug', 'verbose']; function pickLevelFromFlags(flags, options = {}) { if (flags.verbose) @@ -34930,7 +35197,7 @@ exports.parseLogLevel = parseLogLevel; /***/ }), -/* 404 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34954,7 +35221,8 @@ exports.parseLogLevel = parseLogLevel; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const tooling_log_text_writer_1 = __webpack_require__(402); +exports.ToolingLogCollectingWriter = void 0; +const tooling_log_text_writer_1 = __webpack_require__(403); class ToolingLogCollectingWriter extends tooling_log_text_writer_1.ToolingLogTextWriter { constructor(level = 'verbose') { super({ @@ -34973,7 +35241,7 @@ exports.ToolingLogCollectingWriter = ToolingLogCollectingWriter; /***/ }), -/* 405 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34997,12 +35265,12 @@ exports.ToolingLogCollectingWriter = ToolingLogCollectingWriter; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -var absolute_path_serializer_1 = __webpack_require__(406); -exports.createAbsolutePathSerializer = absolute_path_serializer_1.createAbsolutePathSerializer; +var absolute_path_serializer_1 = __webpack_require__(407); +Object.defineProperty(exports, "createAbsolutePathSerializer", { enumerable: true, get: function () { return absolute_path_serializer_1.createAbsolutePathSerializer; } }); /***/ }), -/* 406 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35026,7 +35294,8 @@ exports.createAbsolutePathSerializer = absolute_path_serializer_1.createAbsolute * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const repo_root_1 = __webpack_require__(407); +exports.createAbsolutePathSerializer = void 0; +const repo_root_1 = __webpack_require__(408); function createAbsolutePathSerializer(rootPath = repo_root_1.REPO_ROOT) { return { print: (value) => value.replace(rootPath, '').replace(/\\/g, '/'), @@ -35037,7 +35306,7 @@ exports.createAbsolutePathSerializer = createAbsolutePathSerializer; /***/ }), -/* 407 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35061,10 +35330,11 @@ exports.createAbsolutePathSerializer = createAbsolutePathSerializer; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.REPO_ROOT = void 0; const tslib_1 = __webpack_require__(6); const path_1 = tslib_1.__importDefault(__webpack_require__(4)); -const fs_1 = tslib_1.__importDefault(__webpack_require__(349)); -const load_json_file_1 = tslib_1.__importDefault(__webpack_require__(408)); +const fs_1 = tslib_1.__importDefault(__webpack_require__(350)); +const load_json_file_1 = tslib_1.__importDefault(__webpack_require__(409)); const isKibanaDir = (dir) => { try { const path = path_1.default.resolve(dir, 'package.json'); @@ -35100,16 +35370,16 @@ exports.REPO_ROOT = cursor; /***/ }), -/* 408 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const {promisify} = __webpack_require__(397); -const fs = __webpack_require__(409); -const stripBom = __webpack_require__(414); -const parseJson = __webpack_require__(415); +const {promisify} = __webpack_require__(398); +const fs = __webpack_require__(410); +const stripBom = __webpack_require__(415); +const parseJson = __webpack_require__(416); const parse = (data, filePath, options = {}) => { data = stripBom(data); @@ -35126,17 +35396,17 @@ module.exports.sync = (filePath, options) => parse(fs.readFileSync(filePath, 'ut /***/ }), -/* 409 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(349) -var polyfills = __webpack_require__(410) -var legacy = __webpack_require__(412) -var clone = __webpack_require__(413) +var fs = __webpack_require__(350) +var polyfills = __webpack_require__(411) +var legacy = __webpack_require__(413) +var clone = __webpack_require__(414) var queue = [] -var util = __webpack_require__(397) +var util = __webpack_require__(398) function noop () {} @@ -35153,7 +35423,7 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(queue) - __webpack_require__(371).equal(queue.length, 0) + __webpack_require__(372).equal(queue.length, 0) }) } @@ -35411,10 +35681,10 @@ function retry () { /***/ }), -/* 410 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { -var constants = __webpack_require__(411) +var constants = __webpack_require__(412) var origCwd = process.cwd var cwd = null @@ -35746,16 +36016,16 @@ function patch (fs) { /***/ }), -/* 411 */ +/* 412 */ /***/ (function(module, exports) { module.exports = require("constants"); /***/ }), -/* 412 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(382).Stream +var Stream = __webpack_require__(383).Stream module.exports = legacy @@ -35876,7 +36146,7 @@ function legacy (fs) { /***/ }), -/* 413 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35902,7 +36172,7 @@ function clone (obj) { /***/ }), -/* 414 */ +/* 415 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35924,15 +36194,15 @@ module.exports = string => { /***/ }), -/* 415 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const errorEx = __webpack_require__(416); -const fallback = __webpack_require__(418); -const {default: LinesAndColumns} = __webpack_require__(419); -const {codeFrameColumns} = __webpack_require__(420); +const errorEx = __webpack_require__(417); +const fallback = __webpack_require__(419); +const {default: LinesAndColumns} = __webpack_require__(420); +const {codeFrameColumns} = __webpack_require__(421); const JSONError = errorEx('JSONError', { fileName: errorEx.append('in %s'), @@ -35981,14 +36251,14 @@ module.exports = (string, reviver, filename) => { /***/ }), -/* 416 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(397); -var isArrayish = __webpack_require__(417); +var util = __webpack_require__(398); +var isArrayish = __webpack_require__(418); var errorEx = function errorEx(name, properties) { if (!name || name.constructor !== String) { @@ -36121,7 +36391,7 @@ module.exports = errorEx; /***/ }), -/* 417 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36138,7 +36408,7 @@ module.exports = function isArrayish(obj) { /***/ }), -/* 418 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36177,7 +36447,7 @@ function parseJson (txt, reviver, context) { /***/ }), -/* 419 */ +/* 420 */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; @@ -36241,7 +36511,7 @@ var LinesAndColumns = (function () { /***/ }), -/* 420 */ +/* 421 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36253,7 +36523,7 @@ Object.defineProperty(exports, "__esModule", { exports.codeFrameColumns = codeFrameColumns; exports.default = _default; -var _highlight = _interopRequireWildcard(__webpack_require__(421)); +var _highlight = _interopRequireWildcard(__webpack_require__(422)); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } @@ -36414,7 +36684,7 @@ function _default(rawLines, lineNumber, colNumber, opts = {}) { } /***/ }), -/* 421 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36427,11 +36697,11 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var _jsTokens = _interopRequireWildcard(__webpack_require__(422)); +var _jsTokens = _interopRequireWildcard(__webpack_require__(423)); -var _helperValidatorIdentifier = __webpack_require__(423); +var _helperValidatorIdentifier = __webpack_require__(424); -var _chalk = _interopRequireDefault(__webpack_require__(426)); +var _chalk = _interopRequireDefault(__webpack_require__(427)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -36527,7 +36797,7 @@ function highlight(code, options = {}) { } /***/ }), -/* 422 */ +/* 423 */ /***/ (function(module, exports) { // Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell @@ -36556,7 +36826,7 @@ exports.matchToToken = function(match) { /***/ }), -/* 423 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36614,12 +36884,12 @@ Object.defineProperty(exports, "isKeyword", { } }); -var _identifier = __webpack_require__(424); +var _identifier = __webpack_require__(425); -var _keyword = __webpack_require__(425); +var _keyword = __webpack_require__(426); /***/ }), -/* 424 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36702,7 +36972,7 @@ function isIdentifierName(name) { } /***/ }), -/* 425 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36746,16 +37016,16 @@ function isKeyword(word) { } /***/ }), -/* 426 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(387); -const ansiStyles = __webpack_require__(427); -const stdoutColor = __webpack_require__(428).stdout; +const escapeStringRegexp = __webpack_require__(388); +const ansiStyles = __webpack_require__(428); +const stdoutColor = __webpack_require__(429).stdout; -const template = __webpack_require__(429); +const template = __webpack_require__(430); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -36981,12 +37251,12 @@ module.exports.default = module.exports; // For TypeScript /***/ }), -/* 427 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(389); +const colorConvert = __webpack_require__(390); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -37154,13 +37424,13 @@ Object.defineProperty(module, 'exports', { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11)(module))) /***/ }), -/* 428 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); -const hasFlag = __webpack_require__(394); +const os = __webpack_require__(365); +const hasFlag = __webpack_require__(395); const env = process.env; @@ -37296,7 +37566,7 @@ module.exports = { /***/ }), -/* 429 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37431,7 +37701,7 @@ module.exports = (chalk, tmp) => { /***/ }), -/* 430 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37455,6 +37725,7 @@ module.exports = (chalk, tmp) => { * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.KBN_P12_PASSWORD = exports.KBN_P12_PATH = exports.KBN_CERT_PATH = exports.KBN_KEY_PATH = exports.ES_NOPASSWORD_P12_PATH = exports.ES_EMPTYPASSWORD_P12_PATH = exports.ES_P12_PASSWORD = exports.ES_P12_PATH = exports.ES_CERT_PATH = exports.ES_KEY_PATH = exports.CA_CERT_PATH = void 0; const path_1 = __webpack_require__(4); exports.CA_CERT_PATH = path_1.resolve(__dirname, '../certs/ca.crt'); exports.ES_KEY_PATH = path_1.resolve(__dirname, '../certs/elasticsearch.key'); @@ -37470,7 +37741,7 @@ exports.KBN_P12_PASSWORD = 'storepass'; /***/ }), -/* 431 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37494,17 +37765,17 @@ exports.KBN_P12_PASSWORD = 'storepass'; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -var run_1 = __webpack_require__(432); -exports.run = run_1.run; -var fail_1 = __webpack_require__(433); -exports.createFailError = fail_1.createFailError; -exports.createFlagError = fail_1.createFlagError; -exports.combineErrors = fail_1.combineErrors; -exports.isFailError = fail_1.isFailError; +var run_1 = __webpack_require__(433); +Object.defineProperty(exports, "run", { enumerable: true, get: function () { return run_1.run; } }); +var fail_1 = __webpack_require__(434); +Object.defineProperty(exports, "createFailError", { enumerable: true, get: function () { return fail_1.createFailError; } }); +Object.defineProperty(exports, "createFlagError", { enumerable: true, get: function () { return fail_1.createFlagError; } }); +Object.defineProperty(exports, "combineErrors", { enumerable: true, get: function () { return fail_1.combineErrors; } }); +Object.defineProperty(exports, "isFailError", { enumerable: true, get: function () { return fail_1.isFailError; } }); /***/ }), -/* 432 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37528,13 +37799,14 @@ exports.isFailError = fail_1.isFailError; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.run = void 0; const tslib_1 = __webpack_require__(6); -const util_1 = __webpack_require__(397); +const util_1 = __webpack_require__(398); // @ts-ignore @types are outdated and module is super simple -const exit_hook_1 = tslib_1.__importDefault(__webpack_require__(339)); -const tooling_log_1 = __webpack_require__(400); -const fail_1 = __webpack_require__(433); -const flags_1 = __webpack_require__(434); +const exit_hook_1 = tslib_1.__importDefault(__webpack_require__(340)); +const tooling_log_1 = __webpack_require__(401); +const fail_1 = __webpack_require__(434); +const flags_1 = __webpack_require__(435); const proc_runner_1 = __webpack_require__(7); async function run(fn, options = {}) { var _a; @@ -37609,7 +37881,7 @@ exports.run = run; /***/ }), -/* 433 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37633,7 +37905,8 @@ exports.run = run; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = __webpack_require__(397); +exports.combineErrors = exports.isFailError = exports.createFlagError = exports.createFailError = void 0; +const util_1 = __webpack_require__(398); const FAIL_TAG = Symbol('fail error'); function createFailError(reason, options = {}) { const { exitCode = 1, showHelp = false } = options; @@ -37677,7 +37950,7 @@ exports.combineErrors = combineErrors; /***/ }), -/* 434 */ +/* 435 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37701,10 +37974,11 @@ exports.combineErrors = combineErrors; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.getHelp = exports.getFlags = void 0; const tslib_1 = __webpack_require__(6); const path_1 = __webpack_require__(4); const dedent_1 = tslib_1.__importDefault(__webpack_require__(2)); -const getopts_1 = tslib_1.__importDefault(__webpack_require__(435)); +const getopts_1 = tslib_1.__importDefault(__webpack_require__(436)); function getFlags(argv, options) { const unexpectedNames = new Set(); const flagOpts = options.flags || {}; @@ -37779,9 +38053,9 @@ function getFlags(argv, options) { } exports.getFlags = getFlags; function getHelp(options) { - var _a, _b; + var _a; const usage = options.usage || `node ${path_1.relative(process.cwd(), process.argv[1])}`; - const optionHelp = (dedent_1.default(((_b = (_a = options) === null || _a === void 0 ? void 0 : _a.flags) === null || _b === void 0 ? void 0 : _b.help) || '') + + const optionHelp = (dedent_1.default(((_a = options === null || options === void 0 ? void 0 : options.flags) === null || _a === void 0 ? void 0 : _a.help) || '') + '\n' + dedent_1.default ` --verbose, -v Log verbosely @@ -37807,7 +38081,7 @@ exports.getHelp = getHelp; /***/ }), -/* 435 */ +/* 436 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38019,7 +38293,7 @@ module.exports = getopts /***/ }), -/* 436 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38043,14 +38317,14 @@ module.exports = getopts * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -var kbn_client_1 = __webpack_require__(437); -exports.KbnClient = kbn_client_1.KbnClient; -var kbn_client_requester_1 = __webpack_require__(438); -exports.uriencode = kbn_client_requester_1.uriencode; +var kbn_client_1 = __webpack_require__(438); +Object.defineProperty(exports, "KbnClient", { enumerable: true, get: function () { return kbn_client_1.KbnClient; } }); +var kbn_client_requester_1 = __webpack_require__(439); +Object.defineProperty(exports, "uriencode", { enumerable: true, get: function () { return kbn_client_requester_1.uriencode; } }); /***/ }), -/* 437 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38074,12 +38348,13 @@ exports.uriencode = kbn_client_requester_1.uriencode; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const kbn_client_requester_1 = __webpack_require__(438); -const kbn_client_status_1 = __webpack_require__(481); -const kbn_client_plugins_1 = __webpack_require__(482); -const kbn_client_version_1 = __webpack_require__(483); -const kbn_client_saved_objects_1 = __webpack_require__(484); -const kbn_client_ui_settings_1 = __webpack_require__(485); +exports.KbnClient = void 0; +const kbn_client_requester_1 = __webpack_require__(439); +const kbn_client_status_1 = __webpack_require__(482); +const kbn_client_plugins_1 = __webpack_require__(483); +const kbn_client_version_1 = __webpack_require__(484); +const kbn_client_saved_objects_1 = __webpack_require__(485); +const kbn_client_ui_settings_1 = __webpack_require__(486); class KbnClient { /** * Basic Kibana server client that implements common behaviors for talking @@ -38117,7 +38392,7 @@ exports.KbnClient = KbnClient; /***/ }), -/* 438 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38141,10 +38416,11 @@ exports.KbnClient = KbnClient; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.KbnClientRequester = exports.uriencode = void 0; const tslib_1 = __webpack_require__(6); -const url_1 = tslib_1.__importDefault(__webpack_require__(439)); -const axios_1 = tslib_1.__importDefault(__webpack_require__(440)); -const axios_2 = __webpack_require__(479); +const url_1 = tslib_1.__importDefault(__webpack_require__(440)); +const axios_1 = tslib_1.__importDefault(__webpack_require__(441)); +const axios_2 = __webpack_require__(480); const isConcliftOnGetError = (error) => { return (axios_2.isAxiosResponseError(error) && error.config.method === 'GET' && error.response.status === 409); }; @@ -38184,7 +38460,7 @@ class KbnClientRequester { const url = url_1.default.resolve(this.pickUrl(), options.path); const description = options.description || `${options.method} ${url}`; let attempt = 0; - const maxAttempts = (_a = options.retries, (_a !== null && _a !== void 0 ? _a : DEFAULT_MAX_ATTEMPTS)); + const maxAttempts = (_a = options.retries) !== null && _a !== void 0 ? _a : DEFAULT_MAX_ATTEMPTS; while (true) { attempt += 1; try { @@ -38228,29 +38504,29 @@ exports.KbnClientRequester = KbnClientRequester; /***/ }), -/* 439 */ +/* 440 */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), -/* 440 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(441); +module.exports = __webpack_require__(442); /***/ }), -/* 441 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); -var bind = __webpack_require__(443); -var Axios = __webpack_require__(444); -var mergeConfig = __webpack_require__(475); -var defaults = __webpack_require__(450); +var utils = __webpack_require__(443); +var bind = __webpack_require__(444); +var Axios = __webpack_require__(445); +var mergeConfig = __webpack_require__(476); +var defaults = __webpack_require__(451); /** * Create an instance of Axios @@ -38283,15 +38559,15 @@ axios.create = function create(instanceConfig) { }; // Expose Cancel & CancelToken -axios.Cancel = __webpack_require__(476); -axios.CancelToken = __webpack_require__(477); -axios.isCancel = __webpack_require__(449); +axios.Cancel = __webpack_require__(477); +axios.CancelToken = __webpack_require__(478); +axios.isCancel = __webpack_require__(450); // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; -axios.spread = __webpack_require__(478); +axios.spread = __webpack_require__(479); module.exports = axios; @@ -38300,13 +38576,13 @@ module.exports.default = axios; /***/ }), -/* 442 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var bind = __webpack_require__(443); +var bind = __webpack_require__(444); /*global toString:true*/ @@ -38651,7 +38927,7 @@ module.exports = { /***/ }), -/* 443 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38669,17 +38945,17 @@ module.exports = function bind(fn, thisArg) { /***/ }), -/* 444 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); -var buildURL = __webpack_require__(445); -var InterceptorManager = __webpack_require__(446); -var dispatchRequest = __webpack_require__(447); -var mergeConfig = __webpack_require__(475); +var utils = __webpack_require__(443); +var buildURL = __webpack_require__(446); +var InterceptorManager = __webpack_require__(447); +var dispatchRequest = __webpack_require__(448); +var mergeConfig = __webpack_require__(476); /** * Create a new instance of Axios @@ -38770,13 +39046,13 @@ module.exports = Axios; /***/ }), -/* 445 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); function encode(val) { return encodeURIComponent(val). @@ -38848,13 +39124,13 @@ module.exports = function buildURL(url, params, paramsSerializer) { /***/ }), -/* 446 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); function InterceptorManager() { this.handlers = []; @@ -38907,16 +39183,16 @@ module.exports = InterceptorManager; /***/ }), -/* 447 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); -var transformData = __webpack_require__(448); -var isCancel = __webpack_require__(449); -var defaults = __webpack_require__(450); +var utils = __webpack_require__(443); +var transformData = __webpack_require__(449); +var isCancel = __webpack_require__(450); +var defaults = __webpack_require__(451); /** * Throws a `Cancel` if cancellation has been requested. @@ -38993,13 +39269,13 @@ module.exports = function dispatchRequest(config) { /***/ }), -/* 448 */ +/* 449 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); /** * Transform the data for a request or a response @@ -39020,7 +39296,7 @@ module.exports = function transformData(data, headers, fns) { /***/ }), -/* 449 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39032,14 +39308,14 @@ module.exports = function isCancel(value) { /***/ }), -/* 450 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); -var normalizeHeaderName = __webpack_require__(451); +var utils = __webpack_require__(443); +var normalizeHeaderName = __webpack_require__(452); var DEFAULT_CONTENT_TYPE = { 'Content-Type': 'application/x-www-form-urlencoded' @@ -39055,10 +39331,10 @@ function getDefaultAdapter() { var adapter; if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter - adapter = __webpack_require__(452); + adapter = __webpack_require__(453); } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { // For node use HTTP adapter - adapter = __webpack_require__(462); + adapter = __webpack_require__(463); } return adapter; } @@ -39136,13 +39412,13 @@ module.exports = defaults; /***/ }), -/* 451 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); module.exports = function normalizeHeaderName(headers, normalizedName) { utils.forEach(headers, function processHeader(value, name) { @@ -39155,19 +39431,19 @@ module.exports = function normalizeHeaderName(headers, normalizedName) { /***/ }), -/* 452 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); -var settle = __webpack_require__(453); -var buildURL = __webpack_require__(445); -var buildFullPath = __webpack_require__(456); -var parseHeaders = __webpack_require__(459); -var isURLSameOrigin = __webpack_require__(460); -var createError = __webpack_require__(454); +var utils = __webpack_require__(443); +var settle = __webpack_require__(454); +var buildURL = __webpack_require__(446); +var buildFullPath = __webpack_require__(457); +var parseHeaders = __webpack_require__(460); +var isURLSameOrigin = __webpack_require__(461); +var createError = __webpack_require__(455); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { @@ -39264,7 +39540,7 @@ module.exports = function xhrAdapter(config) { // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { - var cookies = __webpack_require__(461); + var cookies = __webpack_require__(462); // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? @@ -39342,13 +39618,13 @@ module.exports = function xhrAdapter(config) { /***/ }), -/* 453 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var createError = __webpack_require__(454); +var createError = __webpack_require__(455); /** * Resolve or reject a Promise based on response status. @@ -39374,13 +39650,13 @@ module.exports = function settle(resolve, reject, response) { /***/ }), -/* 454 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var enhanceError = __webpack_require__(455); +var enhanceError = __webpack_require__(456); /** * Create an Error with the specified message, config, error code, request and response. @@ -39399,7 +39675,7 @@ module.exports = function createError(message, config, code, request, response) /***/ }), -/* 455 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39448,14 +39724,14 @@ module.exports = function enhanceError(error, config, code, request, response) { /***/ }), -/* 456 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isAbsoluteURL = __webpack_require__(457); -var combineURLs = __webpack_require__(458); +var isAbsoluteURL = __webpack_require__(458); +var combineURLs = __webpack_require__(459); /** * Creates a new URL by combining the baseURL with the requestedURL, @@ -39475,7 +39751,7 @@ module.exports = function buildFullPath(baseURL, requestedURL) { /***/ }), -/* 457 */ +/* 458 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39496,7 +39772,7 @@ module.exports = function isAbsoluteURL(url) { /***/ }), -/* 458 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39517,13 +39793,13 @@ module.exports = function combineURLs(baseURL, relativeURL) { /***/ }), -/* 459 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); // Headers whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers @@ -39577,13 +39853,13 @@ module.exports = function parseHeaders(headers) { /***/ }), -/* 460 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); module.exports = ( utils.isStandardBrowserEnv() ? @@ -39652,13 +39928,13 @@ module.exports = ( /***/ }), -/* 461 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); module.exports = ( utils.isStandardBrowserEnv() ? @@ -39712,25 +39988,25 @@ module.exports = ( /***/ }), -/* 462 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); -var settle = __webpack_require__(453); -var buildFullPath = __webpack_require__(456); -var buildURL = __webpack_require__(445); -var http = __webpack_require__(463); -var https = __webpack_require__(464); -var httpFollow = __webpack_require__(465).http; -var httpsFollow = __webpack_require__(465).https; -var url = __webpack_require__(439); -var zlib = __webpack_require__(473); -var pkg = __webpack_require__(474); -var createError = __webpack_require__(454); -var enhanceError = __webpack_require__(455); +var utils = __webpack_require__(443); +var settle = __webpack_require__(454); +var buildFullPath = __webpack_require__(457); +var buildURL = __webpack_require__(446); +var http = __webpack_require__(464); +var https = __webpack_require__(465); +var httpFollow = __webpack_require__(466).http; +var httpsFollow = __webpack_require__(466).https; +var url = __webpack_require__(440); +var zlib = __webpack_require__(474); +var pkg = __webpack_require__(475); +var createError = __webpack_require__(455); +var enhanceError = __webpack_require__(456); var isHttps = /https:?/; @@ -39998,27 +40274,27 @@ module.exports = function httpAdapter(config) { /***/ }), -/* 463 */ +/* 464 */ /***/ (function(module, exports) { module.exports = require("http"); /***/ }), -/* 464 */ +/* 465 */ /***/ (function(module, exports) { module.exports = require("https"); /***/ }), -/* 465 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { -var url = __webpack_require__(439); -var http = __webpack_require__(463); -var https = __webpack_require__(464); -var assert = __webpack_require__(371); -var Writable = __webpack_require__(382).Writable; -var debug = __webpack_require__(466)("follow-redirects"); +var url = __webpack_require__(440); +var http = __webpack_require__(464); +var https = __webpack_require__(465); +var assert = __webpack_require__(372); +var Writable = __webpack_require__(383).Writable; +var debug = __webpack_require__(467)("follow-redirects"); // RFC7231§4.2.1: Of the request methods defined by this specification, // the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe. @@ -40338,7 +40614,7 @@ module.exports.wrap = wrap; /***/ }), -/* 466 */ +/* 467 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40347,14 +40623,14 @@ module.exports.wrap = wrap; */ if (typeof process === 'undefined' || process.type === 'renderer') { - module.exports = __webpack_require__(467); + module.exports = __webpack_require__(468); } else { - module.exports = __webpack_require__(470); + module.exports = __webpack_require__(471); } /***/ }), -/* 467 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40363,7 +40639,7 @@ if (typeof process === 'undefined' || process.type === 'renderer') { * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(468); +exports = module.exports = __webpack_require__(469); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -40555,7 +40831,7 @@ function localstorage() { /***/ }), -/* 468 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { @@ -40571,7 +40847,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(469); +exports.humanize = __webpack_require__(470); /** * Active `debug` instances. @@ -40786,7 +41062,7 @@ function coerce(val) { /***/ }), -/* 469 */ +/* 470 */ /***/ (function(module, exports) { /** @@ -40944,15 +41220,15 @@ function plural(ms, n, name) { /***/ }), -/* 470 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies. */ -var tty = __webpack_require__(471); -var util = __webpack_require__(397); +var tty = __webpack_require__(472); +var util = __webpack_require__(398); /** * This is the Node.js implementation of `debug()`. @@ -40960,7 +41236,7 @@ var util = __webpack_require__(397); * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(468); +exports = module.exports = __webpack_require__(469); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; @@ -40975,7 +41251,7 @@ exports.useColors = useColors; exports.colors = [ 6, 2, 3, 4, 5, 1 ]; try { - var supportsColor = __webpack_require__(472); + var supportsColor = __webpack_require__(473); if (supportsColor && supportsColor.level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, @@ -41136,19 +41412,19 @@ exports.enable(load()); /***/ }), -/* 471 */ +/* 472 */ /***/ (function(module, exports) { module.exports = require("tty"); /***/ }), -/* 472 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); -const hasFlag = __webpack_require__(394); +const os = __webpack_require__(365); +const hasFlag = __webpack_require__(395); const env = process.env; @@ -41280,25 +41556,25 @@ module.exports = { /***/ }), -/* 473 */ +/* 474 */ /***/ (function(module, exports) { module.exports = require("zlib"); /***/ }), -/* 474 */ +/* 475 */ /***/ (function(module) { module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.19.2\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test && bundlesize\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://github.com/axios/axios\",\"devDependencies\":{\"bundlesize\":\"^0.17.0\",\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.0.2\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^20.1.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-coverage\":\"^1.1.1\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.2.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^5.2.0\",\"sinon\":\"^4.5.0\",\"typescript\":\"^2.8.1\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"1.5.10\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); /***/ }), -/* 475 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(442); +var utils = __webpack_require__(443); /** * Config-specific merge-function which creates a new config-object @@ -41372,7 +41648,7 @@ module.exports = function mergeConfig(config1, config2) { /***/ }), -/* 476 */ +/* 477 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41398,13 +41674,13 @@ module.exports = Cancel; /***/ }), -/* 477 */ +/* 478 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Cancel = __webpack_require__(476); +var Cancel = __webpack_require__(477); /** * A `CancelToken` is an object that can be used to request cancellation of an operation. @@ -41462,7 +41738,7 @@ module.exports = CancelToken; /***/ }), -/* 478 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41496,7 +41772,7 @@ module.exports = function spread(callback) { /***/ }), -/* 479 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41521,11 +41797,11 @@ module.exports = function spread(callback) { */ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = __webpack_require__(6); -tslib_1.__exportStar(__webpack_require__(480), exports); +tslib_1.__exportStar(__webpack_require__(481), exports); /***/ }), -/* 480 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41549,6 +41825,7 @@ tslib_1.__exportStar(__webpack_require__(480), exports); * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAxiosResponseError = exports.isAxiosRequestError = void 0; exports.isAxiosRequestError = (error) => { return error && error.config && error.response === undefined; }; @@ -41558,7 +41835,7 @@ exports.isAxiosResponseError = (error) => { /***/ }), -/* 481 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41582,6 +41859,7 @@ exports.isAxiosResponseError = (error) => { * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.KbnClientStatus = void 0; class KbnClientStatus { constructor(requester) { this.requester = requester; @@ -41607,7 +41885,7 @@ exports.KbnClientStatus = KbnClientStatus; /***/ }), -/* 482 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41631,6 +41909,7 @@ exports.KbnClientStatus = KbnClientStatus; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.KbnClientPlugins = void 0; const PLUGIN_STATUS_ID = /^plugin:(.+?)@/; class KbnClientPlugins { constructor(status) { @@ -41657,7 +41936,7 @@ exports.KbnClientPlugins = KbnClientPlugins; /***/ }), -/* 483 */ +/* 484 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41681,6 +41960,7 @@ exports.KbnClientPlugins = KbnClientPlugins; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.KbnClientVersion = void 0; class KbnClientVersion { constructor(status) { this.status = status; @@ -41698,7 +41978,7 @@ exports.KbnClientVersion = KbnClientVersion; /***/ }), -/* 484 */ +/* 485 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41722,7 +42002,8 @@ exports.KbnClientVersion = KbnClientVersion; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const kbn_client_requester_1 = __webpack_require__(438); +exports.KbnClientSavedObjects = void 0; +const kbn_client_requester_1 = __webpack_require__(439); class KbnClientSavedObjects { constructor(log, requester) { this.log = log; @@ -41807,7 +42088,7 @@ exports.KbnClientSavedObjects = KbnClientSavedObjects; /***/ }), -/* 485 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41831,7 +42112,8 @@ exports.KbnClientSavedObjects = KbnClientSavedObjects; * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); -const kbn_client_requester_1 = __webpack_require__(438); +exports.KbnClientUiSettings = void 0; +const kbn_client_requester_1 = __webpack_require__(439); class KbnClientUiSettings { constructor(log, requester, defaults) { this.log = log; @@ -41907,7 +42189,7 @@ exports.KbnClientUiSettings = KbnClientUiSettings; /***/ }), -/* 486 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41932,11 +42214,11 @@ exports.KbnClientUiSettings = KbnClientUiSettings; */ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = __webpack_require__(6); -tslib_1.__exportStar(__webpack_require__(487), exports); +tslib_1.__exportStar(__webpack_require__(488), exports); /***/ }), -/* 487 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41960,9 +42242,10 @@ tslib_1.__exportStar(__webpack_require__(487), exports); * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.CiStatsReporter = void 0; const tslib_1 = __webpack_require__(6); -const util_1 = __webpack_require__(397); -const axios_1 = tslib_1.__importDefault(__webpack_require__(440)); +const util_1 = __webpack_require__(398); +const axios_1 = tslib_1.__importDefault(__webpack_require__(441)); function parseConfig(log) { const configJson = process.env.KIBANA_CI_STATS_CONFIG; if (!configJson) { @@ -42012,7 +42295,7 @@ class CiStatsReporter { return !!this.config; } async metrics(metrics) { - var _a, _b, _c, _d; + var _a; if (!this.config) { return; } @@ -42039,11 +42322,11 @@ class CiStatsReporter { return; } catch (error) { - if (!((_a = error) === null || _a === void 0 ? void 0 : _a.request)) { + if (!(error === null || error === void 0 ? void 0 : error.request)) { // not an axios error, must be a usage error that we should notify user about throw error; } - if (((_b = error) === null || _b === void 0 ? void 0 : _b.response) && error.response.status !== 502) { + if ((error === null || error === void 0 ? void 0 : error.response) && error.response.status !== 502) { // error response from service was received so warn the user and move on this.log.warning(`error recording metric [status=${error.response.status}] [resp=${util_1.inspect(error.response.data)}] ${bodySummary}`); return; @@ -42053,7 +42336,7 @@ class CiStatsReporter { return; } // we failed to reach the backend and we have remaining attempts, lets retry after a short delay - const reason = ((_d = (_c = error) === null || _c === void 0 ? void 0 : _c.response) === null || _d === void 0 ? void 0 : _d.status) ? `${error.response.status} response` + const reason = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) ? `${error.response.status} response` : 'no response'; this.log.warning(`failed to reach kibana-ci-stats service [reason=${reason}], retrying in ${attempt} seconds`); await new Promise((resolve) => setTimeout(resolve, attempt * 1000)); @@ -42065,16 +42348,16 @@ exports.CiStatsReporter = CiStatsReporter; /***/ }), -/* 488 */ +/* 489 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commands", function() { return commands; }); -/* harmony import */ var _bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(489); -/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(581); -/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(686); -/* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(687); +/* harmony import */ var _bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(490); +/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(582); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(687); +/* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(688); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -42105,18 +42388,18 @@ const commands = { }; /***/ }), -/* 489 */ +/* 490 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BootstrapCommand", function() { return BootstrapCommand; }); -/* harmony import */ var _utils_link_project_executables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(490); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(500); -/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(501); -/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(502); -/* harmony import */ var _utils_project_checksums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(575); -/* harmony import */ var _utils_bootstrap_cache_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(580); +/* harmony import */ var _utils_link_project_executables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(491); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(501); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(502); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(503); +/* harmony import */ var _utils_project_checksums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(576); +/* harmony import */ var _utils_bootstrap_cache_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(581); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -42219,7 +42502,7 @@ const BootstrapCommand = { }; /***/ }), -/* 490 */ +/* 491 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -42227,8 +42510,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkProjectExecutables", function() { return linkProjectExecutables; }); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); -/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(500); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(492); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(501); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -42290,7 +42573,7 @@ async function linkProjectExecutables(projectsByName, projectGraph) { } /***/ }), -/* 491 */ +/* 492 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -42304,15 +42587,15 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDirectory", function() { return isDirectory; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSymlink", function() { return createSymlink; }); -/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(492); +/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(493); /* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cmd_shim__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(349); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(350); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(499); +/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(500); /* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ncp__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(397); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(398); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_4__); /* * Licensed to Elasticsearch B.V. under one or more contributor @@ -42351,7 +42634,7 @@ const copyDirectory = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(ncp async function statTest(path, block) { try { - return block((await lstat(path))); + return block(await lstat(path)); } catch (e) { if (e.code === 'ENOENT') { return false; @@ -42424,7 +42707,7 @@ async function forceCreate(src, dest, type) { } /***/ }), -/* 492 */ +/* 493 */ /***/ (function(module, exports, __webpack_require__) { // On windows, create a .cmd file. @@ -42440,11 +42723,11 @@ async function forceCreate(src, dest, type) { module.exports = cmdShim cmdShim.ifExists = cmdShimIfExists -var fs = __webpack_require__(493) +var fs = __webpack_require__(494) -var mkdir = __webpack_require__(497) +var mkdir = __webpack_require__(498) , path = __webpack_require__(4) - , toBatchSyntax = __webpack_require__(498) + , toBatchSyntax = __webpack_require__(499) , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+=[^ \t]+\s+)*\s*([^ \t]+)(.*)$/ function cmdShimIfExists (from, to, cb) { @@ -42677,15 +42960,15 @@ function times(n, ok, cb) { /***/ }), -/* 493 */ +/* 494 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(349) -var polyfills = __webpack_require__(494) -var legacy = __webpack_require__(495) -var clone = __webpack_require__(496) +var fs = __webpack_require__(350) +var polyfills = __webpack_require__(495) +var legacy = __webpack_require__(496) +var clone = __webpack_require__(497) -var util = __webpack_require__(397) +var util = __webpack_require__(398) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue @@ -42762,7 +43045,7 @@ if (!global[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(global[gracefulQueue]) - __webpack_require__(371).equal(global[gracefulQueue].length, 0) + __webpack_require__(372).equal(global[gracefulQueue].length, 0) }) } } @@ -43029,10 +43312,10 @@ function retry () { /***/ }), -/* 494 */ +/* 495 */ /***/ (function(module, exports, __webpack_require__) { -var constants = __webpack_require__(411) +var constants = __webpack_require__(412) var origCwd = process.cwd var cwd = null @@ -43377,10 +43660,10 @@ function patch (fs) { /***/ }), -/* 495 */ +/* 496 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(382).Stream +var Stream = __webpack_require__(383).Stream module.exports = legacy @@ -43501,7 +43784,7 @@ function legacy (fs) { /***/ }), -/* 496 */ +/* 497 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43527,11 +43810,11 @@ function clone (obj) { /***/ }), -/* 497 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(4); -var fs = __webpack_require__(349); +var fs = __webpack_require__(350); var _0777 = parseInt('0777', 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; @@ -43632,7 +43915,7 @@ mkdirP.sync = function sync (p, opts, made) { /***/ }), -/* 498 */ +/* 499 */ /***/ (function(module, exports) { exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair @@ -43690,10 +43973,10 @@ function replaceDollarWithPercentPair(value) { /***/ }), -/* 499 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(349), +var fs = __webpack_require__(350), path = __webpack_require__(4); module.exports = ncp; @@ -43957,7 +44240,7 @@ function ncp (source, dest, options, callback) { /***/ }), -/* 500 */ +/* 501 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -44017,7 +44300,7 @@ const log = new Log(); /***/ }), -/* 501 */ +/* 502 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -44083,7 +44366,7 @@ async function parallelize(items, fn, concurrency = 4) { } /***/ }), -/* 502 */ +/* 503 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -44092,15 +44375,15 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProjectGraph", function() { return buildProjectGraph; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topologicallyBatchProjects", function() { return topologicallyBatchProjects; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includeTransitiveProjects", function() { return includeTransitiveProjects; }); -/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(503); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(504); /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(397); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(398); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(516); -/* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(517); -/* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(573); +/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(517); +/* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(518); +/* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(574); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -44299,7 +44582,7 @@ function includeTransitiveProjects(subsetOfProjects, allProjects, { } /***/ }), -/* 503 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { // Approach: @@ -44344,27 +44627,27 @@ function includeTransitiveProjects(subsetOfProjects, allProjects, { module.exports = glob -var fs = __webpack_require__(349) -var rp = __webpack_require__(504) -var minimatch = __webpack_require__(506) +var fs = __webpack_require__(350) +var rp = __webpack_require__(505) +var minimatch = __webpack_require__(507) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(510) -var EE = __webpack_require__(373).EventEmitter +var inherits = __webpack_require__(511) +var EE = __webpack_require__(374).EventEmitter var path = __webpack_require__(4) -var assert = __webpack_require__(371) -var isAbsolute = __webpack_require__(512) -var globSync = __webpack_require__(513) -var common = __webpack_require__(514) +var assert = __webpack_require__(372) +var isAbsolute = __webpack_require__(513) +var globSync = __webpack_require__(514) +var common = __webpack_require__(515) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(515) -var util = __webpack_require__(397) +var inflight = __webpack_require__(516) +var util = __webpack_require__(398) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(378) +var once = __webpack_require__(379) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -45095,7 +45378,7 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), -/* 504 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { module.exports = realpath @@ -45105,13 +45388,13 @@ realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch -var fs = __webpack_require__(349) +var fs = __webpack_require__(350) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(505) +var old = __webpack_require__(506) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -45167,7 +45450,7 @@ function unmonkeypatch () { /***/ }), -/* 505 */ +/* 506 */ /***/ (function(module, exports, __webpack_require__) { // Copyright Joyent, Inc. and other Node contributors. @@ -45193,7 +45476,7 @@ function unmonkeypatch () { var pathModule = __webpack_require__(4); var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(349); +var fs = __webpack_require__(350); // JavaScript implementation of realpath, ported from node pre-v6 @@ -45476,7 +45759,7 @@ exports.realpath = function realpath(p, cache, cb) { /***/ }), -/* 506 */ +/* 507 */ /***/ (function(module, exports, __webpack_require__) { module.exports = minimatch @@ -45488,7 +45771,7 @@ try { } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(507) +var expand = __webpack_require__(508) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -46405,11 +46688,11 @@ function regExpEscape (s) { /***/ }), -/* 507 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { -var concatMap = __webpack_require__(508); -var balanced = __webpack_require__(509); +var concatMap = __webpack_require__(509); +var balanced = __webpack_require__(510); module.exports = expandTop; @@ -46612,7 +46895,7 @@ function expand(str, isTop) { /***/ }), -/* 508 */ +/* 509 */ /***/ (function(module, exports) { module.exports = function (xs, fn) { @@ -46631,7 +46914,7 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 509 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46697,22 +46980,22 @@ function range(a, b, str) { /***/ }), -/* 510 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { try { - var util = __webpack_require__(397); + var util = __webpack_require__(398); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ - module.exports = __webpack_require__(511); + module.exports = __webpack_require__(512); } /***/ }), -/* 511 */ +/* 512 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { @@ -46745,7 +47028,7 @@ if (typeof Object.create === 'function') { /***/ }), -/* 512 */ +/* 513 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46772,22 +47055,22 @@ module.exports.win32 = win32; /***/ }), -/* 513 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { module.exports = globSync globSync.GlobSync = GlobSync -var fs = __webpack_require__(349) -var rp = __webpack_require__(504) -var minimatch = __webpack_require__(506) +var fs = __webpack_require__(350) +var rp = __webpack_require__(505) +var minimatch = __webpack_require__(507) var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(503).Glob -var util = __webpack_require__(397) +var Glob = __webpack_require__(504).Glob +var util = __webpack_require__(398) var path = __webpack_require__(4) -var assert = __webpack_require__(371) -var isAbsolute = __webpack_require__(512) -var common = __webpack_require__(514) +var assert = __webpack_require__(372) +var isAbsolute = __webpack_require__(513) +var common = __webpack_require__(515) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts @@ -47264,7 +47547,7 @@ GlobSync.prototype._makeAbs = function (f) { /***/ }), -/* 514 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort @@ -47282,8 +47565,8 @@ function ownProp (obj, field) { } var path = __webpack_require__(4) -var minimatch = __webpack_require__(506) -var isAbsolute = __webpack_require__(512) +var minimatch = __webpack_require__(507) +var isAbsolute = __webpack_require__(513) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -47510,12 +47793,12 @@ function childrenIgnored (self, path) { /***/ }), -/* 515 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { -var wrappy = __webpack_require__(379) +var wrappy = __webpack_require__(380) var reqs = Object.create(null) -var once = __webpack_require__(378) +var once = __webpack_require__(379) module.exports = wrappy(inflight) @@ -47570,7 +47853,7 @@ function slice (args) { /***/ }), -/* 516 */ +/* 517 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -47603,22 +47886,22 @@ class CliError extends Error { } /***/ }), -/* 517 */ +/* 518 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return Project; }); -/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(349); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(350); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(397); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(398); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(516); -/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(500); -/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(518); -/* harmony import */ var _scripts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(563); +/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(517); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(501); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(519); +/* harmony import */ var _scripts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(564); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -47691,7 +47974,7 @@ class Project { this.version = this.json.version; this.productionDependencies = this.json.dependencies || {}; this.devDependencies = this.json.devDependencies || {}; - this.allDependencies = _objectSpread({}, this.devDependencies, {}, this.productionDependencies); + this.allDependencies = _objectSpread(_objectSpread({}, this.devDependencies), this.productionDependencies); this.isWorkspaceRoot = this.json.hasOwnProperty('workspaces'); this.scripts = this.json.scripts || {}; } @@ -47855,7 +48138,7 @@ function normalizePath(path) { } /***/ }), -/* 518 */ +/* 519 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -47863,9 +48146,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readPackageJson", function() { return readPackageJson; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writePackageJson", function() { return writePackageJson; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkDependency", function() { return isLinkDependency; }); -/* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(519); +/* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(520); /* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(read_pkg__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(545); +/* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(546); /* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(write_pkg__WEBPACK_IMPORTED_MODULE_1__); /* * Licensed to Elasticsearch B.V. under one or more contributor @@ -47899,15 +48182,15 @@ function writePackageJson(path, json) { const isLinkDependency = depVersion => depVersion.startsWith('link:'); /***/ }), -/* 519 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {promisify} = __webpack_require__(397); -const fs = __webpack_require__(349); +const {promisify} = __webpack_require__(398); +const fs = __webpack_require__(350); const path = __webpack_require__(4); -const parseJson = __webpack_require__(520); +const parseJson = __webpack_require__(521); const readFileAsync = promisify(fs.readFile); @@ -47922,7 +48205,7 @@ module.exports = async options => { const json = parseJson(await readFileAsync(filePath, 'utf8')); if (options.normalize) { - __webpack_require__(521)(json); + __webpack_require__(522)(json); } return json; @@ -47939,7 +48222,7 @@ module.exports.sync = options => { const json = parseJson(fs.readFileSync(filePath, 'utf8')); if (options.normalize) { - __webpack_require__(521)(json); + __webpack_require__(522)(json); } return json; @@ -47947,15 +48230,15 @@ module.exports.sync = options => { /***/ }), -/* 520 */ +/* 521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const errorEx = __webpack_require__(416); -const fallback = __webpack_require__(418); -const {default: LinesAndColumns} = __webpack_require__(419); -const {codeFrameColumns} = __webpack_require__(420); +const errorEx = __webpack_require__(417); +const fallback = __webpack_require__(419); +const {default: LinesAndColumns} = __webpack_require__(420); +const {codeFrameColumns} = __webpack_require__(421); const JSONError = errorEx('JSONError', { fileName: errorEx.append('in %s'), @@ -48004,15 +48287,15 @@ module.exports = (string, reviver, filename) => { /***/ }), -/* 521 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { module.exports = normalize -var fixer = __webpack_require__(522) +var fixer = __webpack_require__(523) normalize.fixer = fixer -var makeWarning = __webpack_require__(543) +var makeWarning = __webpack_require__(544) var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage','license'] @@ -48049,17 +48332,17 @@ function ucFirst (string) { /***/ }), -/* 522 */ +/* 523 */ /***/ (function(module, exports, __webpack_require__) { -var semver = __webpack_require__(523) -var validateLicense = __webpack_require__(524); -var hostedGitInfo = __webpack_require__(529) -var isBuiltinModule = __webpack_require__(532).isCore +var semver = __webpack_require__(524) +var validateLicense = __webpack_require__(525); +var hostedGitInfo = __webpack_require__(530) +var isBuiltinModule = __webpack_require__(533).isCore var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = __webpack_require__(541) -var url = __webpack_require__(439) -var typos = __webpack_require__(542) +var extractDescription = __webpack_require__(542) +var url = __webpack_require__(440) +var typos = __webpack_require__(543) var fixer = module.exports = { // default warning function @@ -48473,7 +48756,7 @@ function bugsTypos(bugs, warn) { /***/ }), -/* 523 */ +/* 524 */ /***/ (function(module, exports) { exports = module.exports = SemVer @@ -49962,11 +50245,11 @@ function coerce (version) { /***/ }), -/* 524 */ +/* 525 */ /***/ (function(module, exports, __webpack_require__) { -var parse = __webpack_require__(525); -var correct = __webpack_require__(527); +var parse = __webpack_require__(526); +var correct = __webpack_require__(528); var genericWarning = ( 'license should be ' + @@ -50052,10 +50335,10 @@ module.exports = function(argument) { /***/ }), -/* 525 */ +/* 526 */ /***/ (function(module, exports, __webpack_require__) { -var parser = __webpack_require__(526).parser +var parser = __webpack_require__(527).parser module.exports = function (argument) { return parser.parse(argument) @@ -50063,7 +50346,7 @@ module.exports = function (argument) { /***/ }), -/* 526 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {/* parser generated by jison 0.4.17 */ @@ -51416,7 +51699,7 @@ exports.main = function commonjsMain(args) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } - var source = __webpack_require__(349).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8"); + var source = __webpack_require__(350).readFileSync(__webpack_require__(4).normalize(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { @@ -51427,10 +51710,10 @@ if ( true && __webpack_require__.c[__webpack_require__.s] === module) { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11)(module))) /***/ }), -/* 527 */ +/* 528 */ /***/ (function(module, exports, __webpack_require__) { -var licenseIDs = __webpack_require__(528); +var licenseIDs = __webpack_require__(529); function valid(string) { return licenseIDs.indexOf(string) > -1; @@ -51670,20 +51953,20 @@ module.exports = function(identifier) { /***/ }), -/* 528 */ +/* 529 */ /***/ (function(module) { module.exports = JSON.parse("[\"Glide\",\"Abstyles\",\"AFL-1.1\",\"AFL-1.2\",\"AFL-2.0\",\"AFL-2.1\",\"AFL-3.0\",\"AMPAS\",\"APL-1.0\",\"Adobe-Glyph\",\"APAFML\",\"Adobe-2006\",\"AGPL-1.0\",\"Afmparse\",\"Aladdin\",\"ADSL\",\"AMDPLPA\",\"ANTLR-PD\",\"Apache-1.0\",\"Apache-1.1\",\"Apache-2.0\",\"AML\",\"APSL-1.0\",\"APSL-1.1\",\"APSL-1.2\",\"APSL-2.0\",\"Artistic-1.0\",\"Artistic-1.0-Perl\",\"Artistic-1.0-cl8\",\"Artistic-2.0\",\"AAL\",\"Bahyph\",\"Barr\",\"Beerware\",\"BitTorrent-1.0\",\"BitTorrent-1.1\",\"BSL-1.0\",\"Borceux\",\"BSD-2-Clause\",\"BSD-2-Clause-FreeBSD\",\"BSD-2-Clause-NetBSD\",\"BSD-3-Clause\",\"BSD-3-Clause-Clear\",\"BSD-4-Clause\",\"BSD-Protection\",\"BSD-Source-Code\",\"BSD-3-Clause-Attribution\",\"0BSD\",\"BSD-4-Clause-UC\",\"bzip2-1.0.5\",\"bzip2-1.0.6\",\"Caldera\",\"CECILL-1.0\",\"CECILL-1.1\",\"CECILL-2.0\",\"CECILL-2.1\",\"CECILL-B\",\"CECILL-C\",\"ClArtistic\",\"MIT-CMU\",\"CNRI-Jython\",\"CNRI-Python\",\"CNRI-Python-GPL-Compatible\",\"CPOL-1.02\",\"CDDL-1.0\",\"CDDL-1.1\",\"CPAL-1.0\",\"CPL-1.0\",\"CATOSL-1.1\",\"Condor-1.1\",\"CC-BY-1.0\",\"CC-BY-2.0\",\"CC-BY-2.5\",\"CC-BY-3.0\",\"CC-BY-4.0\",\"CC-BY-ND-1.0\",\"CC-BY-ND-2.0\",\"CC-BY-ND-2.5\",\"CC-BY-ND-3.0\",\"CC-BY-ND-4.0\",\"CC-BY-NC-1.0\",\"CC-BY-NC-2.0\",\"CC-BY-NC-2.5\",\"CC-BY-NC-3.0\",\"CC-BY-NC-4.0\",\"CC-BY-NC-ND-1.0\",\"CC-BY-NC-ND-2.0\",\"CC-BY-NC-ND-2.5\",\"CC-BY-NC-ND-3.0\",\"CC-BY-NC-ND-4.0\",\"CC-BY-NC-SA-1.0\",\"CC-BY-NC-SA-2.0\",\"CC-BY-NC-SA-2.5\",\"CC-BY-NC-SA-3.0\",\"CC-BY-NC-SA-4.0\",\"CC-BY-SA-1.0\",\"CC-BY-SA-2.0\",\"CC-BY-SA-2.5\",\"CC-BY-SA-3.0\",\"CC-BY-SA-4.0\",\"CC0-1.0\",\"Crossword\",\"CrystalStacker\",\"CUA-OPL-1.0\",\"Cube\",\"curl\",\"D-FSL-1.0\",\"diffmark\",\"WTFPL\",\"DOC\",\"Dotseqn\",\"DSDP\",\"dvipdfm\",\"EPL-1.0\",\"ECL-1.0\",\"ECL-2.0\",\"eGenix\",\"EFL-1.0\",\"EFL-2.0\",\"MIT-advertising\",\"MIT-enna\",\"Entessa\",\"ErlPL-1.1\",\"EUDatagrid\",\"EUPL-1.0\",\"EUPL-1.1\",\"Eurosym\",\"Fair\",\"MIT-feh\",\"Frameworx-1.0\",\"FreeImage\",\"FTL\",\"FSFAP\",\"FSFUL\",\"FSFULLR\",\"Giftware\",\"GL2PS\",\"Glulxe\",\"AGPL-3.0\",\"GFDL-1.1\",\"GFDL-1.2\",\"GFDL-1.3\",\"GPL-1.0\",\"GPL-2.0\",\"GPL-3.0\",\"LGPL-2.1\",\"LGPL-3.0\",\"LGPL-2.0\",\"gnuplot\",\"gSOAP-1.3b\",\"HaskellReport\",\"HPND\",\"IBM-pibs\",\"IPL-1.0\",\"ICU\",\"ImageMagick\",\"iMatix\",\"Imlib2\",\"IJG\",\"Info-ZIP\",\"Intel-ACPI\",\"Intel\",\"Interbase-1.0\",\"IPA\",\"ISC\",\"JasPer-2.0\",\"JSON\",\"LPPL-1.0\",\"LPPL-1.1\",\"LPPL-1.2\",\"LPPL-1.3a\",\"LPPL-1.3c\",\"Latex2e\",\"BSD-3-Clause-LBNL\",\"Leptonica\",\"LGPLLR\",\"Libpng\",\"libtiff\",\"LAL-1.2\",\"LAL-1.3\",\"LiLiQ-P-1.1\",\"LiLiQ-Rplus-1.1\",\"LiLiQ-R-1.1\",\"LPL-1.02\",\"LPL-1.0\",\"MakeIndex\",\"MTLL\",\"MS-PL\",\"MS-RL\",\"MirOS\",\"MITNFA\",\"MIT\",\"Motosoto\",\"MPL-1.0\",\"MPL-1.1\",\"MPL-2.0\",\"MPL-2.0-no-copyleft-exception\",\"mpich2\",\"Multics\",\"Mup\",\"NASA-1.3\",\"Naumen\",\"NBPL-1.0\",\"NetCDF\",\"NGPL\",\"NOSL\",\"NPL-1.0\",\"NPL-1.1\",\"Newsletr\",\"NLPL\",\"Nokia\",\"NPOSL-3.0\",\"NLOD-1.0\",\"Noweb\",\"NRL\",\"NTP\",\"Nunit\",\"OCLC-2.0\",\"ODbL-1.0\",\"PDDL-1.0\",\"OCCT-PL\",\"OGTSL\",\"OLDAP-2.2.2\",\"OLDAP-1.1\",\"OLDAP-1.2\",\"OLDAP-1.3\",\"OLDAP-1.4\",\"OLDAP-2.0\",\"OLDAP-2.0.1\",\"OLDAP-2.1\",\"OLDAP-2.2\",\"OLDAP-2.2.1\",\"OLDAP-2.3\",\"OLDAP-2.4\",\"OLDAP-2.5\",\"OLDAP-2.6\",\"OLDAP-2.7\",\"OLDAP-2.8\",\"OML\",\"OPL-1.0\",\"OSL-1.0\",\"OSL-1.1\",\"OSL-2.0\",\"OSL-2.1\",\"OSL-3.0\",\"OpenSSL\",\"OSET-PL-2.1\",\"PHP-3.0\",\"PHP-3.01\",\"Plexus\",\"PostgreSQL\",\"psfrag\",\"psutils\",\"Python-2.0\",\"QPL-1.0\",\"Qhull\",\"Rdisc\",\"RPSL-1.0\",\"RPL-1.1\",\"RPL-1.5\",\"RHeCos-1.1\",\"RSCPL\",\"RSA-MD\",\"Ruby\",\"SAX-PD\",\"Saxpath\",\"SCEA\",\"SWL\",\"SMPPL\",\"Sendmail\",\"SGI-B-1.0\",\"SGI-B-1.1\",\"SGI-B-2.0\",\"OFL-1.0\",\"OFL-1.1\",\"SimPL-2.0\",\"Sleepycat\",\"SNIA\",\"Spencer-86\",\"Spencer-94\",\"Spencer-99\",\"SMLNJ\",\"SugarCRM-1.1.3\",\"SISSL\",\"SISSL-1.2\",\"SPL-1.0\",\"Watcom-1.0\",\"TCL\",\"Unlicense\",\"TMate\",\"TORQUE-1.1\",\"TOSL\",\"Unicode-TOU\",\"UPL-1.0\",\"NCSA\",\"Vim\",\"VOSTROM\",\"VSL-1.0\",\"W3C-19980720\",\"W3C\",\"Wsuipa\",\"Xnet\",\"X11\",\"Xerox\",\"XFree86-1.1\",\"xinetd\",\"xpp\",\"XSkat\",\"YPL-1.0\",\"YPL-1.1\",\"Zed\",\"Zend-2.0\",\"Zimbra-1.3\",\"Zimbra-1.4\",\"Zlib\",\"zlib-acknowledgement\",\"ZPL-1.1\",\"ZPL-2.0\",\"ZPL-2.1\",\"BSD-3-Clause-No-Nuclear-License\",\"BSD-3-Clause-No-Nuclear-Warranty\",\"BSD-3-Clause-No-Nuclear-License-2014\",\"eCos-2.0\",\"GPL-2.0-with-autoconf-exception\",\"GPL-2.0-with-bison-exception\",\"GPL-2.0-with-classpath-exception\",\"GPL-2.0-with-font-exception\",\"GPL-2.0-with-GCC-exception\",\"GPL-3.0-with-autoconf-exception\",\"GPL-3.0-with-GCC-exception\",\"StandardML-NJ\",\"WXwindows\"]"); /***/ }), -/* 529 */ +/* 530 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(439) -var gitHosts = __webpack_require__(530) -var GitHost = module.exports = __webpack_require__(531) +var url = __webpack_require__(440) +var gitHosts = __webpack_require__(531) +var GitHost = module.exports = __webpack_require__(532) var protocolToRepresentationMap = { 'git+ssh': 'sshurl', @@ -51804,7 +52087,7 @@ function parseGitUrl (giturl) { /***/ }), -/* 530 */ +/* 531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51879,13 +52162,13 @@ Object.keys(gitHosts).forEach(function (name) { /***/ }), -/* 531 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var gitHosts = __webpack_require__(530) -var extend = Object.assign || __webpack_require__(397)._extend +var gitHosts = __webpack_require__(531) +var extend = Object.assign || __webpack_require__(398)._extend var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) { var gitHostInfo = this @@ -52000,21 +52283,21 @@ GitHost.prototype.toString = function (opts) { /***/ }), -/* 532 */ +/* 533 */ /***/ (function(module, exports, __webpack_require__) { -var core = __webpack_require__(533); -var async = __webpack_require__(535); +var core = __webpack_require__(534); +var async = __webpack_require__(536); async.core = core; async.isCore = function isCore(x) { return core[x]; }; -async.sync = __webpack_require__(540); +async.sync = __webpack_require__(541); exports = async; module.exports = async; /***/ }), -/* 533 */ +/* 534 */ /***/ (function(module, exports, __webpack_require__) { var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; @@ -52061,7 +52344,7 @@ function versionIncluded(specifierValue) { return matchesRange(specifierValue); } -var data = __webpack_require__(534); +var data = __webpack_require__(535); var core = {}; for (var mod in data) { // eslint-disable-line no-restricted-syntax @@ -52073,21 +52356,21 @@ module.exports = core; /***/ }), -/* 534 */ +/* 535 */ /***/ (function(module) { module.exports = JSON.parse("{\"assert\":true,\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debugger\":\"< 8\",\"dgram\":true,\"dns\":true,\"domain\":true,\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":\">= 10 && < 10.1\",\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0\",\"os\":true,\"path\":true,\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"string_decoder\":true,\"sys\":true,\"timers\":true,\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"v8/tools/arguments\":\">= 10\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0\"],\"v8\":\">= 1\",\"vm\":true,\"worker_threads\":\">= 11.7\",\"zlib\":true}"); /***/ }), -/* 535 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { -var core = __webpack_require__(533); -var fs = __webpack_require__(349); +var core = __webpack_require__(534); +var fs = __webpack_require__(350); var path = __webpack_require__(4); -var caller = __webpack_require__(536); -var nodeModulesPaths = __webpack_require__(537); -var normalizeOptions = __webpack_require__(539); +var caller = __webpack_require__(537); +var nodeModulesPaths = __webpack_require__(538); +var normalizeOptions = __webpack_require__(540); var defaultIsFile = function isFile(file, cb) { fs.stat(file, function (err, stat) { @@ -52314,7 +52597,7 @@ module.exports = function resolve(x, options, callback) { /***/ }), -/* 536 */ +/* 537 */ /***/ (function(module, exports) { module.exports = function () { @@ -52328,11 +52611,11 @@ module.exports = function () { /***/ }), -/* 537 */ +/* 538 */ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(4); -var parse = path.parse || __webpack_require__(538); +var parse = path.parse || __webpack_require__(539); var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { var prefix = '/'; @@ -52376,7 +52659,7 @@ module.exports = function nodeModulesPaths(start, opts, request) { /***/ }), -/* 538 */ +/* 539 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52476,7 +52759,7 @@ module.exports.win32 = win32.parse; /***/ }), -/* 539 */ +/* 540 */ /***/ (function(module, exports) { module.exports = function (x, opts) { @@ -52492,15 +52775,15 @@ module.exports = function (x, opts) { /***/ }), -/* 540 */ +/* 541 */ /***/ (function(module, exports, __webpack_require__) { -var core = __webpack_require__(533); -var fs = __webpack_require__(349); +var core = __webpack_require__(534); +var fs = __webpack_require__(350); var path = __webpack_require__(4); -var caller = __webpack_require__(536); -var nodeModulesPaths = __webpack_require__(537); -var normalizeOptions = __webpack_require__(539); +var caller = __webpack_require__(537); +var nodeModulesPaths = __webpack_require__(538); +var normalizeOptions = __webpack_require__(540); var defaultIsFile = function isFile(file) { try { @@ -52652,7 +52935,7 @@ module.exports = function (x, options) { /***/ }), -/* 541 */ +/* 542 */ /***/ (function(module, exports) { module.exports = extractDescription @@ -52672,17 +52955,17 @@ function extractDescription (d) { /***/ }), -/* 542 */ +/* 543 */ /***/ (function(module) { module.exports = JSON.parse("{\"topLevel\":{\"dependancies\":\"dependencies\",\"dependecies\":\"dependencies\",\"depdenencies\":\"dependencies\",\"devEependencies\":\"devDependencies\",\"depends\":\"dependencies\",\"dev-dependencies\":\"devDependencies\",\"devDependences\":\"devDependencies\",\"devDepenencies\":\"devDependencies\",\"devdependencies\":\"devDependencies\",\"repostitory\":\"repository\",\"repo\":\"repository\",\"prefereGlobal\":\"preferGlobal\",\"hompage\":\"homepage\",\"hampage\":\"homepage\",\"autohr\":\"author\",\"autor\":\"author\",\"contributers\":\"contributors\",\"publicationConfig\":\"publishConfig\",\"script\":\"scripts\"},\"bugs\":{\"web\":\"url\",\"name\":\"url\"},\"script\":{\"server\":\"start\",\"tests\":\"test\"}}"); /***/ }), -/* 543 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { -var util = __webpack_require__(397) -var messages = __webpack_require__(544) +var util = __webpack_require__(398) +var messages = __webpack_require__(545) module.exports = function() { var args = Array.prototype.slice.call(arguments, 0) @@ -52707,20 +52990,20 @@ function makeTypoWarning (providedName, probableName, field) { /***/ }), -/* 544 */ +/* 545 */ /***/ (function(module) { module.exports = JSON.parse("{\"repositories\":\"'repositories' (plural) Not supported. Please pick one as the 'repository' field\",\"missingRepository\":\"No repository field.\",\"brokenGitUrl\":\"Probably broken git url: %s\",\"nonObjectScripts\":\"scripts must be an object\",\"nonStringScript\":\"script values must be string commands\",\"nonArrayFiles\":\"Invalid 'files' member\",\"invalidFilename\":\"Invalid filename in 'files' list: %s\",\"nonArrayBundleDependencies\":\"Invalid 'bundleDependencies' list. Must be array of package names\",\"nonStringBundleDependency\":\"Invalid bundleDependencies member: %s\",\"nonDependencyBundleDependency\":\"Non-dependency in bundleDependencies: %s\",\"nonObjectDependencies\":\"%s field must be an object\",\"nonStringDependency\":\"Invalid dependency: %s %s\",\"deprecatedArrayDependencies\":\"specifying %s as array is deprecated\",\"deprecatedModules\":\"modules field is deprecated\",\"nonArrayKeywords\":\"keywords should be an array of strings\",\"nonStringKeyword\":\"keywords should be an array of strings\",\"conflictingName\":\"%s is also the name of a node core module.\",\"nonStringDescription\":\"'description' field should be a string\",\"missingDescription\":\"No description\",\"missingReadme\":\"No README data\",\"missingLicense\":\"No license field.\",\"nonEmailUrlBugsString\":\"Bug string field must be url, email, or {email,url}\",\"nonUrlBugsUrlField\":\"bugs.url field must be a string url. Deleted.\",\"nonEmailBugsEmailField\":\"bugs.email field must be a string email. Deleted.\",\"emptyNormalizedBugs\":\"Normalized value of bugs field is an empty object. Deleted.\",\"nonUrlHomepage\":\"homepage field must be a string url. Deleted.\",\"invalidLicense\":\"license should be a valid SPDX license expression\",\"typo\":\"%s should probably be %s.\"}"); /***/ }), -/* 545 */ +/* 546 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const writeJsonFile = __webpack_require__(546); -const sortKeys = __webpack_require__(558); +const writeJsonFile = __webpack_require__(547); +const sortKeys = __webpack_require__(559); const dependencyKeys = new Set([ 'dependencies', @@ -52785,18 +53068,18 @@ module.exports.sync = (filePath, data, options) => { /***/ }), -/* 546 */ +/* 547 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const fs = __webpack_require__(547); -const writeFileAtomic = __webpack_require__(551); -const sortKeys = __webpack_require__(558); -const makeDir = __webpack_require__(560); -const pify = __webpack_require__(561); -const detectIndent = __webpack_require__(562); +const fs = __webpack_require__(548); +const writeFileAtomic = __webpack_require__(552); +const sortKeys = __webpack_require__(559); +const makeDir = __webpack_require__(561); +const pify = __webpack_require__(562); +const detectIndent = __webpack_require__(563); const init = (fn, filePath, data, options) => { if (!filePath) { @@ -52868,17 +53151,17 @@ module.exports.sync = (filePath, data, options) => { /***/ }), -/* 547 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(349) -var polyfills = __webpack_require__(548) -var legacy = __webpack_require__(549) -var clone = __webpack_require__(550) +var fs = __webpack_require__(350) +var polyfills = __webpack_require__(549) +var legacy = __webpack_require__(550) +var clone = __webpack_require__(551) var queue = [] -var util = __webpack_require__(397) +var util = __webpack_require__(398) function noop () {} @@ -52895,7 +53178,7 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(queue) - __webpack_require__(371).equal(queue.length, 0) + __webpack_require__(372).equal(queue.length, 0) }) } @@ -53153,10 +53436,10 @@ function retry () { /***/ }), -/* 548 */ +/* 549 */ /***/ (function(module, exports, __webpack_require__) { -var constants = __webpack_require__(411) +var constants = __webpack_require__(412) var origCwd = process.cwd var cwd = null @@ -53488,10 +53771,10 @@ function patch (fs) { /***/ }), -/* 549 */ +/* 550 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(382).Stream +var Stream = __webpack_require__(383).Stream module.exports = legacy @@ -53612,7 +53895,7 @@ function legacy (fs) { /***/ }), -/* 550 */ +/* 551 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53638,7 +53921,7 @@ function clone (obj) { /***/ }), -/* 551 */ +/* 552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53648,9 +53931,9 @@ module.exports.sync = writeFileSync module.exports._getTmpname = getTmpname // for testing module.exports._cleanupOnExit = cleanupOnExit -var fs = __webpack_require__(552) -var MurmurHash3 = __webpack_require__(556) -var onExit = __webpack_require__(370) +var fs = __webpack_require__(553) +var MurmurHash3 = __webpack_require__(557) +var onExit = __webpack_require__(371) var path = __webpack_require__(4) var activeFiles = {} @@ -53658,7 +53941,7 @@ var activeFiles = {} /* istanbul ignore next */ var threadId = (function getId () { try { - var workerThreads = __webpack_require__(557) + var workerThreads = __webpack_require__(558) /// if we are in main thread, this is set to `0` return workerThreads.threadId @@ -53883,15 +54166,15 @@ function writeFileSync (filename, data, options) { /***/ }), -/* 552 */ +/* 553 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(349) -var polyfills = __webpack_require__(553) -var legacy = __webpack_require__(555) +var fs = __webpack_require__(350) +var polyfills = __webpack_require__(554) +var legacy = __webpack_require__(556) var queue = [] -var util = __webpack_require__(397) +var util = __webpack_require__(398) function noop () {} @@ -53908,11 +54191,11 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(queue) - __webpack_require__(371).equal(queue.length, 0) + __webpack_require__(372).equal(queue.length, 0) }) } -module.exports = patch(__webpack_require__(554)) +module.exports = patch(__webpack_require__(555)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { module.exports = patch(fs) } @@ -54151,11 +54434,11 @@ function retry () { /***/ }), -/* 553 */ +/* 554 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(554) -var constants = __webpack_require__(411) +var fs = __webpack_require__(555) +var constants = __webpack_require__(412) var origCwd = process.cwd var cwd = null @@ -54487,13 +54770,13 @@ function chownErOk (er) { /***/ }), -/* 554 */ +/* 555 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var fs = __webpack_require__(349) +var fs = __webpack_require__(350) module.exports = clone(fs) @@ -54515,10 +54798,10 @@ function clone (obj) { /***/ }), -/* 555 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(382).Stream +var Stream = __webpack_require__(383).Stream module.exports = legacy @@ -54639,7 +54922,7 @@ function legacy (fs) { /***/ }), -/* 556 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54781,18 +55064,18 @@ function legacy (fs) { /***/ }), -/* 557 */ +/* 558 */ /***/ (function(module, exports) { module.exports = require(undefined); /***/ }), -/* 558 */ +/* 559 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const isPlainObj = __webpack_require__(559); +const isPlainObj = __webpack_require__(560); module.exports = (obj, opts) => { if (!isPlainObj(obj)) { @@ -54849,7 +55132,7 @@ module.exports = (obj, opts) => { /***/ }), -/* 559 */ +/* 560 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -54863,15 +55146,15 @@ module.exports = function (x) { /***/ }), -/* 560 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); +const fs = __webpack_require__(350); const path = __webpack_require__(4); -const pify = __webpack_require__(561); -const semver = __webpack_require__(523); +const pify = __webpack_require__(562); +const semver = __webpack_require__(524); const defaults = { mode: 0o777 & (~process.umask()), @@ -55009,7 +55292,7 @@ module.exports.sync = (input, options) => { /***/ }), -/* 561 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55084,7 +55367,7 @@ module.exports = (input, options) => { /***/ }), -/* 562 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55213,7 +55496,7 @@ module.exports = str => { /***/ }), -/* 563 */ +/* 564 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55222,7 +55505,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackage", function() { return runScriptInPackage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackageStreaming", function() { return runScriptInPackageStreaming; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yarnWorkspacesInfo", function() { return yarnWorkspacesInfo; }); -/* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(564); +/* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(565); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -55299,22 +55582,22 @@ async function yarnWorkspacesInfo(directory) { } /***/ }), -/* 564 */ +/* 565 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawn", function() { return spawn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawnStreaming", function() { return spawnStreaming; }); -/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(382); +/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(383); /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(386); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(387); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(342); +/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(343); /* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(565); +/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(566); /* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(500); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(501); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -55398,7 +55681,7 @@ function spawnStreaming(command, args, opts, { } /***/ }), -/* 565 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { // Copyright IBM Corp. 2014,2018. All Rights Reserved. @@ -55406,12 +55689,12 @@ function spawnStreaming(command, args, opts, { // This file is licensed under the Apache License 2.0. // License text available at https://opensource.org/licenses/Apache-2.0 -module.exports = __webpack_require__(566); -module.exports.cli = __webpack_require__(570); +module.exports = __webpack_require__(567); +module.exports.cli = __webpack_require__(571); /***/ }), -/* 566 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55422,13 +55705,13 @@ module.exports.cli = __webpack_require__(570); -var stream = __webpack_require__(382); -var util = __webpack_require__(397); -var fs = __webpack_require__(349); +var stream = __webpack_require__(383); +var util = __webpack_require__(398); +var fs = __webpack_require__(350); -var through = __webpack_require__(567); -var duplexer = __webpack_require__(568); -var StringDecoder = __webpack_require__(569).StringDecoder; +var through = __webpack_require__(568); +var duplexer = __webpack_require__(569); +var StringDecoder = __webpack_require__(570).StringDecoder; module.exports = Logger; @@ -55617,10 +55900,10 @@ function lineMerger(host) { /***/ }), -/* 567 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(382) +var Stream = __webpack_require__(383) // through // @@ -55731,10 +56014,10 @@ function through (write, end, opts) { /***/ }), -/* 568 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__(382) +var Stream = __webpack_require__(383) var writeMethods = ["write", "end", "destroy"] var readMethods = ["resume", "pause"] var readEvents = ["data", "close"] @@ -55824,13 +56107,13 @@ function duplex(writer, reader) { /***/ }), -/* 569 */ +/* 570 */ /***/ (function(module, exports) { module.exports = require("string_decoder"); /***/ }), -/* 570 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55841,11 +56124,11 @@ module.exports = require("string_decoder"); -var minimist = __webpack_require__(571); +var minimist = __webpack_require__(572); var path = __webpack_require__(4); -var Logger = __webpack_require__(566); -var pkg = __webpack_require__(572); +var Logger = __webpack_require__(567); +var pkg = __webpack_require__(573); module.exports = cli; @@ -55899,7 +56182,7 @@ function usage($0, p) { /***/ }), -/* 571 */ +/* 572 */ /***/ (function(module, exports) { module.exports = function (args, opts) { @@ -56141,29 +56424,29 @@ function isNumber (x) { /***/ }), -/* 572 */ +/* 573 */ /***/ (function(module) { module.exports = JSON.parse("{\"name\":\"strong-log-transformer\",\"version\":\"2.1.0\",\"description\":\"Stream transformer that prefixes lines with timestamps and other things.\",\"author\":\"Ryan Graham \",\"license\":\"Apache-2.0\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/strongloop/strong-log-transformer\"},\"keywords\":[\"logging\",\"streams\"],\"bugs\":{\"url\":\"https://github.com/strongloop/strong-log-transformer/issues\"},\"homepage\":\"https://github.com/strongloop/strong-log-transformer\",\"directories\":{\"test\":\"test\"},\"bin\":{\"sl-log-transformer\":\"bin/sl-log-transformer.js\"},\"main\":\"index.js\",\"scripts\":{\"test\":\"tap --100 test/test-*\"},\"dependencies\":{\"duplexer\":\"^0.1.1\",\"minimist\":\"^1.2.0\",\"through\":\"^2.3.4\"},\"devDependencies\":{\"tap\":\"^12.0.1\"},\"engines\":{\"node\":\">=4\"}}"); /***/ }), -/* 573 */ +/* 574 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "workspacePackagePaths", function() { return workspacePackagePaths; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return copyWorkspacePackages; }); -/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(503); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(504); /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(397); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(398); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(574); -/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(491); -/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(518); -/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(502); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(575); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(492); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(519); +/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(503); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -56201,10 +56484,10 @@ async function workspacePackagePaths(rootPath) { let workspaceProjectsPaths = []; for (const pattern of workspacesPathsPatterns) { - workspaceProjectsPaths = workspaceProjectsPaths.concat((await packagesFromGlobPattern({ + workspaceProjectsPaths = workspaceProjectsPaths.concat(await packagesFromGlobPattern({ pattern, rootPath - }))); + })); } // Filter out exclude glob patterns @@ -56255,7 +56538,7 @@ function packagesFromGlobPattern({ } /***/ }), -/* 574 */ +/* 575 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56325,21 +56608,21 @@ function getProjectPaths({ } /***/ }), -/* 575 */ +/* 576 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllChecksums", function() { return getAllChecksums; }); -/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(349); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(350); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(576); +/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(577); /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(397); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(398); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(342); +/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(343); /* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _yarn_lock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(577); +/* harmony import */ var _yarn_lock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(578); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -56562,27 +56845,27 @@ async function getAllChecksums(kbn, log) { const cacheKeys = new Map(); await Promise.all(Array.from(projects.values()).map(async project => { - cacheKeys.set(project.name, (await getChecksum(project, changesByProject.get(project), yarnLock, kbn, log))); + cacheKeys.set(project.name, await getChecksum(project, changesByProject.get(project), yarnLock, kbn, log)); })); return cacheKeys; } /***/ }), -/* 576 */ +/* 577 */ /***/ (function(module, exports) { module.exports = require("crypto"); /***/ }), -/* 577 */ +/* 578 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readYarnLock", function() { return readYarnLock; }); -/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(578); +/* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(579); /* harmony import */ var _yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_yarnpkg_lockfile__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(492); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -56624,7 +56907,7 @@ async function readYarnLock(kbn) { } /***/ }), -/* 578 */ +/* 579 */ /***/ (function(module, exports, __webpack_require__) { module.exports = @@ -56750,13 +57033,13 @@ exports.default = function (fn) { /* 2 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(397); +module.exports = __webpack_require__(398); /***/ }), /* 3 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(349); +module.exports = __webpack_require__(350); /***/ }), /* 4 */ @@ -58183,7 +58466,7 @@ module.exports = invariant; /* 9 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(576); +module.exports = __webpack_require__(577); /***/ }), /* 10 */, @@ -58609,7 +58892,7 @@ exports.default = Lockfile; /* 17 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(382); +module.exports = __webpack_require__(383); /***/ }), /* 18 */, @@ -58661,7 +58944,7 @@ function nullify(obj = {}) { /* 22 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(371); +module.exports = __webpack_require__(372); /***/ }), /* 23 */ @@ -58848,7 +59131,7 @@ module.exports = {}; /* 36 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(364); +module.exports = __webpack_require__(365); /***/ }), /* 37 */, @@ -59133,7 +59416,7 @@ exports.f = __webpack_require__(33) ? Object.defineProperty : function definePro /* 54 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(373); +module.exports = __webpack_require__(374); /***/ }), /* 55 */ @@ -60507,7 +60790,7 @@ function onceStrict (fn) { /* 63 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(579); +module.exports = __webpack_require__(580); /***/ }), /* 64 */, @@ -61445,7 +61728,7 @@ module.exports.win32 = win32; /* 79 */ /***/ (function(module, exports) { -module.exports = __webpack_require__(471); +module.exports = __webpack_require__(472); /***/ }), /* 80 */, @@ -66902,19 +67185,19 @@ module.exports = process && support(supportLevel); /******/ ]); /***/ }), -/* 579 */ +/* 580 */ /***/ (function(module, exports) { module.exports = require("buffer"); /***/ }), -/* 580 */ +/* 581 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BootstrapCacheFile", function() { return BootstrapCacheFile; }); -/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(349); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(350); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); @@ -67005,20 +67288,20 @@ class BootstrapCacheFile { } /***/ }), -/* 581 */ +/* 582 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CleanCommand", function() { return CleanCommand; }); -/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(582); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(583); /* harmony import */ var del__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(670); +/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(671); /* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(ora__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(491); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(500); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(492); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(501); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -67113,21 +67396,21 @@ const CleanCommand = { }; /***/ }), -/* 582 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {promisify} = __webpack_require__(397); +const {promisify} = __webpack_require__(398); const path = __webpack_require__(4); -const globby = __webpack_require__(583); -const isGlob = __webpack_require__(600); -const slash = __webpack_require__(661); -const gracefulFs = __webpack_require__(493); -const isPathCwd = __webpack_require__(663); -const isPathInside = __webpack_require__(664); -const rimraf = __webpack_require__(665); -const pMap = __webpack_require__(666); +const globby = __webpack_require__(584); +const isGlob = __webpack_require__(601); +const slash = __webpack_require__(662); +const gracefulFs = __webpack_require__(494); +const isPathCwd = __webpack_require__(664); +const isPathInside = __webpack_require__(665); +const rimraf = __webpack_require__(666); +const pMap = __webpack_require__(667); const rimrafP = promisify(rimraf); @@ -67241,19 +67524,19 @@ module.exports.sync = (patterns, {force, dryRun, cwd = process.cwd(), ...options /***/ }), -/* 583 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); -const arrayUnion = __webpack_require__(584); -const merge2 = __webpack_require__(585); -const glob = __webpack_require__(586); -const fastGlob = __webpack_require__(591); -const dirGlob = __webpack_require__(657); -const gitignore = __webpack_require__(659); -const {FilterStream, UniqueStream} = __webpack_require__(662); +const fs = __webpack_require__(350); +const arrayUnion = __webpack_require__(585); +const merge2 = __webpack_require__(586); +const glob = __webpack_require__(587); +const fastGlob = __webpack_require__(592); +const dirGlob = __webpack_require__(658); +const gitignore = __webpack_require__(660); +const {FilterStream, UniqueStream} = __webpack_require__(663); const DEFAULT_FILTER = () => false; @@ -67426,7 +67709,7 @@ module.exports.gitignore = gitignore; /***/ }), -/* 584 */ +/* 585 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67438,7 +67721,7 @@ module.exports = (...arguments_) => { /***/ }), -/* 585 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67450,7 +67733,7 @@ module.exports = (...arguments_) => { * Copyright (c) 2014-2016 Teambition * Licensed under the MIT license. */ -const Stream = __webpack_require__(382) +const Stream = __webpack_require__(383) const PassThrough = Stream.PassThrough const slice = Array.prototype.slice @@ -67552,7 +67835,7 @@ function pauseStreams (streams, options) { /***/ }), -/* 586 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { // Approach: @@ -67597,27 +67880,27 @@ function pauseStreams (streams, options) { module.exports = glob -var fs = __webpack_require__(349) -var rp = __webpack_require__(504) -var minimatch = __webpack_require__(506) +var fs = __webpack_require__(350) +var rp = __webpack_require__(505) +var minimatch = __webpack_require__(507) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(587) -var EE = __webpack_require__(373).EventEmitter +var inherits = __webpack_require__(588) +var EE = __webpack_require__(374).EventEmitter var path = __webpack_require__(4) -var assert = __webpack_require__(371) -var isAbsolute = __webpack_require__(512) -var globSync = __webpack_require__(589) -var common = __webpack_require__(590) +var assert = __webpack_require__(372) +var isAbsolute = __webpack_require__(513) +var globSync = __webpack_require__(590) +var common = __webpack_require__(591) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(515) -var util = __webpack_require__(397) +var inflight = __webpack_require__(516) +var util = __webpack_require__(398) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(378) +var once = __webpack_require__(379) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -68348,22 +68631,22 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), -/* 587 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { try { - var util = __webpack_require__(397); + var util = __webpack_require__(398); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ - module.exports = __webpack_require__(588); + module.exports = __webpack_require__(589); } /***/ }), -/* 588 */ +/* 589 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { @@ -68396,22 +68679,22 @@ if (typeof Object.create === 'function') { /***/ }), -/* 589 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { module.exports = globSync globSync.GlobSync = GlobSync -var fs = __webpack_require__(349) -var rp = __webpack_require__(504) -var minimatch = __webpack_require__(506) +var fs = __webpack_require__(350) +var rp = __webpack_require__(505) +var minimatch = __webpack_require__(507) var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(586).Glob -var util = __webpack_require__(397) +var Glob = __webpack_require__(587).Glob +var util = __webpack_require__(398) var path = __webpack_require__(4) -var assert = __webpack_require__(371) -var isAbsolute = __webpack_require__(512) -var common = __webpack_require__(590) +var assert = __webpack_require__(372) +var isAbsolute = __webpack_require__(513) +var common = __webpack_require__(591) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts @@ -68888,7 +69171,7 @@ GlobSync.prototype._makeAbs = function (f) { /***/ }), -/* 590 */ +/* 591 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort @@ -68906,8 +69189,8 @@ function ownProp (obj, field) { } var path = __webpack_require__(4) -var minimatch = __webpack_require__(506) -var isAbsolute = __webpack_require__(512) +var minimatch = __webpack_require__(507) +var isAbsolute = __webpack_require__(513) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -69134,17 +69417,17 @@ function childrenIgnored (self, path) { /***/ }), -/* 591 */ +/* 592 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const taskManager = __webpack_require__(592); -const async_1 = __webpack_require__(620); -const stream_1 = __webpack_require__(653); -const sync_1 = __webpack_require__(654); -const settings_1 = __webpack_require__(656); -const utils = __webpack_require__(593); +const taskManager = __webpack_require__(593); +const async_1 = __webpack_require__(621); +const stream_1 = __webpack_require__(654); +const sync_1 = __webpack_require__(655); +const settings_1 = __webpack_require__(657); +const utils = __webpack_require__(594); function FastGlob(source, options) { try { assertPatternsInput(source); @@ -69202,13 +69485,13 @@ module.exports = FastGlob; /***/ }), -/* 592 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__(593); +const utils = __webpack_require__(594); function generate(patterns, settings) { const positivePatterns = getPositivePatterns(patterns); const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); @@ -69276,28 +69559,28 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), -/* 593 */ +/* 594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const array = __webpack_require__(594); +const array = __webpack_require__(595); exports.array = array; -const errno = __webpack_require__(595); +const errno = __webpack_require__(596); exports.errno = errno; -const fs = __webpack_require__(596); +const fs = __webpack_require__(597); exports.fs = fs; -const path = __webpack_require__(597); +const path = __webpack_require__(598); exports.path = path; -const pattern = __webpack_require__(598); +const pattern = __webpack_require__(599); exports.pattern = pattern; -const stream = __webpack_require__(619); +const stream = __webpack_require__(620); exports.stream = stream; /***/ }), -/* 594 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69310,7 +69593,7 @@ exports.flatten = flatten; /***/ }), -/* 595 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69323,7 +69606,7 @@ exports.isEnoentCodeError = isEnoentCodeError; /***/ }), -/* 596 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69348,7 +69631,7 @@ exports.createDirentFromStats = createDirentFromStats; /***/ }), -/* 597 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69369,16 +69652,16 @@ exports.makeAbsolute = makeAbsolute; /***/ }), -/* 598 */ +/* 599 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = __webpack_require__(4); -const globParent = __webpack_require__(599); -const isGlob = __webpack_require__(600); -const micromatch = __webpack_require__(602); +const globParent = __webpack_require__(600); +const isGlob = __webpack_require__(601); +const micromatch = __webpack_require__(603); const GLOBSTAR = '**'; function isStaticPattern(pattern) { return !isDynamicPattern(pattern); @@ -69467,15 +69750,15 @@ exports.matchAny = matchAny; /***/ }), -/* 599 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isGlob = __webpack_require__(600); +var isGlob = __webpack_require__(601); var pathPosixDirname = __webpack_require__(4).posix.dirname; -var isWin32 = __webpack_require__(364).platform() === 'win32'; +var isWin32 = __webpack_require__(365).platform() === 'win32'; var slash = '/'; var backslash = /\\/g; @@ -69508,7 +69791,7 @@ module.exports = function globParent(str) { /***/ }), -/* 600 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -69518,7 +69801,7 @@ module.exports = function globParent(str) { * Released under the MIT License. */ -var isExtglob = __webpack_require__(601); +var isExtglob = __webpack_require__(602); var chars = { '{': '}', '(': ')', '[': ']'}; var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; @@ -69562,7 +69845,7 @@ module.exports = function isGlob(str, options) { /***/ }), -/* 601 */ +/* 602 */ /***/ (function(module, exports) { /*! @@ -69588,16 +69871,16 @@ module.exports = function isExtglob(str) { /***/ }), -/* 602 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const util = __webpack_require__(397); -const braces = __webpack_require__(603); -const picomatch = __webpack_require__(613); -const utils = __webpack_require__(616); +const util = __webpack_require__(398); +const braces = __webpack_require__(604); +const picomatch = __webpack_require__(614); +const utils = __webpack_require__(617); const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); /** @@ -70062,16 +70345,16 @@ module.exports = micromatch; /***/ }), -/* 603 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const stringify = __webpack_require__(604); -const compile = __webpack_require__(606); -const expand = __webpack_require__(610); -const parse = __webpack_require__(611); +const stringify = __webpack_require__(605); +const compile = __webpack_require__(607); +const expand = __webpack_require__(611); +const parse = __webpack_require__(612); /** * Expand the given pattern or create a regex-compatible string. @@ -70239,13 +70522,13 @@ module.exports = braces; /***/ }), -/* 604 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const utils = __webpack_require__(605); +const utils = __webpack_require__(606); module.exports = (ast, options = {}) => { let stringify = (node, parent = {}) => { @@ -70278,7 +70561,7 @@ module.exports = (ast, options = {}) => { /***/ }), -/* 605 */ +/* 606 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70397,14 +70680,14 @@ exports.flatten = (...args) => { /***/ }), -/* 606 */ +/* 607 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fill = __webpack_require__(607); -const utils = __webpack_require__(605); +const fill = __webpack_require__(608); +const utils = __webpack_require__(606); const compile = (ast, options = {}) => { let walk = (node, parent = {}) => { @@ -70461,7 +70744,7 @@ module.exports = compile; /***/ }), -/* 607 */ +/* 608 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70474,8 +70757,8 @@ module.exports = compile; -const util = __webpack_require__(397); -const toRegexRange = __webpack_require__(608); +const util = __webpack_require__(398); +const toRegexRange = __webpack_require__(609); const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); @@ -70717,7 +71000,7 @@ module.exports = fill; /***/ }), -/* 608 */ +/* 609 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70730,7 +71013,7 @@ module.exports = fill; -const isNumber = __webpack_require__(609); +const isNumber = __webpack_require__(610); const toRegexRange = (min, max, options) => { if (isNumber(min) === false) { @@ -71012,7 +71295,7 @@ module.exports = toRegexRange; /***/ }), -/* 609 */ +/* 610 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71037,15 +71320,15 @@ module.exports = function(num) { /***/ }), -/* 610 */ +/* 611 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fill = __webpack_require__(607); -const stringify = __webpack_require__(604); -const utils = __webpack_require__(605); +const fill = __webpack_require__(608); +const stringify = __webpack_require__(605); +const utils = __webpack_require__(606); const append = (queue = '', stash = '', enclose = false) => { let result = []; @@ -71157,13 +71440,13 @@ module.exports = expand; /***/ }), -/* 611 */ +/* 612 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const stringify = __webpack_require__(604); +const stringify = __webpack_require__(605); /** * Constants @@ -71185,7 +71468,7 @@ const { CHAR_SINGLE_QUOTE, /* ' */ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __webpack_require__(612); +} = __webpack_require__(613); /** * parse @@ -71497,7 +71780,7 @@ module.exports = parse; /***/ }), -/* 612 */ +/* 613 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71561,26 +71844,26 @@ module.exports = { /***/ }), -/* 613 */ +/* 614 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__(614); +module.exports = __webpack_require__(615); /***/ }), -/* 614 */ +/* 615 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const scan = __webpack_require__(615); -const parse = __webpack_require__(618); -const utils = __webpack_require__(616); +const scan = __webpack_require__(616); +const parse = __webpack_require__(619); +const utils = __webpack_require__(617); /** * Creates a matcher function from one or more glob patterns. The @@ -71883,7 +72166,7 @@ picomatch.toRegex = (source, options) => { * @return {Object} */ -picomatch.constants = __webpack_require__(617); +picomatch.constants = __webpack_require__(618); /** * Expose "picomatch" @@ -71893,13 +72176,13 @@ module.exports = picomatch; /***/ }), -/* 615 */ +/* 616 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const utils = __webpack_require__(616); +const utils = __webpack_require__(617); const { CHAR_ASTERISK, /* * */ @@ -71917,7 +72200,7 @@ const { CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __webpack_require__(617); +} = __webpack_require__(618); const isPathSeparator = code => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; @@ -72119,7 +72402,7 @@ module.exports = (input, options) => { /***/ }), -/* 616 */ +/* 617 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72131,7 +72414,7 @@ const { REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL, REGEX_REMOVE_BACKSLASH -} = __webpack_require__(617); +} = __webpack_require__(618); exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); @@ -72169,7 +72452,7 @@ exports.escapeLast = (input, char, lastIdx) => { /***/ }), -/* 617 */ +/* 618 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72355,14 +72638,14 @@ module.exports = { /***/ }), -/* 618 */ +/* 619 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const utils = __webpack_require__(616); -const constants = __webpack_require__(617); +const utils = __webpack_require__(617); +const constants = __webpack_require__(618); /** * Constants @@ -73373,13 +73656,13 @@ module.exports = parse; /***/ }), -/* 619 */ +/* 620 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const merge2 = __webpack_require__(585); +const merge2 = __webpack_require__(586); function merge(streams) { const mergedStream = merge2(streams); streams.forEach((stream) => { @@ -73391,14 +73674,14 @@ exports.merge = merge; /***/ }), -/* 620 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__(621); -const provider_1 = __webpack_require__(648); +const stream_1 = __webpack_require__(622); +const provider_1 = __webpack_require__(649); class ProviderAsync extends provider_1.default { constructor() { super(...arguments); @@ -73426,16 +73709,16 @@ exports.default = ProviderAsync; /***/ }), -/* 621 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__(382); -const fsStat = __webpack_require__(622); -const fsWalk = __webpack_require__(627); -const reader_1 = __webpack_require__(647); +const stream_1 = __webpack_require__(383); +const fsStat = __webpack_require__(623); +const fsWalk = __webpack_require__(628); +const reader_1 = __webpack_require__(648); class ReaderStream extends reader_1.default { constructor() { super(...arguments); @@ -73488,15 +73771,15 @@ exports.default = ReaderStream; /***/ }), -/* 622 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const async = __webpack_require__(623); -const sync = __webpack_require__(624); -const settings_1 = __webpack_require__(625); +const async = __webpack_require__(624); +const sync = __webpack_require__(625); +const settings_1 = __webpack_require__(626); exports.Settings = settings_1.default; function stat(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -73519,7 +73802,7 @@ function getSettings(settingsOrOptions = {}) { /***/ }), -/* 623 */ +/* 624 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73557,7 +73840,7 @@ function callSuccessCallback(callback, result) { /***/ }), -/* 624 */ +/* 625 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73586,13 +73869,13 @@ exports.read = read; /***/ }), -/* 625 */ +/* 626 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __webpack_require__(626); +const fs = __webpack_require__(627); class Settings { constructor(_options = {}) { this._options = _options; @@ -73609,13 +73892,13 @@ exports.default = Settings; /***/ }), -/* 626 */ +/* 627 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __webpack_require__(349); +const fs = __webpack_require__(350); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -73632,16 +73915,16 @@ exports.createFileSystemAdapter = createFileSystemAdapter; /***/ }), -/* 627 */ +/* 628 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const async_1 = __webpack_require__(628); -const stream_1 = __webpack_require__(643); -const sync_1 = __webpack_require__(644); -const settings_1 = __webpack_require__(646); +const async_1 = __webpack_require__(629); +const stream_1 = __webpack_require__(644); +const sync_1 = __webpack_require__(645); +const settings_1 = __webpack_require__(647); exports.Settings = settings_1.default; function walk(dir, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -73671,13 +73954,13 @@ function getSettings(settingsOrOptions = {}) { /***/ }), -/* 628 */ +/* 629 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const async_1 = __webpack_require__(629); +const async_1 = __webpack_require__(630); class AsyncProvider { constructor(_root, _settings) { this._root = _root; @@ -73708,17 +73991,17 @@ function callSuccessCallback(callback, entries) { /***/ }), -/* 629 */ +/* 630 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(373); -const fsScandir = __webpack_require__(630); -const fastq = __webpack_require__(639); -const common = __webpack_require__(641); -const reader_1 = __webpack_require__(642); +const events_1 = __webpack_require__(374); +const fsScandir = __webpack_require__(631); +const fastq = __webpack_require__(640); +const common = __webpack_require__(642); +const reader_1 = __webpack_require__(643); class AsyncReader extends reader_1.default { constructor(_root, _settings) { super(_root, _settings); @@ -73808,15 +74091,15 @@ exports.default = AsyncReader; /***/ }), -/* 630 */ +/* 631 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const async = __webpack_require__(631); -const sync = __webpack_require__(636); -const settings_1 = __webpack_require__(637); +const async = __webpack_require__(632); +const sync = __webpack_require__(637); +const settings_1 = __webpack_require__(638); exports.Settings = settings_1.default; function scandir(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -73839,16 +74122,16 @@ function getSettings(settingsOrOptions = {}) { /***/ }), -/* 631 */ +/* 632 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fsStat = __webpack_require__(622); -const rpl = __webpack_require__(632); -const constants_1 = __webpack_require__(633); -const utils = __webpack_require__(634); +const fsStat = __webpack_require__(623); +const rpl = __webpack_require__(633); +const constants_1 = __webpack_require__(634); +const utils = __webpack_require__(635); function read(dir, settings, callback) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(dir, settings, callback); @@ -73937,7 +74220,7 @@ function callSuccessCallback(callback, result) { /***/ }), -/* 632 */ +/* 633 */ /***/ (function(module, exports) { module.exports = runParallel @@ -73991,7 +74274,7 @@ function runParallel (tasks, cb) { /***/ }), -/* 633 */ +/* 634 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74007,18 +74290,18 @@ exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = MAJOR_VERSION > 10 || (MAJOR_VERSIO /***/ }), -/* 634 */ +/* 635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __webpack_require__(635); +const fs = __webpack_require__(636); exports.fs = fs; /***/ }), -/* 635 */ +/* 636 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74043,15 +74326,15 @@ exports.createDirentFromStats = createDirentFromStats; /***/ }), -/* 636 */ +/* 637 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fsStat = __webpack_require__(622); -const constants_1 = __webpack_require__(633); -const utils = __webpack_require__(634); +const fsStat = __webpack_require__(623); +const constants_1 = __webpack_require__(634); +const utils = __webpack_require__(635); function read(dir, settings) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(dir, settings); @@ -74102,15 +74385,15 @@ exports.readdir = readdir; /***/ }), -/* 637 */ +/* 638 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = __webpack_require__(4); -const fsStat = __webpack_require__(622); -const fs = __webpack_require__(638); +const fsStat = __webpack_require__(623); +const fs = __webpack_require__(639); class Settings { constructor(_options = {}) { this._options = _options; @@ -74133,13 +74416,13 @@ exports.default = Settings; /***/ }), -/* 638 */ +/* 639 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __webpack_require__(349); +const fs = __webpack_require__(350); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -74158,13 +74441,13 @@ exports.createFileSystemAdapter = createFileSystemAdapter; /***/ }), -/* 639 */ +/* 640 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var reusify = __webpack_require__(640) +var reusify = __webpack_require__(641) function fastqueue (context, worker, concurrency) { if (typeof context === 'function') { @@ -74338,7 +74621,7 @@ module.exports = fastqueue /***/ }), -/* 640 */ +/* 641 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74378,7 +74661,7 @@ module.exports = reusify /***/ }), -/* 641 */ +/* 642 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74409,13 +74692,13 @@ exports.joinPathSegments = joinPathSegments; /***/ }), -/* 642 */ +/* 643 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const common = __webpack_require__(641); +const common = __webpack_require__(642); class Reader { constructor(_root, _settings) { this._root = _root; @@ -74427,14 +74710,14 @@ exports.default = Reader; /***/ }), -/* 643 */ +/* 644 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__(382); -const async_1 = __webpack_require__(629); +const stream_1 = __webpack_require__(383); +const async_1 = __webpack_require__(630); class StreamProvider { constructor(_root, _settings) { this._root = _root; @@ -74464,13 +74747,13 @@ exports.default = StreamProvider; /***/ }), -/* 644 */ +/* 645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = __webpack_require__(645); +const sync_1 = __webpack_require__(646); class SyncProvider { constructor(_root, _settings) { this._root = _root; @@ -74485,15 +74768,15 @@ exports.default = SyncProvider; /***/ }), -/* 645 */ +/* 646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fsScandir = __webpack_require__(630); -const common = __webpack_require__(641); -const reader_1 = __webpack_require__(642); +const fsScandir = __webpack_require__(631); +const common = __webpack_require__(642); +const reader_1 = __webpack_require__(643); class SyncReader extends reader_1.default { constructor() { super(...arguments); @@ -74551,14 +74834,14 @@ exports.default = SyncReader; /***/ }), -/* 646 */ +/* 647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = __webpack_require__(4); -const fsScandir = __webpack_require__(630); +const fsScandir = __webpack_require__(631); class Settings { constructor(_options = {}) { this._options = _options; @@ -74584,15 +74867,15 @@ exports.default = Settings; /***/ }), -/* 647 */ +/* 648 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = __webpack_require__(4); -const fsStat = __webpack_require__(622); -const utils = __webpack_require__(593); +const fsStat = __webpack_require__(623); +const utils = __webpack_require__(594); class Reader { constructor(_settings) { this._settings = _settings; @@ -74624,17 +74907,17 @@ exports.default = Reader; /***/ }), -/* 648 */ +/* 649 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = __webpack_require__(4); -const deep_1 = __webpack_require__(649); -const entry_1 = __webpack_require__(650); -const error_1 = __webpack_require__(651); -const entry_2 = __webpack_require__(652); +const deep_1 = __webpack_require__(650); +const entry_1 = __webpack_require__(651); +const error_1 = __webpack_require__(652); +const entry_2 = __webpack_require__(653); class Provider { constructor(_settings) { this._settings = _settings; @@ -74679,13 +74962,13 @@ exports.default = Provider; /***/ }), -/* 649 */ +/* 650 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__(593); +const utils = __webpack_require__(594); class DeepFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -74745,13 +75028,13 @@ exports.default = DeepFilter; /***/ }), -/* 650 */ +/* 651 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__(593); +const utils = __webpack_require__(594); class EntryFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -74806,13 +75089,13 @@ exports.default = EntryFilter; /***/ }), -/* 651 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__(593); +const utils = __webpack_require__(594); class ErrorFilter { constructor(_settings) { this._settings = _settings; @@ -74828,13 +75111,13 @@ exports.default = ErrorFilter; /***/ }), -/* 652 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__(593); +const utils = __webpack_require__(594); class EntryTransformer { constructor(_settings) { this._settings = _settings; @@ -74861,15 +75144,15 @@ exports.default = EntryTransformer; /***/ }), -/* 653 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__(382); -const stream_2 = __webpack_require__(621); -const provider_1 = __webpack_require__(648); +const stream_1 = __webpack_require__(383); +const stream_2 = __webpack_require__(622); +const provider_1 = __webpack_require__(649); class ProviderStream extends provider_1.default { constructor() { super(...arguments); @@ -74897,14 +75180,14 @@ exports.default = ProviderStream; /***/ }), -/* 654 */ +/* 655 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = __webpack_require__(655); -const provider_1 = __webpack_require__(648); +const sync_1 = __webpack_require__(656); +const provider_1 = __webpack_require__(649); class ProviderSync extends provider_1.default { constructor() { super(...arguments); @@ -74927,15 +75210,15 @@ exports.default = ProviderSync; /***/ }), -/* 655 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fsStat = __webpack_require__(622); -const fsWalk = __webpack_require__(627); -const reader_1 = __webpack_require__(647); +const fsStat = __webpack_require__(623); +const fsWalk = __webpack_require__(628); +const reader_1 = __webpack_require__(648); class ReaderSync extends reader_1.default { constructor() { super(...arguments); @@ -74977,14 +75260,14 @@ exports.default = ReaderSync; /***/ }), -/* 656 */ +/* 657 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __webpack_require__(349); -const os = __webpack_require__(364); +const fs = __webpack_require__(350); +const os = __webpack_require__(365); const CPU_COUNT = os.cpus().length; exports.DEFAULT_FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, @@ -75037,13 +75320,13 @@ exports.default = Settings; /***/ }), -/* 657 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const pathType = __webpack_require__(658); +const pathType = __webpack_require__(659); const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; @@ -75119,13 +75402,13 @@ module.exports.sync = (input, options) => { /***/ }), -/* 658 */ +/* 659 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {promisify} = __webpack_require__(397); -const fs = __webpack_require__(349); +const {promisify} = __webpack_require__(398); +const fs = __webpack_require__(350); async function isType(fsStatType, statsMethodName, filePath) { if (typeof filePath !== 'string') { @@ -75169,17 +75452,17 @@ exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); /***/ }), -/* 659 */ +/* 660 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {promisify} = __webpack_require__(397); -const fs = __webpack_require__(349); +const {promisify} = __webpack_require__(398); +const fs = __webpack_require__(350); const path = __webpack_require__(4); -const fastGlob = __webpack_require__(591); -const gitIgnore = __webpack_require__(660); -const slash = __webpack_require__(661); +const fastGlob = __webpack_require__(592); +const gitIgnore = __webpack_require__(661); +const slash = __webpack_require__(662); const DEFAULT_IGNORE = [ '**/node_modules/**', @@ -75293,7 +75576,7 @@ module.exports.sync = options => { /***/ }), -/* 660 */ +/* 661 */ /***/ (function(module, exports) { // A simple implementation of make-array @@ -75884,7 +76167,7 @@ if ( /***/ }), -/* 661 */ +/* 662 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75902,12 +76185,12 @@ module.exports = path => { /***/ }), -/* 662 */ +/* 663 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {Transform} = __webpack_require__(382); +const {Transform} = __webpack_require__(383); class ObjectTransform extends Transform { constructor() { @@ -75955,7 +76238,7 @@ module.exports = { /***/ }), -/* 663 */ +/* 664 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75977,7 +76260,7 @@ module.exports = path_ => { /***/ }), -/* 664 */ +/* 665 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -76005,15 +76288,15 @@ module.exports = (childPath, parentPath) => { /***/ }), -/* 665 */ +/* 666 */ /***/ (function(module, exports, __webpack_require__) { -const assert = __webpack_require__(371) +const assert = __webpack_require__(372) const path = __webpack_require__(4) -const fs = __webpack_require__(349) +const fs = __webpack_require__(350) let glob = undefined try { - glob = __webpack_require__(586) + glob = __webpack_require__(587) } catch (_err) { // treat glob as optional. } @@ -76379,12 +76662,12 @@ rimraf.sync = rimrafSync /***/ }), -/* 666 */ +/* 667 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const AggregateError = __webpack_require__(667); +const AggregateError = __webpack_require__(668); module.exports = async ( iterable, @@ -76467,13 +76750,13 @@ module.exports = async ( /***/ }), -/* 667 */ +/* 668 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const indentString = __webpack_require__(668); -const cleanStack = __webpack_require__(669); +const indentString = __webpack_require__(669); +const cleanStack = __webpack_require__(670); const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); @@ -76521,7 +76804,7 @@ module.exports = AggregateError; /***/ }), -/* 668 */ +/* 669 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -76563,12 +76846,12 @@ module.exports = (string, count = 1, options) => { /***/ }), -/* 669 */ +/* 670 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); +const os = __webpack_require__(365); const extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/; const pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/; @@ -76610,15 +76893,15 @@ module.exports = (stack, options) => { /***/ }), -/* 670 */ +/* 671 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const chalk = __webpack_require__(671); -const cliCursor = __webpack_require__(675); -const cliSpinners = __webpack_require__(679); -const logSymbols = __webpack_require__(681); +const chalk = __webpack_require__(672); +const cliCursor = __webpack_require__(676); +const cliSpinners = __webpack_require__(680); +const logSymbols = __webpack_require__(682); class Ora { constructor(options) { @@ -76765,16 +77048,16 @@ module.exports.promise = (action, options) => { /***/ }), -/* 671 */ +/* 672 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(387); -const ansiStyles = __webpack_require__(672); -const stdoutColor = __webpack_require__(673).stdout; +const escapeStringRegexp = __webpack_require__(388); +const ansiStyles = __webpack_require__(673); +const stdoutColor = __webpack_require__(674).stdout; -const template = __webpack_require__(674); +const template = __webpack_require__(675); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -77000,12 +77283,12 @@ module.exports.default = module.exports; // For TypeScript /***/ }), -/* 672 */ +/* 673 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(389); +const colorConvert = __webpack_require__(390); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -77173,13 +77456,13 @@ Object.defineProperty(module, 'exports', { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11)(module))) /***/ }), -/* 673 */ +/* 674 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); -const hasFlag = __webpack_require__(394); +const os = __webpack_require__(365); +const hasFlag = __webpack_require__(395); const env = process.env; @@ -77315,7 +77598,7 @@ module.exports = { /***/ }), -/* 674 */ +/* 675 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77450,12 +77733,12 @@ module.exports = (chalk, tmp) => { /***/ }), -/* 675 */ +/* 676 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const restoreCursor = __webpack_require__(676); +const restoreCursor = __webpack_require__(677); let hidden = false; @@ -77496,13 +77779,13 @@ exports.toggle = (force, stream) => { /***/ }), -/* 676 */ +/* 677 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const onetime = __webpack_require__(677); -const signalExit = __webpack_require__(370); +const onetime = __webpack_require__(678); +const signalExit = __webpack_require__(371); module.exports = onetime(() => { signalExit(() => { @@ -77512,12 +77795,12 @@ module.exports = onetime(() => { /***/ }), -/* 677 */ +/* 678 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const mimicFn = __webpack_require__(678); +const mimicFn = __webpack_require__(679); module.exports = (fn, opts) => { // TODO: Remove this in v3 @@ -77558,7 +77841,7 @@ module.exports = (fn, opts) => { /***/ }), -/* 678 */ +/* 679 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77574,27 +77857,27 @@ module.exports = (to, from) => { /***/ }), -/* 679 */ +/* 680 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__(680); +module.exports = __webpack_require__(681); /***/ }), -/* 680 */ +/* 681 */ /***/ (function(module) { module.exports = JSON.parse("{\"dots\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠹\",\"⠸\",\"⠼\",\"⠴\",\"⠦\",\"⠧\",\"⠇\",\"⠏\"]},\"dots2\":{\"interval\":80,\"frames\":[\"⣾\",\"⣽\",\"⣻\",\"⢿\",\"⡿\",\"⣟\",\"⣯\",\"⣷\"]},\"dots3\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠚\",\"⠞\",\"⠖\",\"⠦\",\"⠴\",\"⠲\",\"⠳\",\"⠓\"]},\"dots4\":{\"interval\":80,\"frames\":[\"⠄\",\"⠆\",\"⠇\",\"⠋\",\"⠙\",\"⠸\",\"⠰\",\"⠠\",\"⠰\",\"⠸\",\"⠙\",\"⠋\",\"⠇\",\"⠆\"]},\"dots5\":{\"interval\":80,\"frames\":[\"⠋\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\"]},\"dots6\":{\"interval\":80,\"frames\":[\"⠁\",\"⠉\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠤\",\"⠄\",\"⠄\",\"⠤\",\"⠴\",\"⠲\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠚\",\"⠙\",\"⠉\",\"⠁\"]},\"dots7\":{\"interval\":80,\"frames\":[\"⠈\",\"⠉\",\"⠋\",\"⠓\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠖\",\"⠦\",\"⠤\",\"⠠\",\"⠠\",\"⠤\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\",\"⠉\",\"⠈\"]},\"dots8\":{\"interval\":80,\"frames\":[\"⠁\",\"⠁\",\"⠉\",\"⠙\",\"⠚\",\"⠒\",\"⠂\",\"⠂\",\"⠒\",\"⠲\",\"⠴\",\"⠤\",\"⠄\",\"⠄\",\"⠤\",\"⠠\",\"⠠\",\"⠤\",\"⠦\",\"⠖\",\"⠒\",\"⠐\",\"⠐\",\"⠒\",\"⠓\",\"⠋\",\"⠉\",\"⠈\",\"⠈\"]},\"dots9\":{\"interval\":80,\"frames\":[\"⢹\",\"⢺\",\"⢼\",\"⣸\",\"⣇\",\"⡧\",\"⡗\",\"⡏\"]},\"dots10\":{\"interval\":80,\"frames\":[\"⢄\",\"⢂\",\"⢁\",\"⡁\",\"⡈\",\"⡐\",\"⡠\"]},\"dots11\":{\"interval\":100,\"frames\":[\"⠁\",\"⠂\",\"⠄\",\"⡀\",\"⢀\",\"⠠\",\"⠐\",\"⠈\"]},\"dots12\":{\"interval\":80,\"frames\":[\"⢀⠀\",\"⡀⠀\",\"⠄⠀\",\"⢂⠀\",\"⡂⠀\",\"⠅⠀\",\"⢃⠀\",\"⡃⠀\",\"⠍⠀\",\"⢋⠀\",\"⡋⠀\",\"⠍⠁\",\"⢋⠁\",\"⡋⠁\",\"⠍⠉\",\"⠋⠉\",\"⠋⠉\",\"⠉⠙\",\"⠉⠙\",\"⠉⠩\",\"⠈⢙\",\"⠈⡙\",\"⢈⠩\",\"⡀⢙\",\"⠄⡙\",\"⢂⠩\",\"⡂⢘\",\"⠅⡘\",\"⢃⠨\",\"⡃⢐\",\"⠍⡐\",\"⢋⠠\",\"⡋⢀\",\"⠍⡁\",\"⢋⠁\",\"⡋⠁\",\"⠍⠉\",\"⠋⠉\",\"⠋⠉\",\"⠉⠙\",\"⠉⠙\",\"⠉⠩\",\"⠈⢙\",\"⠈⡙\",\"⠈⠩\",\"⠀⢙\",\"⠀⡙\",\"⠀⠩\",\"⠀⢘\",\"⠀⡘\",\"⠀⠨\",\"⠀⢐\",\"⠀⡐\",\"⠀⠠\",\"⠀⢀\",\"⠀⡀\"]},\"line\":{\"interval\":130,\"frames\":[\"-\",\"\\\\\",\"|\",\"/\"]},\"line2\":{\"interval\":100,\"frames\":[\"⠂\",\"-\",\"–\",\"—\",\"–\",\"-\"]},\"pipe\":{\"interval\":100,\"frames\":[\"┤\",\"┘\",\"┴\",\"└\",\"├\",\"┌\",\"┬\",\"┐\"]},\"simpleDots\":{\"interval\":400,\"frames\":[\". \",\".. \",\"...\",\" \"]},\"simpleDotsScrolling\":{\"interval\":200,\"frames\":[\". \",\".. \",\"...\",\" ..\",\" .\",\" \"]},\"star\":{\"interval\":70,\"frames\":[\"✶\",\"✸\",\"✹\",\"✺\",\"✹\",\"✷\"]},\"star2\":{\"interval\":80,\"frames\":[\"+\",\"x\",\"*\"]},\"flip\":{\"interval\":70,\"frames\":[\"_\",\"_\",\"_\",\"-\",\"`\",\"`\",\"'\",\"´\",\"-\",\"_\",\"_\",\"_\"]},\"hamburger\":{\"interval\":100,\"frames\":[\"☱\",\"☲\",\"☴\"]},\"growVertical\":{\"interval\":120,\"frames\":[\"▁\",\"▃\",\"▄\",\"▅\",\"▆\",\"▇\",\"▆\",\"▅\",\"▄\",\"▃\"]},\"growHorizontal\":{\"interval\":120,\"frames\":[\"▏\",\"▎\",\"▍\",\"▌\",\"▋\",\"▊\",\"▉\",\"▊\",\"▋\",\"▌\",\"▍\",\"▎\"]},\"balloon\":{\"interval\":140,\"frames\":[\" \",\".\",\"o\",\"O\",\"@\",\"*\",\" \"]},\"balloon2\":{\"interval\":120,\"frames\":[\".\",\"o\",\"O\",\"°\",\"O\",\"o\",\".\"]},\"noise\":{\"interval\":100,\"frames\":[\"▓\",\"▒\",\"░\"]},\"bounce\":{\"interval\":120,\"frames\":[\"⠁\",\"⠂\",\"⠄\",\"⠂\"]},\"boxBounce\":{\"interval\":120,\"frames\":[\"▖\",\"▘\",\"▝\",\"▗\"]},\"boxBounce2\":{\"interval\":100,\"frames\":[\"▌\",\"▀\",\"▐\",\"▄\"]},\"triangle\":{\"interval\":50,\"frames\":[\"◢\",\"◣\",\"◤\",\"◥\"]},\"arc\":{\"interval\":100,\"frames\":[\"◜\",\"◠\",\"◝\",\"◞\",\"◡\",\"◟\"]},\"circle\":{\"interval\":120,\"frames\":[\"◡\",\"⊙\",\"◠\"]},\"squareCorners\":{\"interval\":180,\"frames\":[\"◰\",\"◳\",\"◲\",\"◱\"]},\"circleQuarters\":{\"interval\":120,\"frames\":[\"◴\",\"◷\",\"◶\",\"◵\"]},\"circleHalves\":{\"interval\":50,\"frames\":[\"◐\",\"◓\",\"◑\",\"◒\"]},\"squish\":{\"interval\":100,\"frames\":[\"╫\",\"╪\"]},\"toggle\":{\"interval\":250,\"frames\":[\"⊶\",\"⊷\"]},\"toggle2\":{\"interval\":80,\"frames\":[\"▫\",\"▪\"]},\"toggle3\":{\"interval\":120,\"frames\":[\"□\",\"■\"]},\"toggle4\":{\"interval\":100,\"frames\":[\"■\",\"□\",\"▪\",\"▫\"]},\"toggle5\":{\"interval\":100,\"frames\":[\"▮\",\"▯\"]},\"toggle6\":{\"interval\":300,\"frames\":[\"ဝ\",\"၀\"]},\"toggle7\":{\"interval\":80,\"frames\":[\"⦾\",\"⦿\"]},\"toggle8\":{\"interval\":100,\"frames\":[\"◍\",\"◌\"]},\"toggle9\":{\"interval\":100,\"frames\":[\"◉\",\"◎\"]},\"toggle10\":{\"interval\":100,\"frames\":[\"㊂\",\"㊀\",\"㊁\"]},\"toggle11\":{\"interval\":50,\"frames\":[\"⧇\",\"⧆\"]},\"toggle12\":{\"interval\":120,\"frames\":[\"☗\",\"☖\"]},\"toggle13\":{\"interval\":80,\"frames\":[\"=\",\"*\",\"-\"]},\"arrow\":{\"interval\":100,\"frames\":[\"←\",\"↖\",\"↑\",\"↗\",\"→\",\"↘\",\"↓\",\"↙\"]},\"arrow2\":{\"interval\":80,\"frames\":[\"⬆️ \",\"↗️ \",\"➡️ \",\"↘️ \",\"⬇️ \",\"↙️ \",\"⬅️ \",\"↖️ \"]},\"arrow3\":{\"interval\":120,\"frames\":[\"▹▹▹▹▹\",\"▸▹▹▹▹\",\"▹▸▹▹▹\",\"▹▹▸▹▹\",\"▹▹▹▸▹\",\"▹▹▹▹▸\"]},\"bouncingBar\":{\"interval\":80,\"frames\":[\"[ ]\",\"[= ]\",\"[== ]\",\"[=== ]\",\"[ ===]\",\"[ ==]\",\"[ =]\",\"[ ]\",\"[ =]\",\"[ ==]\",\"[ ===]\",\"[====]\",\"[=== ]\",\"[== ]\",\"[= ]\"]},\"bouncingBall\":{\"interval\":80,\"frames\":[\"( ● )\",\"( ● )\",\"( ● )\",\"( ● )\",\"( ●)\",\"( ● )\",\"( ● )\",\"( ● )\",\"( ● )\",\"(● )\"]},\"smiley\":{\"interval\":200,\"frames\":[\"😄 \",\"😝 \"]},\"monkey\":{\"interval\":300,\"frames\":[\"🙈 \",\"🙈 \",\"🙉 \",\"🙊 \"]},\"hearts\":{\"interval\":100,\"frames\":[\"💛 \",\"💙 \",\"💜 \",\"💚 \",\"❤️ \"]},\"clock\":{\"interval\":100,\"frames\":[\"🕐 \",\"🕑 \",\"🕒 \",\"🕓 \",\"🕔 \",\"🕕 \",\"🕖 \",\"🕗 \",\"🕘 \",\"🕙 \",\"🕚 \"]},\"earth\":{\"interval\":180,\"frames\":[\"🌍 \",\"🌎 \",\"🌏 \"]},\"moon\":{\"interval\":80,\"frames\":[\"🌑 \",\"🌒 \",\"🌓 \",\"🌔 \",\"🌕 \",\"🌖 \",\"🌗 \",\"🌘 \"]},\"runner\":{\"interval\":140,\"frames\":[\"🚶 \",\"🏃 \"]},\"pong\":{\"interval\":80,\"frames\":[\"▐⠂ ▌\",\"▐⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂▌\",\"▐ ⠠▌\",\"▐ ⡀▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐ ⠠ ▌\",\"▐ ⠂ ▌\",\"▐ ⠈ ▌\",\"▐ ⠂ ▌\",\"▐ ⠠ ▌\",\"▐ ⡀ ▌\",\"▐⠠ ▌\"]},\"shark\":{\"interval\":120,\"frames\":[\"▐|\\\\____________▌\",\"▐_|\\\\___________▌\",\"▐__|\\\\__________▌\",\"▐___|\\\\_________▌\",\"▐____|\\\\________▌\",\"▐_____|\\\\_______▌\",\"▐______|\\\\______▌\",\"▐_______|\\\\_____▌\",\"▐________|\\\\____▌\",\"▐_________|\\\\___▌\",\"▐__________|\\\\__▌\",\"▐___________|\\\\_▌\",\"▐____________|\\\\▌\",\"▐____________/|▌\",\"▐___________/|_▌\",\"▐__________/|__▌\",\"▐_________/|___▌\",\"▐________/|____▌\",\"▐_______/|_____▌\",\"▐______/|______▌\",\"▐_____/|_______▌\",\"▐____/|________▌\",\"▐___/|_________▌\",\"▐__/|__________▌\",\"▐_/|___________▌\",\"▐/|____________▌\"]},\"dqpb\":{\"interval\":100,\"frames\":[\"d\",\"q\",\"p\",\"b\"]},\"weather\":{\"interval\":100,\"frames\":[\"☀️ \",\"☀️ \",\"☀️ \",\"🌤 \",\"⛅️ \",\"🌥 \",\"☁️ \",\"🌧 \",\"🌨 \",\"🌧 \",\"🌨 \",\"🌧 \",\"🌨 \",\"⛈ \",\"🌨 \",\"🌧 \",\"🌨 \",\"☁️ \",\"🌥 \",\"⛅️ \",\"🌤 \",\"☀️ \",\"☀️ \"]},\"christmas\":{\"interval\":400,\"frames\":[\"🌲\",\"🎄\"]}}"); /***/ }), -/* 681 */ +/* 682 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const chalk = __webpack_require__(682); +const chalk = __webpack_require__(683); const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; @@ -77616,16 +77899,16 @@ module.exports = isSupported ? main : fallbacks; /***/ }), -/* 682 */ +/* 683 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(387); -const ansiStyles = __webpack_require__(683); -const stdoutColor = __webpack_require__(684).stdout; +const escapeStringRegexp = __webpack_require__(388); +const ansiStyles = __webpack_require__(684); +const stdoutColor = __webpack_require__(685).stdout; -const template = __webpack_require__(685); +const template = __webpack_require__(686); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -77851,12 +78134,12 @@ module.exports.default = module.exports; // For TypeScript /***/ }), -/* 683 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(389); +const colorConvert = __webpack_require__(390); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -78024,13 +78307,13 @@ Object.defineProperty(module, 'exports', { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(11)(module))) /***/ }), -/* 684 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__(364); -const hasFlag = __webpack_require__(394); +const os = __webpack_require__(365); +const hasFlag = __webpack_require__(395); const env = process.env; @@ -78166,7 +78449,7 @@ module.exports = { /***/ }), -/* 685 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78301,16 +78584,16 @@ module.exports = (chalk, tmp) => { /***/ }), -/* 686 */ +/* 687 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RunCommand", function() { return RunCommand; }); -/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(516); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(500); -/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(501); -/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(502); +/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(517); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(501); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(502); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(503); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -78362,17 +78645,17 @@ const RunCommand = { }; /***/ }), -/* 687 */ +/* 688 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WatchCommand", function() { return WatchCommand; }); -/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(516); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(500); -/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(501); -/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(502); -/* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(688); +/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(517); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(501); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(502); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(503); +/* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(689); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -78457,14 +78740,14 @@ const WatchCommand = { }; /***/ }), -/* 688 */ +/* 689 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waitUntilWatchIsReady", function() { return waitUntilWatchIsReady; }); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(140); -/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(241); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(242); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -78531,17 +78814,17 @@ function waitUntilWatchIsReady(stream, opts = {}) { } /***/ }), -/* 689 */ +/* 690 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runCommand", function() { return runCommand; }); -/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(516); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(500); -/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(502); -/* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(690); -/* harmony import */ var _utils_kibana__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(691); +/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(517); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(501); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(503); +/* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(691); +/* harmony import */ var _utils_kibana__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(692); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -78590,7 +78873,7 @@ async function runCommand(command, config) { const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_2__["buildProjectGraph"])(projects); _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].debug(`Found ${projects.size.toString()} projects`); _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].debug(Object(_utils_projects_tree__WEBPACK_IMPORTED_MODULE_3__["renderProjectsTree"])(config.rootPath, projects)); - await command.run(projects, projectGraph, _objectSpread({}, config, { + await command.run(projects, projectGraph, _objectSpread(_objectSpread({}, config), {}, { kbn })); } catch (error) { @@ -78623,13 +78906,13 @@ function toArray(value) { } /***/ }), -/* 690 */ +/* 691 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderProjectsTree", function() { return renderProjectsTree; }); -/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(386); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(387); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); @@ -78776,7 +79059,7 @@ function addProjectToTree(tree, pathParts, project) { } /***/ }), -/* 691 */ +/* 692 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -78784,12 +79067,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Kibana", function() { return Kibana; }); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var multimatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(692); +/* harmony import */ var multimatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(693); /* harmony import */ var multimatch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(multimatch__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var is_path_inside__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(696); +/* harmony import */ var is_path_inside__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(697); /* harmony import */ var is_path_inside__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(is_path_inside__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(502); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(574); +/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(503); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(575); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -78833,9 +79116,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope class Kibana { static async loadFrom(rootPath) { - return new Kibana((await Object(_projects__WEBPACK_IMPORTED_MODULE_3__["getProjects"])(rootPath, Object(_config__WEBPACK_IMPORTED_MODULE_4__["getProjectPaths"])({ + return new Kibana(await Object(_projects__WEBPACK_IMPORTED_MODULE_3__["getProjects"])(rootPath, Object(_config__WEBPACK_IMPORTED_MODULE_4__["getProjectPaths"])({ rootPath - })))); + }))); } constructor(allWorkspaceProjects) { @@ -78901,7 +79184,7 @@ class Kibana { const allProjects = this.getAllProjects(); const filteredProjects = new Map(); const pkgJsonPaths = Array.from(allProjects.values()).map(p => p.packageJsonLocation); - const filteredPkgJsonGlobs = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getProjectPaths"])(_objectSpread({}, options, { + const filteredPkgJsonGlobs = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getProjectPaths"])(_objectSpread(_objectSpread({}, options), {}, { rootPath: this.kibanaProject.path })).map(g => path__WEBPACK_IMPORTED_MODULE_0___default.a.resolve(g, 'package.json')); const matchingPkgJsonPaths = multimatch__WEBPACK_IMPORTED_MODULE_1___default()(pkgJsonPaths, filteredPkgJsonGlobs); @@ -78930,15 +79213,15 @@ class Kibana { } /***/ }), -/* 692 */ +/* 693 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const minimatch = __webpack_require__(506); -const arrayUnion = __webpack_require__(693); -const arrayDiffer = __webpack_require__(694); -const arrify = __webpack_require__(695); +const minimatch = __webpack_require__(507); +const arrayUnion = __webpack_require__(694); +const arrayDiffer = __webpack_require__(695); +const arrify = __webpack_require__(696); module.exports = (list, patterns, options = {}) => { list = arrify(list); @@ -78962,7 +79245,7 @@ module.exports = (list, patterns, options = {}) => { /***/ }), -/* 693 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78974,7 +79257,7 @@ module.exports = (...arguments_) => { /***/ }), -/* 694 */ +/* 695 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78989,7 +79272,7 @@ module.exports = arrayDiffer; /***/ }), -/* 695 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79019,7 +79302,7 @@ module.exports = arrify; /***/ }), -/* 696 */ +/* 697 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79047,15 +79330,15 @@ module.exports = (childPath, parentPath) => { /***/ }), -/* 697 */ +/* 698 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(698); +/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(699); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _build_production_projects__WEBPACK_IMPORTED_MODULE_0__["buildProductionProjects"]; }); -/* harmony import */ var _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(933); +/* harmony import */ var _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(934); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); /* @@ -79080,23 +79363,23 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 698 */ +/* 699 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return buildProductionProjects; }); -/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(699); +/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(700); /* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cpy__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(582); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(583); /* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(574); -/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(491); -/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(500); -/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(518); -/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(502); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(575); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(492); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(501); +/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(519); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(503); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -79228,21 +79511,21 @@ async function copyToBuild(project, kibanaRoot, buildRoot) { } /***/ }), -/* 699 */ +/* 700 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const EventEmitter = __webpack_require__(373); +const EventEmitter = __webpack_require__(374); const path = __webpack_require__(4); -const os = __webpack_require__(364); -const pAll = __webpack_require__(700); -const arrify = __webpack_require__(702); -const globby = __webpack_require__(703); -const isGlob = __webpack_require__(600); -const cpFile = __webpack_require__(918); -const junk = __webpack_require__(930); -const CpyError = __webpack_require__(931); +const os = __webpack_require__(365); +const pAll = __webpack_require__(701); +const arrify = __webpack_require__(703); +const globby = __webpack_require__(704); +const isGlob = __webpack_require__(601); +const cpFile = __webpack_require__(919); +const junk = __webpack_require__(931); +const CpyError = __webpack_require__(932); const defaultOptions = { ignoreJunk: true @@ -79361,12 +79644,12 @@ module.exports = (source, destination, { /***/ }), -/* 700 */ +/* 701 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pMap = __webpack_require__(701); +const pMap = __webpack_require__(702); module.exports = (iterable, options) => pMap(iterable, element => element(), options); // TODO: Remove this for the next major release @@ -79374,7 +79657,7 @@ module.exports.default = module.exports; /***/ }), -/* 701 */ +/* 702 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79453,7 +79736,7 @@ module.exports.default = pMap; /***/ }), -/* 702 */ +/* 703 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79483,17 +79766,17 @@ module.exports = arrify; /***/ }), -/* 703 */ +/* 704 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); -const arrayUnion = __webpack_require__(704); -const glob = __webpack_require__(706); -const fastGlob = __webpack_require__(711); -const dirGlob = __webpack_require__(911); -const gitignore = __webpack_require__(914); +const fs = __webpack_require__(350); +const arrayUnion = __webpack_require__(705); +const glob = __webpack_require__(707); +const fastGlob = __webpack_require__(712); +const dirGlob = __webpack_require__(912); +const gitignore = __webpack_require__(915); const DEFAULT_FILTER = () => false; @@ -79638,12 +79921,12 @@ module.exports.gitignore = gitignore; /***/ }), -/* 704 */ +/* 705 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var arrayUniq = __webpack_require__(705); +var arrayUniq = __webpack_require__(706); module.exports = function () { return arrayUniq([].concat.apply([], arguments)); @@ -79651,7 +79934,7 @@ module.exports = function () { /***/ }), -/* 705 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79720,7 +80003,7 @@ if ('Set' in global) { /***/ }), -/* 706 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { // Approach: @@ -79765,27 +80048,27 @@ if ('Set' in global) { module.exports = glob -var fs = __webpack_require__(349) -var rp = __webpack_require__(504) -var minimatch = __webpack_require__(506) +var fs = __webpack_require__(350) +var rp = __webpack_require__(505) +var minimatch = __webpack_require__(507) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(707) -var EE = __webpack_require__(373).EventEmitter +var inherits = __webpack_require__(708) +var EE = __webpack_require__(374).EventEmitter var path = __webpack_require__(4) -var assert = __webpack_require__(371) -var isAbsolute = __webpack_require__(512) -var globSync = __webpack_require__(709) -var common = __webpack_require__(710) +var assert = __webpack_require__(372) +var isAbsolute = __webpack_require__(513) +var globSync = __webpack_require__(710) +var common = __webpack_require__(711) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(515) -var util = __webpack_require__(397) +var inflight = __webpack_require__(516) +var util = __webpack_require__(398) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(378) +var once = __webpack_require__(379) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -80516,22 +80799,22 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), -/* 707 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { try { - var util = __webpack_require__(397); + var util = __webpack_require__(398); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ - module.exports = __webpack_require__(708); + module.exports = __webpack_require__(709); } /***/ }), -/* 708 */ +/* 709 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { @@ -80564,22 +80847,22 @@ if (typeof Object.create === 'function') { /***/ }), -/* 709 */ +/* 710 */ /***/ (function(module, exports, __webpack_require__) { module.exports = globSync globSync.GlobSync = GlobSync -var fs = __webpack_require__(349) -var rp = __webpack_require__(504) -var minimatch = __webpack_require__(506) +var fs = __webpack_require__(350) +var rp = __webpack_require__(505) +var minimatch = __webpack_require__(507) var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(706).Glob -var util = __webpack_require__(397) +var Glob = __webpack_require__(707).Glob +var util = __webpack_require__(398) var path = __webpack_require__(4) -var assert = __webpack_require__(371) -var isAbsolute = __webpack_require__(512) -var common = __webpack_require__(710) +var assert = __webpack_require__(372) +var isAbsolute = __webpack_require__(513) +var common = __webpack_require__(711) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts @@ -81056,7 +81339,7 @@ GlobSync.prototype._makeAbs = function (f) { /***/ }), -/* 710 */ +/* 711 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort @@ -81074,8 +81357,8 @@ function ownProp (obj, field) { } var path = __webpack_require__(4) -var minimatch = __webpack_require__(506) -var isAbsolute = __webpack_require__(512) +var minimatch = __webpack_require__(507) +var isAbsolute = __webpack_require__(513) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -81302,10 +81585,10 @@ function childrenIgnored (self, path) { /***/ }), -/* 711 */ +/* 712 */ /***/ (function(module, exports, __webpack_require__) { -const pkg = __webpack_require__(712); +const pkg = __webpack_require__(713); module.exports = pkg.async; module.exports.default = pkg.async; @@ -81318,19 +81601,19 @@ module.exports.generateTasks = pkg.generateTasks; /***/ }), -/* 712 */ +/* 713 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var optionsManager = __webpack_require__(713); -var taskManager = __webpack_require__(714); -var reader_async_1 = __webpack_require__(882); -var reader_stream_1 = __webpack_require__(906); -var reader_sync_1 = __webpack_require__(907); -var arrayUtils = __webpack_require__(909); -var streamUtils = __webpack_require__(910); +var optionsManager = __webpack_require__(714); +var taskManager = __webpack_require__(715); +var reader_async_1 = __webpack_require__(883); +var reader_stream_1 = __webpack_require__(907); +var reader_sync_1 = __webpack_require__(908); +var arrayUtils = __webpack_require__(910); +var streamUtils = __webpack_require__(911); /** * Synchronous API. */ @@ -81396,7 +81679,7 @@ function isString(source) { /***/ }), -/* 713 */ +/* 714 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81434,13 +81717,13 @@ exports.prepare = prepare; /***/ }), -/* 714 */ +/* 715 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var patternUtils = __webpack_require__(715); +var patternUtils = __webpack_require__(716); /** * Generate tasks based on parent directory of each pattern. */ @@ -81531,16 +81814,16 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), -/* 715 */ +/* 716 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path = __webpack_require__(4); -var globParent = __webpack_require__(716); -var isGlob = __webpack_require__(719); -var micromatch = __webpack_require__(720); +var globParent = __webpack_require__(717); +var isGlob = __webpack_require__(720); +var micromatch = __webpack_require__(721); var GLOBSTAR = '**'; /** * Return true for static pattern. @@ -81686,16 +81969,16 @@ exports.matchAny = matchAny; /***/ }), -/* 716 */ +/* 717 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(4); -var isglob = __webpack_require__(717); -var pathDirname = __webpack_require__(718); -var isWin32 = __webpack_require__(364).platform() === 'win32'; +var isglob = __webpack_require__(718); +var pathDirname = __webpack_require__(719); +var isWin32 = __webpack_require__(365).platform() === 'win32'; module.exports = function globParent(str) { // flip windows path separators @@ -81717,7 +82000,7 @@ module.exports = function globParent(str) { /***/ }), -/* 717 */ +/* 718 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -81727,7 +82010,7 @@ module.exports = function globParent(str) { * Licensed under the MIT License. */ -var isExtglob = __webpack_require__(601); +var isExtglob = __webpack_require__(602); module.exports = function isGlob(str) { if (typeof str !== 'string' || str === '') { @@ -81748,14 +82031,14 @@ module.exports = function isGlob(str) { /***/ }), -/* 718 */ +/* 719 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(4); -var inspect = __webpack_require__(397).inspect; +var inspect = __webpack_require__(398).inspect; function assertPath(path) { if (typeof path !== 'string') { @@ -81898,7 +82181,7 @@ module.exports.win32 = win32; /***/ }), -/* 719 */ +/* 720 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -81908,7 +82191,7 @@ module.exports.win32 = win32; * Released under the MIT License. */ -var isExtglob = __webpack_require__(601); +var isExtglob = __webpack_require__(602); var chars = { '{': '}', '(': ')', '[': ']'}; module.exports = function isGlob(str, options) { @@ -81950,7 +82233,7 @@ module.exports = function isGlob(str, options) { /***/ }), -/* 720 */ +/* 721 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81960,19 +82243,19 @@ module.exports = function isGlob(str, options) { * Module dependencies */ -var util = __webpack_require__(397); -var braces = __webpack_require__(721); -var toRegex = __webpack_require__(834); -var extend = __webpack_require__(842); +var util = __webpack_require__(398); +var braces = __webpack_require__(722); +var toRegex = __webpack_require__(835); +var extend = __webpack_require__(843); /** * Local dependencies */ -var compilers = __webpack_require__(845); -var parsers = __webpack_require__(878); -var cache = __webpack_require__(879); -var utils = __webpack_require__(880); +var compilers = __webpack_require__(846); +var parsers = __webpack_require__(879); +var cache = __webpack_require__(880); +var utils = __webpack_require__(881); var MAX_LENGTH = 1024 * 64; /** @@ -82834,7 +83117,7 @@ module.exports = micromatch; /***/ }), -/* 721 */ +/* 722 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82844,18 +83127,18 @@ module.exports = micromatch; * Module dependencies */ -var toRegex = __webpack_require__(722); -var unique = __webpack_require__(736); -var extend = __webpack_require__(731); +var toRegex = __webpack_require__(723); +var unique = __webpack_require__(737); +var extend = __webpack_require__(732); /** * Local dependencies */ -var compilers = __webpack_require__(737); -var parsers = __webpack_require__(754); -var Braces = __webpack_require__(764); -var utils = __webpack_require__(738); +var compilers = __webpack_require__(738); +var parsers = __webpack_require__(755); +var Braces = __webpack_require__(765); +var utils = __webpack_require__(739); var MAX_LENGTH = 1024 * 64; var cache = {}; @@ -83159,15 +83442,15 @@ module.exports = braces; /***/ }), -/* 722 */ +/* 723 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var define = __webpack_require__(723); -var extend = __webpack_require__(731); -var not = __webpack_require__(733); +var define = __webpack_require__(724); +var extend = __webpack_require__(732); +var not = __webpack_require__(734); var MAX_LENGTH = 1024 * 64; /** @@ -83314,7 +83597,7 @@ module.exports.makeRe = makeRe; /***/ }), -/* 723 */ +/* 724 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83327,7 +83610,7 @@ module.exports.makeRe = makeRe; -var isDescriptor = __webpack_require__(724); +var isDescriptor = __webpack_require__(725); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -83352,7 +83635,7 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 724 */ +/* 725 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83365,9 +83648,9 @@ module.exports = function defineProperty(obj, prop, val) { -var typeOf = __webpack_require__(725); -var isAccessor = __webpack_require__(726); -var isData = __webpack_require__(729); +var typeOf = __webpack_require__(726); +var isAccessor = __webpack_require__(727); +var isData = __webpack_require__(730); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { @@ -83381,7 +83664,7 @@ module.exports = function isDescriptor(obj, key) { /***/ }), -/* 725 */ +/* 726 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -83534,7 +83817,7 @@ function isBuffer(val) { /***/ }), -/* 726 */ +/* 727 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83547,7 +83830,7 @@ function isBuffer(val) { -var typeOf = __webpack_require__(727); +var typeOf = __webpack_require__(728); // accessor descriptor properties var accessor = { @@ -83610,10 +83893,10 @@ module.exports = isAccessorDescriptor; /***/ }), -/* 727 */ +/* 728 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(728); +var isBuffer = __webpack_require__(729); var toString = Object.prototype.toString; /** @@ -83732,7 +84015,7 @@ module.exports = function kindOf(val) { /***/ }), -/* 728 */ +/* 729 */ /***/ (function(module, exports) { /*! @@ -83759,7 +84042,7 @@ function isSlowBuffer (obj) { /***/ }), -/* 729 */ +/* 730 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83772,7 +84055,7 @@ function isSlowBuffer (obj) { -var typeOf = __webpack_require__(730); +var typeOf = __webpack_require__(731); // data descriptor properties var data = { @@ -83821,10 +84104,10 @@ module.exports = isDataDescriptor; /***/ }), -/* 730 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(728); +var isBuffer = __webpack_require__(729); var toString = Object.prototype.toString; /** @@ -83943,13 +84226,13 @@ module.exports = function kindOf(val) { /***/ }), -/* 731 */ +/* 732 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(732); +var isObject = __webpack_require__(733); module.exports = function extend(o/*, objects*/) { if (!isObject(o)) { o = {}; } @@ -83983,7 +84266,7 @@ function hasOwn(obj, key) { /***/ }), -/* 732 */ +/* 733 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84003,13 +84286,13 @@ module.exports = function isExtendable(val) { /***/ }), -/* 733 */ +/* 734 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(734); +var extend = __webpack_require__(735); /** * The main export is a function that takes a `pattern` string and an `options` object. @@ -84076,13 +84359,13 @@ module.exports = toRegex; /***/ }), -/* 734 */ +/* 735 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(735); +var isObject = __webpack_require__(736); module.exports = function extend(o/*, objects*/) { if (!isObject(o)) { o = {}; } @@ -84116,7 +84399,7 @@ function hasOwn(obj, key) { /***/ }), -/* 735 */ +/* 736 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84136,7 +84419,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 736 */ +/* 737 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84186,13 +84469,13 @@ module.exports.immutable = function uniqueImmutable(arr) { /***/ }), -/* 737 */ +/* 738 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(738); +var utils = __webpack_require__(739); module.exports = function(braces, options) { braces.compiler @@ -84475,25 +84758,25 @@ function hasQueue(node) { /***/ }), -/* 738 */ +/* 739 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var splitString = __webpack_require__(739); +var splitString = __webpack_require__(740); var utils = module.exports; /** * Module dependencies */ -utils.extend = __webpack_require__(731); -utils.flatten = __webpack_require__(745); -utils.isObject = __webpack_require__(743); -utils.fillRange = __webpack_require__(746); -utils.repeat = __webpack_require__(753); -utils.unique = __webpack_require__(736); +utils.extend = __webpack_require__(732); +utils.flatten = __webpack_require__(746); +utils.isObject = __webpack_require__(744); +utils.fillRange = __webpack_require__(747); +utils.repeat = __webpack_require__(754); +utils.unique = __webpack_require__(737); utils.define = function(obj, key, val) { Object.defineProperty(obj, key, { @@ -84825,7 +85108,7 @@ utils.escapeRegex = function(str) { /***/ }), -/* 739 */ +/* 740 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84838,7 +85121,7 @@ utils.escapeRegex = function(str) { -var extend = __webpack_require__(740); +var extend = __webpack_require__(741); module.exports = function(str, options, fn) { if (typeof str !== 'string') { @@ -85003,14 +85286,14 @@ function keepEscaping(opts, str, idx) { /***/ }), -/* 740 */ +/* 741 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(741); -var assignSymbols = __webpack_require__(744); +var isExtendable = __webpack_require__(742); +var assignSymbols = __webpack_require__(745); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -85070,7 +85353,7 @@ function isEnum(obj, key) { /***/ }), -/* 741 */ +/* 742 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85083,7 +85366,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(742); +var isPlainObject = __webpack_require__(743); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -85091,7 +85374,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 742 */ +/* 743 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85104,7 +85387,7 @@ module.exports = function isExtendable(val) { -var isObject = __webpack_require__(743); +var isObject = __webpack_require__(744); function isObjectObject(o) { return isObject(o) === true @@ -85135,7 +85418,7 @@ module.exports = function isPlainObject(o) { /***/ }), -/* 743 */ +/* 744 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85154,7 +85437,7 @@ module.exports = function isObject(val) { /***/ }), -/* 744 */ +/* 745 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85201,7 +85484,7 @@ module.exports = function(receiver, objects) { /***/ }), -/* 745 */ +/* 746 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85230,7 +85513,7 @@ function flat(arr, res) { /***/ }), -/* 746 */ +/* 747 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85243,11 +85526,11 @@ function flat(arr, res) { -var util = __webpack_require__(397); -var isNumber = __webpack_require__(747); -var extend = __webpack_require__(749); -var repeat = __webpack_require__(751); -var toRegex = __webpack_require__(752); +var util = __webpack_require__(398); +var isNumber = __webpack_require__(748); +var extend = __webpack_require__(750); +var repeat = __webpack_require__(752); +var toRegex = __webpack_require__(753); /** * Return a range of numbers or letters. @@ -85445,7 +85728,7 @@ module.exports = fillRange; /***/ }), -/* 747 */ +/* 748 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85458,7 +85741,7 @@ module.exports = fillRange; -var typeOf = __webpack_require__(748); +var typeOf = __webpack_require__(749); module.exports = function isNumber(num) { var type = typeOf(num); @@ -85474,10 +85757,10 @@ module.exports = function isNumber(num) { /***/ }), -/* 748 */ +/* 749 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(728); +var isBuffer = __webpack_require__(729); var toString = Object.prototype.toString; /** @@ -85596,13 +85879,13 @@ module.exports = function kindOf(val) { /***/ }), -/* 749 */ +/* 750 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(750); +var isObject = __webpack_require__(751); module.exports = function extend(o/*, objects*/) { if (!isObject(o)) { o = {}; } @@ -85636,7 +85919,7 @@ function hasOwn(obj, key) { /***/ }), -/* 750 */ +/* 751 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85656,7 +85939,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 751 */ +/* 752 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85733,7 +86016,7 @@ function repeat(str, num) { /***/ }), -/* 752 */ +/* 753 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85746,8 +86029,8 @@ function repeat(str, num) { -var repeat = __webpack_require__(751); -var isNumber = __webpack_require__(747); +var repeat = __webpack_require__(752); +var isNumber = __webpack_require__(748); var cache = {}; function toRegexRange(min, max, options) { @@ -86034,7 +86317,7 @@ module.exports = toRegexRange; /***/ }), -/* 753 */ +/* 754 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -86059,14 +86342,14 @@ module.exports = function repeat(ele, num) { /***/ }), -/* 754 */ +/* 755 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Node = __webpack_require__(755); -var utils = __webpack_require__(738); +var Node = __webpack_require__(756); +var utils = __webpack_require__(739); /** * Braces parsers @@ -86426,15 +86709,15 @@ function concatNodes(pos, node, parent, options) { /***/ }), -/* 755 */ +/* 756 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(743); -var define = __webpack_require__(756); -var utils = __webpack_require__(763); +var isObject = __webpack_require__(744); +var define = __webpack_require__(757); +var utils = __webpack_require__(764); var ownNames; /** @@ -86925,7 +87208,7 @@ exports = module.exports = Node; /***/ }), -/* 756 */ +/* 757 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -86938,7 +87221,7 @@ exports = module.exports = Node; -var isDescriptor = __webpack_require__(757); +var isDescriptor = __webpack_require__(758); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -86963,7 +87246,7 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 757 */ +/* 758 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -86976,9 +87259,9 @@ module.exports = function defineProperty(obj, prop, val) { -var typeOf = __webpack_require__(758); -var isAccessor = __webpack_require__(759); -var isData = __webpack_require__(761); +var typeOf = __webpack_require__(759); +var isAccessor = __webpack_require__(760); +var isData = __webpack_require__(762); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { @@ -86992,7 +87275,7 @@ module.exports = function isDescriptor(obj, key) { /***/ }), -/* 758 */ +/* 759 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -87127,7 +87410,7 @@ function isBuffer(val) { /***/ }), -/* 759 */ +/* 760 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87140,7 +87423,7 @@ function isBuffer(val) { -var typeOf = __webpack_require__(760); +var typeOf = __webpack_require__(761); // accessor descriptor properties var accessor = { @@ -87203,7 +87486,7 @@ module.exports = isAccessorDescriptor; /***/ }), -/* 760 */ +/* 761 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -87338,7 +87621,7 @@ function isBuffer(val) { /***/ }), -/* 761 */ +/* 762 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87351,7 +87634,7 @@ function isBuffer(val) { -var typeOf = __webpack_require__(762); +var typeOf = __webpack_require__(763); module.exports = function isDataDescriptor(obj, prop) { // data descriptor properties @@ -87394,7 +87677,7 @@ module.exports = function isDataDescriptor(obj, prop) { /***/ }), -/* 762 */ +/* 763 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -87529,13 +87812,13 @@ function isBuffer(val) { /***/ }), -/* 763 */ +/* 764 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var typeOf = __webpack_require__(748); +var typeOf = __webpack_require__(749); var utils = module.exports; /** @@ -88555,17 +88838,17 @@ function assert(val, message) { /***/ }), -/* 764 */ +/* 765 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(731); -var Snapdragon = __webpack_require__(765); -var compilers = __webpack_require__(737); -var parsers = __webpack_require__(754); -var utils = __webpack_require__(738); +var extend = __webpack_require__(732); +var Snapdragon = __webpack_require__(766); +var compilers = __webpack_require__(738); +var parsers = __webpack_require__(755); +var utils = __webpack_require__(739); /** * Customize Snapdragon parser and renderer @@ -88666,17 +88949,17 @@ module.exports = Braces; /***/ }), -/* 765 */ +/* 766 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Base = __webpack_require__(766); -var define = __webpack_require__(792); -var Compiler = __webpack_require__(802); -var Parser = __webpack_require__(831); -var utils = __webpack_require__(811); +var Base = __webpack_require__(767); +var define = __webpack_require__(793); +var Compiler = __webpack_require__(803); +var Parser = __webpack_require__(832); +var utils = __webpack_require__(812); var regexCache = {}; var cache = {}; @@ -88847,20 +89130,20 @@ module.exports.Parser = Parser; /***/ }), -/* 766 */ +/* 767 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(397); -var define = __webpack_require__(767); -var CacheBase = __webpack_require__(768); -var Emitter = __webpack_require__(769); -var isObject = __webpack_require__(743); -var merge = __webpack_require__(786); -var pascal = __webpack_require__(789); -var cu = __webpack_require__(790); +var util = __webpack_require__(398); +var define = __webpack_require__(768); +var CacheBase = __webpack_require__(769); +var Emitter = __webpack_require__(770); +var isObject = __webpack_require__(744); +var merge = __webpack_require__(787); +var pascal = __webpack_require__(790); +var cu = __webpack_require__(791); /** * Optionally define a custom `cache` namespace to use. @@ -89289,7 +89572,7 @@ module.exports.namespace = namespace; /***/ }), -/* 767 */ +/* 768 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89302,7 +89585,7 @@ module.exports.namespace = namespace; -var isDescriptor = __webpack_require__(757); +var isDescriptor = __webpack_require__(758); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -89327,21 +89610,21 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 768 */ +/* 769 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(743); -var Emitter = __webpack_require__(769); -var visit = __webpack_require__(770); -var toPath = __webpack_require__(773); -var union = __webpack_require__(774); -var del = __webpack_require__(778); -var get = __webpack_require__(776); -var has = __webpack_require__(783); -var set = __webpack_require__(777); +var isObject = __webpack_require__(744); +var Emitter = __webpack_require__(770); +var visit = __webpack_require__(771); +var toPath = __webpack_require__(774); +var union = __webpack_require__(775); +var del = __webpack_require__(779); +var get = __webpack_require__(777); +var has = __webpack_require__(784); +var set = __webpack_require__(778); /** * Create a `Cache` constructor that when instantiated will @@ -89595,7 +89878,7 @@ module.exports.namespace = namespace; /***/ }), -/* 769 */ +/* 770 */ /***/ (function(module, exports, __webpack_require__) { @@ -89764,7 +90047,7 @@ Emitter.prototype.hasListeners = function(event){ /***/ }), -/* 770 */ +/* 771 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89777,8 +90060,8 @@ Emitter.prototype.hasListeners = function(event){ -var visit = __webpack_require__(771); -var mapVisit = __webpack_require__(772); +var visit = __webpack_require__(772); +var mapVisit = __webpack_require__(773); module.exports = function(collection, method, val) { var result; @@ -89801,7 +90084,7 @@ module.exports = function(collection, method, val) { /***/ }), -/* 771 */ +/* 772 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89814,7 +90097,7 @@ module.exports = function(collection, method, val) { -var isObject = __webpack_require__(743); +var isObject = __webpack_require__(744); module.exports = function visit(thisArg, method, target, val) { if (!isObject(thisArg) && typeof thisArg !== 'function') { @@ -89841,14 +90124,14 @@ module.exports = function visit(thisArg, method, target, val) { /***/ }), -/* 772 */ +/* 773 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(397); -var visit = __webpack_require__(771); +var util = __webpack_require__(398); +var visit = __webpack_require__(772); /** * Map `visit` over an array of objects. @@ -89885,7 +90168,7 @@ function isObject(val) { /***/ }), -/* 773 */ +/* 774 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89898,7 +90181,7 @@ function isObject(val) { -var typeOf = __webpack_require__(748); +var typeOf = __webpack_require__(749); module.exports = function toPath(args) { if (typeOf(args) !== 'arguments') { @@ -89925,16 +90208,16 @@ function filter(arr) { /***/ }), -/* 774 */ +/* 775 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(735); -var union = __webpack_require__(775); -var get = __webpack_require__(776); -var set = __webpack_require__(777); +var isObject = __webpack_require__(736); +var union = __webpack_require__(776); +var get = __webpack_require__(777); +var set = __webpack_require__(778); module.exports = function unionValue(obj, prop, value) { if (!isObject(obj)) { @@ -89962,7 +90245,7 @@ function arrayify(val) { /***/ }), -/* 775 */ +/* 776 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89998,7 +90281,7 @@ module.exports = function union(init) { /***/ }), -/* 776 */ +/* 777 */ /***/ (function(module, exports) { /*! @@ -90054,7 +90337,7 @@ function toString(val) { /***/ }), -/* 777 */ +/* 778 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90067,10 +90350,10 @@ function toString(val) { -var split = __webpack_require__(739); -var extend = __webpack_require__(734); -var isPlainObject = __webpack_require__(742); -var isObject = __webpack_require__(735); +var split = __webpack_require__(740); +var extend = __webpack_require__(735); +var isPlainObject = __webpack_require__(743); +var isObject = __webpack_require__(736); module.exports = function(obj, prop, val) { if (!isObject(obj)) { @@ -90116,7 +90399,7 @@ function isValidKey(key) { /***/ }), -/* 778 */ +/* 779 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90129,8 +90412,8 @@ function isValidKey(key) { -var isObject = __webpack_require__(743); -var has = __webpack_require__(779); +var isObject = __webpack_require__(744); +var has = __webpack_require__(780); module.exports = function unset(obj, prop) { if (!isObject(obj)) { @@ -90155,7 +90438,7 @@ module.exports = function unset(obj, prop) { /***/ }), -/* 779 */ +/* 780 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90168,9 +90451,9 @@ module.exports = function unset(obj, prop) { -var isObject = __webpack_require__(780); -var hasValues = __webpack_require__(782); -var get = __webpack_require__(776); +var isObject = __webpack_require__(781); +var hasValues = __webpack_require__(783); +var get = __webpack_require__(777); module.exports = function(obj, prop, noZero) { if (isObject(obj)) { @@ -90181,7 +90464,7 @@ module.exports = function(obj, prop, noZero) { /***/ }), -/* 780 */ +/* 781 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90194,7 +90477,7 @@ module.exports = function(obj, prop, noZero) { -var isArray = __webpack_require__(781); +var isArray = __webpack_require__(782); module.exports = function isObject(val) { return val != null && typeof val === 'object' && isArray(val) === false; @@ -90202,7 +90485,7 @@ module.exports = function isObject(val) { /***/ }), -/* 781 */ +/* 782 */ /***/ (function(module, exports) { var toString = {}.toString; @@ -90213,7 +90496,7 @@ module.exports = Array.isArray || function (arr) { /***/ }), -/* 782 */ +/* 783 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90256,7 +90539,7 @@ module.exports = function hasValue(o, noZero) { /***/ }), -/* 783 */ +/* 784 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90269,9 +90552,9 @@ module.exports = function hasValue(o, noZero) { -var isObject = __webpack_require__(743); -var hasValues = __webpack_require__(784); -var get = __webpack_require__(776); +var isObject = __webpack_require__(744); +var hasValues = __webpack_require__(785); +var get = __webpack_require__(777); module.exports = function(val, prop) { return hasValues(isObject(val) && prop ? get(val, prop) : val); @@ -90279,7 +90562,7 @@ module.exports = function(val, prop) { /***/ }), -/* 784 */ +/* 785 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90292,8 +90575,8 @@ module.exports = function(val, prop) { -var typeOf = __webpack_require__(785); -var isNumber = __webpack_require__(747); +var typeOf = __webpack_require__(786); +var isNumber = __webpack_require__(748); module.exports = function hasValue(val) { // is-number checks for NaN and other edge cases @@ -90346,10 +90629,10 @@ module.exports = function hasValue(val) { /***/ }), -/* 785 */ +/* 786 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(728); +var isBuffer = __webpack_require__(729); var toString = Object.prototype.toString; /** @@ -90471,14 +90754,14 @@ module.exports = function kindOf(val) { /***/ }), -/* 786 */ +/* 787 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(787); -var forIn = __webpack_require__(788); +var isExtendable = __webpack_require__(788); +var forIn = __webpack_require__(789); function mixinDeep(target, objects) { var len = arguments.length, i = 0; @@ -90542,7 +90825,7 @@ module.exports = mixinDeep; /***/ }), -/* 787 */ +/* 788 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90555,7 +90838,7 @@ module.exports = mixinDeep; -var isPlainObject = __webpack_require__(742); +var isPlainObject = __webpack_require__(743); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -90563,7 +90846,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 788 */ +/* 789 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90586,7 +90869,7 @@ module.exports = function forIn(obj, fn, thisArg) { /***/ }), -/* 789 */ +/* 790 */ /***/ (function(module, exports) { /*! @@ -90613,14 +90896,14 @@ module.exports = pascalcase; /***/ }), -/* 790 */ +/* 791 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(397); -var utils = __webpack_require__(791); +var util = __webpack_require__(398); +var utils = __webpack_require__(792); /** * Expose class utils @@ -90985,7 +91268,7 @@ cu.bubble = function(Parent, events) { /***/ }), -/* 791 */ +/* 792 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90999,10 +91282,10 @@ var utils = {}; * Lazily required module dependencies */ -utils.union = __webpack_require__(775); -utils.define = __webpack_require__(792); -utils.isObj = __webpack_require__(743); -utils.staticExtend = __webpack_require__(799); +utils.union = __webpack_require__(776); +utils.define = __webpack_require__(793); +utils.isObj = __webpack_require__(744); +utils.staticExtend = __webpack_require__(800); /** @@ -91013,7 +91296,7 @@ module.exports = utils; /***/ }), -/* 792 */ +/* 793 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91026,7 +91309,7 @@ module.exports = utils; -var isDescriptor = __webpack_require__(793); +var isDescriptor = __webpack_require__(794); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -91051,7 +91334,7 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 793 */ +/* 794 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91064,9 +91347,9 @@ module.exports = function defineProperty(obj, prop, val) { -var typeOf = __webpack_require__(794); -var isAccessor = __webpack_require__(795); -var isData = __webpack_require__(797); +var typeOf = __webpack_require__(795); +var isAccessor = __webpack_require__(796); +var isData = __webpack_require__(798); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { @@ -91080,7 +91363,7 @@ module.exports = function isDescriptor(obj, key) { /***/ }), -/* 794 */ +/* 795 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -91233,7 +91516,7 @@ function isBuffer(val) { /***/ }), -/* 795 */ +/* 796 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91246,7 +91529,7 @@ function isBuffer(val) { -var typeOf = __webpack_require__(796); +var typeOf = __webpack_require__(797); // accessor descriptor properties var accessor = { @@ -91309,10 +91592,10 @@ module.exports = isAccessorDescriptor; /***/ }), -/* 796 */ +/* 797 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(728); +var isBuffer = __webpack_require__(729); var toString = Object.prototype.toString; /** @@ -91431,7 +91714,7 @@ module.exports = function kindOf(val) { /***/ }), -/* 797 */ +/* 798 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91444,7 +91727,7 @@ module.exports = function kindOf(val) { -var typeOf = __webpack_require__(798); +var typeOf = __webpack_require__(799); // data descriptor properties var data = { @@ -91493,10 +91776,10 @@ module.exports = isDataDescriptor; /***/ }), -/* 798 */ +/* 799 */ /***/ (function(module, exports, __webpack_require__) { -var isBuffer = __webpack_require__(728); +var isBuffer = __webpack_require__(729); var toString = Object.prototype.toString; /** @@ -91615,7 +91898,7 @@ module.exports = function kindOf(val) { /***/ }), -/* 799 */ +/* 800 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91628,9 +91911,9 @@ module.exports = function kindOf(val) { -var copy = __webpack_require__(800); -var define = __webpack_require__(792); -var util = __webpack_require__(397); +var copy = __webpack_require__(801); +var define = __webpack_require__(793); +var util = __webpack_require__(398); /** * Returns a function for extending the static properties, @@ -91712,15 +91995,15 @@ module.exports = extend; /***/ }), -/* 800 */ +/* 801 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var typeOf = __webpack_require__(748); -var copyDescriptor = __webpack_require__(801); -var define = __webpack_require__(792); +var typeOf = __webpack_require__(749); +var copyDescriptor = __webpack_require__(802); +var define = __webpack_require__(793); /** * Copy static properties, prototype properties, and descriptors from one object to another. @@ -91893,7 +92176,7 @@ module.exports.has = has; /***/ }), -/* 801 */ +/* 802 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91981,16 +92264,16 @@ function isObject(val) { /***/ }), -/* 802 */ +/* 803 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var use = __webpack_require__(803); -var define = __webpack_require__(792); -var debug = __webpack_require__(805)('snapdragon:compiler'); -var utils = __webpack_require__(811); +var use = __webpack_require__(804); +var define = __webpack_require__(793); +var debug = __webpack_require__(806)('snapdragon:compiler'); +var utils = __webpack_require__(812); /** * Create a new `Compiler` with the given `options`. @@ -92144,7 +92427,7 @@ Compiler.prototype = { // source map support if (opts.sourcemap) { - var sourcemaps = __webpack_require__(830); + var sourcemaps = __webpack_require__(831); sourcemaps(this); this.mapVisit(this.ast.nodes); this.applySourceMaps(); @@ -92165,7 +92448,7 @@ module.exports = Compiler; /***/ }), -/* 803 */ +/* 804 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -92178,7 +92461,7 @@ module.exports = Compiler; -var utils = __webpack_require__(804); +var utils = __webpack_require__(805); module.exports = function base(app, opts) { if (!utils.isObject(app) && typeof app !== 'function') { @@ -92293,7 +92576,7 @@ module.exports = function base(app, opts) { /***/ }), -/* 804 */ +/* 805 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -92307,8 +92590,8 @@ var utils = {}; * Lazily required module dependencies */ -utils.define = __webpack_require__(792); -utils.isObject = __webpack_require__(743); +utils.define = __webpack_require__(793); +utils.isObject = __webpack_require__(744); utils.isString = function(val) { @@ -92323,7 +92606,7 @@ module.exports = utils; /***/ }), -/* 805 */ +/* 806 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92332,14 +92615,14 @@ module.exports = utils; */ if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = __webpack_require__(806); + module.exports = __webpack_require__(807); } else { - module.exports = __webpack_require__(809); + module.exports = __webpack_require__(810); } /***/ }), -/* 806 */ +/* 807 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92348,7 +92631,7 @@ if (typeof process !== 'undefined' && process.type === 'renderer') { * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(807); +exports = module.exports = __webpack_require__(808); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -92530,7 +92813,7 @@ function localstorage() { /***/ }), -/* 807 */ +/* 808 */ /***/ (function(module, exports, __webpack_require__) { @@ -92546,7 +92829,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(808); +exports.humanize = __webpack_require__(809); /** * The currently active debug mode names, and names to skip. @@ -92738,7 +93021,7 @@ function coerce(val) { /***/ }), -/* 808 */ +/* 809 */ /***/ (function(module, exports) { /** @@ -92896,15 +93179,15 @@ function plural(ms, n, name) { /***/ }), -/* 809 */ +/* 810 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies. */ -var tty = __webpack_require__(471); -var util = __webpack_require__(397); +var tty = __webpack_require__(472); +var util = __webpack_require__(398); /** * This is the Node.js implementation of `debug()`. @@ -92912,7 +93195,7 @@ var util = __webpack_require__(397); * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(807); +exports = module.exports = __webpack_require__(808); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; @@ -93084,14 +93367,14 @@ function createWritableStdioStream (fd) { break; case 'FILE': - var fs = __webpack_require__(349); + var fs = __webpack_require__(350); stream = new fs.SyncWriteStream(fd, { autoClose: false }); stream._type = 'fs'; break; case 'PIPE': case 'TCP': - var net = __webpack_require__(810); + var net = __webpack_require__(811); stream = new net.Socket({ fd: fd, readable: false, @@ -93150,13 +93433,13 @@ exports.enable(load()); /***/ }), -/* 810 */ +/* 811 */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), -/* 811 */ +/* 812 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -93166,9 +93449,9 @@ module.exports = require("net"); * Module dependencies */ -exports.extend = __webpack_require__(734); -exports.SourceMap = __webpack_require__(812); -exports.sourceMapResolve = __webpack_require__(823); +exports.extend = __webpack_require__(735); +exports.SourceMap = __webpack_require__(813); +exports.sourceMapResolve = __webpack_require__(824); /** * Convert backslash in the given string to forward slashes @@ -93211,7 +93494,7 @@ exports.last = function(arr, n) { /***/ }), -/* 812 */ +/* 813 */ /***/ (function(module, exports, __webpack_require__) { /* @@ -93219,13 +93502,13 @@ exports.last = function(arr, n) { * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ -exports.SourceMapGenerator = __webpack_require__(813).SourceMapGenerator; -exports.SourceMapConsumer = __webpack_require__(819).SourceMapConsumer; -exports.SourceNode = __webpack_require__(822).SourceNode; +exports.SourceMapGenerator = __webpack_require__(814).SourceMapGenerator; +exports.SourceMapConsumer = __webpack_require__(820).SourceMapConsumer; +exports.SourceNode = __webpack_require__(823).SourceNode; /***/ }), -/* 813 */ +/* 814 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -93235,10 +93518,10 @@ exports.SourceNode = __webpack_require__(822).SourceNode; * http://opensource.org/licenses/BSD-3-Clause */ -var base64VLQ = __webpack_require__(814); -var util = __webpack_require__(816); -var ArraySet = __webpack_require__(817).ArraySet; -var MappingList = __webpack_require__(818).MappingList; +var base64VLQ = __webpack_require__(815); +var util = __webpack_require__(817); +var ArraySet = __webpack_require__(818).ArraySet; +var MappingList = __webpack_require__(819).MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -93647,7 +93930,7 @@ exports.SourceMapGenerator = SourceMapGenerator; /***/ }), -/* 814 */ +/* 815 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -93687,7 +93970,7 @@ exports.SourceMapGenerator = SourceMapGenerator; * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var base64 = __webpack_require__(815); +var base64 = __webpack_require__(816); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, @@ -93793,7 +94076,7 @@ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { /***/ }), -/* 815 */ +/* 816 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -93866,7 +94149,7 @@ exports.decode = function (charCode) { /***/ }), -/* 816 */ +/* 817 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -94289,7 +94572,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate /***/ }), -/* 817 */ +/* 818 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -94299,7 +94582,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate * http://opensource.org/licenses/BSD-3-Clause */ -var util = __webpack_require__(816); +var util = __webpack_require__(817); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; @@ -94416,7 +94699,7 @@ exports.ArraySet = ArraySet; /***/ }), -/* 818 */ +/* 819 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -94426,7 +94709,7 @@ exports.ArraySet = ArraySet; * http://opensource.org/licenses/BSD-3-Clause */ -var util = __webpack_require__(816); +var util = __webpack_require__(817); /** * Determine whether mappingB is after mappingA with respect to generated @@ -94501,7 +94784,7 @@ exports.MappingList = MappingList; /***/ }), -/* 819 */ +/* 820 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -94511,11 +94794,11 @@ exports.MappingList = MappingList; * http://opensource.org/licenses/BSD-3-Clause */ -var util = __webpack_require__(816); -var binarySearch = __webpack_require__(820); -var ArraySet = __webpack_require__(817).ArraySet; -var base64VLQ = __webpack_require__(814); -var quickSort = __webpack_require__(821).quickSort; +var util = __webpack_require__(817); +var binarySearch = __webpack_require__(821); +var ArraySet = __webpack_require__(818).ArraySet; +var base64VLQ = __webpack_require__(815); +var quickSort = __webpack_require__(822).quickSort; function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; @@ -95589,7 +95872,7 @@ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; /***/ }), -/* 820 */ +/* 821 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -95706,7 +95989,7 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { /***/ }), -/* 821 */ +/* 822 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -95826,7 +96109,7 @@ exports.quickSort = function (ary, comparator) { /***/ }), -/* 822 */ +/* 823 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -95836,8 +96119,8 @@ exports.quickSort = function (ary, comparator) { * http://opensource.org/licenses/BSD-3-Clause */ -var SourceMapGenerator = __webpack_require__(813).SourceMapGenerator; -var util = __webpack_require__(816); +var SourceMapGenerator = __webpack_require__(814).SourceMapGenerator; +var util = __webpack_require__(817); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other // operating systems these days (capturing the result). @@ -96245,17 +96528,17 @@ exports.SourceNode = SourceNode; /***/ }), -/* 823 */ +/* 824 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2014, 2015, 2016, 2017 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) -var sourceMappingURL = __webpack_require__(824) -var resolveUrl = __webpack_require__(825) -var decodeUriComponent = __webpack_require__(826) -var urix = __webpack_require__(828) -var atob = __webpack_require__(829) +var sourceMappingURL = __webpack_require__(825) +var resolveUrl = __webpack_require__(826) +var decodeUriComponent = __webpack_require__(827) +var urix = __webpack_require__(829) +var atob = __webpack_require__(830) @@ -96553,7 +96836,7 @@ module.exports = { /***/ }), -/* 824 */ +/* 825 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright 2014 Simon Lydell @@ -96616,13 +96899,13 @@ void (function(root, factory) { /***/ }), -/* 825 */ +/* 826 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2014 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) -var url = __webpack_require__(439) +var url = __webpack_require__(440) function resolveUrl(/* ...urls */) { return Array.prototype.reduce.call(arguments, function(resolved, nextUrl) { @@ -96634,13 +96917,13 @@ module.exports = resolveUrl /***/ }), -/* 826 */ +/* 827 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) -var decodeUriComponent = __webpack_require__(827) +var decodeUriComponent = __webpack_require__(828) function customDecodeUriComponent(string) { // `decodeUriComponent` turns `+` into ` `, but that's not wanted. @@ -96651,7 +96934,7 @@ module.exports = customDecodeUriComponent /***/ }), -/* 827 */ +/* 828 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -96752,7 +97035,7 @@ module.exports = function (encodedURI) { /***/ }), -/* 828 */ +/* 829 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2014 Simon Lydell @@ -96775,7 +97058,7 @@ module.exports = urix /***/ }), -/* 829 */ +/* 830 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -96789,16 +97072,16 @@ module.exports = atob.atob = atob; /***/ }), -/* 830 */ +/* 831 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var fs = __webpack_require__(349); +var fs = __webpack_require__(350); var path = __webpack_require__(4); -var define = __webpack_require__(792); -var utils = __webpack_require__(811); +var define = __webpack_require__(793); +var utils = __webpack_require__(812); /** * Expose `mixin()`. @@ -96941,19 +97224,19 @@ exports.comment = function(node) { /***/ }), -/* 831 */ +/* 832 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var use = __webpack_require__(803); -var util = __webpack_require__(397); -var Cache = __webpack_require__(832); -var define = __webpack_require__(792); -var debug = __webpack_require__(805)('snapdragon:parser'); -var Position = __webpack_require__(833); -var utils = __webpack_require__(811); +var use = __webpack_require__(804); +var util = __webpack_require__(398); +var Cache = __webpack_require__(833); +var define = __webpack_require__(793); +var debug = __webpack_require__(806)('snapdragon:parser'); +var Position = __webpack_require__(834); +var utils = __webpack_require__(812); /** * Create a new `Parser` with the given `input` and `options`. @@ -97481,7 +97764,7 @@ module.exports = Parser; /***/ }), -/* 832 */ +/* 833 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -97588,13 +97871,13 @@ MapCache.prototype.del = function mapDelete(key) { /***/ }), -/* 833 */ +/* 834 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var define = __webpack_require__(792); +var define = __webpack_require__(793); /** * Store position for a node @@ -97609,16 +97892,16 @@ module.exports = function Position(start, parser) { /***/ }), -/* 834 */ +/* 835 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var safe = __webpack_require__(835); -var define = __webpack_require__(841); -var extend = __webpack_require__(842); -var not = __webpack_require__(844); +var safe = __webpack_require__(836); +var define = __webpack_require__(842); +var extend = __webpack_require__(843); +var not = __webpack_require__(845); var MAX_LENGTH = 1024 * 64; /** @@ -97771,10 +98054,10 @@ module.exports.makeRe = makeRe; /***/ }), -/* 835 */ +/* 836 */ /***/ (function(module, exports, __webpack_require__) { -var parse = __webpack_require__(836); +var parse = __webpack_require__(837); var types = parse.types; module.exports = function (re, opts) { @@ -97820,13 +98103,13 @@ function isRegExp (x) { /***/ }), -/* 836 */ +/* 837 */ /***/ (function(module, exports, __webpack_require__) { -var util = __webpack_require__(837); -var types = __webpack_require__(838); -var sets = __webpack_require__(839); -var positions = __webpack_require__(840); +var util = __webpack_require__(838); +var types = __webpack_require__(839); +var sets = __webpack_require__(840); +var positions = __webpack_require__(841); module.exports = function(regexpStr) { @@ -98108,11 +98391,11 @@ module.exports.types = types; /***/ }), -/* 837 */ +/* 838 */ /***/ (function(module, exports, __webpack_require__) { -var types = __webpack_require__(838); -var sets = __webpack_require__(839); +var types = __webpack_require__(839); +var sets = __webpack_require__(840); // All of these are private and only used by randexp. @@ -98225,7 +98508,7 @@ exports.error = function(regexp, msg) { /***/ }), -/* 838 */ +/* 839 */ /***/ (function(module, exports) { module.exports = { @@ -98241,10 +98524,10 @@ module.exports = { /***/ }), -/* 839 */ +/* 840 */ /***/ (function(module, exports, __webpack_require__) { -var types = __webpack_require__(838); +var types = __webpack_require__(839); var INTS = function() { return [{ type: types.RANGE , from: 48, to: 57 }]; @@ -98329,10 +98612,10 @@ exports.anyChar = function() { /***/ }), -/* 840 */ +/* 841 */ /***/ (function(module, exports, __webpack_require__) { -var types = __webpack_require__(838); +var types = __webpack_require__(839); exports.wordBoundary = function() { return { type: types.POSITION, value: 'b' }; @@ -98352,7 +98635,7 @@ exports.end = function() { /***/ }), -/* 841 */ +/* 842 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98365,8 +98648,8 @@ exports.end = function() { -var isobject = __webpack_require__(743); -var isDescriptor = __webpack_require__(757); +var isobject = __webpack_require__(744); +var isDescriptor = __webpack_require__(758); var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) ? Reflect.defineProperty : Object.defineProperty; @@ -98397,14 +98680,14 @@ module.exports = function defineProperty(obj, key, val) { /***/ }), -/* 842 */ +/* 843 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(843); -var assignSymbols = __webpack_require__(744); +var isExtendable = __webpack_require__(844); +var assignSymbols = __webpack_require__(745); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -98464,7 +98747,7 @@ function isEnum(obj, key) { /***/ }), -/* 843 */ +/* 844 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98477,7 +98760,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(742); +var isPlainObject = __webpack_require__(743); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -98485,14 +98768,14 @@ module.exports = function isExtendable(val) { /***/ }), -/* 844 */ +/* 845 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(842); -var safe = __webpack_require__(835); +var extend = __webpack_require__(843); +var safe = __webpack_require__(836); /** * The main export is a function that takes a `pattern` string and an `options` object. @@ -98564,14 +98847,14 @@ module.exports = toRegex; /***/ }), -/* 845 */ +/* 846 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var nanomatch = __webpack_require__(846); -var extglob = __webpack_require__(862); +var nanomatch = __webpack_require__(847); +var extglob = __webpack_require__(863); module.exports = function(snapdragon) { var compilers = snapdragon.compiler.compilers; @@ -98648,7 +98931,7 @@ function escapeExtglobs(compiler) { /***/ }), -/* 846 */ +/* 847 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98658,18 +98941,18 @@ function escapeExtglobs(compiler) { * Module dependencies */ -var util = __webpack_require__(397); -var toRegex = __webpack_require__(847); -var extend = __webpack_require__(848); +var util = __webpack_require__(398); +var toRegex = __webpack_require__(848); +var extend = __webpack_require__(849); /** * Local dependencies */ -var compilers = __webpack_require__(850); -var parsers = __webpack_require__(851); -var cache = __webpack_require__(854); -var utils = __webpack_require__(856); +var compilers = __webpack_require__(851); +var parsers = __webpack_require__(852); +var cache = __webpack_require__(855); +var utils = __webpack_require__(857); var MAX_LENGTH = 1024 * 64; /** @@ -99493,15 +99776,15 @@ module.exports = nanomatch; /***/ }), -/* 847 */ +/* 848 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var define = __webpack_require__(792); -var extend = __webpack_require__(734); -var not = __webpack_require__(733); +var define = __webpack_require__(793); +var extend = __webpack_require__(735); +var not = __webpack_require__(734); var MAX_LENGTH = 1024 * 64; /** @@ -99648,14 +99931,14 @@ module.exports.makeRe = makeRe; /***/ }), -/* 848 */ +/* 849 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(849); -var assignSymbols = __webpack_require__(744); +var isExtendable = __webpack_require__(850); +var assignSymbols = __webpack_require__(745); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -99715,7 +99998,7 @@ function isEnum(obj, key) { /***/ }), -/* 849 */ +/* 850 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99728,7 +100011,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(742); +var isPlainObject = __webpack_require__(743); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -99736,7 +100019,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 850 */ +/* 851 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100082,15 +100365,15 @@ module.exports = function(nanomatch, options) { /***/ }), -/* 851 */ +/* 852 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var regexNot = __webpack_require__(733); -var toRegex = __webpack_require__(847); -var isOdd = __webpack_require__(852); +var regexNot = __webpack_require__(734); +var toRegex = __webpack_require__(848); +var isOdd = __webpack_require__(853); /** * Characters to use in negation regex (we want to "not" match @@ -100476,7 +100759,7 @@ module.exports.not = NOT_REGEX; /***/ }), -/* 852 */ +/* 853 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100489,7 +100772,7 @@ module.exports.not = NOT_REGEX; -var isNumber = __webpack_require__(853); +var isNumber = __webpack_require__(854); module.exports = function isOdd(i) { if (!isNumber(i)) { @@ -100503,7 +100786,7 @@ module.exports = function isOdd(i) { /***/ }), -/* 853 */ +/* 854 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100531,14 +100814,14 @@ module.exports = function isNumber(num) { /***/ }), -/* 854 */ +/* 855 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = new (__webpack_require__(855))(); +module.exports = new (__webpack_require__(856))(); /***/ }), -/* 855 */ +/* 856 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100551,7 +100834,7 @@ module.exports = new (__webpack_require__(855))(); -var MapCache = __webpack_require__(832); +var MapCache = __webpack_require__(833); /** * Create a new `FragmentCache` with an optional object to use for `caches`. @@ -100673,7 +100956,7 @@ exports = module.exports = FragmentCache; /***/ }), -/* 856 */ +/* 857 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100686,14 +100969,14 @@ var path = __webpack_require__(4); * Module dependencies */ -var isWindows = __webpack_require__(857)(); -var Snapdragon = __webpack_require__(765); -utils.define = __webpack_require__(858); -utils.diff = __webpack_require__(859); -utils.extend = __webpack_require__(848); -utils.pick = __webpack_require__(860); -utils.typeOf = __webpack_require__(861); -utils.unique = __webpack_require__(736); +var isWindows = __webpack_require__(858)(); +var Snapdragon = __webpack_require__(766); +utils.define = __webpack_require__(859); +utils.diff = __webpack_require__(860); +utils.extend = __webpack_require__(849); +utils.pick = __webpack_require__(861); +utils.typeOf = __webpack_require__(862); +utils.unique = __webpack_require__(737); /** * Returns true if the given value is effectively an empty string @@ -101059,7 +101342,7 @@ utils.unixify = function(options) { /***/ }), -/* 857 */ +/* 858 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -101087,7 +101370,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/* 858 */ +/* 859 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101100,8 +101383,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ -var isobject = __webpack_require__(743); -var isDescriptor = __webpack_require__(757); +var isobject = __webpack_require__(744); +var isDescriptor = __webpack_require__(758); var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) ? Reflect.defineProperty : Object.defineProperty; @@ -101132,7 +101415,7 @@ module.exports = function defineProperty(obj, key, val) { /***/ }), -/* 859 */ +/* 860 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101186,7 +101469,7 @@ function diffArray(one, two) { /***/ }), -/* 860 */ +/* 861 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101199,7 +101482,7 @@ function diffArray(one, two) { -var isObject = __webpack_require__(743); +var isObject = __webpack_require__(744); module.exports = function pick(obj, keys) { if (!isObject(obj) && typeof obj !== 'function') { @@ -101228,7 +101511,7 @@ module.exports = function pick(obj, keys) { /***/ }), -/* 861 */ +/* 862 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -101363,7 +101646,7 @@ function isBuffer(val) { /***/ }), -/* 862 */ +/* 863 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101373,18 +101656,18 @@ function isBuffer(val) { * Module dependencies */ -var extend = __webpack_require__(734); -var unique = __webpack_require__(736); -var toRegex = __webpack_require__(847); +var extend = __webpack_require__(735); +var unique = __webpack_require__(737); +var toRegex = __webpack_require__(848); /** * Local dependencies */ -var compilers = __webpack_require__(863); -var parsers = __webpack_require__(874); -var Extglob = __webpack_require__(877); -var utils = __webpack_require__(876); +var compilers = __webpack_require__(864); +var parsers = __webpack_require__(875); +var Extglob = __webpack_require__(878); +var utils = __webpack_require__(877); var MAX_LENGTH = 1024 * 64; /** @@ -101701,13 +101984,13 @@ module.exports = extglob; /***/ }), -/* 863 */ +/* 864 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var brackets = __webpack_require__(864); +var brackets = __webpack_require__(865); /** * Extglob compilers @@ -101877,7 +102160,7 @@ module.exports = function(extglob) { /***/ }), -/* 864 */ +/* 865 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101887,17 +102170,17 @@ module.exports = function(extglob) { * Local dependencies */ -var compilers = __webpack_require__(865); -var parsers = __webpack_require__(867); +var compilers = __webpack_require__(866); +var parsers = __webpack_require__(868); /** * Module dependencies */ -var debug = __webpack_require__(869)('expand-brackets'); -var extend = __webpack_require__(734); -var Snapdragon = __webpack_require__(765); -var toRegex = __webpack_require__(847); +var debug = __webpack_require__(870)('expand-brackets'); +var extend = __webpack_require__(735); +var Snapdragon = __webpack_require__(766); +var toRegex = __webpack_require__(848); /** * Parses the given POSIX character class `pattern` and returns a @@ -102095,13 +102378,13 @@ module.exports = brackets; /***/ }), -/* 865 */ +/* 866 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var posix = __webpack_require__(866); +var posix = __webpack_require__(867); module.exports = function(brackets) { brackets.compiler @@ -102189,7 +102472,7 @@ module.exports = function(brackets) { /***/ }), -/* 866 */ +/* 867 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102218,14 +102501,14 @@ module.exports = { /***/ }), -/* 867 */ +/* 868 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(868); -var define = __webpack_require__(792); +var utils = __webpack_require__(869); +var define = __webpack_require__(793); /** * Text regex @@ -102444,14 +102727,14 @@ module.exports.TEXT_REGEX = TEXT_REGEX; /***/ }), -/* 868 */ +/* 869 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var toRegex = __webpack_require__(847); -var regexNot = __webpack_require__(733); +var toRegex = __webpack_require__(848); +var regexNot = __webpack_require__(734); var cached; /** @@ -102485,7 +102768,7 @@ exports.createRegex = function(pattern, include) { /***/ }), -/* 869 */ +/* 870 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102494,14 +102777,14 @@ exports.createRegex = function(pattern, include) { */ if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = __webpack_require__(870); + module.exports = __webpack_require__(871); } else { - module.exports = __webpack_require__(873); + module.exports = __webpack_require__(874); } /***/ }), -/* 870 */ +/* 871 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102510,7 +102793,7 @@ if (typeof process !== 'undefined' && process.type === 'renderer') { * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(871); +exports = module.exports = __webpack_require__(872); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -102692,7 +102975,7 @@ function localstorage() { /***/ }), -/* 871 */ +/* 872 */ /***/ (function(module, exports, __webpack_require__) { @@ -102708,7 +102991,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(872); +exports.humanize = __webpack_require__(873); /** * The currently active debug mode names, and names to skip. @@ -102900,7 +103183,7 @@ function coerce(val) { /***/ }), -/* 872 */ +/* 873 */ /***/ (function(module, exports) { /** @@ -103058,15 +103341,15 @@ function plural(ms, n, name) { /***/ }), -/* 873 */ +/* 874 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies. */ -var tty = __webpack_require__(471); -var util = __webpack_require__(397); +var tty = __webpack_require__(472); +var util = __webpack_require__(398); /** * This is the Node.js implementation of `debug()`. @@ -103074,7 +103357,7 @@ var util = __webpack_require__(397); * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(871); +exports = module.exports = __webpack_require__(872); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; @@ -103246,14 +103529,14 @@ function createWritableStdioStream (fd) { break; case 'FILE': - var fs = __webpack_require__(349); + var fs = __webpack_require__(350); stream = new fs.SyncWriteStream(fd, { autoClose: false }); stream._type = 'fs'; break; case 'PIPE': case 'TCP': - var net = __webpack_require__(810); + var net = __webpack_require__(811); stream = new net.Socket({ fd: fd, readable: false, @@ -103312,15 +103595,15 @@ exports.enable(load()); /***/ }), -/* 874 */ +/* 875 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var brackets = __webpack_require__(864); -var define = __webpack_require__(875); -var utils = __webpack_require__(876); +var brackets = __webpack_require__(865); +var define = __webpack_require__(876); +var utils = __webpack_require__(877); /** * Characters to use in text regex (we want to "not" match @@ -103475,7 +103758,7 @@ module.exports = parsers; /***/ }), -/* 875 */ +/* 876 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103488,7 +103771,7 @@ module.exports = parsers; -var isDescriptor = __webpack_require__(757); +var isDescriptor = __webpack_require__(758); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -103513,14 +103796,14 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 876 */ +/* 877 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var regex = __webpack_require__(733); -var Cache = __webpack_require__(855); +var regex = __webpack_require__(734); +var Cache = __webpack_require__(856); /** * Utils @@ -103589,7 +103872,7 @@ utils.createRegex = function(str) { /***/ }), -/* 877 */ +/* 878 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103599,16 +103882,16 @@ utils.createRegex = function(str) { * Module dependencies */ -var Snapdragon = __webpack_require__(765); -var define = __webpack_require__(875); -var extend = __webpack_require__(734); +var Snapdragon = __webpack_require__(766); +var define = __webpack_require__(876); +var extend = __webpack_require__(735); /** * Local dependencies */ -var compilers = __webpack_require__(863); -var parsers = __webpack_require__(874); +var compilers = __webpack_require__(864); +var parsers = __webpack_require__(875); /** * Customize Snapdragon parser and renderer @@ -103674,16 +103957,16 @@ module.exports = Extglob; /***/ }), -/* 878 */ +/* 879 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extglob = __webpack_require__(862); -var nanomatch = __webpack_require__(846); -var regexNot = __webpack_require__(733); -var toRegex = __webpack_require__(834); +var extglob = __webpack_require__(863); +var nanomatch = __webpack_require__(847); +var regexNot = __webpack_require__(734); +var toRegex = __webpack_require__(835); var not; /** @@ -103764,14 +104047,14 @@ function textRegex(pattern) { /***/ }), -/* 879 */ +/* 880 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = new (__webpack_require__(855))(); +module.exports = new (__webpack_require__(856))(); /***/ }), -/* 880 */ +/* 881 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103784,13 +104067,13 @@ var path = __webpack_require__(4); * Module dependencies */ -var Snapdragon = __webpack_require__(765); -utils.define = __webpack_require__(841); -utils.diff = __webpack_require__(859); -utils.extend = __webpack_require__(842); -utils.pick = __webpack_require__(860); -utils.typeOf = __webpack_require__(881); -utils.unique = __webpack_require__(736); +var Snapdragon = __webpack_require__(766); +utils.define = __webpack_require__(842); +utils.diff = __webpack_require__(860); +utils.extend = __webpack_require__(843); +utils.pick = __webpack_require__(861); +utils.typeOf = __webpack_require__(882); +utils.unique = __webpack_require__(737); /** * Returns true if the platform is windows, or `path.sep` is `\\`. @@ -104087,7 +104370,7 @@ utils.unixify = function(options) { /***/ }), -/* 881 */ +/* 882 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -104222,7 +104505,7 @@ function isBuffer(val) { /***/ }), -/* 882 */ +/* 883 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -104241,9 +104524,9 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -var readdir = __webpack_require__(883); -var reader_1 = __webpack_require__(896); -var fs_stream_1 = __webpack_require__(900); +var readdir = __webpack_require__(884); +var reader_1 = __webpack_require__(897); +var fs_stream_1 = __webpack_require__(901); var ReaderAsync = /** @class */ (function (_super) { __extends(ReaderAsync, _super); function ReaderAsync() { @@ -104304,15 +104587,15 @@ exports.default = ReaderAsync; /***/ }), -/* 883 */ +/* 884 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const readdirSync = __webpack_require__(884); -const readdirAsync = __webpack_require__(892); -const readdirStream = __webpack_require__(895); +const readdirSync = __webpack_require__(885); +const readdirAsync = __webpack_require__(893); +const readdirStream = __webpack_require__(896); module.exports = exports = readdirAsyncPath; exports.readdir = exports.readdirAsync = exports.async = readdirAsyncPath; @@ -104396,7 +104679,7 @@ function readdirStreamStat (dir, options) { /***/ }), -/* 884 */ +/* 885 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -104404,11 +104687,11 @@ function readdirStreamStat (dir, options) { module.exports = readdirSync; -const DirectoryReader = __webpack_require__(885); +const DirectoryReader = __webpack_require__(886); let syncFacade = { - fs: __webpack_require__(890), - forEach: __webpack_require__(891), + fs: __webpack_require__(891), + forEach: __webpack_require__(892), sync: true }; @@ -104437,18 +104720,18 @@ function readdirSync (dir, options, internalOptions) { /***/ }), -/* 885 */ +/* 886 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const Readable = __webpack_require__(382).Readable; -const EventEmitter = __webpack_require__(373).EventEmitter; +const Readable = __webpack_require__(383).Readable; +const EventEmitter = __webpack_require__(374).EventEmitter; const path = __webpack_require__(4); -const normalizeOptions = __webpack_require__(886); -const stat = __webpack_require__(888); -const call = __webpack_require__(889); +const normalizeOptions = __webpack_require__(887); +const stat = __webpack_require__(889); +const call = __webpack_require__(890); /** * Asynchronously reads the contents of a directory and streams the results @@ -104824,14 +105107,14 @@ module.exports = DirectoryReader; /***/ }), -/* 886 */ +/* 887 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const globToRegExp = __webpack_require__(887); +const globToRegExp = __webpack_require__(888); module.exports = normalizeOptions; @@ -105008,7 +105291,7 @@ function normalizeOptions (options, internalOptions) { /***/ }), -/* 887 */ +/* 888 */ /***/ (function(module, exports) { module.exports = function (glob, opts) { @@ -105145,13 +105428,13 @@ module.exports = function (glob, opts) { /***/ }), -/* 888 */ +/* 889 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const call = __webpack_require__(889); +const call = __webpack_require__(890); module.exports = stat; @@ -105226,7 +105509,7 @@ function symlinkStat (fs, path, lstats, callback) { /***/ }), -/* 889 */ +/* 890 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105287,14 +105570,14 @@ function callOnce (fn) { /***/ }), -/* 890 */ +/* 891 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); -const call = __webpack_require__(889); +const fs = __webpack_require__(350); +const call = __webpack_require__(890); /** * A facade around {@link fs.readdirSync} that allows it to be called @@ -105358,7 +105641,7 @@ exports.lstat = function (path, callback) { /***/ }), -/* 891 */ +/* 892 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105387,7 +105670,7 @@ function syncForEach (array, iterator, done) { /***/ }), -/* 892 */ +/* 893 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105395,12 +105678,12 @@ function syncForEach (array, iterator, done) { module.exports = readdirAsync; -const maybe = __webpack_require__(893); -const DirectoryReader = __webpack_require__(885); +const maybe = __webpack_require__(894); +const DirectoryReader = __webpack_require__(886); let asyncFacade = { - fs: __webpack_require__(349), - forEach: __webpack_require__(894), + fs: __webpack_require__(350), + forEach: __webpack_require__(895), async: true }; @@ -105442,7 +105725,7 @@ function readdirAsync (dir, options, callback, internalOptions) { /***/ }), -/* 893 */ +/* 894 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105469,7 +105752,7 @@ module.exports = function maybe (cb, promise) { /***/ }), -/* 894 */ +/* 895 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105505,7 +105788,7 @@ function asyncForEach (array, iterator, done) { /***/ }), -/* 895 */ +/* 896 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105513,11 +105796,11 @@ function asyncForEach (array, iterator, done) { module.exports = readdirStream; -const DirectoryReader = __webpack_require__(885); +const DirectoryReader = __webpack_require__(886); let streamFacade = { - fs: __webpack_require__(349), - forEach: __webpack_require__(894), + fs: __webpack_require__(350), + forEach: __webpack_require__(895), async: true }; @@ -105537,16 +105820,16 @@ function readdirStream (dir, options, internalOptions) { /***/ }), -/* 896 */ +/* 897 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path = __webpack_require__(4); -var deep_1 = __webpack_require__(897); -var entry_1 = __webpack_require__(899); -var pathUtil = __webpack_require__(898); +var deep_1 = __webpack_require__(898); +var entry_1 = __webpack_require__(900); +var pathUtil = __webpack_require__(899); var Reader = /** @class */ (function () { function Reader(options) { this.options = options; @@ -105612,14 +105895,14 @@ exports.default = Reader; /***/ }), -/* 897 */ +/* 898 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var pathUtils = __webpack_require__(898); -var patternUtils = __webpack_require__(715); +var pathUtils = __webpack_require__(899); +var patternUtils = __webpack_require__(716); var DeepFilter = /** @class */ (function () { function DeepFilter(options, micromatchOptions) { this.options = options; @@ -105702,7 +105985,7 @@ exports.default = DeepFilter; /***/ }), -/* 898 */ +/* 899 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105733,14 +106016,14 @@ exports.makeAbsolute = makeAbsolute; /***/ }), -/* 899 */ +/* 900 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var pathUtils = __webpack_require__(898); -var patternUtils = __webpack_require__(715); +var pathUtils = __webpack_require__(899); +var patternUtils = __webpack_require__(716); var EntryFilter = /** @class */ (function () { function EntryFilter(options, micromatchOptions) { this.options = options; @@ -105825,7 +106108,7 @@ exports.default = EntryFilter; /***/ }), -/* 900 */ +/* 901 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105844,9 +106127,9 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -var stream = __webpack_require__(382); -var fsStat = __webpack_require__(901); -var fs_1 = __webpack_require__(905); +var stream = __webpack_require__(383); +var fsStat = __webpack_require__(902); +var fs_1 = __webpack_require__(906); var FileSystemStream = /** @class */ (function (_super) { __extends(FileSystemStream, _super); function FileSystemStream() { @@ -105896,14 +106179,14 @@ exports.default = FileSystemStream; /***/ }), -/* 901 */ +/* 902 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const optionsManager = __webpack_require__(902); -const statProvider = __webpack_require__(904); +const optionsManager = __webpack_require__(903); +const statProvider = __webpack_require__(905); /** * Asynchronous API. */ @@ -105934,13 +106217,13 @@ exports.statSync = statSync; /***/ }), -/* 902 */ +/* 903 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fsAdapter = __webpack_require__(903); +const fsAdapter = __webpack_require__(904); function prepare(opts) { const options = Object.assign({ fs: fsAdapter.getFileSystemAdapter(opts ? opts.fs : undefined), @@ -105953,13 +106236,13 @@ exports.prepare = prepare; /***/ }), -/* 903 */ +/* 904 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __webpack_require__(349); +const fs = __webpack_require__(350); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -105976,7 +106259,7 @@ exports.getFileSystemAdapter = getFileSystemAdapter; /***/ }), -/* 904 */ +/* 905 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106028,7 +106311,7 @@ exports.isFollowedSymlink = isFollowedSymlink; /***/ }), -/* 905 */ +/* 906 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106059,7 +106342,7 @@ exports.default = FileSystem; /***/ }), -/* 906 */ +/* 907 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106078,10 +106361,10 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -var stream = __webpack_require__(382); -var readdir = __webpack_require__(883); -var reader_1 = __webpack_require__(896); -var fs_stream_1 = __webpack_require__(900); +var stream = __webpack_require__(383); +var readdir = __webpack_require__(884); +var reader_1 = __webpack_require__(897); +var fs_stream_1 = __webpack_require__(901); var TransformStream = /** @class */ (function (_super) { __extends(TransformStream, _super); function TransformStream(reader) { @@ -106149,7 +106432,7 @@ exports.default = ReaderStream; /***/ }), -/* 907 */ +/* 908 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106168,9 +106451,9 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -var readdir = __webpack_require__(883); -var reader_1 = __webpack_require__(896); -var fs_sync_1 = __webpack_require__(908); +var readdir = __webpack_require__(884); +var reader_1 = __webpack_require__(897); +var fs_sync_1 = __webpack_require__(909); var ReaderSync = /** @class */ (function (_super) { __extends(ReaderSync, _super); function ReaderSync() { @@ -106230,7 +106513,7 @@ exports.default = ReaderSync; /***/ }), -/* 908 */ +/* 909 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106249,8 +106532,8 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); -var fsStat = __webpack_require__(901); -var fs_1 = __webpack_require__(905); +var fsStat = __webpack_require__(902); +var fs_1 = __webpack_require__(906); var FileSystemSync = /** @class */ (function (_super) { __extends(FileSystemSync, _super); function FileSystemSync() { @@ -106296,7 +106579,7 @@ exports.default = FileSystemSync; /***/ }), -/* 909 */ +/* 910 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106312,13 +106595,13 @@ exports.flatten = flatten; /***/ }), -/* 910 */ +/* 911 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var merge2 = __webpack_require__(585); +var merge2 = __webpack_require__(586); /** * Merge multiple streams and propagate their errors into one stream in parallel. */ @@ -106333,13 +106616,13 @@ exports.merge = merge; /***/ }), -/* 911 */ +/* 912 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const pathType = __webpack_require__(912); +const pathType = __webpack_require__(913); const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; @@ -106405,13 +106688,13 @@ module.exports.sync = (input, opts) => { /***/ }), -/* 912 */ +/* 913 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); -const pify = __webpack_require__(913); +const fs = __webpack_require__(350); +const pify = __webpack_require__(914); function type(fn, fn2, fp) { if (typeof fp !== 'string') { @@ -106454,7 +106737,7 @@ exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); /***/ }), -/* 913 */ +/* 914 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106545,17 +106828,17 @@ module.exports = (obj, opts) => { /***/ }), -/* 914 */ +/* 915 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); +const fs = __webpack_require__(350); const path = __webpack_require__(4); -const fastGlob = __webpack_require__(711); -const gitIgnore = __webpack_require__(915); -const pify = __webpack_require__(916); -const slash = __webpack_require__(917); +const fastGlob = __webpack_require__(712); +const gitIgnore = __webpack_require__(916); +const pify = __webpack_require__(917); +const slash = __webpack_require__(918); const DEFAULT_IGNORE = [ '**/node_modules/**', @@ -106653,7 +106936,7 @@ module.exports.sync = options => { /***/ }), -/* 915 */ +/* 916 */ /***/ (function(module, exports) { // A simple implementation of make-array @@ -107122,7 +107405,7 @@ module.exports = options => new IgnoreBase(options) /***/ }), -/* 916 */ +/* 917 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -107197,7 +107480,7 @@ module.exports = (input, options) => { /***/ }), -/* 917 */ +/* 918 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -107215,17 +107498,17 @@ module.exports = input => { /***/ }), -/* 918 */ +/* 919 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const {constants: fsConstants} = __webpack_require__(349); -const pEvent = __webpack_require__(919); -const CpFileError = __webpack_require__(922); -const fs = __webpack_require__(926); -const ProgressEmitter = __webpack_require__(929); +const {constants: fsConstants} = __webpack_require__(350); +const pEvent = __webpack_require__(920); +const CpFileError = __webpack_require__(923); +const fs = __webpack_require__(927); +const ProgressEmitter = __webpack_require__(930); const cpFileAsync = async (source, destination, options, progressEmitter) => { let readError; @@ -107339,12 +107622,12 @@ module.exports.sync = (source, destination, options) => { /***/ }), -/* 919 */ +/* 920 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pTimeout = __webpack_require__(920); +const pTimeout = __webpack_require__(921); const symbolAsyncIterator = Symbol.asyncIterator || '@@asyncIterator'; @@ -107635,12 +107918,12 @@ module.exports.iterator = (emitter, event, options) => { /***/ }), -/* 920 */ +/* 921 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pFinally = __webpack_require__(921); +const pFinally = __webpack_require__(922); class TimeoutError extends Error { constructor(message) { @@ -107686,7 +107969,7 @@ module.exports.TimeoutError = TimeoutError; /***/ }), -/* 921 */ +/* 922 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -107708,12 +107991,12 @@ module.exports = (promise, onFinally) => { /***/ }), -/* 922 */ +/* 923 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const NestedError = __webpack_require__(923); +const NestedError = __webpack_require__(924); class CpFileError extends NestedError { constructor(message, nested) { @@ -107727,10 +108010,10 @@ module.exports = CpFileError; /***/ }), -/* 923 */ +/* 924 */ /***/ (function(module, exports, __webpack_require__) { -var inherits = __webpack_require__(924); +var inherits = __webpack_require__(925); var NestedError = function (message, nested) { this.nested = nested; @@ -107781,20 +108064,20 @@ module.exports = NestedError; /***/ }), -/* 924 */ +/* 925 */ /***/ (function(module, exports, __webpack_require__) { try { - var util = __webpack_require__(397); + var util = __webpack_require__(398); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { - module.exports = __webpack_require__(925); + module.exports = __webpack_require__(926); } /***/ }), -/* 925 */ +/* 926 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { @@ -107823,16 +108106,16 @@ if (typeof Object.create === 'function') { /***/ }), -/* 926 */ +/* 927 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {promisify} = __webpack_require__(397); -const fs = __webpack_require__(493); -const makeDir = __webpack_require__(927); -const pEvent = __webpack_require__(919); -const CpFileError = __webpack_require__(922); +const {promisify} = __webpack_require__(398); +const fs = __webpack_require__(494); +const makeDir = __webpack_require__(928); +const pEvent = __webpack_require__(920); +const CpFileError = __webpack_require__(923); const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); @@ -107929,15 +108212,15 @@ exports.copyFileSync = (source, destination, flags) => { /***/ }), -/* 927 */ +/* 928 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const fs = __webpack_require__(349); +const fs = __webpack_require__(350); const path = __webpack_require__(4); -const {promisify} = __webpack_require__(397); -const semver = __webpack_require__(928); +const {promisify} = __webpack_require__(398); +const semver = __webpack_require__(929); const defaults = { mode: 0o777 & (~process.umask()), @@ -108086,7 +108369,7 @@ module.exports.sync = (input, options) => { /***/ }), -/* 928 */ +/* 929 */ /***/ (function(module, exports) { exports = module.exports = SemVer @@ -109688,12 +109971,12 @@ function coerce (version, options) { /***/ }), -/* 929 */ +/* 930 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const EventEmitter = __webpack_require__(373); +const EventEmitter = __webpack_require__(374); const written = new WeakMap(); @@ -109729,7 +110012,7 @@ module.exports = ProgressEmitter; /***/ }), -/* 930 */ +/* 931 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -109775,12 +110058,12 @@ exports.default = module.exports; /***/ }), -/* 931 */ +/* 932 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const NestedError = __webpack_require__(932); +const NestedError = __webpack_require__(933); class CpyError extends NestedError { constructor(message, nested) { @@ -109794,10 +110077,10 @@ module.exports = CpyError; /***/ }), -/* 932 */ +/* 933 */ /***/ (function(module, exports, __webpack_require__) { -var inherits = __webpack_require__(397).inherits; +var inherits = __webpack_require__(398).inherits; var NestedError = function (message, nested) { this.nested = nested; @@ -109850,14 +110133,14 @@ module.exports = NestedError; /***/ }), -/* 933 */ +/* 934 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return prepareExternalProjectDependencies; }); -/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(518); -/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(517); +/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(519); +/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(518); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 301d9653cda2b..d9ff0be55bde5 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -10,11 +10,11 @@ "prettier": "prettier --write './src/**/*.ts'" }, "devDependencies": { - "@babel/core": "^7.9.0", - "@babel/plugin-proposal-class-properties": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.9.0", - "@babel/preset-env": "^7.9.0", - "@babel/preset-typescript": "^7.9.0", + "@babel/core": "^7.10.2", + "@babel/plugin-proposal-class-properties": "^7.10.1", + "@babel/plugin-proposal-object-rest-spread": "^7.10.1", + "@babel/preset-env": "^7.10.2", + "@babel/preset-typescript": "^7.10.1", "@types/cmd-shim": "^2.0.0", "@types/cpy": "^5.1.0", "@types/dedent": "^0.7.0", @@ -59,13 +59,13 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.3.0", - "typescript": "3.7.2", + "typescript": "3.9.5", "unlazy-loader": "^0.1.3", "webpack": "^4.41.5", "webpack-cli": "^3.3.10", "write-pkg": "^4.0.0" }, "dependencies": { - "tslib": "^1.9.3" + "tslib": "^2.0.0" } } diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json index 8e2fd1c9182ff..c74dba8a34c9d 100644 --- a/packages/kbn-test/package.json +++ b/packages/kbn-test/package.json @@ -10,7 +10,7 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "@babel/cli": "^7.8.4", + "@babel/cli": "^7.10.1", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "@types/parse-link-header": "^1.0.0", diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json index 47ed69bc95697..4da4fb21fbed5 100644 --- a/packages/kbn-ui-framework/package.json +++ b/packages/kbn-ui-framework/package.json @@ -30,7 +30,7 @@ "enzyme-adapter-react-16": "^1.9.1" }, "devDependencies": { - "@babel/core": "^7.9.0", + "@babel/core": "^7.10.2", "@elastic/eui": "0.0.55", "@kbn/babel-preset": "1.0.0", "autoprefixer": "^9.7.4", diff --git a/src/core/public/application/__snapshots__/application_service.test.ts.snap b/src/core/public/application/__snapshots__/application_service.test.ts.snap index c085fb028cd5a..c63a22170c4f6 100644 --- a/src/core/public/application/__snapshots__/application_service.test.ts.snap +++ b/src/core/public/application/__snapshots__/application_service.test.ts.snap @@ -76,6 +76,7 @@ exports[`#start() getComponent returns renderable JSX tree 1`] = ` history={ Object { "push": [MockFunction], + "replace": [MockFunction], } } mounters={Map {}} diff --git a/src/core/public/application/application_service.test.mocks.ts b/src/core/public/application/application_service.test.mocks.ts index a096f05209708..727295237d741 100644 --- a/src/core/public/application/application_service.test.mocks.ts +++ b/src/core/public/application/application_service.test.mocks.ts @@ -29,6 +29,7 @@ jest.doMock('./capabilities', () => ({ export const MockHistory = { push: jest.fn(), + replace: jest.fn(), }; export const createBrowserHistoryMock = jest.fn().mockReturnValue(MockHistory); jest.doMock('history', () => ({ diff --git a/src/core/public/application/application_service.test.ts b/src/core/public/application/application_service.test.ts index 400d1881a5af8..50e47bdf71772 100644 --- a/src/core/public/application/application_service.test.ts +++ b/src/core/public/application/application_service.test.ts @@ -482,9 +482,6 @@ describe('#setup()', () => { describe('#start()', () => { beforeEach(() => { - MockHistory.push.mockReset(); - parseAppUrlMock.mockReset(); - const http = httpServiceMock.createSetupContract({ basePath: '/base-path' }); setupDeps = { http, @@ -497,6 +494,12 @@ describe('#start()', () => { service = new ApplicationService(); }); + afterEach(() => { + MockHistory.push.mockReset(); + MockHistory.replace.mockReset(); + parseAppUrlMock.mockReset(); + }); + it('rejects if called prior to #setup()', async () => { await expect(service.start(startDeps)).rejects.toThrowErrorMatchingInlineSnapshot( `"ApplicationService#setup() must be invoked before start."` @@ -924,6 +927,79 @@ describe('#start()', () => { await navigateToApp('baseApp:legacyApp1'); expect(setupDeps.redirectTo).toHaveBeenCalledWith('/test/app/baseApp'); }); + + describe('when `replace` option is true', () => { + it('use `history.replace` instead of `history.push`', async () => { + service.setup(setupDeps); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('myTestApp', { replace: true }); + expect(MockHistory.replace).toHaveBeenCalledWith('/app/myTestApp', undefined); + + await navigateToApp('myOtherApp', { replace: true }); + expect(MockHistory.replace).toHaveBeenCalledWith('/app/myOtherApp', undefined); + }); + + it('includes state if specified', async () => { + const { register } = service.setup(setupDeps); + + register(Symbol(), createApp({ id: 'app2', appRoute: '/custom/path' })); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('myTestApp', { state: 'my-state', replace: true }); + expect(MockHistory.replace).toHaveBeenCalledWith('/app/myTestApp', 'my-state'); + + await navigateToApp('app2', { state: 'my-state', replace: true }); + expect(MockHistory.replace).toHaveBeenCalledWith('/custom/path', 'my-state'); + }); + it('appends a path if specified', async () => { + const { register } = service.setup(setupDeps); + + register(Symbol(), createApp({ id: 'app2', appRoute: '/custom/path' })); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('myTestApp', { path: 'deep/link/to/location/2', replace: true }); + expect(MockHistory.replace).toHaveBeenCalledWith( + '/app/myTestApp/deep/link/to/location/2', + undefined + ); + + await navigateToApp('app2', { path: 'deep/link/to/location/2', replace: true }); + expect(MockHistory.replace).toHaveBeenCalledWith( + '/custom/path/deep/link/to/location/2', + undefined + ); + }); + it('do not change the behavior when in legacy mode', async () => { + setupDeps.http = httpServiceMock.createSetupContract({ basePath: '/test' }); + setupDeps.injectedMetadata.getLegacyMode.mockReturnValue(true); + service.setup(setupDeps); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('alpha', { replace: true }); + expect(setupDeps.redirectTo).toHaveBeenCalledWith('/test/app/alpha'); + }); + }); + + describe('when `replace` option is false', () => { + it('behave as when the option is unspecified', async () => { + service.setup(setupDeps); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('myTestApp', { replace: false }); + expect(MockHistory.push).toHaveBeenCalledWith('/app/myTestApp', undefined); + + await navigateToApp('myOtherApp', { replace: false }); + expect(MockHistory.push).toHaveBeenCalledWith('/app/myOtherApp', undefined); + + expect(MockHistory.replace).not.toHaveBeenCalled(); + }); + }); }); describe('navigateToUrl', () => { diff --git a/src/core/public/application/application_service.tsx b/src/core/public/application/application_service.tsx index 850422a61bde7..95361d8287c71 100644 --- a/src/core/public/application/application_service.tsx +++ b/src/core/public/application/application_service.tsx @@ -44,6 +44,7 @@ import { LegacyApp, LegacyAppMounter, Mounter, + NavigateToAppOptions, } from './types'; import { getLeaveAction, isConfirmAction } from './application_leave'; import { appendAppPath, parseAppUrl, relativeToAbsolute, getAppInfo } from './utils'; @@ -105,7 +106,7 @@ export class ApplicationService { private registrationClosed = false; private history?: History; private mountContext?: IContextContainer; - private navigate?: (url: string, state: any) => void; + private navigate?: (url: string, state: unknown, replace: boolean) => void; private redirectTo?: (url: string) => void; public setup({ @@ -125,10 +126,16 @@ export class ApplicationService { this.history = history || createBrowserHistory({ basename }); } - // If we do not have history available, use redirectTo to do a full page refresh. - this.navigate = (url, state) => - // basePath not needed here because `history` is configured with basename - this.history ? this.history.push(url, state) : redirectTo(basePath.prepend(url)); + this.navigate = (url, state, replace) => { + if (this.history) { + // basePath not needed here because `history` is configured with basename + return replace ? this.history.replace(url, state) : this.history.push(url, state); + } else { + // If we do not have history available (legacy mode), use redirectTo to do a full page refresh. + return redirectTo(basePath.prepend(url)); + } + }; + this.redirectTo = redirectTo; this.mountContext = context.createContextContainer(); @@ -278,14 +285,14 @@ export class ApplicationService { const navigateToApp: InternalApplicationStart['navigateToApp'] = async ( appId, - { path, state }: { path?: string; state?: any } = {} + { path, state, replace = false }: NavigateToAppOptions = {} ) => { if (await this.shouldNavigate(overlays)) { if (path === undefined) { path = applications$.value.get(appId)?.defaultPath; } this.appLeaveHandlers.delete(this.currentAppId$.value!); - this.navigate!(getAppUrl(availableMounters, appId, path), state); + this.navigate!(getAppUrl(availableMounters, appId, path), state, replace); this.currentAppId$.next(appId); } }; diff --git a/src/core/public/application/index.ts b/src/core/public/application/index.ts index 74356cbd88b34..121f0c7ac07d6 100644 --- a/src/core/public/application/index.ts +++ b/src/core/public/application/index.ts @@ -40,6 +40,7 @@ export { AppLeaveDefaultAction, AppLeaveConfirmAction, LegacyApp, + NavigateToAppOptions, PublicAppInfo, PublicLegacyAppInfo, // Internal types diff --git a/src/core/public/application/integration_tests/application_service.test.tsx b/src/core/public/application/integration_tests/application_service.test.tsx index 89f90a9899dda..e3cd0761c3244 100644 --- a/src/core/public/application/integration_tests/application_service.test.tsx +++ b/src/core/public/application/integration_tests/application_service.test.tsx @@ -125,6 +125,25 @@ describe('ApplicationService', () => { expect(await currentAppId$.pipe(take(1)).toPromise()).toEqual('app1'); }); + + it('replaces the current history entry when the `replace` option is true', async () => { + const { register } = service.setup(setupDeps); + + register(Symbol(), { + id: 'app1', + title: 'App1', + mount: async ({}: AppMountParameters) => { + return () => undefined; + }, + }); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('app1', { path: '/foo' }); + await navigateToApp('app1', { path: '/bar', replace: true }); + + expect(history.entries.map((entry) => entry.pathname)).toEqual(['/', '/app/app1/bar']); + }); }); }); diff --git a/src/core/public/application/types.ts b/src/core/public/application/types.ts index 7c83c684ac73d..53eae58c996a0 100644 --- a/src/core/public/application/types.ts +++ b/src/core/public/application/types.ts @@ -661,6 +661,28 @@ export interface InternalApplicationSetup extends Pick; + navigateToApp(appId: string, options?: NavigateToAppOptions): Promise; /** * Navigate to given url, which can either be an absolute url or a relative path, in a SPA friendly way when possible. diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 40f614ebc3bea..99b75f85340f3 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -125,6 +125,7 @@ export { ScopedHistory, LegacyApp, PublicLegacyAppInfo, + NavigateToAppOptions, } from './application'; export { diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index b44eb48b9ffa9..1914fa7be89ec 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -5,24 +5,146 @@ ```ts import { Action } from 'history'; +import Boom from 'boom'; import { Breadcrumb } from '@elastic/eui'; +import { BulkIndexDocumentsParams } from 'elasticsearch'; +import { CatAliasesParams } from 'elasticsearch'; +import { CatAllocationParams } from 'elasticsearch'; +import { CatCommonParams } from 'elasticsearch'; +import { CatFielddataParams } from 'elasticsearch'; +import { CatHealthParams } from 'elasticsearch'; +import { CatHelpParams } from 'elasticsearch'; +import { CatIndicesParams } from 'elasticsearch'; +import { CatRecoveryParams } from 'elasticsearch'; +import { CatSegmentsParams } from 'elasticsearch'; +import { CatShardsParams } from 'elasticsearch'; +import { CatSnapshotsParams } from 'elasticsearch'; +import { CatTasksParams } from 'elasticsearch'; +import { CatThreadPoolParams } from 'elasticsearch'; +import { ClearScrollParams } from 'elasticsearch'; +import { Client } from 'elasticsearch'; +import { ClusterAllocationExplainParams } from 'elasticsearch'; +import { ClusterGetSettingsParams } from 'elasticsearch'; +import { ClusterHealthParams } from 'elasticsearch'; +import { ClusterPendingTasksParams } from 'elasticsearch'; +import { ClusterPutSettingsParams } from 'elasticsearch'; +import { ClusterRerouteParams } from 'elasticsearch'; +import { ClusterStateParams } from 'elasticsearch'; +import { ClusterStatsParams } from 'elasticsearch'; +import { CountParams } from 'elasticsearch'; +import { CreateDocumentParams } from 'elasticsearch'; +import { DeleteDocumentByQueryParams } from 'elasticsearch'; +import { DeleteDocumentParams } from 'elasticsearch'; +import { DeleteScriptParams } from 'elasticsearch'; +import { DeleteTemplateParams } from 'elasticsearch'; import { EuiButtonEmptyProps } from '@elastic/eui'; import { EuiConfirmModalProps } from '@elastic/eui'; import { EuiGlobalToastListToast } from '@elastic/eui'; import { ExclusiveUnion } from '@elastic/eui'; +import { ExistsParams } from 'elasticsearch'; +import { ExplainParams } from 'elasticsearch'; +import { FieldStatsParams } from 'elasticsearch'; +import { GenericParams } from 'elasticsearch'; +import { GetParams } from 'elasticsearch'; +import { GetResponse } from 'elasticsearch'; +import { GetScriptParams } from 'elasticsearch'; +import { GetSourceParams } from 'elasticsearch'; +import { GetTemplateParams } from 'elasticsearch'; import { History } from 'history'; +import { Href } from 'history'; import { IconType } from '@elastic/eui'; +import { IndexDocumentParams } from 'elasticsearch'; +import { IndicesAnalyzeParams } from 'elasticsearch'; +import { IndicesClearCacheParams } from 'elasticsearch'; +import { IndicesCloseParams } from 'elasticsearch'; +import { IndicesCreateParams } from 'elasticsearch'; +import { IndicesDeleteAliasParams } from 'elasticsearch'; +import { IndicesDeleteParams } from 'elasticsearch'; +import { IndicesDeleteTemplateParams } from 'elasticsearch'; +import { IndicesExistsAliasParams } from 'elasticsearch'; +import { IndicesExistsParams } from 'elasticsearch'; +import { IndicesExistsTemplateParams } from 'elasticsearch'; +import { IndicesExistsTypeParams } from 'elasticsearch'; +import { IndicesFlushParams } from 'elasticsearch'; +import { IndicesFlushSyncedParams } from 'elasticsearch'; +import { IndicesForcemergeParams } from 'elasticsearch'; +import { IndicesGetAliasParams } from 'elasticsearch'; +import { IndicesGetFieldMappingParams } from 'elasticsearch'; +import { IndicesGetMappingParams } from 'elasticsearch'; +import { IndicesGetParams } from 'elasticsearch'; +import { IndicesGetSettingsParams } from 'elasticsearch'; +import { IndicesGetTemplateParams } from 'elasticsearch'; +import { IndicesGetUpgradeParams } from 'elasticsearch'; +import { IndicesOpenParams } from 'elasticsearch'; +import { IndicesPutAliasParams } from 'elasticsearch'; +import { IndicesPutMappingParams } from 'elasticsearch'; +import { IndicesPutSettingsParams } from 'elasticsearch'; +import { IndicesPutTemplateParams } from 'elasticsearch'; +import { IndicesRecoveryParams } from 'elasticsearch'; +import { IndicesRefreshParams } from 'elasticsearch'; +import { IndicesRolloverParams } from 'elasticsearch'; +import { IndicesSegmentsParams } from 'elasticsearch'; +import { IndicesShardStoresParams } from 'elasticsearch'; +import { IndicesShrinkParams } from 'elasticsearch'; +import { IndicesStatsParams } from 'elasticsearch'; +import { IndicesUpdateAliasesParams } from 'elasticsearch'; +import { IndicesUpgradeParams } from 'elasticsearch'; +import { IndicesValidateQueryParams } from 'elasticsearch'; +import { InfoParams } from 'elasticsearch'; +import { IngestDeletePipelineParams } from 'elasticsearch'; +import { IngestGetPipelineParams } from 'elasticsearch'; +import { IngestPutPipelineParams } from 'elasticsearch'; +import { IngestSimulateParams } from 'elasticsearch'; +import { KibanaConfigType } from 'src/core/server/kibana_config'; import { Location } from 'history'; import { LocationDescriptorObject } from 'history'; import { MaybePromise } from '@kbn/utility-types'; +import { MGetParams } from 'elasticsearch'; +import { MGetResponse } from 'elasticsearch'; +import { MSearchParams } from 'elasticsearch'; +import { MSearchResponse } from 'elasticsearch'; +import { MSearchTemplateParams } from 'elasticsearch'; +import { MTermVectorsParams } from 'elasticsearch'; +import { NodesHotThreadsParams } from 'elasticsearch'; +import { NodesInfoParams } from 'elasticsearch'; +import { NodesStatsParams } from 'elasticsearch'; import { Observable } from 'rxjs'; import { ParsedQuery } from 'query-string'; +import { Path } from 'history'; +import { PingParams } from 'elasticsearch'; import { PublicUiSettingsParams as PublicUiSettingsParams_2 } from 'src/core/server/types'; +import { PutScriptParams } from 'elasticsearch'; +import { PutTemplateParams } from 'elasticsearch'; import React from 'react'; +import { ReindexParams } from 'elasticsearch'; +import { ReindexRethrottleParams } from 'elasticsearch'; +import { RenderSearchTemplateParams } from 'elasticsearch'; import * as Rx from 'rxjs'; +import { ScrollParams } from 'elasticsearch'; +import { SearchParams } from 'elasticsearch'; +import { SearchResponse } from 'elasticsearch'; +import { SearchShardsParams } from 'elasticsearch'; +import { SearchTemplateParams } from 'elasticsearch'; import { ShallowPromise } from '@kbn/utility-types'; +import { SnapshotCreateParams } from 'elasticsearch'; +import { SnapshotCreateRepositoryParams } from 'elasticsearch'; +import { SnapshotDeleteParams } from 'elasticsearch'; +import { SnapshotDeleteRepositoryParams } from 'elasticsearch'; +import { SnapshotGetParams } from 'elasticsearch'; +import { SnapshotGetRepositoryParams } from 'elasticsearch'; +import { SnapshotRestoreParams } from 'elasticsearch'; +import { SnapshotStatusParams } from 'elasticsearch'; +import { SnapshotVerifyRepositoryParams } from 'elasticsearch'; +import { SuggestParams } from 'elasticsearch'; +import { TasksCancelParams } from 'elasticsearch'; +import { TasksGetParams } from 'elasticsearch'; +import { TasksListParams } from 'elasticsearch'; +import { TermvectorsParams } from 'elasticsearch'; import { Type } from '@kbn/config-schema'; +import { TypeOf } from '@kbn/config-schema'; import { UnregisterCallback } from 'history'; +import { UpdateDocumentByQueryParams } from 'elasticsearch'; +import { UpdateDocumentParams } from 'elasticsearch'; import { UserProvidedValues as UserProvidedValues_2 } from 'src/core/server/types'; // @internal (undocumented) @@ -116,10 +238,7 @@ export interface ApplicationStart { path?: string; absolute?: boolean; }): string; - navigateToApp(appId: string, options?: { - path?: string; - state?: any; - }): Promise; + navigateToApp(appId: string, options?: NavigateToAppOptions): Promise; navigateToUrl(url: string): Promise; // @deprecated registerMountContext(contextName: T, provider: IContextProvider): void; @@ -913,6 +1032,15 @@ export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulPart // @public export type MountPoint = (element: T) => UnmountCallback; +// Warning: (ae-missing-release-tag) "NavigateToAppOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface NavigateToAppOptions { + path?: string; + replace?: boolean; + state?: unknown; +} + // Warning: (ae-missing-release-tag) "NavType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1118,15 +1246,17 @@ export interface SavedObjectsBulkUpdateOptions { export class SavedObjectsClient { // @internal constructor(http: HttpSetup); - bulkCreate: (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise>; - bulkGet: (objects?: { + bulkCreate: (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise>; + bulkGet: (objects?: Array<{ id: string; type: string; - }[]) => Promise>; + }>) => Promise>; bulkUpdate(objects?: SavedObjectsBulkUpdateObject[]): Promise>; create: (type: string, attributes: T, options?: SavedObjectsCreateOptions) => Promise>; - delete: (type: string, id: string) => Promise<{}>; - find: (options: Pick) => Promise>; + // Warning: (ae-forgotten-export) The symbol "SavedObjectsClientContract" needs to be exported by the entry point index.d.ts + delete: (type: string, id: string) => ReturnType; + // Warning: (ae-forgotten-export) The symbol "SavedObjectsFindOptions" needs to be exported by the entry point index.d.ts + find: (options: SavedObjectsFindOptions_2) => Promise>; get: (type: string, id: string) => Promise>; update(type: string, id: string, attributes: T, { version, migrationVersion, references }?: SavedObjectsUpdateOptions): Promise>; } @@ -1159,6 +1289,7 @@ export interface SavedObjectsFindOptions extends SavedObjectsBaseOptions { page?: number; // (undocumented) perPage?: number; + preference?: string; search?: string; searchFields?: string[]; // (undocumented) @@ -1283,7 +1414,7 @@ export class ScopedHistory implements History | undefined) => UnregisterCallback; createHref: (location: LocationDescriptorObject, { prependBasePath }?: { prependBasePath?: boolean | undefined; - }) => string; + }) => Href; createSubHistory: (basePath: string) => ScopedHistory; go: (n: number) => void; goBack: () => void; @@ -1291,8 +1422,8 @@ export class ScopedHistory implements History, action: Action) => void) => UnregisterCallback; get location(): Location; - push: (pathOrLocation: string | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; - replace: (pathOrLocation: string | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; + push: (pathOrLocation: Path | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; + replace: (pathOrLocation: Path | LocationDescriptorObject, state?: HistoryLocationState | undefined) => void; } // @public diff --git a/src/core/public/saved_objects/saved_objects_client.ts b/src/core/public/saved_objects/saved_objects_client.ts index cdc113871c447..5c8eca4a33ec5 100644 --- a/src/core/public/saved_objects/saved_objects_client.ts +++ b/src/core/public/saved_objects/saved_objects_client.ts @@ -292,6 +292,7 @@ export class SavedObjectsClient { sortField: 'sort_field', type: 'type', filter: 'filter', + preference: 'preference', }; const renamedQuery = renameKeys(renameMap, options); diff --git a/src/core/server/http/router/validator/validator.ts b/src/core/server/http/router/validator/validator.ts index a2299b47ae253..babca87495a4e 100644 --- a/src/core/server/http/router/validator/validator.ts +++ b/src/core/server/http/router/validator/validator.ts @@ -17,14 +17,7 @@ * under the License. */ -import { - ValidationError, - Type, - schema, - ObjectType, - TypeOf, - isConfigSchema, -} from '@kbn/config-schema'; +import { ValidationError, ObjectType, Type, schema, isConfigSchema } from '@kbn/config-schema'; import { Stream } from 'stream'; import { RouteValidationError } from './validator_error'; @@ -92,7 +85,7 @@ type RouteValidationResultType | undefined> = T extends RouteValidationFunction ? ReturnType['value'] : T extends Type - ? TypeOf + ? T['type'] : undefined >; diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index 83e037fb2da66..d631ef9cb353c 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -2017,6 +2017,11 @@ describe('SavedObjectsRepository', () => { }); }); + it(`accepts preference`, async () => { + await findSuccess({ type, preference: 'pref' }); + expectClusterCallArgs({ preference: 'pref' }); + }); + it(`can filter by fields`, async () => { await findSuccess({ type, fields: ['title'] }); expectClusterCallArgs({ diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index b093fe779cab7..03538f2394845 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -576,6 +576,7 @@ export class SavedObjectsRepository { * @property {Array} [options.fields] * @property {string} [options.namespace] * @property {object} [options.hasReference] - { type, id } + * @property {string} [options.preference] * @returns {promise} - { saved_objects: [{ id, type, version, attributes }], total, per_page, page } */ async find({ @@ -591,6 +592,7 @@ export class SavedObjectsRepository { namespace, type, filter, + preference, }: SavedObjectsFindOptions): Promise> { if (!type) { throw SavedObjectsErrorHelpers.createBadRequestError( @@ -638,6 +640,7 @@ export class SavedObjectsRepository { _source: includedFields(type, fields), ignore: [404], rest_total_hits_as_int: true, + preference, body: { seq_no_primary_term: true, ...getSearchDsl(this._mappings, this._registry, { diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index 43b7663491711..2183b47b732f9 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -82,6 +82,8 @@ export interface SavedObjectsFindOptions extends SavedObjectsBaseOptions { hasReference?: { type: string; id: string }; defaultSearchOperator?: 'AND' | 'OR'; filter?: string; + /** An optional ES preference value to be used for the query **/ + preference?: string; } /** diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index eef071e9488bf..0d21586798be0 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -480,11 +480,11 @@ export interface AuthToolkit { export class BasePath { // @internal constructor(serverBasePath?: string); - get: (request: LegacyRequest | KibanaRequest) => string; + get: (request: KibanaRequest | LegacyRequest) => string; prepend: (path: string) => string; remove: (path: string) => string; readonly serverBasePath: string; - set: (request: LegacyRequest | KibanaRequest, requestSpecificBasePath: string) => void; + set: (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void; } // Warning: (ae-forgotten-export) The symbol "BootstrapArgs" needs to be exported by the entry point index.d.ts @@ -2019,6 +2019,7 @@ export interface SavedObjectsFindOptions extends SavedObjectsBaseOptions { page?: number; // (undocumented) perPage?: number; + preference?: string; search?: string; searchFields?: string[]; // (undocumented) @@ -2221,7 +2222,7 @@ export class SavedObjectsRepository { deleteByNamespace(namespace: string, options?: SavedObjectsDeleteByNamespaceOptions): Promise; deleteFromNamespaces(type: string, id: string, namespaces: string[], options?: SavedObjectsDeleteFromNamespacesOptions): Promise<{}>; // (undocumented) - find({ search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, }: SavedObjectsFindOptions): Promise>; + find({ search, defaultSearchOperator, searchFields, hasReference, page, perPage, sortField, sortOrder, fields, namespace, type, filter, preference, }: SavedObjectsFindOptions): Promise>; get(type: string, id: string, options?: SavedObjectsBaseOptions): Promise>; incrementCounter(type: string, id: string, counterFieldName: string, options?: SavedObjectsIncrementCounterOptions): Promise<{ id: string; diff --git a/src/core/server/server.ts b/src/core/server/server.ts index ef12379c199e8..6ca580083648f 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -76,7 +76,7 @@ export class Server { private readonly status: StatusService; private readonly coreApp: CoreApp; - private pluginsInitialized?: boolean; + #pluginsInitialized?: boolean; private coreStart?: InternalCoreStart; constructor( @@ -179,7 +179,7 @@ export class Server { }; const pluginsSetup = await this.plugins.setup(coreSetup); - this.pluginsInitialized = pluginsSetup.initialized; + this.#pluginsInitialized = pluginsSetup.initialized; await this.legacy.setup({ core: { ...coreSetup, plugins: pluginsSetup, rendering: renderingSetup }, @@ -198,7 +198,7 @@ export class Server { const elasticsearchStart = await this.elasticsearch.start(); const savedObjectsStart = await this.savedObjects.start({ elasticsearch: elasticsearchStart, - pluginsInitialized: this.pluginsInitialized, + pluginsInitialized: this.#pluginsInitialized, }); const capabilitiesStart = this.capabilities.start(); const uiSettingsStart = await this.uiSettings.start(); diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index 66f0c0355c2d9..2ea71fa2c1d33 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -47,6 +47,7 @@ import { InstallDependenciesTask, BuildKibanaPlatformPluginsTask, OptimizeBuildTask, + PatchNativeModulesTask, RemovePackageJsonDepsTask, RemoveWorkspacesTask, TranspileBabelTask, @@ -136,6 +137,7 @@ export async function buildDistributables(options) { * directories and perform platform-specific steps */ await run(CreateArchivesSourcesTask); + await run(PatchNativeModulesTask); await run(CleanExtraBinScriptsTask); await run(CleanExtraBrowsersTask); await run(CleanNodeBuildsTask); diff --git a/src/dev/build/tasks/nodejs/__tests__/download.js b/src/dev/build/lib/__tests__/download.js similarity index 100% rename from src/dev/build/tasks/nodejs/__tests__/download.js rename to src/dev/build/lib/__tests__/download.js diff --git a/src/dev/build/lib/__tests__/fixtures/foo.txt.gz b/src/dev/build/lib/__tests__/fixtures/foo.txt.gz new file mode 100644 index 0000000000000..46fef5a6af78c Binary files /dev/null and b/src/dev/build/lib/__tests__/fixtures/foo.txt.gz differ diff --git a/src/dev/build/lib/__tests__/fs.js b/src/dev/build/lib/__tests__/fs.js index 0b2db4c538fb8..bf7596b012f79 100644 --- a/src/dev/build/lib/__tests__/fs.js +++ b/src/dev/build/lib/__tests__/fs.js @@ -23,11 +23,12 @@ import { chmodSync, statSync } from 'fs'; import del from 'del'; import expect from '@kbn/expect'; -import { mkdirp, write, read, getChildPaths, copyAll, getFileHash, untar } from '../fs'; +import { mkdirp, write, read, getChildPaths, copyAll, getFileHash, untar, gunzip } from '../fs'; const TMP = resolve(__dirname, '__tmp__'); const FIXTURES = resolve(__dirname, 'fixtures'); const FOO_TAR_PATH = resolve(FIXTURES, 'foo_dir.tar.gz'); +const FOO_GZIP_PATH = resolve(FIXTURES, 'foo.txt.gz'); const BAR_TXT_PATH = resolve(FIXTURES, 'foo_dir/bar.txt'); const WORLD_EXECUTABLE = resolve(FIXTURES, 'bin/world_executable'); @@ -323,4 +324,39 @@ describe('dev/build/lib/fs', () => { expect(await read(resolve(destination, 'foo/foo.txt'))).to.be('foo\n'); }); }); + + describe('gunzip()', () => { + it('rejects if source path is not absolute', async () => { + try { + await gunzip('foo/bar', '**/*', __dirname); + throw new Error('Expected gunzip() to reject'); + } catch (error) { + assertNonAbsoluteError(error); + } + }); + + it('rejects if destination path is not absolute', async () => { + try { + await gunzip(__dirname, '**/*', 'foo/bar'); + throw new Error('Expected gunzip() to reject'); + } catch (error) { + assertNonAbsoluteError(error); + } + }); + + it('rejects if neither path is not absolute', async () => { + try { + await gunzip('foo/bar', '**/*', 'foo/bar'); + throw new Error('Expected gunzip() to reject'); + } catch (error) { + assertNonAbsoluteError(error); + } + }); + + it('extracts gzip from source into destination, creating destination if necessary', async () => { + const destination = resolve(TMP, 'z/y/x/v/u/t/foo.txt'); + await gunzip(FOO_GZIP_PATH, destination); + expect(await read(resolve(destination))).to.be('foo\n'); + }); + }); }); diff --git a/src/dev/build/tasks/nodejs/download.js b/src/dev/build/lib/download.js similarity index 98% rename from src/dev/build/tasks/nodejs/download.js rename to src/dev/build/lib/download.js index fb3294e2d1221..fbd2d47ff7b06 100644 --- a/src/dev/build/tasks/nodejs/download.js +++ b/src/dev/build/lib/download.js @@ -24,7 +24,7 @@ import chalk from 'chalk'; import { createHash } from 'crypto'; import Axios from 'axios'; -import { mkdirp } from '../../lib'; +import { mkdirp } from './fs'; function tryUnlink(path) { try { diff --git a/src/dev/build/lib/fs.js b/src/dev/build/lib/fs.js index 864a07e837c3f..b905f40d0de1e 100644 --- a/src/dev/build/lib/fs.js +++ b/src/dev/build/lib/fs.js @@ -195,6 +195,19 @@ export async function untar(source, destination, extractOptions = {}) { ]); } +export async function gunzip(source, destination) { + assertAbsolute(source); + assertAbsolute(destination); + + await mkdirAsync(dirname(destination), { recursive: true }); + + await createPromiseFromStreams([ + fs.createReadStream(source), + createGunzip(), + fs.createWriteStream(destination), + ]); +} + export async function compress(type, options = {}, source, destination) { const output = fs.createWriteStream(destination); const archive = archiver(type, options.archiverOptions); diff --git a/src/dev/build/lib/index.js b/src/dev/build/lib/index.js index afebd090d797d..6540db6f37a72 100644 --- a/src/dev/build/lib/index.js +++ b/src/dev/build/lib/index.js @@ -28,10 +28,12 @@ export { copyAll, getFileHash, untar, + gunzip, deleteAll, deleteEmptyFolders, compress, isFileAccessible, } from './fs'; +export { download } from './download'; export { scanDelete } from './scan_delete'; export { scanCopy } from './scan_copy'; diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index bafb5a2fe115e..be675b4aa6ca4 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -33,6 +33,7 @@ export * from './nodejs_modules'; export * from './notice_file_task'; export * from './optimize_task'; export * from './os_packages'; +export * from './patch_native_modules_task'; export * from './transpile_babel_task'; export * from './transpile_scss_task'; export * from './verify_env_task'; diff --git a/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js b/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js index 9357735e3f5a3..c1764d06b43b3 100644 --- a/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js +++ b/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js @@ -22,7 +22,7 @@ import expect from '@kbn/expect'; import * as NodeShasumsNS from '../node_shasums'; import * as NodeDownloadInfoNS from '../node_download_info'; -import * as DownloadNS from '../download'; +import * as DownloadNS from '../../../lib/download'; // sinon can't stub '../../../lib' properly import { DownloadNodeBuildsTask } from '../download_node_builds_task'; describe('src/dev/build/tasks/nodejs/download_node_builds_task', () => { diff --git a/src/dev/build/tasks/nodejs/download_node_builds_task.js b/src/dev/build/tasks/nodejs/download_node_builds_task.js index 86ddb0506f972..c0907e6c42a97 100644 --- a/src/dev/build/tasks/nodejs/download_node_builds_task.js +++ b/src/dev/build/tasks/nodejs/download_node_builds_task.js @@ -17,7 +17,7 @@ * under the License. */ -import { download } from './download'; +import { download } from '../../lib'; import { getNodeShasums } from './node_shasums'; import { getNodeDownloadInfo } from './node_download_info'; diff --git a/src/dev/build/tasks/patch_native_modules_task.js b/src/dev/build/tasks/patch_native_modules_task.js new file mode 100644 index 0000000000000..fba33442fad10 --- /dev/null +++ b/src/dev/build/tasks/patch_native_modules_task.js @@ -0,0 +1,103 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import fs from 'fs'; +import path from 'path'; +import util from 'util'; +import { deleteAll, download, gunzip, untar } from '../lib'; + +const DOWNLOAD_DIRECTORY = '.native_modules'; + +const packages = [ + { + name: 're2', + version: '1.14.0', + destinationPath: 'node_modules/re2/build/Release/re2.node', + extractMethod: 'gunzip', + archives: { + darwin: { + url: 'https://github.com/uhop/node-re2/releases/download/1.14.0/darwin-x64-64.gz', + sha256: '54c8386cb7cd53895cf379522114bfe82378e300e127e58d392ddd40a77e396f', + }, + linux: { + url: 'https://github.com/uhop/node-re2/releases/download/1.14.0/linux-x64-64.gz', + sha256: 'f54f059035e71a7ccb3fa201080e260c41d228d13a8247974b4bb157691b6757', + }, + windows: { + url: 'https://github.com/uhop/node-re2/releases/download/1.14.0/win32-x64-64.gz', + sha256: 'de708446a8b802f4634c2cfef097c2625a2811fdcd8133dfd7b7c485f966caa9', + }, + }, + }, +]; + +async function getInstalledVersion(config, packageName) { + const packageJSONPath = config.resolveFromRepo( + path.join('node_modules', packageName, 'package.json') + ); + const buffer = await util.promisify(fs.readFile)(packageJSONPath); + const packageJSON = JSON.parse(buffer); + return packageJSON.version; +} + +async function patchModule(config, log, build, platform, pkg) { + const installedVersion = await getInstalledVersion(config, pkg.name); + if (installedVersion !== pkg.version) { + throw new Error( + `Can't patch ${pkg.name}'s native module, we were expecting version ${pkg.version} and found ${installedVersion}` + ); + } + const platformName = platform.getName(); + const archive = pkg.archives[platformName]; + const archiveName = path.basename(archive.url); + const downloadPath = config.resolveFromRepo(DOWNLOAD_DIRECTORY, pkg.name, archiveName); + const extractPath = build.resolvePathForPlatform(platform, pkg.destinationPath); + log.debug(`Patching ${pkg.name} binaries from ${archive.url} to ${extractPath}`); + + await deleteAll([extractPath], log); + await download({ + log, + url: archive.url, + destination: downloadPath, + sha256: archive.sha256, + retries: 3, + }); + switch (pkg.extractMethod) { + case 'gunzip': + await gunzip(downloadPath, extractPath); + break; + case 'untar': + await untar(downloadPath, extractPath); + break; + default: + throw new Error(`Extract method of ${pkg.extractMethod} is not supported`); + } +} + +export const PatchNativeModulesTask = { + description: 'Patching platform-specific native modules', + async run(config, log, build) { + for (const pkg of packages) { + await Promise.all( + config.getTargetPlatforms().map(async (platform) => { + await patchModule(config, log, build, platform, pkg); + }) + ); + } + }, +}; diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/either.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/either.test.js new file mode 100644 index 0000000000000..cce8fd3c2e62d --- /dev/null +++ b/src/dev/code_coverage/ingest_coverage/__tests__/either.test.js @@ -0,0 +1,67 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { fromNullable, tryCatch, left, right } from '../either'; +import { noop } from '../utils'; +import expect from '@kbn/expect'; + +const pluck = (x) => (obj) => obj[x]; +const expectNull = (x) => expect(x).to.equal(null); +const attempt = (obj) => fromNullable(obj).map(pluck('detail')); + +describe(`either datatype functions`, () => { + describe(`helpers`, () => { + it(`'fromNullable' should be a fn`, () => { + expect(typeof fromNullable).to.be('function'); + }); + it(`'tryCatch' should be a fn`, () => { + expect(typeof tryCatch).to.be('function'); + }); + it(`'left' should be a fn`, () => { + expect(typeof left).to.be('function'); + }); + it(`'right' should be a fn`, () => { + expect(typeof right).to.be('function'); + }); + }); + describe('tryCatch', () => { + let sut = undefined; + it(`should return a 'Left' on error`, () => { + sut = tryCatch(() => { + throw new Error('blah'); + }); + expect(sut.inspect()).to.be('Left(Error: blah)'); + }); + it(`should return a 'Right' on successful execution`, () => { + sut = tryCatch(noop); + expect(sut.inspect()).to.be('Right(undefined)'); + }); + }); + describe(`'fromNullable`, () => { + it(`should continue processing if a truthy is calculated`, () => { + attempt({ detail: 'x' }).fold( + () => {}, + (x) => expect(x).to.equal('x') + ); + }); + it(`should drop processing if a falsey is calculated`, () => { + attempt(false).fold(expectNull, () => {}); + }); + }); +}); diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/ingest.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/ingest.test.js new file mode 100644 index 0000000000000..ad5b4da0873b9 --- /dev/null +++ b/src/dev/code_coverage/ingest_coverage/__tests__/ingest.test.js @@ -0,0 +1,37 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import expect from '@kbn/expect'; +import { maybeTeamAssign } from '../ingest'; +import { COVERAGE_INDEX, TOTALS_INDEX } from '../constants'; + +describe(`Ingest fns`, () => { + describe(`maybeTeamAssign fn`, () => { + describe(`against the coverage index`, () => { + it(`should have the pipeline prop`, () => { + expect(maybeTeamAssign(COVERAGE_INDEX, {})).to.have.property('pipeline'); + }); + }); + describe(`against the totals index`, () => { + it(`should not have the pipeline prop`, () => { + expect(maybeTeamAssign(TOTALS_INDEX, {})).not.to.have.property('pipeline'); + }); + }); + }); +}); diff --git a/src/dev/code_coverage/ingest_coverage/either.js b/src/dev/code_coverage/ingest_coverage/either.js index a52fd2f7212d6..eeb48893f18d8 100644 --- a/src/dev/code_coverage/ingest_coverage/either.js +++ b/src/dev/code_coverage/ingest_coverage/either.js @@ -23,7 +23,7 @@ export const Right = (x) => ({ chain: (f) => f(x), map: (f) => Right(f(x)), - fold: (f, g) => g(x), + fold: (leftFn, rightFn) => rightFn(x), inspect: () => `Right(${x})`, }); @@ -38,7 +38,7 @@ export function right(x) { export const Left = (x) => ({ chain: (f) => Left(x), map: (f) => Left(x), - fold: (f, g) => f(x), + fold: (leftFn, rightFn) => leftFn(x), inspect: () => `Left(${x})`, }); diff --git a/src/dev/code_coverage/ingest_coverage/ingest.js b/src/dev/code_coverage/ingest_coverage/ingest.js index 9167bea17ae05..d6c55a9a655b8 100644 --- a/src/dev/code_coverage/ingest_coverage/ingest.js +++ b/src/dev/code_coverage/ingest_coverage/ingest.js @@ -19,79 +19,40 @@ const { Client } = require('@elastic/elasticsearch'); import { createFailError } from '@kbn/dev-utils'; -import chalk from 'chalk'; -import { green, always, pretty } from './utils'; -import { fromNullable } from './either'; import { COVERAGE_INDEX, TOTALS_INDEX } from './constants'; +import { errMsg, redact } from './ingest_helpers'; +import { noop } from './utils'; +import { right, left } from './either'; const node = process.env.ES_HOST || 'http://localhost:9200'; -const redacted = redact(node); const client = new Client({ node }); - -const indexName = (body) => (body.isTotal ? TOTALS_INDEX : COVERAGE_INDEX); +const pipeline = process.env.PIPELINE_NAME || 'team_assignment'; +const redacted = redact(node); export const ingest = (log) => async (body) => { - const index = indexName(body); - - if (process.env.NODE_ENV === 'integration_test') { - log.debug(`### Just Logging, ${green('NOT actually sending')} to [${green(index)}]`); - logSuccess(log, index, body); - } else { - try { - log.debug(`### Actually sending to: ${green(index)}`); - await client.index({ index, body }); - logSuccess(log, index, body); - } catch (e) { - throw createFailError(errMsg(index, body, e)); - } - } + const index = body.isTotal ? TOTALS_INDEX : COVERAGE_INDEX; + const maybeWithPipeline = maybeTeamAssign(index, body); + const withIndex = { index, body: maybeWithPipeline }; + const dontSend = noop; + + log.verbose(withIndex); + + process.env.NODE_ENV === 'integration_test' + ? left(null) + : right(withIndex).fold(dontSend, async function doSend(finalPayload) { + await send(index, redacted, finalPayload); + }); }; -function logSuccess(log, index, body) { - const logShort = () => `### Sent: -### ES HOST (redacted): ${redacted} -### Index: ${green(index)}`; - - logShort(); - log.verbose(pretty(body)); - const { staticSiteUrl } = body; - - logShort(); - log.debug(`### staticSiteUrl: ${staticSiteUrl}`); -} -function errMsg(index, body, e) { - const orig = fromNullable(e.body).fold( - always(''), - () => `### Orig Err:\n${pretty(e.body.error)}` - ); - - const red = color('red'); - - return ` -### ES HOST (redacted): \n\t${red(redacted)} -### INDEX: \n\t${red(index)} -### Partial orig err stack: \n\t${partial(e.stack)} -### Item BODY:\n${pretty(body)} -${orig} - -### Troubleshooting Hint: -${red('Perhaps the coverage data was not merged properly?\n')} -`; -} - -function partial(x) { - return x.split('\n').splice(0, 2).join('\n'); -} -function redact(x) { - const url = new URL(x); - if (url.password) { - return `${url.protocol}//${url.host}`; - } else { - return x; +async function send(idx, redacted, requestBody) { + try { + await client.index(requestBody); + } catch (e) { + throw createFailError(errMsg(idx, redacted, requestBody, e)); } } -function color(whichColor) { - return function colorInner(x) { - return chalk[whichColor].bgWhiteBright(x); - }; + +export function maybeTeamAssign(index, body) { + const payload = index === TOTALS_INDEX ? body : { ...body, pipeline }; + return payload; } diff --git a/src/dev/code_coverage/ingest_coverage/ingest_helpers.js b/src/dev/code_coverage/ingest_coverage/ingest_helpers.js new file mode 100644 index 0000000000000..11e5755bb0282 --- /dev/null +++ b/src/dev/code_coverage/ingest_coverage/ingest_helpers.js @@ -0,0 +1,61 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { always, pretty } from './utils'; +import chalk from 'chalk'; +import { fromNullable } from './either'; + +export function errMsg(index, redacted, body, e) { + const orig = fromNullable(e.body).fold( + always(''), + () => `### Orig Err:\n${pretty(e.body.error)}` + ); + + const red = color('red'); + + return ` +### ES HOST (redacted): \n\t${red(redacted)} +### INDEX: \n\t${red(index)} +### Partial orig err stack: \n\t${partial(e.stack)} +### Item BODY:\n${pretty(body)} +${orig} + +### Troubleshooting Hint: +${red('Perhaps the coverage data was not merged properly?\n')} +`; +} + +function partial(x) { + return x.split('\n').splice(0, 2).join('\n'); +} + +export function redact(x) { + const url = new URL(x); + if (url.password) { + return `${url.protocol}//${url.host}`; + } else { + return x; + } +} + +function color(whichColor) { + return function colorInner(x) { + return chalk[whichColor].bgWhiteBright(x); + }; +} diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js b/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js new file mode 100644 index 0000000000000..013adc8b6b0af --- /dev/null +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js @@ -0,0 +1,131 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { resolve } from 'path'; +import execa from 'execa'; +import expect from '@kbn/expect'; + +const ROOT_DIR = resolve(__dirname, '../../../../..'); +const MOCKS_DIR = resolve(__dirname, './mocks'); +const env = { + BUILD_ID: 407, + CI_RUN_URL: 'https://kibana-ci.elastic.co/job/elastic+kibana+code-coverage/407/', + STATIC_SITE_URL_BASE: 'https://kibana-coverage.elastic.dev', + TIME_STAMP: '2020-03-02T21:11:47Z', + ES_HOST: 'https://super:changeme@some.fake.host:9243', + NODE_ENV: 'integration_test', + COVERAGE_INGESTION_KIBANA_ROOT: '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana', +}; + +describe('Ingesting coverage', () => { + const verboseArgs = [ + 'scripts/ingest_coverage.js', + '--verbose', + '--vcsInfoPath', + 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt', + '--path', + ]; + + const summaryPath = 'jest-combined/coverage-summary-manual-mix.json'; + const resolved = resolve(MOCKS_DIR, summaryPath); + + describe(`staticSiteUrl`, () => { + let actualUrl = ''; + const siteUrlRegex = /staticSiteUrl:\s*(.+,)/; + + beforeAll(async () => { + const opts = [...verboseArgs, resolved]; + const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); + actualUrl = siteUrlRegex.exec(stdout)[1]; + }); + + it('should contain the static host', () => { + const staticHost = /https:\/\/kibana-coverage\.elastic\.dev/; + expect(staticHost.test(actualUrl)).ok(); + }); + it('should contain the timestamp', () => { + const timeStamp = /\d{4}-\d{2}-\d{2}T\d{2}.*\d{2}.*\d{2}Z/; + expect(timeStamp.test(actualUrl)).ok(); + }); + it('should contain the folder structure', () => { + const folderStructure = /(?:.*|.*-combined)\//; + expect(folderStructure.test(actualUrl)).ok(); + }); + }); + + describe(`vcsInfo`, () => { + let vcsInfo; + describe(`without a commit msg in the vcs info file`, () => { + const args = [ + 'scripts/ingest_coverage.js', + '--verbose', + '--vcsInfoPath', + 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt', + '--path', + ]; + + beforeAll(async () => { + const opts = [...args, resolved]; + const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); + vcsInfo = stdout; + }); + + it(`should be an obj w/o a commit msg`, () => { + const commitMsgRE = /"commitMsg"/; + expect(commitMsgRE.test(vcsInfo)).to.not.be.ok(); + }); + }); + }); + describe(`team assignment`, () => { + let shouldNotHavePipelineOut = ''; + let shouldIndeedHavePipelineOut = ''; + + const args = [ + 'scripts/ingest_coverage.js', + '--verbose', + '--vcsInfoPath', + 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt', + '--path', + ]; + + const teamAssignRE = /pipeline:/; + + beforeAll(async () => { + const summaryPath = 'jest-combined/coverage-summary-just-total.json'; + const resolved = resolve(MOCKS_DIR, summaryPath); + const opts = [...args, resolved]; + const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); + shouldNotHavePipelineOut = stdout; + }); + beforeAll(async () => { + const summaryPath = 'jest-combined/coverage-summary-manual-mix.json'; + const resolved = resolve(MOCKS_DIR, summaryPath); + const opts = [...args, resolved]; + const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); + shouldIndeedHavePipelineOut = stdout; + }); + + it(`should not occur when going to the totals index`, () => { + expect(teamAssignRE.test(shouldNotHavePipelineOut)).to.not.be.ok(); + }); + it(`should indeed occur when going to the coverage index`, () => { + expect(teamAssignRE.test(shouldIndeedHavePipelineOut)).to.be.ok(); + }); + }); +}); diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt index 13544e90d1401..b13d430a0dc25 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt @@ -2,7 +2,3 @@ f07b34f6206 Tre' Seymour Lorem :) ipsum Tre' λ dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - - Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst. - - diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt new file mode 100644 index 0000000000000..77cf5e2e60c98 --- /dev/null +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt @@ -0,0 +1,3 @@ + origin/ingest-code-coverage + f07b34f6206 + Tre' Seymour diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-just-total.json b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-just-total.json new file mode 100644 index 0000000000000..339fb485c6597 --- /dev/null +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-just-total.json @@ -0,0 +1,28 @@ +{ + "total": { + "lines": { + "total": 14817, + "covered": 3377, + "skipped": 0, + "pct": 22.79 + }, + "statements": { + "total": 15507, + "covered": 3453, + "skipped": 0, + "pct": 22.27 + }, + "functions": { + "total": 3286, + "covered": 654, + "skipped": 0, + "pct": 19.9 + }, + "branches": { + "total": 8060, + "covered": 1439, + "skipped": 0, + "pct": 17.85 + } + } +} diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary.json b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary.json deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/dev/code_coverage/ingest_coverage/transforms.js b/src/dev/code_coverage/ingest_coverage/transforms.js index cecaf1e192b8c..4cb6c2892c4f2 100644 --- a/src/dev/code_coverage/ingest_coverage/transforms.js +++ b/src/dev/code_coverage/ingest_coverage/transforms.js @@ -100,20 +100,23 @@ export const ciRunUrl = (obj) => fromNullable(process.env.CI_RUN_URL).fold(always(obj), (ciRunUrl) => ({ ...obj, ciRunUrl })); const size = 50; -const truncateCommitMsg = (x) => (x.length > size ? `${x.slice(0, 50)}...` : x); +const truncateMsg = (msg) => (msg.length > size ? `${msg.slice(0, 50)}...` : msg); export const itemizeVcs = (vcsInfo) => (obj) => { const [branch, sha, author, commitMsg] = vcsInfo; - return { - ...obj, - vcs: { - branch, - sha, - author, - commitMsg: truncateCommitMsg(commitMsg), - vcsUrl: `https://github.com/elastic/kibana/commit/${sha}`, - }, + + const vcs = { + branch, + sha, + author, + vcsUrl: `https://github.com/elastic/kibana/commit/${sha}`, }; + const res = fromNullable(commitMsg).fold(always({ ...obj, vcs }), (msg) => ({ + ...obj, + vcs: { ...vcs, commitMsg: truncateMsg(msg) }, + })); + + return res; }; export const testRunner = (obj) => { const { jsonSummaryPath } = obj; diff --git a/src/dev/i18n/extractors/code.js b/src/dev/i18n/extractors/code.js index 6439f8ceff332..71f28a36e6e84 100644 --- a/src/dev/i18n/extractors/code.js +++ b/src/dev/i18n/extractors/code.js @@ -72,10 +72,13 @@ export function* extractCodeMessages(buffer, reporter) { 'typescript', 'objectRestSpread', 'classProperties', + 'classPrivateProperties', + 'classPrivateMethods', 'asyncGenerators', 'dynamicImport', 'nullishCoalescingOperator', 'optionalChaining', + 'exportNamespaceFrom', ], }); } catch (error) { diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 64db131f5219a..04b07748c4052 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -79,7 +79,7 @@ export default { ], coverageDirectory: '/target/kibana-coverage/jest', coverageReporters: !!process.env.CODE_COVERAGE ? ['json'] : ['html', 'text'], - moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], + moduleFileExtensions: ['js', 'json', 'ts', 'tsx', 'node'], modulePathIgnorePatterns: ['__fixtures__/', 'target/'], testMatch: ['**/*.test.{js,ts,tsx}'], testPathIgnorePatterns: [ diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 8dccb9830526c..efc42405688d4 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -21,6 +21,7 @@ // used as dependencies or dev dependencies export const LICENSE_WHITELIST = [ 'Elastic-License', + '0BSD', '(BSD-2-Clause OR MIT OR Apache-2.0)', '(BSD-2-Clause OR MIT)', '(BSD-3-Clause AND Apache-2.0)', @@ -78,29 +79,12 @@ export const DEV_ONLY_LICENSE_WHITELIST = ['MPL-2.0']; // Globally overrides a license for a given package@version export const LICENSE_OVERRIDES = { - 'cycle@1.0.3': ['CC0-1.0'], // conversion to a public-domain like license 'jsts@1.1.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint - // TODO can be removed once we upgrade past elasticsearch-browser@14.0.0 - 'elasticsearch-browser@13.0.1': ['Apache-2.0'], - - // TODO can be removed once we upgrade past colors.js@1.0.0 - 'colors@0.5.1': ['MIT'], - - // TODO can be removed once we upgrade past map-stream@0.5.0 - 'map-stream@0.1.0': ['MIT'], - - 'uglify-js@2.2.5': ['BSD'], - 'png-js@0.1.1': ['MIT'], - 'sha.js@2.4.11': ['BSD-3-Clause AND MIT'], - - // TODO can be removed if the ISSUE#239 is accepted on the source + // TODO can be removed if the https://github.com/jindw/xmldom/issues/239 is released 'xmldom@0.1.27': ['MIT'], - // TODO can be removed if the PR#9 is accepted on the source - 'pause-stream@0.0.11': ['MIT'], - // TODO can be removed once we upgrade the use of walk dependency past or equal to v2.3.14 'walk@2.3.9': ['MIT'], }; diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 253fc104061a8..bc3a6265cc582 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -47,6 +47,7 @@ export const IGNORE_FILE_GLOBS = [ '**/Jenkinsfile*', 'Dockerfile*', 'vars/*', + '.ci/pipeline-library/**/*', // Files in this directory must match a pre-determined name in some cases. 'x-pack/plugins/canvas/.storybook/*', diff --git a/src/es_archiver/actions/load.ts b/src/es_archiver/actions/load.ts index 19b5b9e75f31a..03de8f39a7c04 100644 --- a/src/es_archiver/actions/load.ts +++ b/src/es_archiver/actions/load.ts @@ -49,6 +49,7 @@ const pipeline = (...streams: Readable[]) => export async function loadAction({ name, skipExisting, + useCreate, client, dataDir, log, @@ -56,6 +57,7 @@ export async function loadAction({ }: { name: string; skipExisting: boolean; + useCreate: boolean; client: Client; dataDir: string; log: ToolingLog; @@ -87,7 +89,7 @@ export async function loadAction({ await createPromiseFromStreams([ recordStream, createCreateIndexStream({ client, stats, skipExisting, log }), - createIndexDocRecordsStream(client, stats, progress), + createIndexDocRecordsStream(client, stats, progress, useCreate), ]); progress.deactivate(); diff --git a/src/es_archiver/es_archiver.ts b/src/es_archiver/es_archiver.ts index 5614dfd842087..f36cbb3f516b9 100644 --- a/src/es_archiver/es_archiver.ts +++ b/src/es_archiver/es_archiver.ts @@ -80,12 +80,20 @@ export class EsArchiver { * @param {Object} options * @property {Boolean} options.skipExisting - should existing indices * be ignored or overwritten + * @property {Boolean} options.useCreate - use a create operation instead of index for documents * @return Promise */ - async load(name: string, { skipExisting = false }: { skipExisting?: boolean } = {}) { + async load( + name: string, + { + skipExisting = false, + useCreate = false, + }: { skipExisting?: boolean; useCreate?: boolean } = {} + ) { return await loadAction({ name, skipExisting: !!skipExisting, + useCreate: !!useCreate, client: this.client, dataDir: this.dataDir, log: this.log, diff --git a/src/es_archiver/lib/docs/index_doc_records_stream.ts b/src/es_archiver/lib/docs/index_doc_records_stream.ts index a21227aae66c2..28790176af73d 100644 --- a/src/es_archiver/lib/docs/index_doc_records_stream.ts +++ b/src/es_archiver/lib/docs/index_doc_records_stream.ts @@ -22,15 +22,20 @@ import { Writable } from 'stream'; import { Stats } from '../stats'; import { Progress } from '../progress'; -export function createIndexDocRecordsStream(client: Client, stats: Stats, progress: Progress) { +export function createIndexDocRecordsStream( + client: Client, + stats: Stats, + progress: Progress, + useCreate: boolean = false +) { async function indexDocs(docs: any[]) { const body: any[] = []; - + const operation = useCreate === true ? 'create' : 'index'; docs.forEach((doc) => { stats.indexedDoc(doc.index); body.push( { - index: { + [operation]: { _index: doc.index, _id: doc.id, }, diff --git a/src/plugins/console/public/lib/autocomplete/autocomplete.ts b/src/plugins/console/public/lib/autocomplete/autocomplete.ts index b05c7ddbb020d..3959f2ed8cf46 100644 --- a/src/plugins/console/public/lib/autocomplete/autocomplete.ts +++ b/src/plugins/console/public/lib/autocomplete/autocomplete.ts @@ -308,7 +308,7 @@ export function getCurrentMethodAndTokenPaths( } // eslint-disable-next-line -export default function({ coreEditor: editor, parser }: { coreEditor: CoreEditor; parser: any }) { +export default function ({ coreEditor: editor, parser }: { coreEditor: CoreEditor; parser: any }) { function isUrlPathToken(token: Token | null) { switch ((token || ({} as any)).type) { case 'url.slash': diff --git a/src/plugins/console/server/lib/spec_definitions/js/globals.ts b/src/plugins/console/server/lib/spec_definitions/js/globals.ts index 32e1957f74d0b..9fef5c6dbf1e3 100644 --- a/src/plugins/console/server/lib/spec_definitions/js/globals.ts +++ b/src/plugins/console/server/lib/spec_definitions/js/globals.ts @@ -57,7 +57,6 @@ export const globals = (specService: SpecDefinitionsService) => { fields: { '{field}': { fragment_size: 20, - number_of_fragments: 3, ...highlightOptions, }, }, diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index 2121ca4c784bd..946c804d3e6cb 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -105,11 +105,6 @@ export class DashboardContainer extends Container { diff --git a/src/plugins/data/common/es_query/kuery/node_types/function.ts b/src/plugins/data/common/es_query/kuery/node_types/function.ts index 1fb3b2cec0a1c..fd4e408acb57a 100644 --- a/src/plugins/data/common/es_query/kuery/node_types/function.ts +++ b/src/plugins/data/common/es_query/kuery/node_types/function.ts @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -// @ts-ignore + import { functions } from '../functions'; import { IIndexPattern, KueryNode } from '../../..'; import { FunctionName, FunctionTypeBuildNode } from './types'; @@ -30,7 +30,7 @@ export function buildNode(functionName: FunctionName, ...args: any[]) { } return { - type: 'function', + type: 'function' as 'function', function: functionName, // This requires better typing of the different typings and their return types. // @ts-ignore diff --git a/src/plugins/data/common/field_formats/index.ts b/src/plugins/data/common/field_formats/index.ts index b64e115fd55ff..5c67073c07dd5 100644 --- a/src/plugins/data/common/field_formats/index.ts +++ b/src/plugins/data/common/field_formats/index.ts @@ -54,4 +54,5 @@ export { // Used in data plugin only FieldFormatInstanceType, IFieldFormat, + FieldFormatsStartCommon, } from './types'; diff --git a/src/plugins/data/common/field_formats/types.ts b/src/plugins/data/common/field_formats/types.ts index 5f11c7fe094bc..6f773378de08d 100644 --- a/src/plugins/data/common/field_formats/types.ts +++ b/src/plugins/data/common/field_formats/types.ts @@ -17,6 +17,7 @@ * under the License. */ import { FieldFormat } from './field_format'; +import { FieldFormatsRegistry } from './field_formats_registry'; /** @public **/ export type FieldFormatsContentType = 'html' | 'text'; @@ -99,3 +100,5 @@ export interface IFieldFormatMetaParams { basePath?: string; }; } + +export type FieldFormatsStartCommon = Omit; diff --git a/src/plugins/kibana_utils/public/field_mapping/index.ts b/src/plugins/data/common/field_mapping/index.ts similarity index 100% rename from src/plugins/kibana_utils/public/field_mapping/index.ts rename to src/plugins/data/common/field_mapping/index.ts diff --git a/src/plugins/kibana_utils/public/field_mapping/mapping_setup.test.ts b/src/plugins/data/common/field_mapping/mapping_setup.test.ts similarity index 97% rename from src/plugins/kibana_utils/public/field_mapping/mapping_setup.test.ts rename to src/plugins/data/common/field_mapping/mapping_setup.test.ts index ca40685db0ebf..e57699e879a87 100644 --- a/src/plugins/kibana_utils/public/field_mapping/mapping_setup.test.ts +++ b/src/plugins/data/common/field_mapping/mapping_setup.test.ts @@ -18,7 +18,7 @@ */ import { expandShorthand } from './mapping_setup'; -import { ES_FIELD_TYPES } from '../../../data/public'; +import { ES_FIELD_TYPES } from '../../../data/common'; describe('mapping_setup', () => { it('allows shortcuts for field types by just setting the value to the type name', () => { diff --git a/src/plugins/kibana_utils/public/field_mapping/mapping_setup.ts b/src/plugins/data/common/field_mapping/mapping_setup.ts similarity index 100% rename from src/plugins/kibana_utils/public/field_mapping/mapping_setup.ts rename to src/plugins/data/common/field_mapping/mapping_setup.ts diff --git a/src/plugins/kibana_utils/public/field_mapping/types.ts b/src/plugins/data/common/field_mapping/types.ts similarity index 95% rename from src/plugins/kibana_utils/public/field_mapping/types.ts rename to src/plugins/data/common/field_mapping/types.ts index f3fb9b000e45a..973a58d3baec4 100644 --- a/src/plugins/kibana_utils/public/field_mapping/types.ts +++ b/src/plugins/data/common/field_mapping/types.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ES_FIELD_TYPES } from '../../../data/public'; +import { ES_FIELD_TYPES } from '../../../data/common'; /** @public */ export interface FieldMappingSpec { diff --git a/src/plugins/data/common/index.ts b/src/plugins/data/common/index.ts index e4a663a1599f1..adbd93d518fc7 100644 --- a/src/plugins/data/common/index.ts +++ b/src/plugins/data/common/index.ts @@ -27,3 +27,4 @@ export * from './search'; export * from './search/aggs'; export * from './types'; export * from './utils'; +export * from './field_mapping'; diff --git a/src/plugins/data/public/index_patterns/fields/__snapshots__/field.test.ts.snap b/src/plugins/data/common/index_patterns/fields/__snapshots__/field.test.ts.snap similarity index 100% rename from src/plugins/data/public/index_patterns/fields/__snapshots__/field.test.ts.snap rename to src/plugins/data/common/index_patterns/fields/__snapshots__/field.test.ts.snap diff --git a/src/plugins/data/public/index_patterns/fields/field.test.ts b/src/plugins/data/common/index_patterns/fields/field.test.ts similarity index 94% rename from src/plugins/data/public/index_patterns/fields/field.test.ts rename to src/plugins/data/common/index_patterns/fields/field.test.ts index 18252b159d98d..711c176fed9cc 100644 --- a/src/plugins/data/public/index_patterns/fields/field.test.ts +++ b/src/plugins/data/common/index_patterns/fields/field.test.ts @@ -18,9 +18,8 @@ */ import { Field } from './field'; -import { IndexPattern } from '..'; -import { notificationServiceMock } from '../../../../../core/public/mocks'; -import { FieldFormatsStart } from '../../field_formats'; +import { IndexPattern } from '../index_patterns'; +import { FieldFormatsStartCommon } from '../..'; import { KBN_FIELD_TYPES } from '../../../common'; describe('Field', function () { @@ -34,8 +33,8 @@ describe('Field', function () { { ...fieldValues, ...values }, false, { - fieldFormats: {} as FieldFormatsStart, - toastNotifications: notificationServiceMock.createStartContract().toasts, + fieldFormats: {} as FieldFormatsStartCommon, + onNotification: () => {}, } ); } @@ -215,8 +214,8 @@ describe('Field', function () { it('exports the property to JSON', () => { const field = new Field({ fieldFormatMap: { name: {} } } as IndexPattern, fieldValues, false, { - fieldFormats: {} as FieldFormatsStart, - toastNotifications: notificationServiceMock.createStartContract().toasts, + fieldFormats: {} as FieldFormatsStartCommon, + onNotification: () => {}, }); expect(flatten(field)).toMatchSnapshot(); }); diff --git a/src/plugins/data/public/index_patterns/fields/field.ts b/src/plugins/data/common/index_patterns/fields/field.ts similarity index 89% rename from src/plugins/data/public/index_patterns/fields/field.ts rename to src/plugins/data/common/index_patterns/fields/field.ts index 625df17d62e0d..c53e3f2b1f621 100644 --- a/src/plugins/data/public/index_patterns/fields/field.ts +++ b/src/plugins/data/common/index_patterns/fields/field.ts @@ -18,10 +18,9 @@ */ import { i18n } from '@kbn/i18n'; -import { ToastsStart } from 'kibana/public'; // @ts-ignore import { ObjDefine } from './obj_define'; -import { IndexPattern } from '../index_patterns'; +import { IIndexPattern } from '../../types'; import { IFieldType, getKbnFieldType, @@ -29,13 +28,14 @@ import { FieldFormat, shortenDottedString, } from '../../../common'; -import { FieldFormatsStart } from '../../field_formats'; +import { OnNotification } from '../types'; +import { FieldFormatsStartCommon } from '../../field_formats'; export type FieldSpec = Record; interface FieldDependencies { - fieldFormats: FieldFormatsStart; - toastNotifications: ToastsStart; + fieldFormats: FieldFormatsStartCommon; + onNotification: OnNotification; } export class Field implements IFieldType { @@ -55,17 +55,17 @@ export class Field implements IFieldType { scripted?: boolean; subType?: IFieldSubType; displayName?: string; - indexPattern?: IndexPattern; + indexPattern?: IIndexPattern; readFromDocValues?: boolean; format: any; $$spec: FieldSpec; conflictDescriptions?: Record; constructor( - indexPattern: IndexPattern, + indexPattern: IIndexPattern, spec: FieldSpec | Field, shortDotsEnable: boolean, - { fieldFormats, toastNotifications }: FieldDependencies + { fieldFormats, onNotification }: FieldDependencies ) { // unwrap old instances of Field if (spec instanceof Field) spec = spec.$$spec; @@ -90,11 +90,7 @@ export class Field implements IFieldType { values: { name: spec.name, title: indexPattern.title }, defaultMessage: 'Field {name} in indexPattern {title} is using an unknown field type.', }); - - toastNotifications.addDanger({ - title, - text, - }); + onNotification({ title, text, color: 'danger', iconType: 'alert' }); } if (!type) type = getKbnFieldType('unknown'); @@ -103,7 +99,7 @@ export class Field implements IFieldType { if (!FieldFormat.isInstanceOfFieldFormat(format)) { format = - indexPattern.fieldFormatMap[spec.name] || + (indexPattern.fieldFormatMap && indexPattern.fieldFormatMap[spec.name]) || fieldFormats.getDefaultInstance(spec.type, spec.esTypes); } diff --git a/src/plugins/data/public/index_patterns/fields/field_list.ts b/src/plugins/data/common/index_patterns/fields/field_list.ts similarity index 87% rename from src/plugins/data/public/index_patterns/fields/field_list.ts rename to src/plugins/data/common/index_patterns/fields/field_list.ts index 1aef0b1ccadaa..173a629863a71 100644 --- a/src/plugins/data/public/index_patterns/fields/field_list.ts +++ b/src/plugins/data/common/index_patterns/fields/field_list.ts @@ -18,17 +18,17 @@ */ import { findIndex } from 'lodash'; -import { ToastsStart } from 'kibana/public'; -import { IndexPattern } from '../index_patterns'; +import { IIndexPattern } from '../../types'; import { IFieldType } from '../../../common'; import { Field, FieldSpec } from './field'; -import { FieldFormatsStart } from '../../field_formats'; +import { OnNotification } from '../types'; +import { FieldFormatsStartCommon } from '../../field_formats'; type FieldMap = Map; interface FieldListDependencies { - fieldFormats: FieldFormatsStart; - toastNotifications: ToastsStart; + fieldFormats: FieldFormatsStartCommon; + onNotification: OnNotification; } export interface IIndexPatternFieldList extends Array { @@ -40,19 +40,19 @@ export interface IIndexPatternFieldList extends Array { } export type CreateIndexPatternFieldList = ( - indexPattern: IndexPattern, + indexPattern: IIndexPattern, specs?: FieldSpec[], shortDotsEnable?: boolean ) => IIndexPatternFieldList; export const getIndexPatternFieldListCreator = ({ fieldFormats, - toastNotifications, + onNotification, }: FieldListDependencies): CreateIndexPatternFieldList => (...fieldListParams) => { class FieldList extends Array implements IIndexPatternFieldList { private byName: FieldMap = new Map(); private groups: Map = new Map(); - private indexPattern: IndexPattern; + private indexPattern: IIndexPattern; private shortDotsEnable: boolean; private setByName = (field: Field) => this.byName.set(field.name, field); private setByGroup = (field: Field) => { @@ -63,7 +63,7 @@ export const getIndexPatternFieldListCreator = ({ }; private removeByGroup = (field: IFieldType) => this.groups.get(field.type)!.delete(field.name); - constructor(indexPattern: IndexPattern, specs: FieldSpec[] = [], shortDotsEnable = false) { + constructor(indexPattern: IIndexPattern, specs: FieldSpec[] = [], shortDotsEnable = false) { super(); this.indexPattern = indexPattern; this.shortDotsEnable = shortDotsEnable; @@ -76,7 +76,7 @@ export const getIndexPatternFieldListCreator = ({ add = (field: FieldSpec) => { const newField = new Field(this.indexPattern, field, this.shortDotsEnable, { fieldFormats, - toastNotifications, + onNotification, }); this.push(newField); this.setByName(newField); @@ -94,7 +94,7 @@ export const getIndexPatternFieldListCreator = ({ update = (field: FieldSpec) => { const newField = new Field(this.indexPattern, field, this.shortDotsEnable, { fieldFormats, - toastNotifications, + onNotification, }); const index = this.findIndex((f) => f.name === newField.name); this.splice(index, 1, newField); diff --git a/src/plugins/data/common/index_patterns/fields/index.ts b/src/plugins/data/common/index_patterns/fields/index.ts index 5b6fef3e51fa9..1b7c87d556f59 100644 --- a/src/plugins/data/common/index_patterns/fields/index.ts +++ b/src/plugins/data/common/index_patterns/fields/index.ts @@ -19,3 +19,5 @@ export * from './types'; export { isFilterable, isNestedField } from './utils'; +export * from './field_list'; +export * from './field'; diff --git a/src/plugins/data/public/index_patterns/fields/obj_define.js b/src/plugins/data/common/index_patterns/fields/obj_define.js similarity index 100% rename from src/plugins/data/public/index_patterns/fields/obj_define.js rename to src/plugins/data/common/index_patterns/fields/obj_define.js diff --git a/src/plugins/data/public/index_patterns/fields/obj_define.test.js b/src/plugins/data/common/index_patterns/fields/obj_define.test.js similarity index 100% rename from src/plugins/data/public/index_patterns/fields/obj_define.test.js rename to src/plugins/data/common/index_patterns/fields/obj_define.test.js diff --git a/src/plugins/data/public/index_patterns/index_patterns/_fields_fetcher.ts b/src/plugins/data/common/index_patterns/index_patterns/_fields_fetcher.ts similarity index 91% rename from src/plugins/data/public/index_patterns/index_patterns/_fields_fetcher.ts rename to src/plugins/data/common/index_patterns/index_patterns/_fields_fetcher.ts index d9850086339c0..727c4d445688d 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/_fields_fetcher.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/_fields_fetcher.ts @@ -17,8 +17,7 @@ * under the License. */ -import { IndexPattern } from './index_pattern'; -import { GetFieldsOptions, IIndexPatternsApiClient } from './index_patterns_api_client'; +import { GetFieldsOptions, IIndexPatternsApiClient, IndexPattern } from '.'; /** @internal */ export const createFieldsFetcher = ( diff --git a/src/plugins/data/public/index_patterns/index_patterns/_pattern_cache.ts b/src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/_pattern_cache.ts rename to src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts diff --git a/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts new file mode 100644 index 0000000000000..2737627bf1977 --- /dev/null +++ b/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts @@ -0,0 +1,57 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { contains } from 'lodash'; +import { CoreStart } from 'kibana/public'; +import { IndexPatternsContract } from './index_patterns'; + +export type EnsureDefaultIndexPattern = () => Promise | undefined; + +export const createEnsureDefaultIndexPattern = ( + uiSettings: CoreStart['uiSettings'], + onRedirectNoIndexPattern: () => Promise | void +) => { + /** + * Checks whether a default index pattern is set and exists and defines + * one otherwise. + */ + return async function ensureDefaultIndexPattern(this: IndexPatternsContract) { + const patterns = await this.getIds(); + let defaultId = uiSettings.get('defaultIndex'); + let defined = !!defaultId; + const exists = contains(patterns, defaultId); + + if (defined && !exists) { + uiSettings.remove('defaultIndex'); + defaultId = defined = false; + } + + if (defined) { + return; + } + + // If there is any index pattern created, set the first as default + if (patterns.length >= 1) { + defaultId = patterns[0]; + uiSettings.set('defaultIndex', defaultId); + } else { + return onRedirectNoIndexPattern(); + } + }; +}; diff --git a/src/plugins/data/public/index_patterns/index_patterns/flatten_hit.ts b/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/flatten_hit.ts rename to src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/format_hit.ts b/src/plugins/data/common/index_patterns/index_patterns/format_hit.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/format_hit.ts rename to src/plugins/data/common/index_patterns/index_patterns/format_hit.ts diff --git a/src/plugins/data/common/index_patterns/index_patterns/index.ts b/src/plugins/data/common/index_patterns/index_patterns/index.ts new file mode 100644 index 0000000000000..5fae08f3bb775 --- /dev/null +++ b/src/plugins/data/common/index_patterns/index_patterns/index.ts @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export * from './index_patterns_api_client'; +export * from './types'; +export * from './_pattern_cache'; +export * from './flatten_hit'; +export * from './format_hit'; +export * from './index_pattern'; +export * from './index_patterns'; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts similarity index 93% rename from src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts index 84135bb5d1e2b..8ec3072bf916b 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts @@ -19,24 +19,19 @@ import { defaults, pluck, last, get } from 'lodash'; -jest.mock('../../../../kibana_utils/public/history'); import { IndexPattern } from './index_pattern'; -import { DuplicateField } from '../../../../kibana_utils/public'; +import { DuplicateField } from '../../../../kibana_utils/common'; // @ts-ignore import mockLogStashFields from '../../../../../fixtures/logstash_fields'; // @ts-ignore import { stubbedSavedObjectIndexPattern } from '../../../../../fixtures/stubbed_saved_object_index_pattern'; import { Field } from '../fields'; -import { setNotifications, setFieldFormats } from '../../services'; -// Temporary disable eslint, will be removed after moving to new platform folder -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { notificationServiceMock } from '../../../../../core/public/notifications/notifications_service.mock'; -import { FieldFormatsStart } from '../../field_formats'; +import { FieldFormatsStartCommon } from '../../field_formats'; -jest.mock('../../../../kibana_utils/public', () => { - const originalModule = jest.requireActual('../../../../kibana_utils/public'); +jest.mock('../../field_mapping', () => { + const originalModule = jest.requireActual('../../field_mapping'); return { ...originalModule, @@ -107,7 +102,10 @@ function create(id: string, payload?: any): Promise { (cfg: any) => config.get(cfg), savedObjectsClient as any, apiClient, - patternCache + patternCache, + ({ getDefaultInstance: () => {}, getType: () => {} } as unknown) as FieldFormatsStartCommon, + () => {}, + () => {} ); setDocsourcePayload(id, payload); @@ -121,18 +119,11 @@ function setDocsourcePayload(id: string | null, providedPayload: any) { describe('IndexPattern', () => { const indexPatternId = 'test-pattern'; - const notifications = notificationServiceMock.createStartContract(); let indexPattern: IndexPattern; // create an indexPattern instance for each test beforeEach(() => { - setNotifications(notifications); - setFieldFormats(({ - getDefaultInstance: jest.fn(), - deserialize: jest.fn() as any, - } as unknown) as FieldFormatsStart); - return create(indexPatternId).then((pattern: IndexPattern) => { indexPattern = pattern; }); @@ -377,7 +368,10 @@ describe('IndexPattern', () => { (cfg: any) => config.get(cfg), savedObjectsClient as any, apiClient, - patternCache + patternCache, + ({ getDefaultInstance: () => {}, getType: () => {} } as unknown) as FieldFormatsStartCommon, + () => {}, + () => {} ); await pattern.init(); @@ -389,7 +383,10 @@ describe('IndexPattern', () => { (cfg: any) => config.get(cfg), savedObjectsClient as any, apiClient, - patternCache + patternCache, + ({ getDefaultInstance: () => {}, getType: () => {} } as unknown) as FieldFormatsStartCommon, + () => {}, + () => {} ); await samePattern.init(); diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts similarity index 91% rename from src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts index 84ea12a1f684f..aefa8734b01c7 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts @@ -20,13 +20,7 @@ import _, { each, reject } from 'lodash'; import { i18n } from '@kbn/i18n'; import { SavedObjectsClientContract } from 'src/core/public'; -import { - DuplicateField, - SavedObjectNotFound, - expandShorthand, - FieldMappingSpec, - MappingObject, -} from '../../../../kibana_utils/public'; +import { DuplicateField, SavedObjectNotFound } from '../../../../kibana_utils/common'; import { ES_FIELD_TYPES, @@ -41,10 +35,12 @@ import { Field, IIndexPatternFieldList, getIndexPatternFieldListCreator } from ' import { createFieldsFetcher } from './_fields_fetcher'; import { formatHitProvider } from './format_hit'; import { flattenHitWrapper } from './flatten_hit'; -import { IIndexPatternsApiClient } from './index_patterns_api_client'; -import { getNotifications, getFieldFormats } from '../../services'; -import { TypeMeta } from './types'; +import { IIndexPatternsApiClient } from '.'; +import { TypeMeta } from '.'; +import { OnNotification, OnError } from '../types'; +import { FieldFormatsStartCommon } from '../../field_formats'; import { PatternCache } from './_pattern_cache'; +import { expandShorthand, FieldMappingSpec, MappingObject } from '../../field_mapping'; const MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS = 3; const type = 'index-pattern'; @@ -72,6 +68,9 @@ export class IndexPattern implements IIndexPattern { private originalBody: { [key: string]: any } = {}; public fieldsFetcher: any; // probably want to factor out any direct usage and change to private private shortDotsEnable: boolean = false; + private fieldFormats: FieldFormatsStartCommon; + private onNotification: OnNotification; + private onError: OnError; private apiClient: IIndexPatternsApiClient; private mapping: MappingObject = expandShorthand({ @@ -101,7 +100,10 @@ export class IndexPattern implements IIndexPattern { getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, - patternCache: PatternCache + patternCache: PatternCache, + fieldFormats: FieldFormatsStartCommon, + onNotification: OnNotification, + onError: OnError ) { this.id = id; this.savedObjectsClient = savedObjectsClient; @@ -109,13 +111,16 @@ export class IndexPattern implements IIndexPattern { // instead of storing config we rather store the getter only as np uiSettingsClient has circular references // which cause problems when being consumed from angular this.getConfig = getConfig; + this.fieldFormats = fieldFormats; + this.onNotification = onNotification; + this.onError = onError; this.shortDotsEnable = this.getConfig(UI_SETTINGS.SHORT_DOTS_ENABLE); this.metaFields = this.getConfig(UI_SETTINGS.META_FIELDS); this.createFieldList = getIndexPatternFieldListCreator({ - fieldFormats: getFieldFormats(), - toastNotifications: getNotifications().toasts, + fieldFormats, + onNotification, }); this.fields = this.createFieldList(this, [], this.shortDotsEnable); @@ -128,7 +133,7 @@ export class IndexPattern implements IIndexPattern { this.flattenHit = flattenHitWrapper(this, this.getConfig(UI_SETTINGS.META_FIELDS)); this.formatHit = formatHitProvider( this, - getFieldFormats().getDefaultInstance(KBN_FIELD_TYPES.STRING) + fieldFormats.getDefaultInstance(KBN_FIELD_TYPES.STRING) ); this.formatField = this.formatHit.formatField; } @@ -140,7 +145,7 @@ export class IndexPattern implements IIndexPattern { } private deserializeFieldFormatMap(mapping: any) { - const FieldFormat = getFieldFormats().getType(mapping.id); + const FieldFormat = this.fieldFormats.getType(mapping.id); return FieldFormat && new FieldFormat(mapping.params, this.getConfig); } @@ -296,8 +301,8 @@ export class IndexPattern implements IIndexPattern { }, false, { - fieldFormats: getFieldFormats(), - toastNotifications: getNotifications().toasts, + fieldFormats: this.fieldFormats, + onNotification: this.onNotification, } ) ); @@ -400,8 +405,12 @@ export class IndexPattern implements IIndexPattern { this.getConfig, this.savedObjectsClient, this.apiClient, - this.patternCache + this.patternCache, + this.fieldFormats, + this.onNotification, + this.onError ); + await duplicatePattern.destroy(); } @@ -449,7 +458,10 @@ export class IndexPattern implements IIndexPattern { this.getConfig, this.savedObjectsClient, this.apiClient, - this.patternCache + this.patternCache, + this.fieldFormats, + this.onNotification, + this.onError ); return samePattern.init().then(() => { // What keys changed from now and what the server returned @@ -474,14 +486,12 @@ export class IndexPattern implements IIndexPattern { } if (unresolvedCollision) { - const message = i18n.translate('data.indexPatterns.unableWriteLabel', { + const title = i18n.translate('data.indexPatterns.unableWriteLabel', { defaultMessage: 'Unable to write index pattern! Refresh the page to get the most up to date changes for this index pattern.', }); - const { toasts } = getNotifications(); - - toasts.addDanger(message); + this.onNotification({ title, color: 'danger' }); throw err; } @@ -519,15 +529,13 @@ export class IndexPattern implements IIndexPattern { // we still want to notify the user that there is a problem // but we do not want to potentially make any pages unusable // so do not rethrow the error here - const { toasts } = getNotifications(); if (err instanceof IndexPatternMissingIndices) { - toasts.addDanger((err as any).message); - + this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); return []; } - toasts.addError(err, { + this.onError(err, { title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', values: { diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns.test.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts similarity index 91% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns.test.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts index fc0be270e9c50..5ff19a3c54cb1 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns.test.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts @@ -21,11 +21,11 @@ import { IndexPatternsService } from './index_patterns'; import { SavedObjectsClientContract, SavedObjectsFindResponsePublic } from 'kibana/public'; import { coreMock, httpServiceMock } from '../../../../../core/public/mocks'; -import { fieldFormatsServiceMock } from '../../field_formats/mocks'; +import { fieldFormatsMock } from '../../field_formats/mocks'; const core = coreMock.createStart(); const http = httpServiceMock.createStartContract(); -const fieldFormats = fieldFormatsServiceMock.createStartContract(); +const fieldFormats = fieldFormatsMock; jest.mock('./index_pattern', () => { class IndexPattern { @@ -62,7 +62,15 @@ describe('IndexPatterns', () => { }) as Promise> ); - indexPatterns = new IndexPatternsService(core, savedObjectsClient, http, fieldFormats); + indexPatterns = new IndexPatternsService( + core.uiSettings, + savedObjectsClient, + http, + fieldFormats, + () => {}, + () => {}, + () => {} + ); }); test('does cache gets for the same id', async () => { diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts similarity index 85% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index 32b31d4f2758d..db2a68956f106 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -25,9 +25,9 @@ import { CoreStart, } from 'src/core/public'; -import { createIndexPatternCache } from './_pattern_cache'; +import { createIndexPatternCache } from '.'; import { IndexPattern } from './index_pattern'; -import { IndexPatternsApiClient, GetFieldsOptions } from './index_patterns_api_client'; +import { IndexPatternsApiClient, GetFieldsOptions } from '.'; import { createEnsureDefaultIndexPattern, EnsureDefaultIndexPattern, @@ -38,7 +38,8 @@ import { Field, FieldSpec, } from '../fields'; -import { FieldFormatsStart } from '../../field_formats'; +import { OnNotification, OnError } from '../types'; +import { FieldFormatsStartCommon } from '../../field_formats'; const indexPatternCache = createIndexPatternCache(); @@ -53,6 +54,9 @@ export class IndexPatternsService { private savedObjectsClient: SavedObjectsClientContract; private savedObjectsCache?: Array> | null; private apiClient: IndexPatternsApiClient; + private fieldFormats: FieldFormatsStartCommon; + private onNotification: OnNotification; + private onError: OnError; ensureDefaultIndexPattern: EnsureDefaultIndexPattern; createFieldList: CreateIndexPatternFieldList; createField: ( @@ -62,23 +66,32 @@ export class IndexPatternsService { ) => Field; constructor( - core: CoreStart, + uiSettings: CoreStart['uiSettings'], savedObjectsClient: SavedObjectsClientContract, http: HttpStart, - fieldFormats: FieldFormatsStart + fieldFormats: FieldFormatsStartCommon, + onNotification: OnNotification, + onError: OnError, + onRedirectNoIndexPattern: () => void ) { this.apiClient = new IndexPatternsApiClient(http); - this.config = core.uiSettings; + this.config = uiSettings; this.savedObjectsClient = savedObjectsClient; - this.ensureDefaultIndexPattern = createEnsureDefaultIndexPattern(core); + this.fieldFormats = fieldFormats; + this.onNotification = onNotification; + this.onError = onError; + this.ensureDefaultIndexPattern = createEnsureDefaultIndexPattern( + uiSettings, + onRedirectNoIndexPattern + ); this.createFieldList = getIndexPatternFieldListCreator({ fieldFormats, - toastNotifications: core.notifications.toasts, + onNotification, }); this.createField = (indexPattern, spec, shortDotsEnable) => { return new Field(indexPattern, spec, shortDotsEnable, { fieldFormats, - toastNotifications: core.notifications.toasts, + onNotification, }); }; } @@ -178,7 +191,10 @@ export class IndexPatternsService { (cfg: any) => this.config.get(cfg), this.savedObjectsClient, this.apiClient, - indexPatternCache + indexPatternCache, + this.fieldFormats, + this.onNotification, + this.onError ); return indexPattern.init(); diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns_api_client.test.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_patterns_api_client.test.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns_api_client.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts rename to src/plugins/data/common/index_patterns/index_patterns/index_patterns_api_client.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/types.ts b/src/plugins/data/common/index_patterns/index_patterns/types.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/types.ts rename to src/plugins/data/common/index_patterns/index_patterns/types.ts diff --git a/src/plugins/data/public/index_patterns/lib/errors.ts b/src/plugins/data/common/index_patterns/lib/errors.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/errors.ts rename to src/plugins/data/common/index_patterns/lib/errors.ts diff --git a/src/plugins/data/public/index_patterns/lib/get_from_saved_object.ts b/src/plugins/data/common/index_patterns/lib/get_from_saved_object.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/get_from_saved_object.ts rename to src/plugins/data/common/index_patterns/lib/get_from_saved_object.ts diff --git a/src/plugins/data/public/index_patterns/lib/get_title.ts b/src/plugins/data/common/index_patterns/lib/get_title.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/get_title.ts rename to src/plugins/data/common/index_patterns/lib/get_title.ts diff --git a/src/plugins/data/public/index_patterns/lib/index.ts b/src/plugins/data/common/index_patterns/lib/index.ts similarity index 99% rename from src/plugins/data/public/index_patterns/lib/index.ts rename to src/plugins/data/common/index_patterns/lib/index.ts index 2893096c4af9d..d9eccb6685ded 100644 --- a/src/plugins/data/public/index_patterns/lib/index.ts +++ b/src/plugins/data/common/index_patterns/lib/index.ts @@ -17,9 +17,10 @@ * under the License. */ -export { getTitle } from './get_title'; -export * from './types'; -export { validateIndexPattern } from './validate_index_pattern'; export { IndexPatternMissingIndices } from './errors'; +export { getTitle } from './get_title'; export { getFromSavedObject } from './get_from_saved_object'; export { isDefault } from './is_default'; + +export * from './types'; +export { validateIndexPattern } from './validate_index_pattern'; diff --git a/src/plugins/data/public/index_patterns/lib/is_default.ts b/src/plugins/data/common/index_patterns/lib/is_default.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/is_default.ts rename to src/plugins/data/common/index_patterns/lib/is_default.ts diff --git a/src/plugins/data/public/index_patterns/lib/types.ts b/src/plugins/data/common/index_patterns/lib/types.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/types.ts rename to src/plugins/data/common/index_patterns/lib/types.ts diff --git a/src/plugins/data/public/index_patterns/lib/validate_index_pattern.test.ts b/src/plugins/data/common/index_patterns/lib/validate_index_pattern.test.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/validate_index_pattern.test.ts rename to src/plugins/data/common/index_patterns/lib/validate_index_pattern.test.ts diff --git a/src/plugins/data/public/index_patterns/lib/validate_index_pattern.ts b/src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts similarity index 100% rename from src/plugins/data/public/index_patterns/lib/validate_index_pattern.ts rename to src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts diff --git a/src/plugins/data/common/index_patterns/types.ts b/src/plugins/data/common/index_patterns/types.ts index e21d27a70e02a..7399bbbc10a7e 100644 --- a/src/plugins/data/common/index_patterns/types.ts +++ b/src/plugins/data/common/index_patterns/types.ts @@ -17,6 +17,7 @@ * under the License. */ +import { ToastInputFields, ErrorToastOptions } from 'src/core/public/notifications'; import { IFieldType } from './fields'; export interface IIndexPattern { @@ -47,3 +48,6 @@ export interface IndexPatternAttributes { typeMeta: string; timeFieldName?: string; } + +export type OnNotification = (toastInputFields: ToastInputFields) => void; +export type OnError = (error: Error, toastInputFields: ErrorToastOptions) => void; diff --git a/src/plugins/data/public/index_patterns/utils.ts b/src/plugins/data/common/index_patterns/utils.ts similarity index 100% rename from src/plugins/data/public/index_patterns/utils.ts rename to src/plugins/data/common/index_patterns/utils.ts diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 301ff8d3f67d8..1554ac71f8c55 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -443,6 +443,8 @@ export { getKbnTypeNames, } from '../common'; +export * from '../common/field_mapping'; + /* * Plugin setup */ diff --git a/src/plugins/data/public/index_patterns/index.ts b/src/plugins/data/public/index_patterns/index.ts index 58c2cae1de0f3..0a8397467807c 100644 --- a/src/plugins/data/public/index_patterns/index.ts +++ b/src/plugins/data/public/index_patterns/index.ts @@ -25,10 +25,14 @@ export { validateIndexPattern, getFromSavedObject, isDefault, -} from './lib'; -export { flattenHitWrapper, formatHitProvider } from './index_patterns'; +} from '../../common/index_patterns/lib'; +export { flattenHitWrapper, formatHitProvider, onRedirectNoIndexPattern } from './index_patterns'; -export { getIndexPatternFieldListCreator, Field, IIndexPatternFieldList } from './fields'; +export { + getIndexPatternFieldListCreator, + Field, + IIndexPatternFieldList, +} from '../../common/index_patterns'; // TODO: figure out how to replace IndexPatterns in get_inner_angular. export { diff --git a/src/plugins/data/public/index_patterns/index_patterns/ensure_default_index_pattern.tsx b/src/plugins/data/public/index_patterns/index_patterns/ensure_default_index_pattern.tsx deleted file mode 100644 index 2088bd8c925df..0000000000000 --- a/src/plugins/data/public/index_patterns/index_patterns/ensure_default_index_pattern.tsx +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { contains } from 'lodash'; -import React from 'react'; -import { History } from 'history'; -import { i18n } from '@kbn/i18n'; -import { EuiCallOut } from '@elastic/eui'; -import { CoreStart } from 'kibana/public'; -import { toMountPoint } from '../../../../kibana_react/public'; -import { IndexPatternsContract } from './index_patterns'; - -export type EnsureDefaultIndexPattern = (history: History) => Promise | undefined; - -export const createEnsureDefaultIndexPattern = (core: CoreStart) => { - let bannerId: string; - let timeoutId: NodeJS.Timeout | undefined; - - /** - * Checks whether a default index pattern is set and exists and defines - * one otherwise. - * - * If there are no index patterns, redirect to management page and show - * banner. In this case the promise returned from this function will never - * resolve to wait for the URL change to happen. - */ - return async function ensureDefaultIndexPattern(this: IndexPatternsContract, history: History) { - const patterns = await this.getIds(); - let defaultId = core.uiSettings.get('defaultIndex'); - let defined = !!defaultId; - const exists = contains(patterns, defaultId); - - if (defined && !exists) { - core.uiSettings.remove('defaultIndex'); - defaultId = defined = false; - } - - if (defined) { - return; - } - - // If there is any index pattern created, set the first as default - if (patterns.length >= 1) { - defaultId = patterns[0]; - core.uiSettings.set('defaultIndex', defaultId); - } else { - const canManageIndexPatterns = core.application.capabilities.management.kibana.index_patterns; - const redirectTarget = canManageIndexPatterns ? '/management/kibana/indexPatterns' : '/home'; - - if (timeoutId) { - clearTimeout(timeoutId); - } - - const bannerMessage = i18n.translate( - 'data.indexPatterns.ensureDefaultIndexPattern.bannerLabel', - { - defaultMessage: - "In order to visualize and explore data in Kibana, you'll need to create an index pattern to retrieve data from Elasticsearch.", - } - ); - - // Avoid being hostile to new users who don't have an index pattern setup yet - // give them a friendly info message instead of a terse error message - bannerId = core.overlays.banners.replace( - bannerId, - toMountPoint() - ); - - // hide the message after the user has had a chance to acknowledge it -- so it doesn't permanently stick around - timeoutId = setTimeout(() => { - core.overlays.banners.remove(bannerId); - timeoutId = undefined; - }, 15000); - - if (redirectTarget === '/home') { - core.application.navigateToApp('home'); - } else { - core.application.navigateToApp('management', { - path: `/kibana/indexPatterns?bannerMessage=${bannerMessage}`, - }); - } - - // return never-resolving promise to stop resolving and wait for the url change - return new Promise(() => {}); - } - }; -}; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index.ts b/src/plugins/data/public/index_patterns/index_patterns/index.ts index fca82025cdc66..0db1c8c68b4ac 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/index.ts @@ -17,9 +17,5 @@ * under the License. */ -export * from './flatten_hit'; -export * from './format_hit'; -export * from './index_pattern'; -export * from './index_patterns'; -export * from './index_patterns_api_client'; -export * from './types'; +export * from '../../../common/index_patterns/index_patterns'; +export * from './redirect_no_index_pattern'; diff --git a/src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx b/src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx new file mode 100644 index 0000000000000..e32a8e023cf40 --- /dev/null +++ b/src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx @@ -0,0 +1,69 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { EuiCallOut } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { CoreStart } from 'kibana/public'; +import { toMountPoint } from '../../../../kibana_react/public'; + +let bannerId: string; + +export const onRedirectNoIndexPattern = ( + capabilities: CoreStart['application']['capabilities'], + navigateToApp: CoreStart['application']['navigateToApp'], + overlays: CoreStart['overlays'] +) => () => { + const canManageIndexPatterns = capabilities.management.kibana.index_patterns; + const redirectTarget = canManageIndexPatterns ? '/management/kibana/indexPatterns' : '/home'; + let timeoutId: NodeJS.Timeout | undefined; + + if (timeoutId) { + clearTimeout(timeoutId); + } + + const bannerMessage = i18n.translate('data.indexPatterns.ensureDefaultIndexPattern.bannerLabel', { + defaultMessage: + "In order to visualize and explore data in Kibana, you'll need to create an index pattern to retrieve data from Elasticsearch.", + }); + + // Avoid being hostile to new users who don't have an index pattern setup yet + // give them a friendly info message instead of a terse error message + bannerId = overlays.banners.replace( + bannerId, + toMountPoint() + ); + + // hide the message after the user has had a chance to acknowledge it -- so it doesn't permanently stick around + timeoutId = setTimeout(() => { + overlays.banners.remove(bannerId); + timeoutId = undefined; + }, 15000); + + if (redirectTarget === '/home') { + navigateToApp('home'); + } else { + navigateToApp('management', { + path: `/kibana/indexPatterns?bannerMessage=${bannerMessage}`, + }); + } + + // return never-resolving promise to stop resolving and wait for the url change + return new Promise(() => {}); +}; diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 06b5cbdfdfdfb..baac2cf0d7a77 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -40,7 +40,7 @@ import { SearchService } from './search/search_service'; import { FieldFormatsService } from './field_formats'; import { QueryService } from './query'; import { createIndexPatternSelect } from './ui/index_pattern_select'; -import { IndexPatternsService } from './index_patterns'; +import { IndexPatternsService, onRedirectNoIndexPattern } from './index_patterns'; import { setFieldFormats, setHttp, @@ -154,7 +154,7 @@ export class DataPublicPlugin implements Plugin { + notifications.toasts.add(toastInputFields); + }, + notifications.toasts.addError, + onRedirectNoIndexPattern(application.capabilities, application.navigateToApp, overlays) + ); setIndexPatterns(indexPatterns); const query = this.queryService.start(savedObjects); diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index bd3ec0d3f2294..f23dfe857c775 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -9,56 +9,177 @@ import _ from 'lodash'; import { Action } from 'history'; import { ApplicationStart } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; +import Boom from 'boom'; import { Breadcrumb } from '@elastic/eui'; +import { BulkIndexDocumentsParams } from 'elasticsearch'; +import { CatAliasesParams } from 'elasticsearch'; +import { CatAllocationParams } from 'elasticsearch'; +import { CatCommonParams } from 'elasticsearch'; +import { CatFielddataParams } from 'elasticsearch'; +import { CatHealthParams } from 'elasticsearch'; +import { CatHelpParams } from 'elasticsearch'; +import { CatIndicesParams } from 'elasticsearch'; +import { CatRecoveryParams } from 'elasticsearch'; +import { CatSegmentsParams } from 'elasticsearch'; +import { CatShardsParams } from 'elasticsearch'; +import { CatSnapshotsParams } from 'elasticsearch'; +import { CatTasksParams } from 'elasticsearch'; +import { CatThreadPoolParams } from 'elasticsearch'; +import { ClearScrollParams } from 'elasticsearch'; +import { Client } from 'elasticsearch'; +import { ClusterAllocationExplainParams } from 'elasticsearch'; +import { ClusterGetSettingsParams } from 'elasticsearch'; +import { ClusterHealthParams } from 'elasticsearch'; +import { ClusterPendingTasksParams } from 'elasticsearch'; +import { ClusterPutSettingsParams } from 'elasticsearch'; +import { ClusterRerouteParams } from 'elasticsearch'; +import { ClusterStateParams } from 'elasticsearch'; +import { ClusterStatsParams } from 'elasticsearch'; import { Component } from 'react'; import { CoreSetup } from 'src/core/public'; import { CoreStart } from 'kibana/public'; import { CoreStart as CoreStart_2 } from 'src/core/public'; +import { CountParams } from 'elasticsearch'; +import { CreateDocumentParams } from 'elasticsearch'; +import { DeleteDocumentByQueryParams } from 'elasticsearch'; +import { DeleteDocumentParams } from 'elasticsearch'; +import { DeleteScriptParams } from 'elasticsearch'; +import { DeleteTemplateParams } from 'elasticsearch'; import { Ensure } from '@kbn/utility-types'; +import { ErrorToastOptions } from 'src/core/public/notifications'; import { EuiButtonEmptyProps } from '@elastic/eui'; import { EuiComboBoxProps } from '@elastic/eui'; import { EuiConfirmModalProps } from '@elastic/eui'; import { EuiFieldText } from '@elastic/eui'; import { EuiGlobalToastListToast } from '@elastic/eui'; import { ExclusiveUnion } from '@elastic/eui'; +import { ExistsParams } from 'elasticsearch'; +import { ExplainParams } from 'elasticsearch'; import { ExpressionAstFunction } from 'src/plugins/expressions/public'; import { ExpressionsSetup } from 'src/plugins/expressions/public'; +import { FieldStatsParams } from 'elasticsearch'; +import { GenericParams } from 'elasticsearch'; +import { GetParams } from 'elasticsearch'; +import { GetResponse } from 'elasticsearch'; +import { GetScriptParams } from 'elasticsearch'; +import { GetSourceParams } from 'elasticsearch'; +import { GetTemplateParams } from 'elasticsearch'; import { History } from 'history'; +import { Href } from 'history'; import { HttpSetup } from 'src/core/public'; import { HttpStart } from 'src/core/public'; import { IconType } from '@elastic/eui'; +import { IndexDocumentParams } from 'elasticsearch'; +import { IndicesAnalyzeParams } from 'elasticsearch'; +import { IndicesClearCacheParams } from 'elasticsearch'; +import { IndicesCloseParams } from 'elasticsearch'; +import { IndicesCreateParams } from 'elasticsearch'; +import { IndicesDeleteAliasParams } from 'elasticsearch'; +import { IndicesDeleteParams } from 'elasticsearch'; +import { IndicesDeleteTemplateParams } from 'elasticsearch'; +import { IndicesExistsAliasParams } from 'elasticsearch'; +import { IndicesExistsParams } from 'elasticsearch'; +import { IndicesExistsTemplateParams } from 'elasticsearch'; +import { IndicesExistsTypeParams } from 'elasticsearch'; +import { IndicesFlushParams } from 'elasticsearch'; +import { IndicesFlushSyncedParams } from 'elasticsearch'; +import { IndicesForcemergeParams } from 'elasticsearch'; +import { IndicesGetAliasParams } from 'elasticsearch'; +import { IndicesGetFieldMappingParams } from 'elasticsearch'; +import { IndicesGetMappingParams } from 'elasticsearch'; +import { IndicesGetParams } from 'elasticsearch'; +import { IndicesGetSettingsParams } from 'elasticsearch'; +import { IndicesGetTemplateParams } from 'elasticsearch'; +import { IndicesGetUpgradeParams } from 'elasticsearch'; +import { IndicesOpenParams } from 'elasticsearch'; +import { IndicesPutAliasParams } from 'elasticsearch'; +import { IndicesPutMappingParams } from 'elasticsearch'; +import { IndicesPutSettingsParams } from 'elasticsearch'; +import { IndicesPutTemplateParams } from 'elasticsearch'; +import { IndicesRecoveryParams } from 'elasticsearch'; +import { IndicesRefreshParams } from 'elasticsearch'; +import { IndicesRolloverParams } from 'elasticsearch'; +import { IndicesSegmentsParams } from 'elasticsearch'; +import { IndicesShardStoresParams } from 'elasticsearch'; +import { IndicesShrinkParams } from 'elasticsearch'; +import { IndicesStatsParams } from 'elasticsearch'; +import { IndicesUpdateAliasesParams } from 'elasticsearch'; +import { IndicesUpgradeParams } from 'elasticsearch'; +import { IndicesValidateQueryParams } from 'elasticsearch'; +import { InfoParams } from 'elasticsearch'; +import { IngestDeletePipelineParams } from 'elasticsearch'; +import { IngestGetPipelineParams } from 'elasticsearch'; +import { IngestPutPipelineParams } from 'elasticsearch'; +import { IngestSimulateParams } from 'elasticsearch'; import { InjectedIntl } from '@kbn/i18n/react'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { IUiSettingsClient } from 'src/core/public'; import { IUiSettingsClient as IUiSettingsClient_3 } from 'kibana/public'; +import { KibanaConfigType } from 'src/core/server/kibana_config'; import { Location } from 'history'; import { LocationDescriptorObject } from 'history'; import { MaybePromise } from '@kbn/utility-types'; +import { MGetParams } from 'elasticsearch'; +import { MGetResponse } from 'elasticsearch'; import { Moment } from 'moment'; import moment from 'moment'; +import { MSearchParams } from 'elasticsearch'; +import { MSearchResponse } from 'elasticsearch'; +import { MSearchTemplateParams } from 'elasticsearch'; +import { MTermVectorsParams } from 'elasticsearch'; import { NameList } from 'elasticsearch'; +import { NodesHotThreadsParams } from 'elasticsearch'; +import { NodesInfoParams } from 'elasticsearch'; +import { NodesStatsParams } from 'elasticsearch'; import { Observable } from 'rxjs'; +import { Path } from 'history'; +import { PingParams } from 'elasticsearch'; import { Plugin as Plugin_2 } from 'src/core/public'; import { PluginInitializerContext as PluginInitializerContext_2 } from 'src/core/public'; import { PopoverAnchorPosition } from '@elastic/eui'; import { PublicUiSettingsParams } from 'src/core/server/types'; +import { PutScriptParams } from 'elasticsearch'; +import { PutTemplateParams } from 'elasticsearch'; import React from 'react'; import * as React_2 from 'react'; +import { ReindexParams } from 'elasticsearch'; +import { ReindexRethrottleParams } from 'elasticsearch'; +import { RenderSearchTemplateParams } from 'elasticsearch'; import { Required } from '@kbn/utility-types'; import * as Rx from 'rxjs'; import { SavedObject as SavedObject_2 } from 'src/core/public'; import { SavedObjectsClientContract } from 'src/core/public'; +import { ScrollParams } from 'elasticsearch'; import { SearchParams } from 'elasticsearch'; import { SearchResponse as SearchResponse_2 } from 'elasticsearch'; +import { SearchShardsParams } from 'elasticsearch'; +import { SearchTemplateParams } from 'elasticsearch'; import { SimpleSavedObject } from 'src/core/public'; +import { SnapshotCreateParams } from 'elasticsearch'; +import { SnapshotCreateRepositoryParams } from 'elasticsearch'; +import { SnapshotDeleteParams } from 'elasticsearch'; +import { SnapshotDeleteRepositoryParams } from 'elasticsearch'; +import { SnapshotGetParams } from 'elasticsearch'; +import { SnapshotGetRepositoryParams } from 'elasticsearch'; +import { SnapshotRestoreParams } from 'elasticsearch'; +import { SnapshotStatusParams } from 'elasticsearch'; +import { SnapshotVerifyRepositoryParams } from 'elasticsearch'; import { Subscription } from 'rxjs'; +import { SuggestParams } from 'elasticsearch'; +import { TasksCancelParams } from 'elasticsearch'; +import { TasksGetParams } from 'elasticsearch'; +import { TasksListParams } from 'elasticsearch'; +import { TermvectorsParams } from 'elasticsearch'; import { Toast } from 'kibana/public'; +import { ToastInputFields } from 'src/core/public/notifications'; import { ToastsStart } from 'kibana/public'; import { TypeOf } from '@kbn/config-schema'; import { UiActionsSetup } from 'src/plugins/ui_actions/public'; import { UiActionsStart } from 'src/plugins/ui_actions/public'; import { Unit } from '@elastic/datemath'; import { UnregisterCallback } from 'history'; +import { UpdateDocumentByQueryParams } from 'elasticsearch'; +import { UpdateDocumentParams } from 'elasticsearch'; import { UserProvidedValues } from 'src/core/server/types'; // Warning: (ae-forgotten-export) The symbol "AggConfigSerialized" needs to be exported by the entry point index.d.ts @@ -73,9 +194,9 @@ export type AggConfigOptions = Assign KBN_FIELD_TYPES; +export const castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES; +// Warning: (ae-forgotten-export) The symbol "QueryStart" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "QuerySetup" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "BaseStateContainer" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "connectToQueryState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public -export const connectToQueryState: ({ timefilter: { timefilter }, filterManager, state$, }: Pick<{ - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: QueryStateChange; - state: QueryState; - }>; - savedQueries: import("..").SavedQueryService; -} | { - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: QueryStateChange; - state: QueryState; - }>; -}, "state$" | "timefilter" | "filterManager">, stateContainer: BaseStateContainer, syncConfig: { - time?: boolean | undefined; - refreshInterval?: boolean | undefined; - filters?: boolean | FilterStateStore | undefined; +export const connectToQueryState: ({ timefilter: { timefilter }, filterManager, state$, }: Pick, stateContainer: BaseStateContainer, syncConfig: { + time?: boolean; + refreshInterval?: boolean; + filters?: FilterStateStore | boolean; }) => () => void; // Warning: (ae-missing-release-tag) "createSavedQueryService" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const createSavedQueryService: (savedObjectsClient: Pick) => SavedQueryService; +export const createSavedQueryService: (savedObjectsClient: SavedObjectsClientContract) => SavedQueryService; // Warning: (ae-missing-release-tag) "CustomFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -211,8 +319,6 @@ export interface DataPublicPluginSetup { // // (undocumented) fieldFormats: FieldFormatsSetup; - // Warning: (ae-forgotten-export) The symbol "QuerySetup" needs to be exported by the entry point index.d.ts - // // (undocumented) query: QuerySetup; // Warning: (ae-forgotten-export) The symbol "ISearchSetup" needs to be exported by the entry point index.d.ts @@ -240,8 +346,6 @@ export interface DataPublicPluginStart { fieldFormats: FieldFormatsStart; // (undocumented) indexPatterns: IndexPatternsContract; - // Warning: (ae-forgotten-export) The symbol "QueryStart" needs to be exported by the entry point index.d.ts - // // (undocumented) query: QueryStart; // Warning: (ae-forgotten-export) The symbol "ISearchStart" needs to be exported by the entry point index.d.ts @@ -421,12 +525,17 @@ export type ExistsFilter = Filter & { exists?: FilterExistsProperty; }; +// Warning: (ae-forgotten-export) The symbol "ShorthandFieldMapObject" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export const expandShorthand: (sh: Record) => MappingObject; + // Warning: (ae-forgotten-export) The symbol "SavedObjectReference" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "extractReferences" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export const extractSearchSourceReferences: (state: SearchSourceFields) => [SearchSourceFields & { - indexRefName?: string | undefined; + indexRefName?: string; }, SavedObjectReference[]]; // Warning: (ae-missing-release-tag) "FetchOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -547,6 +656,16 @@ export type FieldFormatsContentType = 'html' | 'text'; // @public (undocumented) export type FieldFormatsGetConfigFn = (key: string, defaultOverride?: T) => T; +// @public (undocumented) +export interface FieldMappingSpec { + // (undocumented) + _deserialize?: (mapping: string) => any | undefined; + // (undocumented) + _serialize?: (mapping: any) => string | undefined; + // (undocumented) + type: ES_FIELD_TYPES; +} + // Warning: (ae-missing-release-tag) "Filter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -624,7 +743,7 @@ export function getEsPreference(uiSettings: IUiSettingsClient_2, sessionId?: str // Warning: (ae-missing-release-tag) "getIndexPatternFieldListCreator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const getIndexPatternFieldListCreator: ({ fieldFormats, toastNotifications, }: FieldListDependencies) => CreateIndexPatternFieldList; +export const getIndexPatternFieldListCreator: ({ fieldFormats, onNotification, }: FieldListDependencies) => CreateIndexPatternFieldList; // Warning: (ae-missing-release-tag) "getKbnTypeNames" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -861,7 +980,10 @@ export type IMetricAggType = MetricAggType; export class IndexPattern implements IIndexPattern { // Warning: (ae-forgotten-export) The symbol "IIndexPatternsApiClient" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "PatternCache" needs to be exported by the entry point index.d.ts - constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache); + // Warning: (ae-forgotten-export) The symbol "FieldFormatsStartCommon" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "OnNotification" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "OnError" needs to be exported by the entry point index.d.ts + constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache, fieldFormats: FieldFormatsStartCommon, onNotification: OnNotification, onError: OnError); // (undocumented) [key: string]: any; // (undocumented) @@ -989,7 +1111,7 @@ export class IndexPatternField implements IFieldType { // (undocumented) $$spec: FieldSpec; // Warning: (ae-forgotten-export) The symbol "FieldDependencies" needs to be exported by the entry point index.d.ts - constructor(indexPattern: IndexPattern, spec: FieldSpec | IndexPatternField, shortDotsEnable: boolean, { fieldFormats, toastNotifications }: FieldDependencies); + constructor(indexPattern: IIndexPattern, spec: FieldSpec | IndexPatternField, shortDotsEnable: boolean, { fieldFormats, onNotification }: FieldDependencies); // (undocumented) aggregatable?: boolean; // (undocumented) @@ -1005,7 +1127,7 @@ export class IndexPatternField implements IFieldType { // (undocumented) format: any; // (undocumented) - indexPattern?: IndexPattern; + indexPattern?: IIndexPattern; // (undocumented) lang?: string; // (undocumented) @@ -1214,6 +1336,9 @@ export interface KueryNode { type: keyof NodeTypes; } +// @public (undocumented) +export type MappingObject = Record; + // Warning: (ae-missing-release-tag) "MatchAllFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1721,22 +1846,7 @@ export const SYNC_SEARCH_STRATEGY = "SYNC_SEARCH_STRATEGY"; // Warning: (ae-missing-release-tag) "syncQueryStateWithUrl" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public -export const syncQueryStateWithUrl: (query: Pick<{ - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: import("./types").QueryStateChange; - state: QueryState; - }>; - savedQueries: import("..").SavedQueryService; -} | { - filterManager: import("..").FilterManager; - timefilter: import("..").TimefilterSetup; - state$: import("rxjs").Observable<{ - changes: import("./types").QueryStateChange; - state: QueryState; - }>; -}, "state$" | "timefilter" | "filterManager">, kbnUrlStateStorage: IKbnUrlStateStorage) => { +export const syncQueryStateWithUrl: (query: Pick, kbnUrlStateStorage: IKbnUrlStateStorage) => { stop: () => void; hasInheritedQueryFromUrl: boolean; }; @@ -1883,8 +1993,7 @@ export const UI_SETTINGS: { // src/plugins/data/public/index.ts:398:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts // src/plugins/data/public/index.ts:399:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts // src/plugins/data/public/index.ts:402:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:33:33 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:37:1 - (ae-forgotten-export) The symbol "QueryStateChange" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:40:60 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts // src/plugins/data/public/types.ts:52:5 - (ae-forgotten-export) The symbol "createFiltersFromValueClickAction" needs to be exported by the entry point index.d.ts // src/plugins/data/public/types.ts:53:5 - (ae-forgotten-export) The symbol "createFiltersFromRangeSelectAction" needs to be exported by the entry point index.d.ts // src/plugins/data/public/types.ts:61:5 - (ae-forgotten-export) The symbol "IndexPatternSelectProps" needs to be exported by the entry point index.d.ts diff --git a/src/plugins/data/public/search/legacy/fetch_soon.ts b/src/plugins/data/public/search/legacy/fetch_soon.ts index fed2c52bc491f..252682c7c8e58 100644 --- a/src/plugins/data/public/search/legacy/fetch_soon.ts +++ b/src/plugins/data/public/search/legacy/fetch_soon.ts @@ -42,7 +42,7 @@ export async function fetchSoon( * @param ms The number of milliseconds to wait * @return Promise A promise that resolves with the result of executing the function */ -function delay(fn: Function, ms: number) { +function delay(fn: (...args: any) => T, ms: number): Promise { return new Promise((resolve) => { setTimeout(() => resolve(fn()), ms); }); @@ -75,7 +75,7 @@ async function delayedFetch( const i = requestsToFetch.length; requestsToFetch = [...requestsToFetch, request]; requestOptions = [...requestOptions, options]; - const responses = await (fetchInProgress = + const responses: SearchResponse[] = await (fetchInProgress = fetchInProgress || delay(() => { const response = callClient(requestsToFetch, requestOptions, fetchHandlers); diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx index 94138f60b52b1..8e8054ac204d9 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx @@ -83,4 +83,4 @@ export class PhraseSuggestorUI extends React.Com }, 500); } -export const PhraseSuggestor = withKibana(PhraseSuggestorUI); +export const PhraseSuggestor = withKibana(PhraseSuggestorUI as any); diff --git a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx index 6eb4f82a940b1..20e3fdae5ce5f 100644 --- a/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx @@ -24,7 +24,7 @@ import { Required } from '@kbn/utility-types'; import { EuiComboBox, EuiComboBoxProps } from '@elastic/eui'; import { SavedObjectsClientContract, SimpleSavedObject } from '../../../../../core/public'; -import { getTitle } from '../../index_patterns/lib'; +import { getTitle } from '../../../common/index_patterns/lib'; export type IndexPatternSelectProps = Required< // Omit, 'isLoading' | 'onSearchChange' | 'options' | 'selectedOptions' | 'append' | 'prepend' | 'sortMatchesBy'>, diff --git a/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts b/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts index 97a714f09474b..519c517259edb 100644 --- a/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts +++ b/src/plugins/data/server/kql_telemetry/usage_collector/make_kql_usage_collector.test.ts @@ -31,12 +31,12 @@ describe('makeKQLUsageCollector', () => { }); it('should call registerCollector', () => { - makeKQLUsageCollector(usageCollectionMock, '.kibana'); + makeKQLUsageCollector(usageCollectionMock as UsageCollectionSetup, '.kibana'); expect(usageCollectionMock.registerCollector).toHaveBeenCalledTimes(1); }); it('should call makeUsageCollector with type = kql', () => { - makeKQLUsageCollector(usageCollectionMock, '.kibana'); + makeKQLUsageCollector(usageCollectionMock as UsageCollectionSetup, '.kibana'); expect(usageCollectionMock.makeUsageCollector).toHaveBeenCalledTimes(1); expect(usageCollectionMock.makeUsageCollector.mock.calls[0][0].type).toBe('kql'); }); diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index ab8903f8c6790..2d4185415b9d5 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -150,7 +150,7 @@ import { Url } from 'url'; // Warning: (ae-missing-release-tag) "castEsToKbnFieldTypeName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public -export const castEsToKbnFieldTypeName: (esType: string) => KBN_FIELD_TYPES; +export const castEsToKbnFieldTypeName: (esType: ES_FIELD_TYPES | string) => KBN_FIELD_TYPES; // Warning: (ae-forgotten-export) The symbol "PluginConfigDescriptor" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ConfigSchema" needs to be exported by the entry point index.d.ts diff --git a/src/plugins/embeddable/public/lib/embeddables/with_subscription.tsx b/src/plugins/embeddable/public/lib/embeddables/with_subscription.tsx index 9bc5889715c76..fb846e5d43722 100644 --- a/src/plugins/embeddable/public/lib/embeddables/with_subscription.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/with_subscription.tsx @@ -68,12 +68,7 @@ export const withEmbeddableSubscription = < render() { return ( - + ); } }; diff --git a/src/plugins/data/public/index_patterns/fields/index.ts b/src/plugins/es_ui_shared/common/index.ts similarity index 89% rename from src/plugins/data/public/index_patterns/fields/index.ts rename to src/plugins/es_ui_shared/common/index.ts index 1644e23a163a6..c13dff5cf1fa1 100644 --- a/src/plugins/data/public/index_patterns/fields/index.ts +++ b/src/plugins/es_ui_shared/common/index.ts @@ -17,5 +17,4 @@ * under the License. */ -export * from './field_list'; -export * from './field'; +export { Privileges, MissingPrivileges } from '../__packages_do_not_import__/authorization'; diff --git a/src/plugins/es_ui_shared/public/authorization/index.ts b/src/plugins/es_ui_shared/public/authorization/index.ts index 3a02c0d2694f3..e18ab32ffdfa8 100644 --- a/src/plugins/es_ui_shared/public/authorization/index.ts +++ b/src/plugins/es_ui_shared/public/authorization/index.ts @@ -17,4 +17,14 @@ * under the License. */ -export * from '../../__packages_do_not_import__/authorization'; +export { + AuthorizationContext, + AuthorizationProvider, + Error, + MissingPrivileges, + NotAuthorizedSection, + Privileges, + SectionError, + useAuthorizationContext, + WithPrivileges, +} from '../../__packages_do_not_import__/authorization'; diff --git a/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx b/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx index c22394435be83..ed5e5f99d2fa0 100644 --- a/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx +++ b/src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx @@ -53,7 +53,6 @@ export const SelectField = ({ field, euiFieldProps, ...rest }: Props) => { onChange={(e) => { field.setValue(e.target.value); }} - options={[]} hasNoInitialSelection={true} isInvalid={isInvalid} data-test-subj="select" diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts index 9800af2398927..b83006c6cec52 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts @@ -320,7 +320,7 @@ export const useField = ( validationTypeToValidate: validationType, }); - if ((validationErrors as Promise).then) { + if (Reflect.has(validationErrors, 'then')) { return (validationErrors as Promise).then(onValidationErrors); } return onValidationErrors(validationErrors as ValidationError[]); diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/index.test.ts index 006b0854255ed..5658b38120596 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/index.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/index.test.ts @@ -17,10 +17,11 @@ * under the License. */ -import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/server'; import { savedObjectsRepositoryMock } from '../../../../../core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { CollectorOptions } from '../../../../../plugins/usage_collection/server/collector/collector'; +import { + CollectorOptions, + createUsageCollectionSetupMock, +} from '../../../../usage_collection/server/usage_collection.mock'; import { registerApplicationUsageCollector } from './'; import { @@ -34,10 +35,11 @@ describe('telemetry_application_usage', () => { let collector: CollectorOptions; - const usageCollectionMock: jest.Mocked = { - makeUsageCollector: jest.fn().mockImplementation((config) => (collector = config)), - registerCollector: jest.fn(), - } as any; + const usageCollectionMock = createUsageCollectionSetupMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = config; + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); const getUsageCollector = jest.fn(); const registerType = jest.fn(); diff --git a/src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts index ff0a537caf863..2bfe59d7dd4fc 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts @@ -17,20 +17,22 @@ * under the License. */ -import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/server'; import { pluginInitializerContextConfigMock } from '../../../../../core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { CollectorOptions } from '../../../../../plugins/usage_collection/server/collector/collector'; +import { + CollectorOptions, + createUsageCollectionSetupMock, +} from '../../../../usage_collection/server/usage_collection.mock'; import { registerKibanaUsageCollector } from './'; describe('telemetry_kibana', () => { let collector: CollectorOptions; - const usageCollectionMock: jest.Mocked = { - makeUsageCollector: jest.fn().mockImplementation((config) => (collector = config)), - registerCollector: jest.fn(), - } as any; + const usageCollectionMock = createUsageCollectionSetupMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = config; + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); const legacyConfig$ = pluginInitializerContextConfigMock({}).legacy.globalConfig$; const callCluster = jest.fn().mockImplementation(() => ({})); diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts index 2f6b564aacebb..d4b635448d0a3 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts @@ -17,20 +17,22 @@ * under the License. */ -import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { uiSettingsServiceMock } from '../../../../../core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { CollectorOptions } from '../../../../../plugins/usage_collection/server/collector/collector'; +import { + CollectorOptions, + createUsageCollectionSetupMock, +} from '../../../../usage_collection/server/usage_collection.mock'; import { registerManagementUsageCollector } from './'; describe('telemetry_application_usage_collector', () => { let collector: CollectorOptions; - const usageCollectionMock: jest.Mocked = { - makeUsageCollector: jest.fn().mockImplementation((config) => (collector = config)), - registerCollector: jest.fn(), - } as any; + const usageCollectionMock = createUsageCollectionSetupMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = config; + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); const uiSettingsClient = uiSettingsServiceMock.createClient(); const getUiSettingsClient = jest.fn(() => uiSettingsClient); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts index 82e3496f19134..359d3a396665d 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts @@ -18,9 +18,10 @@ */ import { Subject } from 'rxjs'; -import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/server'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { CollectorOptions } from '../../../../../plugins/usage_collection/server/collector/collector'; +import { + CollectorOptions, + createUsageCollectionSetupMock, +} from '../../../../usage_collection/server/usage_collection.mock'; import { registerOpsStatsCollector } from './'; import { OpsMetrics } from '../../../../../core/server'; @@ -28,10 +29,11 @@ import { OpsMetrics } from '../../../../../core/server'; describe('telemetry_ops_stats', () => { let collector: CollectorOptions; - const usageCollectionMock: jest.Mocked = { - makeStatsCollector: jest.fn().mockImplementation((config) => (collector = config)), - registerCollector: jest.fn(), - } as any; + const usageCollectionMock = createUsageCollectionSetupMock(); + usageCollectionMock.makeStatsCollector.mockImplementation((config) => { + collector = config; + return createUsageCollectionSetupMock().makeStatsCollector(config); + }); const metrics$ = new Subject(); const callCluster = jest.fn(); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts index 7b4ad08e44647..fca685ef4b805 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts @@ -17,20 +17,22 @@ * under the License. */ -import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/server'; import { savedObjectsRepositoryMock } from '../../../../../core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { CollectorOptions } from '../../../../../plugins/usage_collection/server/collector/collector'; +import { + CollectorOptions, + createUsageCollectionSetupMock, +} from '../../../../usage_collection/server/usage_collection.mock'; import { registerUiMetricUsageCollector } from './'; describe('telemetry_ui_metric', () => { let collector: CollectorOptions; - const usageCollectionMock: jest.Mocked = { - makeUsageCollector: jest.fn().mockImplementation((config) => (collector = config)), - registerCollector: jest.fn(), - } as any; + const usageCollectionMock = createUsageCollectionSetupMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = config; + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); const getUsageCollector = jest.fn(); const registerType = jest.fn(); diff --git a/src/plugins/kibana_usage_collection/server/index.test.ts b/src/plugins/kibana_usage_collection/server/index.test.ts index 4b24dd222a5e7..c2680fef01caa 100644 --- a/src/plugins/kibana_usage_collection/server/index.test.ts +++ b/src/plugins/kibana_usage_collection/server/index.test.ts @@ -23,25 +23,27 @@ import { savedObjectsRepositoryMock, uiSettingsServiceMock, } from '../../../core/server/mocks'; -import { UsageCollectionSetup } from '../../usage_collection/server'; +import { + CollectorOptions, + createUsageCollectionSetupMock, +} from '../../usage_collection/server/usage_collection.mock'; + import { plugin } from './'; describe('kibana_usage_collection', () => { const pluginInstance = plugin(coreMock.createPluginInitializerContext({})); - const usageCollectors: Array<{ isReady: () => boolean }> = []; + const usageCollectors: CollectorOptions[] = []; - const usageCollection: jest.Mocked = { - makeStatsCollector: jest.fn().mockImplementation((opts) => { - usageCollectors.push(opts); - return opts; - }), - makeUsageCollector: jest.fn().mockImplementation((opts) => { - usageCollectors.push(opts); - return opts; - }), - registerCollector: jest.fn(), - } as any; + const usageCollection = createUsageCollectionSetupMock(); + usageCollection.makeUsageCollector.mockImplementation((opts) => { + usageCollectors.push(opts); + return createUsageCollectionSetupMock().makeUsageCollector(opts); + }); + usageCollection.makeStatsCollector.mockImplementation((opts) => { + usageCollectors.push(opts); + return createUsageCollectionSetupMock().makeStatsCollector(opts); + }); test('Runs the setup method without issues', () => { const coreSetup = coreMock.createSetup(); diff --git a/src/plugins/kibana_utils/public/errors/errors.test.ts b/src/plugins/kibana_utils/common/errors/errors.test.ts similarity index 100% rename from src/plugins/kibana_utils/public/errors/errors.test.ts rename to src/plugins/kibana_utils/common/errors/errors.test.ts diff --git a/src/plugins/kibana_utils/public/errors/errors.ts b/src/plugins/kibana_utils/common/errors/errors.ts similarity index 100% rename from src/plugins/kibana_utils/public/errors/errors.ts rename to src/plugins/kibana_utils/common/errors/errors.ts diff --git a/src/plugins/kibana_utils/public/errors/index.ts b/src/plugins/kibana_utils/common/errors/index.ts similarity index 100% rename from src/plugins/kibana_utils/public/errors/index.ts rename to src/plugins/kibana_utils/common/errors/index.ts diff --git a/src/plugins/kibana_utils/common/index.ts b/src/plugins/kibana_utils/common/index.ts index 87b625ef9a64f..99daed98dbe64 100644 --- a/src/plugins/kibana_utils/common/index.ts +++ b/src/plugins/kibana_utils/common/index.ts @@ -22,6 +22,7 @@ export * from './of'; export * from './ui'; export * from './state_containers'; export * from './typed_json'; +export * from './errors'; export { createGetterSetter, Get, Set } from './create_getter_setter'; export { distinctUntilChangedWithInitialValue } from './distinct_until_changed_with_initial_value'; export { url } from './url'; diff --git a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx index cffb7ff4549a8..d8121b656deeb 100644 --- a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx +++ b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx @@ -24,7 +24,7 @@ import ReactDOM from 'react-dom'; import ReactMarkdown from 'react-markdown'; import { ApplicationStart, HttpStart, ToastsSetup } from 'kibana/public'; -import { SavedObjectNotFound } from '../errors'; +import { SavedObjectNotFound } from '..'; interface Mapping { [key: string]: string | { app: string; path: string }; diff --git a/src/plugins/kibana_utils/public/index.ts b/src/plugins/kibana_utils/public/index.ts index 3d8a4414de70c..6f61e2c228970 100644 --- a/src/plugins/kibana_utils/public/index.ts +++ b/src/plugins/kibana_utils/public/index.ts @@ -34,8 +34,7 @@ export { defaultFeedbackMessage, } from '../common'; export * from './core'; -export * from './errors'; -export * from './field_mapping'; +export * from '../common/errors'; export * from './field_wildcard'; export * from './parse'; export * from './render_complete'; diff --git a/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts b/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts index 9d0e25132271c..47390c7dc9104 100644 --- a/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts +++ b/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts @@ -18,11 +18,12 @@ */ import _ from 'lodash'; import { EsResponse, SavedObject, SavedObjectConfig, SavedObjectKibanaServices } from '../../types'; -import { expandShorthand, SavedObjectNotFound } from '../../../../kibana_utils/public'; +import { SavedObjectNotFound } from '../../../../kibana_utils/public'; import { IndexPattern, injectSearchSourceReferences, parseSearchSourceJSON, + expandShorthand, } from '../../../../data/public'; /** diff --git a/src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts b/src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts index 8895336aa9ffa..0313b7978c5ab 100644 --- a/src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts +++ b/src/plugins/saved_objects/public/saved_object/helpers/check_for_duplicate_title.ts @@ -31,10 +31,13 @@ import { displayDuplicateTitleConfirmModal } from './display_duplicate_title_con * @param services */ export async function checkForDuplicateTitle( - savedObject: SavedObject, + savedObject: Pick< + SavedObject, + 'id' | 'title' | 'getDisplayName' | 'lastSavedTitle' | 'copyOnSave' | 'getEsType' + >, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: (() => void) | undefined, - services: SavedObjectKibanaServices + services: Pick ): Promise { const { savedObjectsClient, overlays } = services; // Don't check for duplicates if user has already confirmed save with duplicate title diff --git a/src/plugins/saved_objects/public/saved_object/helpers/display_duplicate_title_confirm_modal.ts b/src/plugins/saved_objects/public/saved_object/helpers/display_duplicate_title_confirm_modal.ts index 0b02977830fda..1b9e6fb6e996f 100644 --- a/src/plugins/saved_objects/public/saved_object/helpers/display_duplicate_title_confirm_modal.ts +++ b/src/plugins/saved_objects/public/saved_object/helpers/display_duplicate_title_confirm_modal.ts @@ -23,7 +23,7 @@ import { confirmModalPromise } from './confirm_modal_promise'; import { SavedObject } from '../../types'; export function displayDuplicateTitleConfirmModal( - savedObject: SavedObject, + savedObject: Pick, overlays: OverlayStart ): Promise { const confirmMessage = i18n.translate( diff --git a/src/plugins/saved_objects/public/saved_object/helpers/serialize_saved_object.ts b/src/plugins/saved_objects/public/saved_object/helpers/serialize_saved_object.ts index acb371b8af9c2..24e467ad18ac4 100644 --- a/src/plugins/saved_objects/public/saved_object/helpers/serialize_saved_object.ts +++ b/src/plugins/saved_objects/public/saved_object/helpers/serialize_saved_object.ts @@ -18,8 +18,7 @@ */ import _ from 'lodash'; import { SavedObject, SavedObjectConfig } from '../../types'; -import { expandShorthand } from '../../../../kibana_utils/public'; -import { extractSearchSourceReferences } from '../../../../data/public'; +import { extractSearchSourceReferences, expandShorthand } from '../../../../data/public'; export function serializeSavedObject(savedObject: SavedObject, config: SavedObjectConfig) { // mapping definition for the fields that this object will expose diff --git a/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts b/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts index a17f1b8232a22..645c5a4be8a6c 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts @@ -28,8 +28,10 @@ export interface KibanaUsageStats { }; kibana_stats: { os: { - platform: string; - platformRelease: string; + // These should be provided + platform: string | undefined; + platformRelease: string | undefined; + // The ones below are really optional distro?: string; distroRelease?: string; }; diff --git a/src/plugins/telemetry/server/telemetry_repository/get_telemetry_saved_object.ts b/src/plugins/telemetry/server/telemetry_repository/get_telemetry_saved_object.ts index 1b3ea093fb3d8..cce02ec27e9b5 100644 --- a/src/plugins/telemetry/server/telemetry_repository/get_telemetry_saved_object.ts +++ b/src/plugins/telemetry/server/telemetry_repository/get_telemetry_saved_object.ts @@ -28,7 +28,7 @@ export const getTelemetrySavedObject: GetTelemetrySavedObject = async ( repository: SavedObjectsClientContract ) => { try { - const { attributes } = await repository.get('telemetry', 'telemetry'); + const { attributes } = await repository.get('telemetry', 'telemetry'); return attributes; } catch (error) { if (SavedObjectsErrorHelpers.isNotFoundError(error)) { diff --git a/src/plugins/usage_collection/server/collector/collector_set.ts b/src/plugins/usage_collection/server/collector/collector_set.ts index 66673bd7902a2..e8791138c5e26 100644 --- a/src/plugins/usage_collection/server/collector/collector_set.ts +++ b/src/plugins/usage_collection/server/collector/collector_set.ts @@ -71,7 +71,8 @@ export class CollectorSet { return x instanceof UsageCollector; }; - public areAllCollectorsReady = async (collectorSet = this) => { + public areAllCollectorsReady = async (collectorSet: CollectorSet = this) => { + // Kept this for runtime validation in JS code. if (!(collectorSet instanceof CollectorSet)) { throw new Error( `areAllCollectorsReady method given bad collectorSet parameter: ` + typeof collectorSet diff --git a/src/plugins/usage_collection/server/report/store_report.test.ts b/src/plugins/usage_collection/server/report/store_report.test.ts index 29b6d79cc139a..d8327eb834e12 100644 --- a/src/plugins/usage_collection/server/report/store_report.test.ts +++ b/src/plugins/usage_collection/server/report/store_report.test.ts @@ -20,7 +20,7 @@ import { savedObjectsRepositoryMock } from '../../../../core/server/mocks'; import { storeReport } from './store_report'; import { ReportSchemaType } from './schema'; -import { METRIC_TYPE } from '../../public'; +import { METRIC_TYPE } from '@kbn/analytics'; describe('store_report', () => { test('stores report for all types of data', async () => { diff --git a/src/plugins/usage_collection/server/usage_collection.mock.ts b/src/plugins/usage_collection/server/usage_collection.mock.ts new file mode 100644 index 0000000000000..7a6d16d6950ec --- /dev/null +++ b/src/plugins/usage_collection/server/usage_collection.mock.ts @@ -0,0 +1,47 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { CollectorOptions } from './collector/collector'; +import { UsageCollectionSetup } from './index'; + +export { CollectorOptions }; + +export const createUsageCollectionSetupMock = () => { + const usageCollectionSetupMock: jest.Mocked = { + areAllCollectorsReady: jest.fn(), + bulkFetch: jest.fn(), + bulkFetchUsage: jest.fn(), + getCollectorByType: jest.fn(), + getFilteredCollectorSet: jest.fn(), + // @ts-ignore jest.fn doesn't play nice with type guards + isUsageCollector: jest.fn(), + makeCollectorSetFromArray: jest.fn(), + makeStatsCollector: jest.fn(), + map: jest.fn(), + maximumWaitTimeForAllCollectorsInS: 0, + some: jest.fn(), + toApiFieldNames: jest.fn(), + toObject: jest.fn(), + makeUsageCollector: jest.fn(), + registerCollector: jest.fn(), + }; + + usageCollectionSetupMock.areAllCollectorsReady.mockResolvedValue(true); + return usageCollectionSetupMock; +}; diff --git a/src/plugins/vis_type_timelion/public/components/panel.tsx b/src/plugins/vis_type_timelion/public/components/panel.tsx index 99c5532c04832..f4f1cd84613be 100644 --- a/src/plugins/vis_type_timelion/public/components/panel.tsx +++ b/src/plugins/vis_type_timelion/public/components/panel.tsx @@ -38,6 +38,11 @@ import { tickFormatters } from '../helpers/tick_formatters'; import { generateTicksProvider } from '../helpers/tick_generator'; import { TimelionVisDependencies } from '../plugin'; +interface CrosshairPlot extends jquery.flot.plot { + setCrosshair: (pos: Position) => void; + clearCrosshair: () => void; +} + interface PanelProps { interval: string; seriesList: Sheet; @@ -70,26 +75,26 @@ const emptyCaption = '
'; function Panel({ interval, seriesList, renderComplete }: PanelProps) { const kibana = useKibana(); const [chart, setChart] = useState(() => cloneDeep(seriesList.list)); - const [canvasElem, setCanvasElem] = useState(); - const [chartElem, setChartElem] = useState(); + const [canvasElem, setCanvasElem] = useState(); + const [chartElem, setChartElem] = useState(); const [originalColorMap, setOriginalColorMap] = useState(() => new Map()); const [highlightedSeries, setHighlightedSeries] = useState(null); - const [focusedSeries, setFocusedSeries] = useState(); - const [plot, setPlot] = useState(); + const [focusedSeries, setFocusedSeries] = useState(); + const [plot, setPlot] = useState(); // Used to toggle the series, and for displaying values on hover - const [legendValueNumbers, setLegendValueNumbers] = useState(); - const [legendCaption, setLegendCaption] = useState(); + const [legendValueNumbers, setLegendValueNumbers] = useState>(); + const [legendCaption, setLegendCaption] = useState>(); - const canvasRef = useCallback((node) => { + const canvasRef = useCallback((node: HTMLDivElement | null) => { if (node !== null) { setCanvasElem(node); } }, []); - const elementRef = useCallback((node) => { + const elementRef = useCallback((node: HTMLDivElement | null) => { if (node !== null) { setChartElem(node); } @@ -97,7 +102,9 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { useEffect( () => () => { - $(chartElem).off('plotselected').off('plothover').off('mouseleave'); + if (chartElem) { + $(chartElem).off('plotselected').off('plothover').off('mouseleave'); + } }, [chartElem] ); @@ -149,7 +156,7 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { const updateCaption = useCallback( (plotData: any) => { - if (get(plotData, '[0]._global.legend.showTime', true)) { + if (canvasElem && get(plotData, '[0]._global.legend.showTime', true)) { const caption = $(''); caption.html(emptyCaption); setLegendCaption(caption); @@ -199,7 +206,7 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { }); } - const newPlot = $.plot(canvasElem, updatedSeries, options); + const newPlot = $.plot($(canvasElem), updatedSeries, options); setPlot(newPlot); renderComplete(); @@ -249,12 +256,12 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { (pos: Position) => { unhighlightSeries(); - const axes = plot.getAxes(); - if (pos.x < axes.xaxis.min || pos.x > axes.xaxis.max) { + const axes = plot!.getAxes(); + if (pos.x < axes.xaxis.min! || pos.x > axes.xaxis.max!) { return; } - const dataset = plot.getData(); + const dataset = plot!.getData(); if (legendCaption) { legendCaption.text( moment(pos.x).format(get(dataset, '[0]._global.legend.timeFormat', DEFAULT_TIME_FORMAT)) @@ -262,10 +269,11 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { } for (let i = 0; i < dataset.length; ++i) { const series = dataset[i]; - const useNearestPoint = series.lines.show && !series.lines.steps; + const useNearestPoint = series.lines!.show && !series.lines!.steps; const precision = get(series, '_meta.precision', 2); - if (series._hide) { + // We're setting this flag on top on the series object belonging to the flot library, so we're simply casting here. + if ((series as { _hide?: boolean })._hide) { continue; } @@ -282,14 +290,17 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { const y = currentPoint[1]; - if (y != null && legendValueNumbers) { - let label = y.toFixed(precision); - if (series.yaxis.tickFormatter) { - label = series.yaxis.tickFormatter(Number(label), series.yaxis); + if (legendValueNumbers) { + if (y == null) { + legendValueNumbers.eq(i).empty(); + } else { + let label = y.toFixed(precision); + const formatter = ((series.yaxis as unknown) as Axis).tickFormatter; + if (formatter) { + label = formatter(Number(label), (series.yaxis as unknown) as Axis); + } + legendValueNumbers.eq(i).text(`(${label})`); } - legendValueNumbers.eq(i).text(`(${label})`); - } else { - legendValueNumbers.eq(i).empty(); } } }, @@ -310,7 +321,7 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { if (legendCaption) { legendCaption.html(emptyCaption); } - each(legendValueNumbers, (num: Node) => { + each(legendValueNumbers!, (num: Node) => { $(num).empty(); }); }, [legendCaption, legendValueNumbers]); @@ -320,7 +331,7 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { if (!plot) { return; } - plot.setCrosshair(pos); + (plot as CrosshairPlot).setCrosshair(pos); debouncedSetLegendNumbers(pos); }, [plot, debouncedSetLegendNumbers] @@ -329,7 +340,7 @@ function Panel({ interval, seriesList, renderComplete }: PanelProps) { if (!plot) { return; } - plot.clearCrosshair(); + (plot as CrosshairPlot).clearCrosshair(); clearLegendNumbers(); }, [plot, clearLegendNumbers]); diff --git a/src/plugins/vis_type_timelion/server/series_functions/label.js b/src/plugins/vis_type_timelion/server/series_functions/label.js index 4d9a26c46aaaf..b5282967a62e0 100644 --- a/src/plugins/vis_type_timelion/server/series_functions/label.js +++ b/src/plugins/vis_type_timelion/server/series_functions/label.js @@ -51,7 +51,10 @@ export default new Chainable('label', { const config = args.byName; return alter(args, function (eachSeries) { if (config.regex) { - eachSeries.label = eachSeries.label.replace(new RegExp(config.regex), config.label); + // not using a standard `import` so that if there's an issue with the re2 native module + // that it doesn't prevent Kibana from starting up and we only have an issue using Timelion labels + const RE2 = require('re2'); + eachSeries.label = eachSeries.label.replace(new RE2(config.regex), config.label); } else { eachSeries.label = config.label; } diff --git a/src/plugins/vis_type_vega/public/_vega_vis.scss b/src/plugins/vis_type_vega/public/_vega_vis.scss index 159d0dff50ab4..4fc6fbc326ec1 100644 --- a/src/plugins/vis_type_vega/public/_vega_vis.scss +++ b/src/plugins/vis_type_vega/public/_vega_vis.scss @@ -14,7 +14,6 @@ max-height: 100%; width: 100%; height: 100%; - overflow: hidden; // BUG #23514: Make sure Vega doesn't display the controls in two places .vega-bindings { diff --git a/src/plugins/vis_type_vega/public/data_model/es_query_parser.js b/src/plugins/vis_type_vega/public/data_model/es_query_parser.js index 387301c2c7de9..f7772ff888a61 100644 --- a/src/plugins/vis_type_vega/public/data_model/es_query_parser.js +++ b/src/plugins/vis_type_vega/public/data_model/es_query_parser.js @@ -24,6 +24,7 @@ import { isPlainObject, cloneDeep } from 'lodash'; const TIMEFILTER = '%timefilter%'; const AUTOINTERVAL = '%autointerval%'; const MUST_CLAUSE = '%dashboard_context-must_clause%'; +const FILTER_CLAUSE = '%dashboard_context-filter_clause%'; const MUST_NOT_CLAUSE = '%dashboard_context-must_not_clause%'; // These values may appear in the 'url': { ... } object @@ -203,8 +204,22 @@ export class EsQueryParser { // For arrays, replace MUST_CLAUSE and MUST_NOT_CLAUSE string elements for (let pos = 0; pos < obj.length; ) { const item = obj[pos]; - if (isQuery && (item === MUST_CLAUSE || item === MUST_NOT_CLAUSE)) { - const ctxTag = item === MUST_CLAUSE ? 'must' : 'must_not'; + if ( + isQuery && + (item === FILTER_CLAUSE || item === MUST_CLAUSE || item === MUST_NOT_CLAUSE) + ) { + let ctxTag = ''; + switch (item) { + case FILTER_CLAUSE: + ctxTag = 'filter'; + break; + case MUST_CLAUSE: + ctxTag = 'must'; + break; + case MUST_NOT_CLAUSE: + ctxTag = 'must_not'; + break; + } const ctx = cloneDeep(this._filters); if (ctx && ctx.bool && ctx.bool[ctxTag]) { if (Array.isArray(ctx.bool[ctxTag])) { diff --git a/src/plugins/vis_type_vega/public/data_model/es_query_parser.test.js b/src/plugins/vis_type_vega/public/data_model/es_query_parser.test.js index fd474bef73b8c..b04e221fc354e 100644 --- a/src/plugins/vis_type_vega/public/data_model/es_query_parser.test.js +++ b/src/plugins/vis_type_vega/public/data_model/es_query_parser.test.js @@ -28,8 +28,12 @@ const day = 24 * hour; const rangeStart = 10 * day; const rangeEnd = 12 * day; -const ctxArr = { bool: { must: [{ match_all: { c: 3 } }], must_not: [{ d: 4 }] } }; -const ctxObj = { bool: { must: { match_all: { a: 1 } }, must_not: { b: 2 } } }; +const ctxArr = { + bool: { must: [{ match_all: { c: 3 } }], must_not: [{ d: 4 }], filter: [{ f: 6 }] }, +}; +const ctxObj = { + bool: { must: { match_all: { a: 1 } }, must_not: { b: 2 }, filter: { e: 6 } }, +}; function create(min, max, dashboardCtx) { const inst = new EsQueryParser( @@ -152,16 +156,34 @@ describe(`EsQueryParser.injectQueryContextVars`, () => { test( `mixed clause arr`, check( - { arr: [1, '%dashboard_context-must_clause%', 2, '%dashboard_context-must_not_clause%'] }, - { arr: [1, ...ctxArr.bool.must, 2, ...ctxArr.bool.must_not] }, + { + arr: [ + 1, + '%dashboard_context-must_clause%', + 2, + '%dashboard_context-must_not_clause%', + 3, + '%dashboard_context-filter_clause%', + ], + }, + { arr: [1, ...ctxArr.bool.must, 2, ...ctxArr.bool.must_not, 3, ...ctxArr.bool.filter] }, ctxArr ) ); test( `mixed clause obj`, check( - { arr: ['%dashboard_context-must_clause%', 1, '%dashboard_context-must_not_clause%', 2] }, - { arr: [ctxObj.bool.must, 1, ctxObj.bool.must_not, 2] }, + { + arr: [ + '%dashboard_context-must_clause%', + 1, + '%dashboard_context-must_not_clause%', + 2, + '%dashboard_context-filter_clause%', + 3, + ], + }, + { arr: [ctxObj.bool.must, 1, ctxObj.bool.must_not, 2, ctxObj.bool.filter, 3] }, ctxObj ) ); @@ -229,6 +251,7 @@ describe(`EsQueryParser.parseEsRequest`, () => { }, ], must_not: [{ d: 4 }], + filter: [{ f: 6 }], }, }, }, diff --git a/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts b/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts index bdc9038fc6a77..0345507334c65 100644 --- a/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts +++ b/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts @@ -16,9 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -import { SavedObjectAttributes, SavedObjectReference } from '../../../../core/public'; +import { + SavedObjectAttribute, + SavedObjectAttributes, + SavedObjectReference, +} from '../../../../core/public'; import { VisSavedObject } from '../types'; -import { injectSearchSourceReferences, extractSearchSourceReferences } from '../../../data/public'; +import { + extractSearchSourceReferences, + injectSearchSourceReferences, + SearchSourceFields, +} from '../../../data/public'; export function extractReferences({ attributes, @@ -32,9 +40,9 @@ export function extractReferences({ if (updatedAttributes.searchSourceFields) { const [searchSource, searchSourceReferences] = extractSearchSourceReferences( - updatedAttributes.searchSourceFields as any + updatedAttributes.searchSourceFields as SearchSourceFields ); - updatedAttributes.searchSourceFields = searchSource; + updatedAttributes.searchSourceFields = searchSource as SavedObjectAttribute; searchSourceReferences.forEach((r) => updatedReferences.push(r)); } diff --git a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts index 6f18cbc5026ec..73e3360004e5a 100644 --- a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts +++ b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts @@ -25,6 +25,7 @@ export interface VisualizationListItem { stage: 'experimental' | 'beta' | 'production'; savedObjectType: string; title: string; + description?: string; typeTitle: string; } diff --git a/test/common/services/security/test_user.ts b/test/common/services/security/test_user.ts index c0abf236e3412..104094f5b6fb5 100644 --- a/test/common/services/security/test_user.ts +++ b/test/common/services/security/test_user.ts @@ -31,9 +31,9 @@ export async function createTestUserService( const config = getService('config'); // @ts-ignore browser service is not normally available in common. const browser: Browser | void = hasService('browser') && getService('browser'); - const testSubjects: TestSubjects | void = - // @ts-ignore testSubject service is not normally available in common. - hasService('testSubjects') && getService('testSubjects'); + const testSubjects: TestSubjects | undefined = + // testSubject service is not normally available in common. + hasService('testSubjects') ? (getService('testSubjects' as any) as TestSubjects) : undefined; const kibanaServer = getService('kibanaServer'); const enabledPlugins = config.get('security.disableTestUser') diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index 24b38fae96653..535aecba26770 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_app_status/package.json b/test/plugin_functional/plugins/core_app_status/package.json index 0197b79487eea..1f3e4c0b577f2 100644 --- a/test/plugin_functional/plugins/core_app_status/package.json +++ b/test/plugin_functional/plugins/core_app_status/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_plugin_a/package.json b/test/plugin_functional/plugins/core_plugin_a/package.json index 060ae49f43e8a..fea4d4cd9ac65 100644 --- a/test/plugin_functional/plugins/core_plugin_a/package.json +++ b/test/plugin_functional/plugins/core_plugin_a/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_plugin_appleave/package.json b/test/plugin_functional/plugins/core_plugin_appleave/package.json index 98fa79b2bec47..c80b5659d0167 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/package.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_plugin_b/package.json b/test/plugin_functional/plugins/core_plugin_b/package.json index 3eb878b9ed5dc..370776a2e42bb 100644 --- a/test/plugin_functional/plugins/core_plugin_b/package.json +++ b/test/plugin_functional/plugins/core_plugin_b/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/package.json b/test/plugin_functional/plugins/core_plugin_chromeless/package.json index 0bd6409f99c91..e78f9249fb875 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/package.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_plugin_legacy/package.json b/test/plugin_functional/plugins/core_plugin_legacy/package.json index 5f784c7b836a5..41c311e8d7153 100644 --- a/test/plugin_functional/plugins/core_plugin_legacy/package.json +++ b/test/plugin_functional/plugins/core_plugin_legacy/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/package.json b/test/plugin_functional/plugins/core_plugin_static_assets/package.json index 304e1b11fde42..3de8f7845b1a7 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/package.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/core_provider_plugin/package.json b/test/plugin_functional/plugins/core_provider_plugin/package.json index 4356dd54bf490..061b897cd9eea 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/package.json +++ b/test/plugin_functional/plugins/core_provider_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/doc_views_plugin/package.json b/test/plugin_functional/plugins/doc_views_plugin/package.json index 0cef1bf65c0e8..6189ed2e024ab 100644 --- a/test/plugin_functional/plugins/doc_views_plugin/package.json +++ b/test/plugin_functional/plugins/doc_views_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json index 71a635c444b8c..612ae3806177c 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json @@ -16,6 +16,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/kbn_top_nav/package.json b/test/plugin_functional/plugins/kbn_top_nav/package.json index 510d681a4a75c..101593e7258e8 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/package.json +++ b/test/plugin_functional/plugins/kbn_top_nav/package.json @@ -12,7 +12,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index 78f0b42a6fbda..0a6b5fb185d30 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 6dbc9c71f2e81..34ac418a941ea 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/legacy_plugin/package.json b/test/plugin_functional/plugins/legacy_plugin/package.json index b04d8688b3d39..c8ec7ffac865b 100644 --- a/test/plugin_functional/plugins/legacy_plugin/package.json +++ b/test/plugin_functional/plugins/legacy_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/management_test_plugin/package.json b/test/plugin_functional/plugins/management_test_plugin/package.json index 656d92e9eb1f7..d4919970f06e7 100644 --- a/test/plugin_functional/plugins/management_test_plugin/package.json +++ b/test/plugin_functional/plugins/management_test_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/rendering_plugin/package.json b/test/plugin_functional/plugins/rendering_plugin/package.json index d0e69b3bb3462..5554669758aff 100644 --- a/test/plugin_functional/plugins/rendering_plugin/package.json +++ b/test/plugin_functional/plugins/rendering_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/test/plugin_functional/plugins/ui_settings_plugin/package.json b/test/plugin_functional/plugins/ui_settings_plugin/package.json index 778fa7a1fc77e..1c5abcf2a65c2 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/package.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/vars/kibanaPipeline.groovy b/vars/kibanaPipeline.groovy index f4c44a8ae2df4..ca9af5d2346cd 100644 --- a/vars/kibanaPipeline.groovy +++ b/vars/kibanaPipeline.groovy @@ -221,6 +221,8 @@ def call(Map params = [:], Closure closure) { timestamps { ansiColor('xterm') { if (config.checkPrChanges && githubPr.isPr()) { + pipelineLibraryTests() + print "Checking PR for changes to determine if CI needs to be run..." if (prChanges.areChangesSkippable()) { @@ -235,5 +237,15 @@ def call(Map params = [:], Closure closure) { } } +def pipelineLibraryTests() { + whenChanged(['vars/', '.ci/pipeline-library/']) { + workers.base(size: 'flyweight', bootstrapped: false, ramDisk: false) { + dir('.ci/pipeline-library') { + sh './gradlew test' + } + } + } +} + return this diff --git a/vars/prChanges.groovy b/vars/prChanges.groovy index 4b9b20a945f76..414e651177277 100644 --- a/vars/prChanges.groovy +++ b/vars/prChanges.groovy @@ -1,6 +1,6 @@ import groovy.transform.Field -public static @Field PR_CHANGES_CACHE = null +public static @Field PR_CHANGES_CACHE = [] def getSkippablePaths() { return [ @@ -8,6 +8,7 @@ def getSkippablePaths() { /^rfcs\//, /^.ci\/.+\.yml$/, /^.ci\/es-snapshots\//, + /^.ci\/pipeline-library\//, /^\.github\//, /\.md$/, ] @@ -42,7 +43,10 @@ def areChangesSkippable() { def getChanges() { if (!PR_CHANGES_CACHE && env.ghprbPullId) { withGithubCredentials { - PR_CHANGES_CACHE = githubPrs.getChanges(env.ghprbPullId) + def changes = githubPrs.getChanges(env.ghprbPullId) + if (changes) { + PR_CHANGES_CACHE.addAll(changes) + } } } diff --git a/vars/slackNotifications.groovy b/vars/slackNotifications.groovy index c50a99d3e335c..2ffb420ecf3f4 100644 --- a/vars/slackNotifications.groovy +++ b/vars/slackNotifications.groovy @@ -62,7 +62,17 @@ def getTestFailures() { def messages = [] messages << "*Test Failures*" - def list = failures.collect { "• <${it.url}|${it.fullDisplayName.split(/\./, 2)[-1]}>" }.join("\n") + def list = failures.collect { + def name = it + .fullDisplayName + .split(/\./, 2)[-1] + // Only the following three characters need to be escaped for link text, per Slack's docs + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + + return "• <${it.url}|${name}>" + }.join("\n") return "*Test Failures*\n${list}" } @@ -100,6 +110,7 @@ def sendFailedBuild(Map params = [:]) { ] + params def title = "${getStatusIcon()} ${config.title}" + def message = "${getStatusIcon()} ${config.message}" def blocks = [markdownBlock(title)] getFailedBuildBlocks().each { blocks << it } @@ -111,7 +122,7 @@ def sendFailedBuild(Map params = [:]) { username: config.username, iconEmoji: config.icon, color: config.color, - message: config.message, + message: message, blocks: blocks ) } diff --git a/vars/workers.groovy b/vars/workers.groovy index 387f62a625230..8034a548285a4 100644 --- a/vars/workers.groovy +++ b/vars/workers.groovy @@ -3,6 +3,8 @@ def label(size) { switch(size) { + case 'flyweight': + return 'flyweight' case 's': return 'linux && immutable' case 's-highmem': diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index 74553bbde0cd6..4bf03828bb461 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -9,7 +9,7 @@ export function createJestConfig({ kibanaDirectory, rootDir, xPackKibanaDirector return { rootDir, roots: ['/plugins', '/legacy/plugins', '/legacy/server'], - moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], + moduleFileExtensions: ['js', 'json', 'ts', 'tsx', 'node'], moduleNameMapper: { '@elastic/eui$': `${kibanaDirectory}/node_modules/@elastic/eui/test-env`, '@elastic/eui/lib/(.*)?': `${kibanaDirectory}/node_modules/@elastic/eui/test-env/$1`, diff --git a/x-pack/examples/ui_actions_enhanced_examples/package.json b/x-pack/examples/ui_actions_enhanced_examples/package.json index a9f004b075cec..4c8b2a716d98f 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/package.json +++ b/x-pack/examples/ui_actions_enhanced_examples/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" } } diff --git a/x-pack/legacy/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts b/x-pack/legacy/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts index f76cd46a60440..0600ed8e3fbf6 100644 --- a/x-pack/legacy/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts +++ b/x-pack/legacy/plugins/beats_management/server/lib/adapters/beats/elasticsearch_beats_adapter.ts @@ -11,6 +11,15 @@ import { DatabaseAdapter } from '../database/adapter_types'; import { FrameworkUser } from '../framework/adapter_types'; import { BeatsTagAssignment, CMBeatsAdapter } from './adapter_types'; +function formatWithTags(beat: CMBeat) { + const { tags, ...rest } = beat; + + return { + tags: tags || [], + ...rest, + }; +} + export class ElasticsearchBeatsAdapter implements CMBeatsAdapter { private database: DatabaseAdapter; @@ -97,10 +106,9 @@ export class ElasticsearchBeatsAdapter implements CMBeatsAdapter { if (beats.length === 0) { return []; } - return beats.map((beat: any) => ({ - tags: [] as string[], - ...(omit(beat._source.beat as CMBeat, ['access_token']) as CMBeat), - })); + return beats.map((beat: any) => + formatWithTags(omit(beat._source.beat as CMBeat, ['access_token']) as CMBeat) + ); } public async getBeatWithToken( @@ -124,7 +132,7 @@ export class ElasticsearchBeatsAdapter implements CMBeatsAdapter { if (beats.length === 0) { return null; } - return omit(_get({ tags: [], ...beats[0] }, '_source.beat'), [ + return omit(_get(formatWithTags(beats[0]), '_source.beat'), [ 'access_token', ]); } @@ -165,10 +173,9 @@ export class ElasticsearchBeatsAdapter implements CMBeatsAdapter { } const beats = _get(response, 'hits.hits', []); - return beats.map((beat: any) => ({ - tags: [] as string[], - ...(omit(beat._source.beat as CMBeat, ['access_token']) as CMBeat), - })); + return beats.map((beat: any) => + formatWithTags(omit(beat._source.beat as CMBeat, ['access_token']) as CMBeat) + ); } public async removeTagsFromBeats( diff --git a/x-pack/legacy/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts b/x-pack/legacy/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts index f60b5c8b4d0f6..2bc6f18756447 100644 --- a/x-pack/legacy/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts +++ b/x-pack/legacy/plugins/beats_management/server/lib/adapters/configuration_blocks/elasticsearch_configuration_block_adapter.ts @@ -137,12 +137,13 @@ export class ElasticsearchConfigurationBlockAdapter implements ConfigurationBloc public async create(user: FrameworkUser, configs: ConfigurationBlock[]): Promise { const body = flatten( configs.map((config) => { - const id = config.id || uuidv4(); + const { id: configId, ...configWithoutId } = config; + const id = configId || uuidv4(); return [ { index: { _id: `configuration_block:${id}` } }, { type: 'configuration_block', - configuration_block: { id, ...config, config: JSON.stringify(config.config) }, + configuration_block: { id, ...configWithoutId, config: JSON.stringify(config.config) }, }, ]; }) diff --git a/x-pack/package.json b/x-pack/package.json index fb708ab09d841..4f22c027c1a4c 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -36,6 +36,7 @@ "@kbn/es": "1.0.0", "@kbn/expect": "1.0.0", "@kbn/plugin-helpers": "9.0.2", + "@kbn/storybook": "1.0.0", "@kbn/test": "1.0.0", "@kbn/utility-types": "1.0.0", "@storybook/addon-actions": "^5.2.6", @@ -94,9 +95,9 @@ "@types/prop-types": "^15.5.3", "@types/proper-lockfile": "^3.0.1", "@types/puppeteer": "^1.20.1", - "@types/react": "^16.9.19", + "@types/react": "^16.9.36", "@types/react-beautiful-dnd": "^12.1.1", - "@types/react-dom": "^16.9.5", + "@types/react-dom": "^16.9.8", "@types/react-redux": "^7.1.7", "@types/react-router-dom": "^5.1.3", "@types/react-sticky": "^6.0.3", @@ -177,19 +178,19 @@ "tmp": "0.1.0", "tree-kill": "^1.2.2", "ts-loader": "^6.0.4", - "typescript": "3.7.2", + "typescript": "3.9.5", "vinyl-fs": "^3.0.3", "whatwg-fetch": "^3.0.0", "xml-crypto": "^1.4.0", "yargs": "4.8.1" }, "dependencies": { - "@babel/core": "^7.9.0", - "@babel/register": "^7.9.0", - "@babel/runtime": "^7.9.2", + "@babel/core": "^7.10.2", + "@babel/register": "^7.10.1", + "@babel/runtime": "^7.10.2", "@elastic/apm-rum-react": "^1.1.1", "@elastic/datemath": "5.0.3", - "@elastic/ems-client": "7.8.0", + "@elastic/ems-client": "7.9.3", "@elastic/eui": "24.1.0", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.3.0", @@ -199,7 +200,6 @@ "@kbn/config-schema": "1.0.0", "@kbn/i18n": "1.0.0", "@kbn/interpreter": "1.0.0", - "@kbn/storybook": "1.0.0", "@kbn/ui-framework": "1.0.0", "@mapbox/geojson-rewind": "^0.4.1", "@mapbox/mapbox-gl-draw": "^1.1.2", @@ -355,7 +355,7 @@ "tinycolor2": "1.4.1", "tinymath": "1.2.1", "topojson-client": "3.0.0", - "tslib": "^1.9.3", + "tslib": "^2.0.0", "turf": "3.0.14", "typescript-fsa": "^3.0.0", "typescript-fsa-reducers": "^1.2.1", @@ -380,4 +380,4 @@ "cypress-multi-reporters" ] } -} +} \ No newline at end of file diff --git a/x-pack/plugins/actions/server/plugin.test.ts b/x-pack/plugins/actions/server/plugin.test.ts index 9f485b1664c89..1602b26559bed 100644 --- a/x-pack/plugins/actions/server/plugin.test.ts +++ b/x-pack/plugins/actions/server/plugin.test.ts @@ -6,11 +6,11 @@ import { PluginInitializerContext, RequestHandlerContext } from '../../../../src/core/server'; import { coreMock, httpServerMock } from '../../../../src/core/server/mocks'; +import { usageCollectionPluginMock } from '../../../../src/plugins/usage_collection/server/mocks'; import { licensingMock } from '../../licensing/server/mocks'; import { encryptedSavedObjectsMock } from '../../encrypted_saved_objects/server/mocks'; import { taskManagerMock } from '../../task_manager/server/mocks'; import { eventLogMock } from '../../event_log/server/mocks'; -import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { ActionType } from './types'; import { ActionsConfig } from './config'; import { @@ -21,10 +21,6 @@ import { } from './plugin'; describe('Actions Plugin', () => { - const usageCollectionMock: jest.Mocked = ({ - makeUsageCollector: jest.fn(), - registerCollector: jest.fn(), - } as unknown) as jest.Mocked; describe('setup()', () => { let context: PluginInitializerContext; let plugin: ActionsPlugin; @@ -46,7 +42,7 @@ describe('Actions Plugin', () => { encryptedSavedObjects: encryptedSavedObjectsMock.createSetup(), licensing: licensingMock.createSetup(), eventLog: eventLogMock.createSetup(), - usageCollection: usageCollectionMock, + usageCollection: usageCollectionPluginMock.createSetupContract(), }; }); @@ -203,7 +199,7 @@ describe('Actions Plugin', () => { encryptedSavedObjects: encryptedSavedObjectsMock.createSetup(), licensing: licensingMock.createSetup(), eventLog: eventLogMock.createSetup(), - usageCollection: usageCollectionMock, + usageCollection: usageCollectionPluginMock.createSetupContract(), }; pluginsStart = { taskManager: taskManagerMock.createStart(), diff --git a/x-pack/plugins/actions/server/usage/actions_usage_collector.test.ts b/x-pack/plugins/actions/server/usage/actions_usage_collector.test.ts index 214690383ceba..2e2944aab425c 100644 --- a/x-pack/plugins/actions/server/usage/actions_usage_collector.test.ts +++ b/x-pack/plugins/actions/server/usage/actions_usage_collector.test.ts @@ -22,12 +22,18 @@ describe('registerActionsUsageCollector', () => { }); it('should call registerCollector', () => { - registerActionsUsageCollector(usageCollectionMock, mockTaskManagerStart); + registerActionsUsageCollector( + usageCollectionMock as UsageCollectionSetup, + mockTaskManagerStart + ); expect(usageCollectionMock.registerCollector).toHaveBeenCalledTimes(1); }); it('should call makeUsageCollector with type = actions', () => { - registerActionsUsageCollector(usageCollectionMock, mockTaskManagerStart); + registerActionsUsageCollector( + usageCollectionMock as UsageCollectionSetup, + mockTaskManagerStart + ); expect(usageCollectionMock.makeUsageCollector).toHaveBeenCalledTimes(1); expect(usageCollectionMock.makeUsageCollector.mock.calls[0][0].type).toBe('actions'); }); diff --git a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts index 50dafba00a7e4..a2d64c94ce007 100644 --- a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts +++ b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts @@ -11,7 +11,7 @@ import { taskManagerMock } from '../../task_manager/server/task_manager.mock'; import { KibanaRequest } from '../../../../src/core/server'; import { loggingServiceMock, savedObjectsClientMock } from '../../../../src/core/server/mocks'; import { encryptedSavedObjectsMock } from '../../encrypted_saved_objects/server/mocks'; -import { AuthenticatedUser } from '../../security/public'; +import { AuthenticatedUser } from '../../../plugins/security/common/model'; import { securityMock } from '../../security/server/mocks'; import { actionsMock } from '../../actions/server/mocks'; diff --git a/x-pack/plugins/alerts/server/usage/alerts_usage_collector.test.ts b/x-pack/plugins/alerts/server/usage/alerts_usage_collector.test.ts index e530c7afeebdc..b48d173ba36d9 100644 --- a/x-pack/plugins/alerts/server/usage/alerts_usage_collector.test.ts +++ b/x-pack/plugins/alerts/server/usage/alerts_usage_collector.test.ts @@ -22,12 +22,12 @@ describe('registerAlertsUsageCollector', () => { }); it('should call registerCollector', () => { - registerAlertsUsageCollector(usageCollectionMock, taskManagerStart); + registerAlertsUsageCollector(usageCollectionMock as UsageCollectionSetup, taskManagerStart); expect(usageCollectionMock.registerCollector).toHaveBeenCalledTimes(1); }); it('should call makeUsageCollector with type = alerts', () => { - registerAlertsUsageCollector(usageCollectionMock, taskManagerStart); + registerAlertsUsageCollector(usageCollectionMock as UsageCollectionSetup, taskManagerStart); expect(usageCollectionMock.makeUsageCollector).toHaveBeenCalledTimes(1); expect(usageCollectionMock.makeUsageCollector.mock.calls[0][0].type).toBe('alerts'); }); diff --git a/x-pack/plugins/apm/e2e/package.json b/x-pack/plugins/apm/e2e/package.json index 1fa96b24d625d..417dda4c5220e 100644 --- a/x-pack/plugins/apm/e2e/package.json +++ b/x-pack/plugins/apm/e2e/package.json @@ -19,7 +19,7 @@ "p-limit": "^2.3.0", "p-retry": "^4.2.0", "ts-loader": "^7.0.4", - "typescript": "3.9.2", + "typescript": "3.9.5", "wait-on": "^5.0.0", "webpack": "^4.43.0", "yargs": "^15.3.1" diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.stories.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.stories.tsx deleted file mode 100644 index 30031a05304bb..0000000000000 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.stories.tsx +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { EuiCard, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { storiesOf } from '@storybook/react'; -import cytoscape from 'cytoscape'; -import React from 'react'; -import { Cytoscape } from './Cytoscape'; -import serviceMapResponse from './cytoscape-layout-test-response.json'; -import { iconForNode } from './icons'; - -const elementsFromResponses = serviceMapResponse.elements; - -storiesOf('app/ServiceMap/Cytoscape', module).add( - 'example', - () => { - const elements: cytoscape.ElementDefinition[] = [ - { - data: { - id: 'opbeans-python', - 'service.name': 'opbeans-python', - 'agent.name': 'python', - }, - }, - { - data: { - id: 'opbeans-node', - 'service.name': 'opbeans-node', - 'agent.name': 'nodejs', - }, - }, - { - data: { - id: 'opbeans-ruby', - 'service.name': 'opbeans-ruby', - 'agent.name': 'ruby', - }, - }, - { data: { source: 'opbeans-python', target: 'opbeans-node' } }, - { - data: { - bidirectional: true, - source: 'opbeans-python', - target: 'opbeans-ruby', - }, - }, - ]; - const height = 300; - const width = 1340; - const serviceName = 'opbeans-python'; - return ( - - ); - }, - { - info: { - propTables: false, - source: false, - }, - } -); - -storiesOf('app/ServiceMap/Cytoscape', module) - .add( - 'node icons', - () => { - const cy = cytoscape(); - const elements = [ - { data: { id: 'default' } }, - { - data: { - id: 'aws', - 'span.type': 'aws', - 'span.subtype': 'servicename', - }, - }, - { data: { id: 'cache', 'span.type': 'cache' } }, - { data: { id: 'database', 'span.type': 'db' } }, - { - data: { - id: 'cassandra', - 'span.type': 'db', - 'span.subtype': 'cassandra', - }, - }, - { - data: { - id: 'elasticsearch', - 'span.type': 'db', - 'span.subtype': 'elasticsearch', - }, - }, - { - data: { - id: 'mongodb', - 'span.type': 'db', - 'span.subtype': 'mongodb', - }, - }, - { - data: { - id: 'mysql', - 'span.type': 'db', - 'span.subtype': 'mysql', - }, - }, - { - data: { - id: 'postgresql', - 'span.type': 'db', - 'span.subtype': 'postgresql', - }, - }, - { - data: { - id: 'redis', - 'span.type': 'db', - 'span.subtype': 'redis', - }, - }, - { data: { id: 'external', 'span.type': 'external' } }, - { data: { id: 'ext', 'span.type': 'ext' } }, - { - data: { - id: 'graphql', - 'span.type': 'external', - 'span.subtype': 'graphql', - }, - }, - { - data: { - id: 'grpc', - 'span.type': 'external', - 'span.subtype': 'grpc', - }, - }, - { - data: { - id: 'websocket', - 'span.type': 'external', - 'span.subtype': 'websocket', - }, - }, - { data: { id: 'messaging', 'span.type': 'messaging' } }, - { - data: { - id: 'jms', - 'span.type': 'messaging', - 'span.subtype': 'jms', - }, - }, - { - data: { - id: 'kafka', - 'span.type': 'messaging', - 'span.subtype': 'kafka', - }, - }, - { data: { id: 'template', 'span.type': 'template' } }, - { - data: { - id: 'handlebars', - 'span.type': 'template', - 'span.subtype': 'handlebars', - }, - }, - { - data: { - id: 'dark', - 'service.name': 'dark service', - 'agent.name': 'dark', - }, - }, - { - data: { - id: 'dotnet', - 'service.name': 'dotnet service', - 'agent.name': 'dotnet', - }, - }, - { - data: { - id: 'dotNet', - 'service.name': 'dotNet service', - 'agent.name': 'dotNet', - }, - }, - { - data: { - id: 'go', - 'service.name': 'go service', - 'agent.name': 'go', - }, - }, - { - data: { - id: 'java', - 'service.name': 'java service', - 'agent.name': 'java', - }, - }, - { - data: { - id: 'RUM (js-base)', - 'service.name': 'RUM service', - 'agent.name': 'js-base', - }, - }, - { - data: { - id: 'RUM (rum-js)', - 'service.name': 'RUM service', - 'agent.name': 'rum-js', - }, - }, - { - data: { - id: 'nodejs', - 'service.name': 'nodejs service', - 'agent.name': 'nodejs', - }, - }, - { - data: { - id: 'php', - 'service.name': 'php service', - 'agent.name': 'php', - }, - }, - { - data: { - id: 'python', - 'service.name': 'python service', - 'agent.name': 'python', - }, - }, - { - data: { - id: 'ruby', - 'service.name': 'ruby service', - 'agent.name': 'ruby', - }, - }, - ]; - cy.add(elements); - - return ( - - {cy.nodes().map((node) => ( - - - agent.name: {node.data('agent.name') || 'undefined'} -
- span.type: {node.data('span.type') || 'undefined'} -
- span.subtype: {node.data('span.subtype') || 'undefined'} - - } - icon={ - {node.data('label')} - } - title={node.data('id')} - /> -
- ))} -
- ); - }, - { - info: { - propTables: false, - source: false, - }, - } - ) - .add( - 'layout', - () => { - const height = 640; - const width = 1340; - const serviceName = undefined; // global service map - - return ( - - ); - }, - { - info: { - source: false, - }, - } - ) - .addParameters({ options: { showPanel: false } }); - -storiesOf('app/ServiceMap/Cytoscape', module).add( - 'node severity', - () => { - const elements = [ - { data: { id: 'undefined', 'service.name': 'severity: undefined' } }, - { - data: { - id: 'warning', - 'service.name': 'severity: warning', - severity: 'warning', - }, - }, - { - data: { - id: 'minor', - 'service.name': 'severity: minor', - severity: 'minor', - }, - }, - { - data: { - id: 'major', - 'service.name': 'severity: major', - severity: 'major', - }, - }, - { - data: { - id: 'critical', - 'service.name': 'severity: critical', - severity: 'critical', - }, - }, - ]; - return ; - }, - { - info: { propTables: false, source: false }, - } -); diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx index c57d702b9a546..c2764d3adfa7c 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx @@ -77,6 +77,7 @@ function getLayoutOptions( ): cytoscape.LayoutOptions { return { name: 'breadthfirst', + // @ts-ignore DefinitelyTyped is incorrect here. Roots can be an Array roots: selectedRoots.length ? selectedRoots : undefined, fit: true, padding: nodeHeight, diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/Cytoscape.stories.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/Cytoscape.stories.tsx new file mode 100644 index 0000000000000..28cb7a6f9d291 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/Cytoscape.stories.tsx @@ -0,0 +1,327 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { EuiCard, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { storiesOf } from '@storybook/react'; +import cytoscape from 'cytoscape'; +import React from 'react'; +import { Cytoscape } from '../Cytoscape'; +import { iconForNode } from '../icons'; + +storiesOf('app/ServiceMap/Cytoscape', module).add( + 'example', + () => { + const elements: cytoscape.ElementDefinition[] = [ + { + data: { + id: 'opbeans-python', + 'service.name': 'opbeans-python', + 'agent.name': 'python', + }, + }, + { + data: { + id: 'opbeans-node', + 'service.name': 'opbeans-node', + 'agent.name': 'nodejs', + }, + }, + { + data: { + id: 'opbeans-ruby', + 'service.name': 'opbeans-ruby', + 'agent.name': 'ruby', + }, + }, + { data: { source: 'opbeans-python', target: 'opbeans-node' } }, + { + data: { + bidirectional: true, + source: 'opbeans-python', + target: 'opbeans-ruby', + }, + }, + ]; + const height = 300; + const width = 1340; + const serviceName = 'opbeans-python'; + return ( + + ); + }, + { + info: { + propTables: false, + source: false, + }, + } +); + +storiesOf('app/ServiceMap/Cytoscape', module).add( + 'node icons', + () => { + const cy = cytoscape(); + const elements = [ + { data: { id: 'default' } }, + { + data: { + id: 'aws', + 'span.type': 'aws', + 'span.subtype': 'servicename', + }, + }, + { data: { id: 'cache', 'span.type': 'cache' } }, + { data: { id: 'database', 'span.type': 'db' } }, + { + data: { + id: 'cassandra', + 'span.type': 'db', + 'span.subtype': 'cassandra', + }, + }, + { + data: { + id: 'elasticsearch', + 'span.type': 'db', + 'span.subtype': 'elasticsearch', + }, + }, + { + data: { + id: 'mongodb', + 'span.type': 'db', + 'span.subtype': 'mongodb', + }, + }, + { + data: { + id: 'mysql', + 'span.type': 'db', + 'span.subtype': 'mysql', + }, + }, + { + data: { + id: 'postgresql', + 'span.type': 'db', + 'span.subtype': 'postgresql', + }, + }, + { + data: { + id: 'redis', + 'span.type': 'db', + 'span.subtype': 'redis', + }, + }, + { data: { id: 'external', 'span.type': 'external' } }, + { data: { id: 'ext', 'span.type': 'ext' } }, + { + data: { + id: 'graphql', + 'span.type': 'external', + 'span.subtype': 'graphql', + }, + }, + { + data: { + id: 'grpc', + 'span.type': 'external', + 'span.subtype': 'grpc', + }, + }, + { + data: { + id: 'websocket', + 'span.type': 'external', + 'span.subtype': 'websocket', + }, + }, + { data: { id: 'messaging', 'span.type': 'messaging' } }, + { + data: { + id: 'jms', + 'span.type': 'messaging', + 'span.subtype': 'jms', + }, + }, + { + data: { + id: 'kafka', + 'span.type': 'messaging', + 'span.subtype': 'kafka', + }, + }, + { data: { id: 'template', 'span.type': 'template' } }, + { + data: { + id: 'handlebars', + 'span.type': 'template', + 'span.subtype': 'handlebars', + }, + }, + { + data: { + id: 'dark', + 'service.name': 'dark service', + 'agent.name': 'dark', + }, + }, + { + data: { + id: 'dotnet', + 'service.name': 'dotnet service', + 'agent.name': 'dotnet', + }, + }, + { + data: { + id: 'dotNet', + 'service.name': 'dotNet service', + 'agent.name': 'dotNet', + }, + }, + { + data: { + id: 'go', + 'service.name': 'go service', + 'agent.name': 'go', + }, + }, + { + data: { + id: 'java', + 'service.name': 'java service', + 'agent.name': 'java', + }, + }, + { + data: { + id: 'RUM (js-base)', + 'service.name': 'RUM service', + 'agent.name': 'js-base', + }, + }, + { + data: { + id: 'RUM (rum-js)', + 'service.name': 'RUM service', + 'agent.name': 'rum-js', + }, + }, + { + data: { + id: 'nodejs', + 'service.name': 'nodejs service', + 'agent.name': 'nodejs', + }, + }, + { + data: { + id: 'php', + 'service.name': 'php service', + 'agent.name': 'php', + }, + }, + { + data: { + id: 'python', + 'service.name': 'python service', + 'agent.name': 'python', + }, + }, + { + data: { + id: 'ruby', + 'service.name': 'ruby service', + 'agent.name': 'ruby', + }, + }, + ]; + cy.add(elements); + + return ( + + {cy.nodes().map((node) => ( + + + agent.name: {node.data('agent.name') || 'undefined'} +
+ span.type: {node.data('span.type') || 'undefined'} +
+ span.subtype: {node.data('span.subtype') || 'undefined'} + + } + icon={ + {node.data('label')} + } + title={node.data('id')} + /> +
+ ))} +
+ ); + }, + { + info: { + propTables: false, + source: false, + }, + } +); + +storiesOf('app/ServiceMap/Cytoscape', module).add( + 'node severity', + () => { + const elements = [ + { data: { id: 'undefined', 'service.name': 'severity: undefined' } }, + { + data: { + id: 'warning', + 'service.name': 'severity: warning', + severity: 'warning', + }, + }, + { + data: { + id: 'minor', + 'service.name': 'severity: minor', + severity: 'minor', + }, + }, + { + data: { + id: 'major', + 'service.name': 'severity: major', + severity: 'major', + }, + }, + { + data: { + id: 'critical', + 'service.name': 'severity: critical', + severity: 'critical', + }, + }, + ]; + return ; + }, + { + info: { propTables: false, source: false }, + } +); diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/CytoscapeExampleData.stories.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/CytoscapeExampleData.stories.tsx new file mode 100644 index 0000000000000..33b3fab28f9ac --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/CytoscapeExampleData.stories.tsx @@ -0,0 +1,198 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +/* eslint-disable no-console */ + +import { + EuiFlexGroup, + EuiFlexItem, + EuiButton, + EuiFieldNumber, + EuiToolTip, + EuiCodeEditor, +} from '@elastic/eui'; +import { storiesOf } from '@storybook/react'; +import React, { useState, useEffect } from 'react'; +import { Cytoscape } from '../Cytoscape'; +import { generateServiceMapElements } from './generate_service_map_elements'; +import exampleResponseOpbeansBeats from './example_response_opbeans_beats.json'; +import exampleResponseHipsterStore from './example_response_hipster_store.json'; +import exampleResponseTodo from './example_response_todo.json'; + +const STORYBOOK_PATH = 'app/ServiceMap/Cytoscape/Example data'; + +const SESSION_STORAGE_KEY = `${STORYBOOK_PATH}/pre-loaded map`; +function getSessionJson() { + return window.sessionStorage.getItem(SESSION_STORAGE_KEY); +} +function setSessionJson(json: string) { + window.sessionStorage.setItem(SESSION_STORAGE_KEY, json); +} + +storiesOf(STORYBOOK_PATH, module).add( + 'Generate map', + () => { + const [size, setSize] = useState(10); + const [json, setJson] = useState(''); + const [elements, setElements] = useState( + generateServiceMapElements(size) + ); + + return ( +
+ + + { + setElements(generateServiceMapElements(size)); + setJson(''); + }} + > + Generate service map + + + + + setSize(e.target.valueAsNumber)} + /> + + + + { + setJson(JSON.stringify({ elements }, null, 2)); + }} + > + Get JSON + + + + + + + {json && ( + + )} +
+ ); + }, + { + info: { propTables: false, source: false }, + } +); + +storiesOf(STORYBOOK_PATH, module).add( + 'Map from JSON', + () => { + const [json, setJson] = useState( + getSessionJson() || JSON.stringify(exampleResponseTodo, null, 2) + ); + const [elements, setElements] = useState([]); + useEffect(() => { + try { + setElements(JSON.parse(json).elements); + } catch (error) { + console.log(error); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ( +
+ + + + + { + setElements(JSON.parse(json).elements); + setSessionJson(json); + }} + > + Render JSON + + + + { + setJson(value); + }} + /> +
+ ); + }, + { + info: { propTables: false, source: false }, + } +); + +storiesOf(STORYBOOK_PATH, module).add( + 'Todo app', + () => { + return ( +
+ +
+ ); + }, + { + info: { propTables: false, source: false }, + } +); + +storiesOf(STORYBOOK_PATH, module).add( + 'Opbeans + beats', + () => { + return ( +
+ +
+ ); + }, + { + info: { propTables: false, source: false }, + } +); + +storiesOf(STORYBOOK_PATH, module).add( + 'Hipster store', + () => { + return ( +
+ +
+ ); + }, + { + info: { propTables: false, source: false }, + } +); diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_hipster_store.json b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_hipster_store.json new file mode 100644 index 0000000000000..4a31d9d24548c --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_hipster_store.json @@ -0,0 +1,355 @@ +{ + "elements": [ + { + "data": { + "source": "advertService", + "target": ">elasticsearch", + "id": "advertService~>elasticsearch", + "sourceData": { + "id": "advertService", + "service.name": "advertService", + "agent.name": "java" + }, + "targetData": { + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.type": "db", + "id": ">elasticsearch", + "label": "elasticsearch" + } + } + }, + { + "data": { + "source": "checkoutService", + "target": "cartService", + "id": "checkoutService~cartService", + "sourceData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + }, + "targetData": { + "id": "cartService", + "service.name": "cartService", + "agent.name": "dotnet" + } + } + }, + { + "data": { + "source": "checkoutService", + "target": "currencyService", + "id": "checkoutService~currencyService", + "sourceData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + }, + "targetData": { + "id": "currencyService", + "service.name": "currencyService", + "agent.name": "nodejs" + } + } + }, + { + "data": { + "source": "checkoutService", + "target": "emailService", + "id": "checkoutService~emailService", + "sourceData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + }, + "targetData": { + "id": "emailService", + "service.name": "emailService", + "agent.name": "python" + } + } + }, + { + "data": { + "source": "checkoutService", + "target": "paymentService", + "id": "checkoutService~paymentService", + "sourceData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + }, + "targetData": { + "id": "paymentService", + "service.name": "paymentService", + "agent.name": "nodejs" + } + } + }, + { + "data": { + "source": "checkoutService", + "target": "productCatalogService", + "id": "checkoutService~productCatalogService", + "sourceData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + }, + "targetData": { + "id": "productCatalogService", + "service.name": "productCatalogService", + "agent.name": "go", + "service.framework.name": "grpc" + } + } + }, + { + "data": { + "source": "checkoutService", + "target": "shippingService", + "id": "checkoutService~shippingService", + "sourceData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + }, + "targetData": { + "id": "shippingService", + "service.name": "shippingService", + "agent.name": "go", + "service.framework.name": "grpc" + } + } + }, + { + "data": { + "source": "frontend", + "target": "advertService", + "id": "frontend~advertService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "advertService", + "service.name": "advertService", + "agent.name": "java" + } + } + }, + { + "data": { + "source": "frontend", + "target": "cartService", + "id": "frontend~cartService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "cartService", + "service.name": "cartService", + "agent.name": "dotnet" + } + } + }, + { + "data": { + "source": "frontend", + "target": "checkoutService", + "id": "frontend~checkoutService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + } + } + }, + { + "data": { + "source": "frontend", + "target": "currencyService", + "id": "frontend~currencyService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "currencyService", + "service.name": "currencyService", + "agent.name": "nodejs" + } + } + }, + { + "data": { + "source": "frontend", + "target": "productCatalogService", + "id": "frontend~productCatalogService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "productCatalogService", + "service.name": "productCatalogService", + "agent.name": "go", + "service.framework.name": "grpc" + } + } + }, + { + "data": { + "source": "frontend", + "target": "recommendationService", + "id": "frontend~recommendationService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "recommendationService", + "service.name": "recommendationService", + "agent.name": "python" + } + } + }, + { + "data": { + "source": "frontend", + "target": "shippingService", + "id": "frontend~shippingService", + "sourceData": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + }, + "targetData": { + "id": "shippingService", + "service.name": "shippingService", + "agent.name": "go", + "service.framework.name": "grpc" + } + } + }, + { + "data": { + "source": "recommendationService", + "target": "productCatalogService", + "id": "recommendationService~productCatalogService", + "sourceData": { + "id": "recommendationService", + "service.name": "recommendationService", + "agent.name": "python" + }, + "targetData": { + "id": "productCatalogService", + "service.name": "productCatalogService", + "agent.name": "go", + "service.framework.name": "grpc" + } + } + }, + { + "data": { + "id": "frontend", + "service.name": "frontend", + "agent.name": "go" + } + }, + { + "data": { + "id": "checkoutService", + "service.name": "checkoutService", + "agent.name": "go", + "service.framework.name": "grpc" + } + }, + { + "data": { + "id": "cartService", + "service.name": "cartService", + "agent.name": "dotnet" + } + }, + { + "data": { + "id": "currencyService", + "service.name": "currencyService", + "agent.name": "nodejs" + } + }, + { + "data": { + "id": "productCatalogService", + "service.name": "productCatalogService", + "agent.name": "go", + "service.framework.name": "grpc" + } + }, + { + "data": { + "id": "advertService", + "service.name": "advertService", + "agent.name": "java" + } + }, + { + "data": { + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.type": "db", + "id": ">elasticsearch", + "label": "elasticsearch" + } + }, + { + "data": { + "id": "paymentService", + "service.name": "paymentService", + "agent.name": "nodejs" + } + }, + { + "data": { + "id": "shippingService", + "service.name": "shippingService", + "agent.name": "go", + "service.framework.name": "grpc" + } + }, + { + "data": { + "id": "emailService", + "service.name": "emailService", + "agent.name": "python" + } + }, + { + "data": { + "id": "recommendationService", + "service.name": "recommendationService", + "agent.name": "python" + } + } + ] +} diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape-layout-test-response.json b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json similarity index 57% rename from x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape-layout-test-response.json rename to x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json index e55ba65bcbcb9..153fa57bb05e7 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape-layout-test-response.json +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_opbeans_beats.json @@ -2,12 +2,12 @@ "elements": [ { "data": { - "source": "apm-server", + "source": "auditbeat", "target": ">elasticsearch", - "id": "apm-server~>elasticsearch", + "id": "auditbeat~>elasticsearch", "sourceData": { - "id": "apm-server", - "service.name": "apm-server", + "id": "auditbeat", + "service.name": "auditbeat", "agent.name": "go" }, "targetData": { @@ -21,67 +21,78 @@ }, { "data": { - "source": "client", - "target": "opbeans-node", - "id": "client~opbeans-node", + "source": "filebeat", + "target": ">elasticsearch", + "id": "filebeat~>elasticsearch", "sourceData": { - "id": "client", - "service.name": "client", - "agent.name": "rum-js" + "id": "filebeat", + "service.name": "filebeat", + "agent.name": "go" }, "targetData": { - "id": "opbeans-node", - "service.environment": "production", - "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.type": "db", + "id": ">elasticsearch", + "label": "elasticsearch" } } }, { "data": { - "source": "opbeans-go", - "target": ">postgresql", - "id": "opbeans-go~>postgresql", + "source": "heartbeat", + "target": ">elasticsearch", + "id": "heartbeat~>elasticsearch", "sourceData": { - "id": "opbeans-go", - "service.environment": "production", - "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "id": "heartbeat", + "service.name": "heartbeat", + "agent.name": "go" }, "targetData": { - "span.subtype": "postgresql", - "span.destination.service.resource": "postgresql", + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", "span.type": "db", - "id": ">postgresql", - "label": "postgresql" + "id": ">elasticsearch", + "label": "elasticsearch" + } + } + }, + { + "data": { + "source": "metricbeat", + "target": ">elasticsearch", + "id": "metricbeat~>elasticsearch", + "sourceData": { + "id": "metricbeat", + "service.name": "metricbeat", + "agent.name": "go" + }, + "targetData": { + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.type": "db", + "id": ">elasticsearch", + "label": "elasticsearch" } } }, { "data": { "source": "opbeans-go", - "target": "opbeans-dotnet", - "id": "opbeans-go~opbeans-dotnet", + "target": ">postgresql", + "id": "opbeans-go~>postgresql", "sourceData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" - }, - "targetData": { - "id": "opbeans-dotnet", - "service.name": "opbeans-dotnet", - "agent.name": "dotnet", - "service.framework.name": "ASP.NET Core", - "max_score": 43.63972429875661, - "severity": "minor" + "agent.name": "go" + }, + "targetData": { + "span.subtype": "postgresql", + "span.destination.service.resource": "postgresql", + "span.type": "db", + "id": ">postgresql", + "label": "postgresql" } } }, @@ -92,20 +103,15 @@ "id": "opbeans-go~opbeans-java", "sourceData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "agent.name": "go" }, "targetData": { "id": "opbeans-java", "service.environment": "production", "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "agent.name": "java" }, "bidirectional": true } @@ -117,45 +123,15 @@ "id": "opbeans-go~opbeans-node", "sourceData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "agent.name": "go" }, "targetData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" - }, - "bidirectional": true - } - }, - { - "data": { - "source": "opbeans-go", - "target": "opbeans-python", - "id": "opbeans-go~opbeans-python", - "sourceData": { - "id": "opbeans-go", - "service.environment": "production", - "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" - }, - "targetData": { - "id": "opbeans-python", - "service.environment": "production", - "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "nodejs" }, "bidirectional": true } @@ -167,19 +143,15 @@ "id": "opbeans-go~opbeans-ruby", "sourceData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "agent.name": "go" }, "targetData": { "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "bidirectional": true } @@ -193,9 +165,7 @@ "id": "opbeans-java", "service.environment": "production", "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "agent.name": "java" }, "targetData": { "span.subtype": "postgresql", @@ -206,29 +176,6 @@ } } }, - { - "data": { - "source": "opbeans-java", - "target": "opbeans-dotnet", - "id": "opbeans-java~opbeans-dotnet", - "sourceData": { - "id": "opbeans-java", - "service.environment": "production", - "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" - }, - "targetData": { - "id": "opbeans-dotnet", - "service.name": "opbeans-dotnet", - "agent.name": "dotnet", - "service.framework.name": "ASP.NET Core", - "max_score": 43.63972429875661, - "severity": "minor" - } - } - }, { "data": { "source": "opbeans-java", @@ -238,18 +185,13 @@ "id": "opbeans-java", "service.environment": "production", "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "agent.name": "java" }, "targetData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "agent.name": "go" }, "isInverseEdge": true } @@ -263,111 +205,92 @@ "id": "opbeans-java", "service.environment": "production", "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "agent.name": "java" }, "targetData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" - }, - "bidirectional": true + "agent.name": "nodejs" + } } }, { "data": { "source": "opbeans-java", - "target": "opbeans-python", - "id": "opbeans-java~opbeans-python", + "target": "opbeans-ruby", + "id": "opbeans-java~opbeans-ruby", "sourceData": { "id": "opbeans-java", "service.environment": "production", "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "agent.name": "java" }, "targetData": { - "id": "opbeans-python", + "id": "opbeans-ruby", "service.environment": "production", - "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "service.name": "opbeans-ruby", + "agent.name": "ruby" }, "bidirectional": true } }, { "data": { - "source": "opbeans-java", - "target": "opbeans-ruby", - "id": "opbeans-java~opbeans-ruby", + "source": "opbeans-node", + "target": ">postgresql", + "id": "opbeans-node~>postgresql", "sourceData": { - "id": "opbeans-java", - "service.environment": "production", - "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + "agent.name": "nodejs" }, "targetData": { - "id": "opbeans-ruby", - "service.environment": "production", - "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" - }, - "bidirectional": true + "span.subtype": "postgresql", + "span.destination.service.resource": "postgresql", + "span.type": "db", + "id": ">postgresql", + "label": "postgresql" + } } }, { "data": { "source": "opbeans-node", - "target": "opbeans-go", - "id": "opbeans-node~opbeans-go", + "target": ">redis", + "id": "opbeans-node~>redis", "sourceData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "agent.name": "nodejs" }, "targetData": { - "id": "opbeans-go", - "service.environment": "production", - "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" - }, - "isInverseEdge": true + "span.subtype": "redis", + "span.destination.service.resource": "redis", + "span.type": "cache", + "id": ">redis", + "label": "redis" + } } }, { "data": { "source": "opbeans-node", - "target": "opbeans-java", - "id": "opbeans-node~opbeans-java", + "target": "opbeans-go", + "id": "opbeans-node~opbeans-go", "sourceData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "agent.name": "nodejs" }, "targetData": { - "id": "opbeans-java", - "service.environment": "production", - "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + "agent.name": "go" }, "isInverseEdge": true } @@ -379,19 +302,15 @@ "id": "opbeans-node~opbeans-python", "sourceData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "agent.name": "nodejs" }, "targetData": { "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "bidirectional": true } @@ -403,17 +322,15 @@ "id": "opbeans-node~opbeans-ruby", "sourceData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "agent.name": "nodejs" }, "targetData": { "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "bidirectional": true } @@ -427,10 +344,7 @@ "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "targetData": { "span.subtype": "elasticsearch", @@ -450,10 +364,7 @@ "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "targetData": { "span.subtype": "postgresql", @@ -473,44 +384,17 @@ "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "targetData": { "span.subtype": "redis", "span.destination.service.resource": "redis", - "span.type": "db", + "span.type": "cache", "id": ">redis", "label": "redis" } } }, - { - "data": { - "source": "opbeans-python", - "target": "opbeans-dotnet", - "id": "opbeans-python~opbeans-dotnet", - "sourceData": { - "id": "opbeans-python", - "service.environment": "production", - "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" - }, - "targetData": { - "id": "opbeans-dotnet", - "service.name": "opbeans-dotnet", - "agent.name": "dotnet", - "service.framework.name": "ASP.NET Core", - "max_score": 43.63972429875661, - "severity": "minor" - } - } - }, { "data": { "source": "opbeans-python", @@ -520,46 +404,14 @@ "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "targetData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" - }, - "isInverseEdge": true - } - }, - { - "data": { - "source": "opbeans-python", - "target": "opbeans-java", - "id": "opbeans-python~opbeans-java", - "sourceData": { - "id": "opbeans-python", - "service.environment": "production", - "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" - }, - "targetData": { - "id": "opbeans-java", - "service.environment": "production", - "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" - }, - "isInverseEdge": true + "agent.name": "go" + } } }, { @@ -571,17 +423,13 @@ "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "targetData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "agent.name": "nodejs" }, "isInverseEdge": true } @@ -595,17 +443,13 @@ "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "targetData": { "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "bidirectional": true } @@ -619,8 +463,7 @@ "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "targetData": { "span.subtype": "postgresql", @@ -631,28 +474,6 @@ } } }, - { - "data": { - "source": "opbeans-ruby", - "target": "opbeans-dotnet", - "id": "opbeans-ruby~opbeans-dotnet", - "sourceData": { - "id": "opbeans-ruby", - "service.environment": "production", - "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" - }, - "targetData": { - "id": "opbeans-dotnet", - "service.name": "opbeans-dotnet", - "agent.name": "dotnet", - "service.framework.name": "ASP.NET Core", - "max_score": 43.63972429875661, - "severity": "minor" - } - } - }, { "data": { "source": "opbeans-ruby", @@ -662,17 +483,13 @@ "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "targetData": { "id": "opbeans-go", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "agent.name": "go" }, "isInverseEdge": true } @@ -686,16 +503,13 @@ "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "targetData": { "id": "opbeans-java", "service.environment": "production", "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "agent.name": "java" }, "isInverseEdge": true } @@ -709,15 +523,13 @@ "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "targetData": { "id": "opbeans-node", - "service.environment": "production", + "service.environment": "testing", "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "agent.name": "nodejs" }, "isInverseEdge": true } @@ -731,29 +543,118 @@ "id": "opbeans-ruby", "service.environment": "production", "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "agent.name": "ruby" }, "targetData": { "id": "opbeans-python", "service.environment": "production", "service.name": "opbeans-python", - "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "agent.name": "python" }, "isInverseEdge": true } }, { "data": { - "id": "opbeans-java", + "source": "opbeans-rum", + "target": "opbeans-go", + "id": "opbeans-rum~opbeans-go", + "sourceData": { + "id": "opbeans-rum", + "service.name": "opbeans-rum", + "agent.name": "rum-js" + }, + "targetData": { + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + "agent.name": "go" + } + } + }, + { + "data": { + "source": "opbeans-rum", + "target": "opbeans-java", + "id": "opbeans-rum~opbeans-java", + "sourceData": { + "id": "opbeans-rum", + "service.name": "opbeans-rum", + "agent.name": "rum-js" + }, + "targetData": { + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "agent.name": "java" + } + } + }, + { + "data": { + "source": "opbeans-rum", + "target": "opbeans-node", + "id": "opbeans-rum~opbeans-node", + "sourceData": { + "id": "opbeans-rum", + "service.name": "opbeans-rum", + "agent.name": "rum-js" + }, + "targetData": { + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + "agent.name": "nodejs" + } + } + }, + { + "data": { + "source": "opbeans-rum", + "target": "opbeans-python", + "id": "opbeans-rum~opbeans-python", + "sourceData": { + "id": "opbeans-rum", + "service.name": "opbeans-rum", + "agent.name": "rum-js" + }, + "targetData": { + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "agent.name": "python" + } + } + }, + { + "data": { + "source": "opbeans-rum", + "target": "opbeans-ruby", + "id": "opbeans-rum~opbeans-ruby", + "sourceData": { + "id": "opbeans-rum", + "service.name": "opbeans-rum", + "agent.name": "rum-js" + }, + "targetData": { + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "agent.name": "ruby" + } + } + }, + { + "data": { + "id": "opbeans-ruby", "service.environment": "production", - "service.name": "opbeans-java", - "agent.name": "java", - "max_score": 31.374423806075157, - "severity": "minor" + "service.name": "opbeans-ruby", + "agent.name": "ruby", + "anomaly_score": 0.9451165434428855, + "anomaly_severity": "warning", + "actual_value": 600594.456140351, + "typical_value": 98407.17630621382, + "ml_job_id": "opbeans-ruby-request-high_mean_response_time" } }, { @@ -762,45 +663,53 @@ "service.environment": "production", "service.name": "opbeans-python", "agent.name": "python", - "service.framework.name": "django", - "max_score": 92.48735, - "severity": "critical" + "anomaly_score": 92.10488496975145, + "anomaly_severity": "critical", + "actual_value": 1596444.9295154181, + "typical_value": 1555919.4721130468, + "ml_job_id": "opbeans-python-celery-high_mean_response_time" } }, { "data": { - "span.subtype": "postgresql", - "span.destination.service.resource": "postgresql", - "span.type": "db", - "id": ">postgresql", - "label": "postgresql" + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + "agent.name": "nodejs", + "anomaly_score": 41.31593099784474, + "anomaly_severity": "minor", + "actual_value": 1187598.8214285707, + "typical_value": 1010742.0877798817, + "ml_job_id": "opbeans-node-worker-high_mean_response_time" } }, { "data": { - "id": "opbeans-ruby", + "id": "opbeans-java", "service.environment": "production", - "service.name": "opbeans-ruby", - "agent.name": "ruby", - "service.framework.name": "Ruby on Rails" + "service.name": "opbeans-java", + "agent.name": "java", + "anomaly_score": 0.36530918260427264, + "anomaly_severity": "warning", + "actual_value": 2151205.742857142, + "typical_value": 55528.3821951346, + "ml_job_id": "opbeans-java-request-high_mean_response_time" } }, { "data": { - "id": "opbeans-go", - "service.environment": "production", - "service.name": "opbeans-go", - "agent.name": "go", - "service.framework.name": "gin", - "max_score": 92.40731, - "severity": "critical" + "span.subtype": "postgresql", + "span.destination.service.resource": "postgresql", + "span.type": "db", + "id": ">postgresql", + "label": "postgresql" } }, { "data": { - "id": "apm-server", - "service.name": "apm-server", - "agent.name": "go" + "id": "opbeans-rum", + "service.name": "opbeans-rum", + "agent.name": "rum-js" } }, { @@ -814,37 +723,60 @@ }, { "data": { - "id": "opbeans-node", - "service.environment": "production", - "service.name": "opbeans-node", - "agent.name": "nodejs", - "service.framework.name": "express" + "span.subtype": "redis", + "span.destination.service.resource": "redis", + "span.type": "cache", + "id": ">redis", + "label": "redis" } }, { "data": { - "id": "opbeans-dotnet", - "service.name": "opbeans-dotnet", - "agent.name": "dotnet", - "service.framework.name": "ASP.NET Core", - "max_score": 43.63972429875661, - "severity": "minor" + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + "agent.name": "go", + "anomaly_score": 0.2633884161762746, + "anomaly_severity": "warning", + "actual_value": 9247010.450000009, + "typical_value": 94426.04179433428, + "ml_job_id": "opbeans-go-request-high_mean_response_time" } }, { "data": { - "span.subtype": "redis", - "span.destination.service.resource": "redis", - "span.type": "db", - "id": ">redis", - "label": "redis" + "id": "heartbeat", + "service.name": "heartbeat", + "agent.name": "go" } }, { "data": { - "id": "client", - "service.name": "client", - "agent.name": "rum-js" + "id": "filebeat", + "service.name": "filebeat", + "agent.name": "go" + } + }, + { + "data": { + "id": "metricbeat", + "service.name": "metricbeat", + "agent.name": "go" + } + }, + { + "data": { + "id": "auditbeat", + "service.name": "auditbeat", + "agent.name": "go" + } + }, + { + "data": { + "service.name": "opbeans-dotnet", + "agent.name": "dotNet", + "service.environment": null, + "id": "opbeans-dotnet" } } ] diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_todo.json b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_todo.json new file mode 100644 index 0000000000000..c848cd92dd366 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/example_response_todo.json @@ -0,0 +1,63 @@ +{ + "elements": [ + { + "data": { + "source": "todo-app", + "target": "task-service", + "id": "todo-app~task-service", + "sourceData": { + "id": "todo-app", + "service.name": "todo-app", + "agent.name": "rum-js" + }, + "targetData": { + "id": "task-service", + "service.name": "task-service", + "agent.name": "nodejs" + } + } + }, + { + "data": { + "source": "task-service", + "target": ">elasticsearch", + "id": "task-service~>elasticsearch", + "sourceData": { + "id": "task-service", + "service.name": "task-service", + "agent.name": "nodejs" + }, + "targetData": { + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.type": "db", + "id": ">elasticsearch", + "label": "elasticsearch" + } + } + }, + { + "data": { + "id": "todo-app", + "service.name": "todo-app", + "agent.name": "rum-js" + } + }, + { + "data": { + "id": "task-service", + "service.name": "task-service", + "agent.name": "nodejs" + } + }, + { + "data": { + "span.subtype": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.type": "db", + "id": ">elasticsearch", + "label": "elasticsearch" + } + } + ] +} diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/generate_service_map_elements.ts b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/generate_service_map_elements.ts new file mode 100644 index 0000000000000..e7d55cd570710 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/__stories__/generate_service_map_elements.ts @@ -0,0 +1,222 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { getSeverity } from '../../../../../common/ml_job_constants'; + +export function generateServiceMapElements(size: number): any[] { + const services = range(size).map((i) => { + const name = getName(); + const anomalyScore = randn(101); + return { + id: name, + 'service.environment': 'production', + 'service.name': name, + 'agent.name': getAgentName(), + anomaly_score: anomalyScore, + anomaly_severity: getSeverity(anomalyScore), + actual_value: Math.random() * 2000000, + typical_value: Math.random() * 1000000, + ml_job_id: `${name}-request-high_mean_response_time`, + }; + }); + + const connections = range(Math.round(size * 1.5)) + .map((i) => { + const sourceNode = services[randn(size)]; + const targetNode = services[randn(size)]; + return { + id: `${sourceNode.id}~${targetNode.id}`, + source: sourceNode.id, + target: targetNode.id, + ...(probability(0.3) + ? { + bidirectional: true, + } + : null), + }; + }) + .filter(({ source, target }) => source !== target); + + return [ + ...services.map((serviceData) => ({ data: serviceData })), + ...connections.map((connectionData) => ({ data: connectionData })), + ]; +} + +function range(n: number) { + return Array(n) + .fill(0) + .map((e, i) => i); +} + +function randn(n: number) { + return Math.floor(Math.random() * n); +} + +function probability(p: number) { + return Math.random() < p; +} + +function getAgentName() { + return AGENT_NAMES[Math.floor(Math.random() * AGENT_NAMES.length)]; +} + +function getName() { + return NAMES[Math.floor(Math.random() * NAMES.length)]; +} + +const AGENT_NAMES = [ + 'dotnet', + 'go', + 'java', + 'rum-js', + 'nodejs', + 'php', + 'python', + 'ruby', +]; + +const NAMES = [ + 'abomination', + 'anaconda', + 'apocalypse', + 'arcade', + 'angel', + 'asp', + 'beast', + 'beetle', + 'bishop', + 'black-knight', + 'black-mamba', + 'black-widow', + 'blade', + 'blob', + 'boomerang', + 'bullseye', + 'black-panther', + 'cable', + 'cannonball', + 'carnage', + 'callisto', + 'colossus', + 'crimson-dynamo', + 'cyclops', + 'cypher', + 'daredevil', + 'dazzler', + 'deadpool', + 'deathbringer', + 'death', + 'deathlok', + 'deathstrike', + 'destiny', + 'detonator', + 'diablo', + 'doctor-doom', + 'doctor-octopus', + 'doctor-strange', + 'domino', + 'dragonhart,', + 'electro', + 'elektra', + 'falcon', + 'forge', + 'fury', + 'gambit', + 'gladiator', + 'green', + 'grizzly', + 'hammerhead', + 'havok', + 'hawk-owl', + 'hawkeye', + 'hobgoblin', + 'hulk', + 'human-torch', + 'hurricane', + 'iceman', + 'iron-man', + 'invisible-woman', + 'juggernaut', + 'kingpin', + 'ka-zar', + 'leech', + 'loki', + 'longshot', + 'lumpkin,', + 'madame-web', + 'magician', + 'magneto', + 'man-thing', + 'mastermind', + 'mister-fantastic', + 'mister-sinister', + 'mister-nix', + 'modok', + 'mojo', + 'mole-man', + 'morbius', + 'morlocks', + 'moondragon', + 'moon', + 'madrox', + 'mystique', + 'namor', + 'nightmare', + 'nightcrawler', + 'nighthawk', + 'nihil', + 'northstar', + 'omega-red', + 'orb-weaver', + 'ox', + 'polaris', + 'power-man', + 'princess-python', + 'proteus', + 'punisher', + 'pyro', + 'quicksilver', + 'rhino', + 'rogue', + 'ronin', + 'sabretooth', + 'sandman', + 'scorpion', + 'sentinel', + 'shadowcat', + 'shocker', + 'silvermane', + 'silver-surfer', + 'spider-man', + 'spider-woman', + 'spiral', + 'storm', + 'stryfe', + 'sub-zero', + 'sunder', + 'super-skrull', + 'swarm', + 'tarantula', + 'thanos', + 'thor', + 'tinkerer', + 'toad', + 'unus', + 'valkyrie', + 'vanisher', + 'venom', + 'vision', + 'vulture', + 'wasp', + 'whiz-kid', + 'wildpack', + 'wolfsbane', + 'wolverine', + 'wraith', + 'yellowjacket', + 'zero', +]; diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscapeOptions.ts b/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscapeOptions.ts index 9b35b0b33a70d..5107d36df85d8 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscapeOptions.ts +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscapeOptions.ts @@ -183,11 +183,10 @@ const style: cytoscape.Stylesheet[] = [ : parseInt(theme.paddingSizes.xs, 10), }, }, - // @ts-ignore DefinitelyTyped says visibility is "none" but it's - // actually "hidden" { selector: 'edge[isInverseEdge]', - // @ts-ignore + // @ts-ignore DefinitelyTyped says visibility is "none" but it's + // actually "hidden" style: { visibility: 'hidden' }, }, { diff --git a/x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/AgentConfigurationCreateEdit/SettingsPage/SettingsPage.tsx b/x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/AgentConfigurationCreateEdit/SettingsPage/SettingsPage.tsx index d4b541442fa32..bbf3921b383fd 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/AgentConfigurationCreateEdit/SettingsPage/SettingsPage.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/AgentConfigurationCreateEdit/SettingsPage/SettingsPage.tsx @@ -37,7 +37,7 @@ import { useUiTracker } from '../../../../../../../../observability/public'; import { SettingFormRow } from './SettingFormRow'; import { getOptionLabel } from '../../../../../../../common/agent_configuration/all_option'; -function removeEmpty(obj: T): T { +function removeEmpty(obj: { [key: string]: any }) { return Object.fromEntries( Object.entries(obj).filter(([_, v]) => v != null && v !== '') ); diff --git a/x-pack/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx b/x-pack/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx index fd107a087cace..b457fb1092bc6 100644 --- a/x-pack/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx @@ -116,3 +116,8 @@ export function ErrorRateAlertTrigger(props: Props) { /> ); } + +// Default export is required for React.lazy loading +// +// eslint-disable-next-line import/no-default-export +export default ErrorRateAlertTrigger; diff --git a/x-pack/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx b/x-pack/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx index 5cea4696d60a7..473fd432c166a 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx @@ -175,3 +175,8 @@ export function TransactionDurationAlertTrigger(props: Props) { /> ); } + +// Default export is required for React.lazy loading +// +// eslint-disable-next-line import/no-default-export +export default TransactionDurationAlertTrigger; diff --git a/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/CustomPlot.stories.tsx b/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/CustomPlot.stories.tsx new file mode 100644 index 0000000000000..48e83763cb9df --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/CustomPlot.stories.tsx @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { storiesOf } from '@storybook/react'; +import React from 'react'; +// @ts-ignore +import CustomPlot from './'; + +storiesOf('shared/charts/CustomPlot', module).add( + 'with annotations but no data', + () => { + const annotations = [ + { + type: 'version', + id: '2020-06-10 04:36:31', + '@timestamp': 1591763925012, + text: '2020-06-10 04:36:31', + }, + { + type: 'version', + id: '2020-06-10 15:23:01', + '@timestamp': 1591802689233, + text: '2020-06-10 15:23:01', + }, + ]; + return ; + }, + { + info: { + source: false, + text: + "When a chart has no data but does have annotations, the annotations shouldn't show up at all.", + }, + } +); diff --git a/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/index.js b/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/index.js index 050cb0639ee88..e1ffec3a8d97f 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/index.js +++ b/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/index.js @@ -168,7 +168,7 @@ export class InnerCustomPlot extends PureComponent { tickFormatX={this.props.tickFormatX} /> - {this.state.showAnnotations && !isEmpty(annotations) && ( + {this.state.showAnnotations && !isEmpty(annotations) && !noHits && ( { this.setState(({ showAnnotations }) => ({ diff --git a/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/test/CustomPlot.test.js b/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/test/CustomPlot.test.js index d906e7f5093c2..ad1d73f2b766b 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/test/CustomPlot.test.js +++ b/x-pack/plugins/apm/public/components/shared/charts/CustomPlot/test/CustomPlot.test.js @@ -255,12 +255,28 @@ describe('when response has no data', () => { const onHover = jest.fn(); const onMouseLeave = jest.fn(); const onSelectionEnd = jest.fn(); + const annotations = [ + { + type: 'version', + id: '2020-06-10 04:36:31', + '@timestamp': 1591763925012, + text: '2020-06-10 04:36:31', + }, + { + type: 'version', + id: '2020-06-10 15:23:01', + '@timestamp': 1591802689233, + text: '2020-06-10 15:23:01', + }, + ]; + let wrapper; beforeEach(() => { const series = getEmptySeries(1451606400000, 1451610000000); wrapper = mount( { expect(wrapper.find('Tooltip').length).toEqual(0); }); + it('should not show annotations', () => { + expect(wrapper.find('AnnotationsPlot')).toHaveLength(0); + }); + it('should have correct markup', () => { expect(toJson(wrapper)).toMatchSnapshot(); }); diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index 0939c51b16605..2f46e2090351b 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -5,40 +5,38 @@ */ import { i18n } from '@kbn/i18n'; +import { lazy } from 'react'; +import { ConfigSchema } from '.'; import { AppMountParameters, CoreSetup, CoreStart, + DEFAULT_APP_CATEGORIES, Plugin, PluginInitializerContext, } from '../../../../src/core/public'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; - -import { - PluginSetupContract as AlertingPluginPublicSetup, - PluginStartContract as AlertingPluginPublicStart, -} from '../../alerts/public'; -import { FeaturesPluginSetup } from '../../features/public'; import { DataPublicPluginSetup, DataPublicPluginStart, } from '../../../../src/plugins/data/public'; import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; +import { + PluginSetupContract as AlertingPluginPublicSetup, + PluginStartContract as AlertingPluginPublicStart, +} from '../../alerts/public'; +import { FeaturesPluginSetup } from '../../features/public'; import { LicensingPluginSetup } from '../../licensing/public'; import { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, } from '../../triggers_actions_ui/public'; -import { ConfigSchema } from '.'; -import { createCallApmApi } from './services/rest/createCallApmApi'; -import { featureCatalogueEntry } from './featureCatalogueEntry'; import { AlertType } from '../common/alert_types'; -import { ErrorRateAlertTrigger } from './components/shared/ErrorRateAlertTrigger'; -import { TransactionDurationAlertTrigger } from './components/shared/TransactionDurationAlertTrigger'; +import { featureCatalogueEntry } from './featureCatalogueEntry'; +import { createCallApmApi } from './services/rest/createCallApmApi'; +import { createStaticIndexPattern } from './services/rest/index_pattern'; import { setHelpExtension } from './setHelpExtension'; import { toggleAppLinkInNav } from './toggleAppLinkInNav'; import { setReadonlyBadge } from './updateBadge'; -import { createStaticIndexPattern } from './services/rest/index_pattern'; export type ApmPluginSetup = void; export type ApmPluginStart = void; @@ -112,7 +110,9 @@ export class ApmPlugin implements Plugin { defaultMessage: 'Error rate', }), iconClass: 'bell', - alertParamsExpression: ErrorRateAlertTrigger, + alertParamsExpression: lazy(() => + import('./components/shared/ErrorRateAlertTrigger') + ), validate: () => ({ errors: [], }), @@ -125,7 +125,9 @@ export class ApmPlugin implements Plugin { defaultMessage: 'Transaction duration', }), iconClass: 'bell', - alertParamsExpression: TransactionDurationAlertTrigger, + alertParamsExpression: lazy(() => + import('./components/shared/TransactionDurationAlertTrigger') + ), validate: () => ({ errors: [], }), diff --git a/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts b/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts index acc93a94424b7..a3c97cd8828d8 100644 --- a/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts +++ b/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts @@ -59,9 +59,9 @@ const cliEsCredentials = pick( }, identity ) as { - 'elasticsearch.username': string; - 'elasticsearch.password': string; - 'elasticsearch.hosts': string; + 'elasticsearch.username'?: string; + 'elasticsearch.password'?: string; + 'elasticsearch.hosts'?: string; }; const config = { diff --git a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts index 1fd1aef4c8b70..1d14c509274a8 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts @@ -157,7 +157,7 @@ export function registerTransactionDurationAlertType({ const { agg } = response.aggregations; - const value = 'values' in agg ? agg.values[0] : agg.value; + const value = 'values' in agg ? agg.values[0] : agg?.value; if (value && value > alertParams.threshold * 1000) { const alertInstance = services.alertInstanceFactory( diff --git a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts index d788ae81a7db8..ea7cc9b145696 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts @@ -4,8 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ import { SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; -import { apmIndexPattern } from '../../../../../../src/plugins/apm_oss/server'; -import { APM_STATIC_INDEX_PATTERN_ID } from '../../../../../../src/plugins/apm_oss/server'; +import { + apmIndexPattern, + APM_STATIC_INDEX_PATTERN_ID, +} from '../../../../../../src/plugins/apm_oss/server'; import { hasHistoricalAgentData } from '../services/get_services/has_historical_agent_data'; import { Setup } from '../helpers/setup_request'; import { APMRequestHandlerContext } from '../../routes/typings'; diff --git a/x-pack/plugins/apm/server/lib/metrics/transform_metrics_chart.ts b/x-pack/plugins/apm/server/lib/metrics/transform_metrics_chart.ts index c0c9afe13b3dd..affb7c2a12075 100644 --- a/x-pack/plugins/apm/server/lib/metrics/transform_metrics_chart.ts +++ b/x-pack/plugins/apm/server/lib/metrics/transform_metrics_chart.ts @@ -33,7 +33,7 @@ type GenericMetricsRequest = Overwrite< date_histogram: AggregationOptionsByType['date_histogram']; aggs: Record>; }; - } & Record>; + } & Record>; }; } >; @@ -51,7 +51,11 @@ export function transformDataToMetricsChart( yUnit: chartBase.yUnit, noHits: hits.total.value === 0, series: Object.keys(chartBase.series).map((seriesKey, i) => { - const overallValue = aggregations?.[seriesKey].value; + const overallValue = (aggregations?.[seriesKey] as + | { + value: number | null; + } + | undefined)?.value; return { title: chartBase.series[seriesKey].title, diff --git a/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts b/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts index f7413979d7c82..f3f69131b42a2 100644 --- a/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts +++ b/x-pack/plugins/apm/server/lib/settings/custom_link/custom_link_types.ts @@ -38,7 +38,7 @@ export const payloadRt = t.intersection([ id: t.string, filters: t.array( t.type({ - key: t.string, + key: t.union([t.literal(''), t.keyof(filterOptionsRt.props)]), value: t.string, }) ), diff --git a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts index 0466a908ffa50..967314644c246 100644 --- a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts +++ b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts @@ -44,11 +44,12 @@ export async function getLocalUIFilters({ const response = await client.search(query); const filter = localUIFilters[name]; + const buckets = response?.aggregations?.by_terms?.buckets ?? []; return { ...filter, options: sortByOrder( - response.aggregations?.by_terms.buckets.map((bucket) => { + buckets.map((bucket) => { return { name: bucket.key as string, count: @@ -56,7 +57,7 @@ export async function getLocalUIFilters({ ? bucket.bucket_count.value : bucket.doc_count, }; - }) || [], + }), 'count', 'desc' ), diff --git a/x-pack/plugins/apm/server/routes/ui_filters.ts b/x-pack/plugins/apm/server/routes/ui_filters.ts index 1b3ee8ad0df0b..8f4ef94b86ac5 100644 --- a/x-pack/plugins/apm/server/routes/ui_filters.ts +++ b/x-pack/plugins/apm/server/routes/ui_filters.ts @@ -75,7 +75,10 @@ function createLocalFiltersRoute< queryRt, }: { path: TPath; - getProjection: GetProjection; + getProjection: GetProjection< + TProjection, + t.IntersectionC<[TQueryRT, BaseQueryType]> + >; queryRt: TQueryRT; }) { return createRoute(() => ({ @@ -207,9 +210,10 @@ export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute({ export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/serviceNodes', getProjection: ({ setup, query }) => { + const { serviceName } = query; return getServiceNodesProjection({ setup, - serviceName: query.serviceName, + serviceName, }); }, queryRt: t.type({ diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js index 299f96ff1b4e8..b3e735d202220 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js @@ -41,8 +41,12 @@ ToggleArgInput.propTypes = { onValueChange: PropTypes.func.isRequired, argValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.object]).isRequired, argId: PropTypes.string.isRequired, - labelValue: PropTypes.string, - showLabelValue: PropTypes.bool, + typeInstance: PropTypes.shape({ + displayName: PropTypes.string.isRequired, + options: PropTypes.shape({ + labelValue: PropTypes.string.isRequired, + }), + }).isRequired, renderError: PropTypes.func.isRequired, }; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/markdown.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/markdown.js index edae739ee0d3d..bebcc290a313d 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/markdown.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/markdown.js @@ -37,7 +37,7 @@ export const markdown = () => ({ argType: 'toggle', default: false, options: { - labelValue: 'Open all links in a new tab', + labelValue: strings.getOpenLinksInNewTabLabelName(), }, }, ], diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js index f1b6a48d1e7b0..6a32da2c3c0e9 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js @@ -75,6 +75,9 @@ export const pie = () => ({ help: strings.getLabelsHelp(), argType: 'toggle', default: true, + options: { + labelValue: strings.getLabelsToggleSwitch(), + }, }, { name: 'seriesStyle', diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/shape.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/shape.js index c3e97b4bd5dea..5eb8b1deb219b 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/shape.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/shape.js @@ -46,6 +46,9 @@ export const shape = () => ({ displayName: strings.getMaintainAspectDisplayName(), argType: 'toggle', help: strings.getMaintainAspectHelp(), + options: { + labelValue: strings.getMaintainAspectLabelName(), + }, }, ], }); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/table.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/table.js index 73324feddcab0..126559269f95a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/table.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/table.js @@ -33,6 +33,9 @@ export const table = () => ({ help: strings.getPaginateHelp(), argType: 'toggle', default: true, + options: { + labelValue: strings.getPaginateToggleSwitch(), + }, }, { name: 'showHeader', @@ -40,6 +43,9 @@ export const table = () => ({ help: strings.getShowHeaderHelp(), argType: 'toggle', default: true, + options: { + labelValue: strings.getShowHeaderToggleSwitch(), + }, }, ], }); diff --git a/x-pack/plugins/canvas/common/lib/autocomplete.ts b/x-pack/plugins/canvas/common/lib/autocomplete.ts index 982aee1ea19c8..0ab549bd14e83 100644 --- a/x-pack/plugins/canvas/common/lib/autocomplete.ts +++ b/x-pack/plugins/canvas/common/lib/autocomplete.ts @@ -419,7 +419,7 @@ function getArgNameSuggestions( }); const argDefs: ArgSuggestionValue[] = unusedArgDefs - .map(([name, arg]) => ({ name, ...arg })) + .map(([_name, arg]) => arg) .sort(unnamedArgComparator); return argDefs.map((argDef) => { diff --git a/x-pack/plugins/canvas/i18n/ui.ts b/x-pack/plugins/canvas/i18n/ui.ts index 1abe56c99dc89..f69f9e747ab90 100644 --- a/x-pack/plugins/canvas/i18n/ui.ts +++ b/x-pack/plugins/canvas/i18n/ui.ts @@ -791,8 +791,12 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.pie.args.labelsTitle', { defaultMessage: 'Labels', }), - getLabelsHelp: () => + getLabelsToggleSwitch: () => i18n.translate('xpack.canvas.uis.views.pie.args.labelsToggleSwitch', { + defaultMessage: 'Show labels', + }), + getLabelsHelp: () => + i18n.translate('xpack.canvas.uis.views.pie.args.labelsLabel', { defaultMessage: 'Show/hide labels', }), getLegendDisplayName: () => @@ -1075,10 +1079,14 @@ export const ViewStrings = { }), getMaintainAspectDisplayName: () => i18n.translate('xpack.canvas.uis.views.shape.args.maintainAspectTitle', { - defaultMessage: 'Fixed ratio', + defaultMessage: 'Aspect ratio settings', }), - getMaintainAspectHelp: () => + getMaintainAspectLabelName: () => i18n.translate('xpack.canvas.uis.views.shape.args.maintainAspectLabel', { + defaultMessage: 'Use a fixed ratio', + }), + getMaintainAspectHelp: () => + i18n.translate('xpack.canvas.uis.views.shape.args.maintainAspectHelpLabel', { defaultMessage: `Enable to maintain aspect ratio`, }), getShapeDisplayName: () => @@ -1099,6 +1107,10 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.table.args.paginateTitle', { defaultMessage: 'Pagination', }), + getPaginateToggleSwitch: () => + i18n.translate('xpack.canvas.uis.views.table.args.paginateToggleSwitch', { + defaultMessage: 'Show pagination controls', + }), getPaginateHelp: () => i18n.translate('xpack.canvas.uis.views.table.args.paginateLabel', { defaultMessage: @@ -1116,6 +1128,10 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.table.args.showHeaderTitle', { defaultMessage: 'Header', }), + getShowHeaderToggleSwitch: () => + i18n.translate('xpack.canvas.uis.views.table.args.showHeaderToggleSwitch', { + defaultMessage: 'Show the header row', + }), getShowHeaderHelp: () => i18n.translate('xpack.canvas.uis.views.table.args.showHeaderLabel', { defaultMessage: 'Show or hide the header row with titles for each column', diff --git a/x-pack/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx index dba97a15fee5c..44d2f70fcdfad 100644 --- a/x-pack/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx @@ -18,7 +18,7 @@ import { EuiOverlayMask, EuiButton, } from '@elastic/eui'; -import { map, sortBy } from 'lodash'; +import { sortBy } from 'lodash'; import { ComponentStrings } from '../../../i18n'; import { CustomElement } from '../../../types'; import { ConfirmModal } from '../confirm_modal/confirm_modal'; @@ -84,7 +84,7 @@ export const SavedElementsModal: FunctionComponent = ({ const handleEdit = async (name: string, description: string, image: string) => { if (elementToEdit) { - await updateCustomElement(elementToEdit.id, name, description, image); + updateCustomElement(elementToEdit.id, name, description, image); } hideEditModal(); }; @@ -94,7 +94,7 @@ export const SavedElementsModal: FunctionComponent = ({ const handleDelete = async () => { if (elementToDelete) { - await removeCustomElement(elementToDelete.id); + removeCustomElement(elementToDelete.id); } hideDeleteModal(); }; @@ -137,10 +137,7 @@ export const SavedElementsModal: FunctionComponent = ({ }; const sortElements = (elements: CustomElement[]): CustomElement[] => - sortBy( - map(elements, (element, name) => ({ name, ...element })), - 'displayName' - ); + sortBy(elements, 'displayName'); const onSearch = (e: ChangeEvent) => setSearch(e.target.value); diff --git a/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx b/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx index a0ab8d53485f5..8bbc3e09af4bf 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx @@ -7,6 +7,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import React from 'react'; import { EditMenu } from '../edit_menu'; +import { PositionedElement } from '../../../../../types'; const handlers = { cutNodes: action('cutNodes'), @@ -41,11 +42,16 @@ storiesOf('components/WorkpadHeader/EditMenu', module) )) .add('single element selected', () => ( - + )) .add('single grouped element selected', () => ( ( ( { const pageId = getSelectedPage(state); const nodes = getNodes(state, pageId) as PositionedElement[]; const selectedToplevelNodes = getSelectedToplevelNodes(state); + const selectedPrimaryShapeObjects = selectedToplevelNodes .map((id: string) => nodes.find((s: PositionedElement) => s.id === id)) .filter((shape?: PositionedElement) => shape) as PositionedElement[]; + const selectedPersistentPrimaryNodes = flatten( selectedPrimaryShapeObjects.map((shape: PositionedElement) => nodes.find((n: PositionedElement) => n.id === shape.id) // is it a leaf or a persisted group? @@ -70,12 +72,18 @@ const mapStateToProps = (state: State) => { : nodes.filter((s: PositionedElement) => s.position.parent === shape.id).map((s) => s.id) ) ); - const selectedNodeIds = flatten(selectedPersistentPrimaryNodes.map(crawlTree(nodes))); + + const selectedNodeIds: string[] = flatten(selectedPersistentPrimaryNodes.map(crawlTree(nodes))); + const selectedNodes = selectedNodeIds + .map((id: string) => nodes.find((s) => s.id === id)) + .filter((node: PositionedElement | undefined): node is PositionedElement => { + return !!node; + }); return { pageId, selectedToplevelNodes, - selectedNodes: selectedNodeIds.map((id: string) => nodes.find((s) => s.id === id)), + selectedNodes, state, }; }; diff --git a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx index 23861c332a0d3..d5841a1069ea1 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { PureComponent } from 'react'; +import React, { CSSProperties, PureComponent } from 'react'; // @ts-ignore Untyped local import { WORKPAD_CONTAINER_ID } from '../../../apps/workpad/workpad_app'; @@ -52,14 +52,12 @@ export class InteractionBoundary extends PureComponent { } render() { - const style = Object.assign( - { - top: '50%', - left: '50%', - position: 'absolute', - }, - this.state - ); + const style: CSSProperties = { + top: '50%', + left: '50%', + position: 'absolute', + ...this.state, + }; return
; } } diff --git a/x-pack/plugins/canvas/public/lib/clone_subgraphs.js b/x-pack/plugins/canvas/public/lib/clone_subgraphs.ts similarity index 83% rename from x-pack/plugins/canvas/public/lib/clone_subgraphs.js rename to x-pack/plugins/canvas/public/lib/clone_subgraphs.ts index e4dfa1cefcaba..c3a3933e06a6d 100644 --- a/x-pack/plugins/canvas/public/lib/clone_subgraphs.js +++ b/x-pack/plugins/canvas/public/lib/clone_subgraphs.ts @@ -4,16 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ +// @ts-ignore Untyped local import { arrayToMap } from './aeroelastic/functional'; import { getId } from './get_id'; +import { PositionedElement } from '../../types'; -export const cloneSubgraphs = (nodes) => { +export const cloneSubgraphs = (nodes: PositionedElement[]) => { const idMap = arrayToMap(nodes.map((n) => n.id)); + // We simultaneously provide unique id values for all elements (across all pages) // AND ensure that parent-child relationships are retained (via matching id values within page) Object.keys(idMap).forEach((key) => (idMap[key] = getId(key.split('-')[0]))); // new group names to which we can map + // must return elements in the same order, for several reasons - const newNodes = nodes.map((element) => ({ + return nodes.map((element) => ({ ...element, id: idMap[element.id], position: { @@ -21,5 +25,4 @@ export const cloneSubgraphs = (nodes) => { parent: element.position.parent ? idMap[element.position.parent] : null, }, })); - return newNodes; }; diff --git a/x-pack/plugins/canvas/public/lib/element_handler_creators.ts b/x-pack/plugins/canvas/public/lib/element_handler_creators.ts index d280c62888df0..a2bf5a62ec1f7 100644 --- a/x-pack/plugins/canvas/public/lib/element_handler_creators.ts +++ b/x-pack/plugins/canvas/public/lib/element_handler_creators.ts @@ -37,7 +37,7 @@ export interface Props { /** * selects elements on the page */ - selectToplevelNodes: (elements: PositionedElement) => void; + selectToplevelNodes: (elements: PositionedElement[]) => void; /** * deletes elements from the page */ diff --git a/x-pack/plugins/canvas/public/state/selectors/workpad.ts b/x-pack/plugins/canvas/public/state/selectors/workpad.ts index 4b3431e59a34e..55bf2a7ea31f7 100644 --- a/x-pack/plugins/canvas/public/state/selectors/workpad.ts +++ b/x-pack/plugins/canvas/public/state/selectors/workpad.ts @@ -324,7 +324,7 @@ export function getElements( return elements.map(appendAst); } -const augment = (type: string) => (n: T): T => ({ +const augment = (type: string) => (n: T): T => ({ ...n, position: { ...n.position, type }, ...(type === 'group' && { expression: 'shape fill="rgba(255,255,255,0)" | render' }), // fixme unify with mw/aeroelastic diff --git a/x-pack/plugins/case/server/routes/api/utils.ts b/x-pack/plugins/case/server/routes/api/utils.ts index fb199442f9425..b7f3c68d1662f 100644 --- a/x-pack/plugins/case/server/routes/api/utils.ts +++ b/x-pack/plugins/case/server/routes/api/utils.ts @@ -132,8 +132,8 @@ export const flattenCaseSavedObject = ({ version: savedObject.version ?? '0', comments: flattenCommentSavedObjects(comments), totalComment, - connector_id: savedObject.attributes.connector_id ?? caseConfigureConnectorId, ...savedObject.attributes, + connector_id: savedObject.attributes.connector_id ?? caseConfigureConnectorId, }); export const transformComments = ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_action_menu/auto_follow_pattern_action_menu.tsx b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_action_menu/auto_follow_pattern_action_menu.tsx index 1d8f8bacc8c84..ce26e4e71a5db 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_action_menu/auto_follow_pattern_action_menu.tsx +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_action_menu/auto_follow_pattern_action_menu.tsx @@ -169,7 +169,7 @@ const AutoFollowPatternActionMenuUI: FunctionComponent = ({ export const AutoFollowPatternActionMenu = (props: Omit) => ( {(deleteAutoFollowPattern: (ids: string[]) => void) => ( - + )} ); diff --git a/x-pack/plugins/embeddable_enhanced/public/plugin.ts b/x-pack/plugins/embeddable_enhanced/public/plugin.ts index e6413ac03aeae..a14cdfd035d2e 100644 --- a/x-pack/plugins/embeddable_enhanced/public/plugin.ts +++ b/x-pack/plugins/embeddable_enhanced/public/plugin.ts @@ -127,17 +127,19 @@ export class EmbeddableEnhancedPlugin }); dynamicActions.start().catch((error) => { - /* eslint-disable */ - console.log('Failed to start embeddable dynamic actions', embeddable); - console.error(error); + /* eslint-disable */ + + console.log('Failed to start embeddable dynamic actions', embeddable); + console.error(error); /* eslint-enable */ }); const stop = () => { dynamicActions.stop().catch((error) => { - /* eslint-disable */ - console.log('Failed to stop embeddable dynamic actions', embeddable); - console.error(error); + /* eslint-disable */ + + console.log('Failed to stop embeddable dynamic actions', embeddable); + console.error(error); /* eslint-enable */ }); }; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/contants.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/contants.ts new file mode 100644 index 0000000000000..a58aad6dc6bc2 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/contants.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export const POLICY_NAME = 'my_policy'; + +export const DELETE_PHASE_POLICY = { + version: 1, + modified_date: Date.now(), + policy: { + phases: { + hot: { + min_age: '0ms', + actions: { + rollover: { + max_size: '50gb', + }, + }, + }, + delete: { + min_age: '0ms', + actions: { + wait_for_snapshot: { + policy: 'my_snapshot_policy', + }, + delete: { + delete_searchable_snapshot: true, + }, + }, + }, + }, + }, + name: POLICY_NAME, +}; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx new file mode 100644 index 0000000000000..a36cd7e35c36f --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act } from 'react-dom/test-utils'; + +import { registerTestBed, TestBed, TestBedConfig } from '../../../../../test_utils'; + +import { POLICY_NAME } from './contants'; +import { TestSubjects } from '../helpers'; + +import { EditPolicy } from '../../../public/application/sections/edit_policy'; +import { indexLifecycleManagementStore } from '../../../public/application/store'; + +const testBedConfig: TestBedConfig = { + store: () => indexLifecycleManagementStore(), + memoryRouter: { + initialEntries: [`/policies/edit/${POLICY_NAME}`], + componentRoutePath: `/policies/edit/:policyName`, + }, +}; + +const initTestBed = registerTestBed(EditPolicy, testBedConfig); + +export interface EditPolicyTestBed extends TestBed { + actions: { + setWaitForSnapshotPolicy: (snapshotPolicyName: string) => void; + savePolicy: () => void; + }; +} + +export const setup = async (): Promise => { + const testBed = await initTestBed(); + + const setWaitForSnapshotPolicy = (snapshotPolicyName: string) => { + const { component, form } = testBed; + form.setInputValue('waitForSnapshotField', snapshotPolicyName, true); + component.update(); + }; + + const savePolicy = async () => { + const { component, find } = testBed; + await act(async () => { + find('savePolicyButton').simulate('click'); + }); + component.update(); + }; + + return { + ...testBed, + actions: { + setWaitForSnapshotPolicy, + savePolicy, + }, + }; +}; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts new file mode 100644 index 0000000000000..cc04749af3205 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act } from 'react-dom/test-utils'; + +import { setupEnvironment } from '../helpers/setup_environment'; + +import { EditPolicyTestBed, setup } from './edit_policy.helpers'; +import { DELETE_PHASE_POLICY } from './contants'; + +import { API_BASE_PATH } from '../../../common/constants'; + +window.scrollTo = jest.fn(); + +describe('', () => { + let testBed: EditPolicyTestBed; + const { server, httpRequestsMockHelpers } = setupEnvironment(); + afterAll(() => { + server.restore(); + }); + + describe('delete phase', () => { + beforeEach(async () => { + httpRequestsMockHelpers.setLoadPolicies([DELETE_PHASE_POLICY]); + + await act(async () => { + testBed = await setup(); + }); + + const { component } = testBed; + component.update(); + }); + + test('wait for snapshot policy field should correctly display snapshot policy name', () => { + expect(testBed.find('waitForSnapshotField').props().value).toEqual( + DELETE_PHASE_POLICY.policy.phases.delete.actions.wait_for_snapshot.policy + ); + }); + + test('wait for snapshot field should correctly update snapshot policy name', async () => { + const { actions } = testBed; + + const newPolicyName = 'my_new_snapshot_policy'; + actions.setWaitForSnapshotPolicy(newPolicyName); + await actions.savePolicy(); + + const expected = { + name: DELETE_PHASE_POLICY.name, + phases: { + ...DELETE_PHASE_POLICY.policy.phases, + delete: { + ...DELETE_PHASE_POLICY.policy.phases.delete, + actions: { + ...DELETE_PHASE_POLICY.policy.phases.delete.actions, + wait_for_snapshot: { + policy: newPolicyName, + }, + }, + }, + }, + }; + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/policies`); + expect(latestRequest.method).toBe('POST'); + expect(JSON.parse(JSON.parse(latestRequest.requestBody).body)).toEqual(expected); + }); + + test('wait for snapshot field should delete action if field is empty', async () => { + const { actions } = testBed; + + actions.setWaitForSnapshotPolicy(''); + await actions.savePolicy(); + + const expected = { + name: DELETE_PHASE_POLICY.name, + phases: { + ...DELETE_PHASE_POLICY.policy.phases, + delete: { + ...DELETE_PHASE_POLICY.policy.phases.delete, + actions: { + ...DELETE_PHASE_POLICY.policy.phases.delete.actions, + }, + }, + }, + }; + delete expected.phases.delete.actions.wait_for_snapshot; + + const latestRequest = server.requests[server.requests.length - 1]; + expect(JSON.parse(JSON.parse(latestRequest.requestBody).body)).toEqual(expected); + }); + }); +}); diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/http_requests.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/http_requests.ts new file mode 100644 index 0000000000000..f41742fc104ff --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/http_requests.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { SinonFakeServer, fakeServer } from 'sinon'; +import { API_BASE_PATH } from '../../../common/constants'; + +export const init = () => { + const server = fakeServer.create(); + server.respondImmediately = true; + server.respondWith([200, {}, 'DefaultServerResponse']); + + return { + server, + httpRequestsMockHelpers: registerHttpRequestMockHelpers(server), + }; +}; + +const registerHttpRequestMockHelpers = (server: SinonFakeServer) => { + const setLoadPolicies = (response: any = []) => { + server.respondWith('GET', `${API_BASE_PATH}/policies`, [ + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify(response), + ]); + }; + + return { + setLoadPolicies, + }; +}; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts new file mode 100644 index 0000000000000..3cff2e3ab050f --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts @@ -0,0 +1,7 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export type TestSubjects = 'waitForSnapshotField' | 'savePolicyButton'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/setup_environment.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/setup_environment.ts new file mode 100644 index 0000000000000..b3205a9523c62 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/setup_environment.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import axios from 'axios'; +import axiosXhrAdapter from 'axios/lib/adapters/xhr'; + +import { init as initHttp } from '../../../public/application/services/http'; +import { init as initHttpRequests } from './http_requests'; +import { init as initUiMetric } from '../../../public/application/services/ui_metric'; +import { init as initNotification } from '../../../public/application/services/notification'; + +import { usageCollectionPluginMock } from '../../../../../../src/plugins/usage_collection/public/mocks'; + +import { + notificationServiceMock, + fatalErrorsServiceMock, +} from '../../../../../../src/core/public/mocks'; + +const mockHttpClient = axios.create({ adapter: axiosXhrAdapter }); + +export const setupEnvironment = () => { + initUiMetric(usageCollectionPluginMock.createSetupContract()); + initNotification( + notificationServiceMock.createSetupContract().toasts, + fatalErrorsServiceMock.createSetupContract() + ); + + mockHttpClient.interceptors.response.use(({ data }) => data); + initHttp(mockHttpClient); + const { server, httpRequestsMockHelpers } = initHttpRequests(); + + return { + server, + httpRequestsMockHelpers, + }; +}; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/constants/index.ts b/x-pack/plugins/index_lifecycle_management/public/application/constants/index.ts index a631a38fbcb7e..6319fc0d68543 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/constants/index.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/constants/index.ts @@ -37,6 +37,8 @@ export const PHASE_PRIMARY_SHARD_COUNT: string = 'selectedPrimaryShardCount'; export const PHASE_REPLICA_COUNT: string = 'selectedReplicaCount'; export const PHASE_INDEX_PRIORITY: string = 'phaseIndexPriority'; +export const PHASE_WAIT_FOR_SNAPSHOT_POLICY = 'waitForSnapshotPolicy'; + export const PHASE_ATTRIBUTES_THAT_ARE_NUMBERS_VALIDATE: string[] = [ PHASE_ROLLOVER_MINIMUM_AGE, PHASE_FORCE_MERGE_SEGMENTS, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/delete_phase/delete_phase.js b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/delete_phase/delete_phase.js index 3b3e489d38f7d..299bf28778ab4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/delete_phase/delete_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/delete_phase/delete_phase.js @@ -7,10 +7,16 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiDescribedFormGroup, EuiSwitch } from '@elastic/eui'; +import { + EuiDescribedFormGroup, + EuiSwitch, + EuiFieldText, + EuiTextColor, + EuiFormRow, +} from '@elastic/eui'; -import { PHASE_DELETE, PHASE_ENABLED } from '../../../../constants'; -import { ActiveBadge, PhaseErrorMessage } from '../../../components'; +import { PHASE_DELETE, PHASE_ENABLED, PHASE_WAIT_FOR_SNAPSHOT_POLICY } from '../../../../constants'; +import { ActiveBadge, LearnMoreLink, OptionalLabel, PhaseErrorMessage } from '../../../components'; import { MinAgeInput } from '../min_age_input'; export class DeletePhase extends PureComponent { @@ -85,6 +91,48 @@ export class DeletePhase extends PureComponent {
)} + {phaseData[PHASE_ENABLED] ? ( + + + + } + description={ + + {' '} + + + } + titleSize="xs" + fullWidth + > + + + + + } + > + setPhaseData(PHASE_WAIT_FOR_SNAPSHOT_POLICY, e.target.value)} + /> + + + ) : null}
); } diff --git a/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/delete_phase.js b/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/delete_phase.js index b5296cd83fabd..8534893e7e3b3 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/delete_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/delete_phase.js @@ -9,6 +9,7 @@ import { PHASE_ROLLOVER_MINIMUM_AGE, PHASE_ROLLOVER_MINIMUM_AGE_UNITS, PHASE_ROLLOVER_ALIAS, + PHASE_WAIT_FOR_SNAPSHOT_POLICY, } from '../../constants'; export const defaultDeletePhase = { @@ -17,5 +18,6 @@ export const defaultDeletePhase = { [PHASE_ROLLOVER_ALIAS]: '', [PHASE_ROLLOVER_MINIMUM_AGE]: 0, [PHASE_ROLLOVER_MINIMUM_AGE_UNITS]: 'd', + [PHASE_WAIT_FOR_SNAPSHOT_POLICY]: '', }; export const defaultEmptyDeletePhase = defaultDeletePhase; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/index.d.ts b/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/index.d.ts index 889e038f9e2c4..abf6db416c7f4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/index.d.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/store/defaults/index.d.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +export declare const defaultDeletePhase: any; export declare const defaultColdPhase: any; export declare const defaultWarmPhase: any; export declare const defaultHotPhase: any; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/store/selectors/policies.js b/x-pack/plugins/index_lifecycle_management/public/application/store/selectors/policies.js index a3aef8679817d..32c6d93383c22 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/store/selectors/policies.js +++ b/x-pack/plugins/index_lifecycle_management/public/application/store/selectors/policies.js @@ -31,6 +31,7 @@ import { PHASE_FREEZE_ENABLED, PHASE_INDEX_PRIORITY, PHASE_ROLLOVER_MAX_DOCUMENTS, + PHASE_WAIT_FOR_SNAPSHOT_POLICY, } from '../../constants'; import { filterItems, sortTable } from '../../services'; @@ -194,6 +195,9 @@ const phaseFromES = (phase, phaseName, defaultEmptyPolicy) => { if (actions.set_priority) { policy[PHASE_INDEX_PRIORITY] = actions.set_priority.priority; } + if (actions.wait_for_snapshot) { + policy[PHASE_WAIT_FOR_SNAPSHOT_POLICY] = actions.wait_for_snapshot.policy; + } } return policy; }; @@ -308,5 +312,13 @@ export const phaseToES = (phase, originalEsPhase) => { priority: phase[PHASE_INDEX_PRIORITY], }; } + + if (phase[PHASE_WAIT_FOR_SNAPSHOT_POLICY]) { + esPhase.actions.wait_for_snapshot = { + policy: phase[PHASE_WAIT_FOR_SNAPSHOT_POLICY], + }; + } else { + delete esPhase.actions.wait_for_snapshot; + } return esPhase; }; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx index d966a439817f4..311cb37d0b47a 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/shape_datatype.test.tsx @@ -61,10 +61,7 @@ describe('Mappings editor: shape datatype', () => { await updateFieldAndCloseFlyout(); // It should have the default parameters values added - updatedMappings.properties.myField = { - type: 'shape', - ...defaultShapeParameters, - }; + updatedMappings.properties.myField = defaultShapeParameters; ({ data } = await getMappingsEditorData(component)); expect(data).toEqual(updatedMappings); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx index 581624e312206..5f6d3a6e7b459 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/datatypes/text_datatype.test.tsx @@ -77,7 +77,6 @@ describe.skip('Mappings editor: text datatype', () => { // It should have the default parameters values added updatedMappings.properties.myField = { - type: 'text', ...defaultTextParameters, }; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx index 71e1aacb734c1..bc592c71898b0 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx @@ -77,8 +77,8 @@ const LogColumnHeader: React.FunctionComponent<{ ); -const LogColumnHeadersWrapper = euiStyled.div.attrs(() => ({ - role: 'row', +const LogColumnHeadersWrapper = euiStyled.div.attrs((props) => ({ + role: props.role ?? 'row', }))` align-items: stretch; display: flex; @@ -93,8 +93,8 @@ const LogColumnHeadersWrapper = euiStyled.div.attrs(() => ({ z-index: 1; `; -const LogColumnHeaderWrapper = euiStyled(LogEntryColumn).attrs(() => ({ - role: 'columnheader', +const LogColumnHeaderWrapper = euiStyled(LogEntryColumn).attrs((props) => ({ + role: props.role ?? 'columnheader', }))` align-items: center; display: flex; diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_status.tsx b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_status.tsx index 0d478ddd0407a..10205e9684ef2 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_status.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module_status.tsx @@ -265,8 +265,9 @@ const getSetupStatus = (everyJobStatus: Record(value: Value): value is MandatoryProperty => - value.error != null; +const hasError = ( + value: Value +): value is MandatoryProperty => value.error != null; export const useModuleStatus = (jobTypes: JobType[]) => { return useReducer(createStatusReducer(jobTypes), { jobTypes }, createInitialState); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx index a6c9efb5e17d1..5fcee6193b357 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx @@ -44,7 +44,7 @@ export const GroupOfNodes: React.FC = ({ {group.nodes.map((node) => ( = withTheme return { label: '', value: '' }; }, [nodeType, node.ip, node.id, options.fields]); - const nodeLogsMenuItemLinkProps = useLinkProps({ - app: 'logs', - ...getNodeLogsUrl({ + const nodeLogsMenuItemLinkProps = useLinkProps( + getNodeLogsUrl({ nodeType, nodeId: node.id, time: currentTime, - }), - }); + }) + ); const nodeDetailMenuItemLinkProps = useLinkProps({ ...getNodeDetailUrl({ nodeType, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts index e676fb3e09c2b..4ce73f2cad628 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts @@ -10,7 +10,7 @@ import { WaffleSortOption } from '../hooks/use_waffle_options'; const SORT_PATHS = { name: (node: SnapshotNode) => last(node.path), - value: 'metric.value', + value: (node: SnapshotNode) => node.metric.value || 0, }; export const sortNodes = (sort: WaffleSortOption, nodes: SnapshotNode[]) => { diff --git a/x-pack/plugins/ingest_manager/common/types/models/agent.ts b/x-pack/plugins/ingest_manager/common/types/models/agent.ts index c2f8b0f981b57..7644e2ca57f26 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/agent.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/agent.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectAttributes } from 'src/core/public'; import { AGENT_TYPE_EPHEMERAL, AGENT_TYPE_PERMANENT, AGENT_TYPE_TEMPORARY } from '../../constants'; export type AgentType = @@ -26,9 +25,10 @@ export interface AgentAction extends NewAgentAction { created_at: string; } -export interface AgentActionSOAttributes extends SavedObjectAttributes { +export interface AgentActionSOAttributes { type: 'CONFIG_CHANGE' | 'DATA_DUMP' | 'RESUME' | 'PAUSE'; sent_at?: string; + timestamp?: string; created_at: string; agent_id: string; data?: string; @@ -62,7 +62,7 @@ export interface AgentEvent extends NewAgentEvent { id: string; } -export interface AgentEventSOAttributes extends NewAgentEvent, SavedObjectAttributes {} +export type AgentEventSOAttributes = NewAgentEvent; type MetadataValue = string | AgentMetadata; @@ -92,6 +92,6 @@ export interface Agent extends AgentBase { status?: string; } -export interface AgentSOAttributes extends AgentBase, SavedObjectAttributes { +export interface AgentSOAttributes extends AgentBase { current_error_events?: string; } diff --git a/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts b/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts index b19e4a0f4ac27..7547f56237eec 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts @@ -33,6 +33,8 @@ export interface AgentConfig extends NewAgentConfig { revision: number; } +export type AgentConfigSOAttributes = Omit; + export type FullAgentConfigDatasource = Pick< Datasource, 'id' | 'name' | 'namespace' | 'enabled' diff --git a/x-pack/plugins/ingest_manager/common/types/models/datasource.ts b/x-pack/plugins/ingest_manager/common/types/models/datasource.ts index 42ce69a5707cb..aa92b90a6caec 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/datasource.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/datasource.ts @@ -63,3 +63,5 @@ export interface Datasource extends Omit { created_at: string; created_by: string; } + +export type DatasourceSOAttributes = Omit; diff --git a/x-pack/plugins/ingest_manager/common/types/models/output.ts b/x-pack/plugins/ingest_manager/common/types/models/output.ts index f4ded50d7d474..f3e76cd167b3f 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/output.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/output.ts @@ -20,6 +20,8 @@ export interface NewOutput { config?: Record; } +export type OutputSOAttributes = NewOutput; + export type Output = NewOutput & { id: string; }; diff --git a/x-pack/plugins/ingest_manager/dev_docs/api/epm.md b/x-pack/plugins/ingest_manager/dev_docs/api/epm.md new file mode 100644 index 0000000000000..12fecc928419b --- /dev/null +++ b/x-pack/plugins/ingest_manager/dev_docs/api/epm.md @@ -0,0 +1,24 @@ +This document is part of the original drafts for ingest management documentation in `docs/ingest_manager` and may be outdated. +Overall documentation of Ingest Management is now maintained in the `elastic/stack-docs` repository. + +# Elastic Package Manager API + +The Package Manager offers an API. Here an example on how they can be used. + +List installed packages: + +``` +curl localhost:5601/api/ingest_manager/epm/packages +``` + +Install a package: + +``` +curl -X POST localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4 +``` + +Delete a package: + +``` +curl -X DELETE localhost:5601/api/ingest_manager/epm/packages/iptables-1.0.4 +``` diff --git a/x-pack/plugins/ingest_manager/dev_docs/definitions.md b/x-pack/plugins/ingest_manager/dev_docs/definitions.md new file mode 100644 index 0000000000000..0d9e285ab80d3 --- /dev/null +++ b/x-pack/plugins/ingest_manager/dev_docs/definitions.md @@ -0,0 +1,71 @@ +This document is part of the original drafts for ingest management documentation in `docs/ingest_manager` and may be outdated. +Overall documentation of Ingest Management is now maintained in the `elastic/stack-docs` repository. + +# Ingest Management Definitions + +This section is to define terms used across ingest management. + +## Data Source + +A data source is a definition on how to collect data from a service, for example `nginx`. A data source contains +definitions for one or multiple inputs and each input can contain one or multiple streams. + +With the example of the nginx Data Source, it contains to inputs: `logs` and `nginx/metrics`. Logs and metrics are collected +differently. The `logs` input contains two streams, `access` and `error`, the `nginx/metrics` input contains the stubstatus stream. + + +## Data Stream + +Data Streams are a [new concept](https://github.com/elastic/elasticsearch/issues/53100) in Elasticsearch which simplify +ingesting data and the setup of Elasticsearch. + +## Elastic Agent + +A single, unified agent that users can deploy to hosts or containers. It controls which data is collected from the host or containers and where the data is sent. It will run Beats, Endpoint or other monitoring programs as needed. It can operate standalone or pull a configuration policy from Fleet. + + +## Elastic Package Registry + +The Elastic Package Registry (EPR) is a service which runs under [https://epr.elastic.co]. It serves the packages through its API. +More details about the registry can be found [here](https://github.com/elastic/package-registry). + +## Fleet + +Fleet is the part of the Ingest Manager UI in Kibana that handles the part of enrolling Elastic Agents, +managing agents and sending configurations to the Elastic Agent. + +## Indexing Strategy + +Ingest Management + Elastic Agent follow a strict new indexing strategy: `{type}-{dataset}-{namespace}`. An example +for this is `logs-nginx.access-default`. More details about it can be found in the Index Strategy below. All data of +the index strategy is sent to Data Streams. + +## Input + +An input is the configuration unit in an Agent Config that defines the options on how to collect data from +an endpoint. This could be username / password which are need to authenticate with a service or a host url +as an example. + +An input is part of a Data Source and contains streams. + +## Integration + +An integration is a package with the type integration. An integration package has at least 1 data source +and usually collects data from / about a service. + +## Namespace + +A user-specified string that will be used to part of the index name in Elasticsearch. It helps users identify logs coming from a specific environment (like prod or test), an application, or other identifiers. + +## Package + +A package contains all the assets for the Elastic Stack. A more detailed definition of a +package can be found under https://github.com/elastic/package-registry. + +Besides the assets, a package contains the data source definitions with its inputs and streams. + +## Stream + +A stream is a configuration unit in the Elastic Agent config. A stream is part of an input and defines how the data +fetched by this input should be processed and which Data Stream to send it to. + diff --git a/x-pack/plugins/ingest_manager/dev_docs/epm.md b/x-pack/plugins/ingest_manager/dev_docs/epm.md new file mode 100644 index 0000000000000..abcab718f7ab9 --- /dev/null +++ b/x-pack/plugins/ingest_manager/dev_docs/epm.md @@ -0,0 +1,30 @@ +This document is part of the original drafts for ingest management documentation in `docs/ingest_manager` and may be outdated. +Overall documentation of Ingest Management is now maintained in the `elastic/stack-docs` repository. + +# Package Upgrades + +When upgrading a package between a bugfix or a minor version, no breaking changes should happen. Upgrading a package has the following effect: + +* Removal of existing dashboards +* Installation of new dashboards +* Write new ingest pipelines with the version +* Write new Elasticsearch alias templates +* Trigger a rollover for all the affected indices + +The new ingest pipeline is expected to still work with the data coming from older configurations. In most cases this means some of the fields can be missing. For this to work, each event must contain the version of config / package it is coming from to make such a decision. + +In case of a breaking change in the data structure, the new ingest pipeline is also expected to deal with this change. In case there are breaking changes which cannot be dealt with in an ingest pipeline, a new package has to be created. + +Each package lists its minimal required agent version. In case there are agents enrolled with an older version, the user is notified to upgrade these agents as otherwise the new configs cannot be rolled out. + +# Generated assets + +When a package is installed or upgraded, certain Kibana and Elasticsearch assets are generated from . These follow the naming conventions explained above (see "indexing strategy") and contain configuration for the elastic stack that makes ingesting and displaying data work with as little user interaction as possible. + +## Elasticsearch Index Templates + +### Generation + +* Index templates are generated from `YAML` files contained in the package. +* There is one index template per dataset. +* For the generation of an index template, all `yml` files contained in the package subdirectory `dataset/DATASET_NAME/fields/` are used. \ No newline at end of file diff --git a/x-pack/plugins/ingest_manager/dev_docs/indexing_strategy.md b/x-pack/plugins/ingest_manager/dev_docs/indexing_strategy.md new file mode 100644 index 0000000000000..fd7edcb7fcca0 --- /dev/null +++ b/x-pack/plugins/ingest_manager/dev_docs/indexing_strategy.md @@ -0,0 +1,77 @@ +This document is part of the original drafts for ingest management documentation in `docs/ingest_manager` and may be outdated. +Overall documentation of Ingest Management is now maintained in the `elastic/stack-docs` repository. + +# Indexing Strategy + +Ingest Management enforces an indexing strategy to allow the system to automatically detect indices and run queries on it. In short the indexing strategy looks as following: + +``` +{dataset.type}-{dataset.name}-{dataset.namespace} +``` + +The `{dataset.type}` can be `logs` or `metrics`. The `{dataset.namespace}` is the part where the user can use free form. The only two requirement are that it has only characters allowed in an Elasticsearch index name and does NOT contain a `-`. The `dataset` is defined by the data that is indexed. The same requirements as for the namespace apply. It is expected that the fields for type, namespace and dataset are part of each event and are constant keywords. If there is a dataset or a namespace with a `-` inside, it is recommended to replace it either by a `.` or a `_`. + +Note: More `{dataset.type}`s might be added in the future like `traces`. + +This indexing strategy has a few advantages: + +* Each index contains only the fields which are relevant for the dataset. This leads to more dense indices and better field completion. +* ILM policies can be applied per namespace per dataset. +* Rollups can be specified per namespace per dataset. +* Having the namespace user configurable makes setting security permissions possible. +* Having a global metrics and logs template, allows to create new indices on demand which still follow the convention. This is common in the case of k8s as an example. +* Constant keywords allow to narrow down the indices we need to access for querying very efficiently. This is especially relevant in environments which a large number of indices or with indices on slower nodes. + +Overall it creates smaller indices in size, makes querying more efficient and allows users to define their own naming parts in namespace and still benefiting from all features that can be built on top of the indexing startegy. + +## Ingest Pipeline + +The ingest pipelines for a specific dataset will have the following naming scheme: + +``` +{dataset.type}-{dataset.name}-{package.version} +``` + +As an example, the ingest pipeline for the Nginx access logs is called `logs-nginx.access-3.4.1`. The same ingest pipeline is used for all namespaces. It is possible that a dataset has multiple ingest pipelines in which case a suffix is added to the name. + +The version is included in each pipeline to allow upgrades. The pipeline itself is listed in the index template and is automatically applied at ingest time. + +## Templates & ILM Policies + +To make the above strategy possible, alias templates are required. For each type there is a basic alias template with a default ILM policy. These default templates apply to all indices which follow the indexing strategy and do not have a more specific dataset alias template. + +The `metrics` and `logs` alias template contain all the basic fields from ECS. + +Each type template contains an ILM policy. Modifying this default ILM policy will affect all data covered by the default templates. + +The templates for a dataset are called as following: + +``` +{dataset.type}-{dataset.name} +``` + +The pattern used inside the index template is `{type}-{dataset}-*` to match all namespaces. + +## Defaults + +If the Elastic Agent is used to ingest data and only the type is specified, `default` for the namespace is used and `generic` for the dataset. + +## Data filtering + +Filtering for data in queries for example in visualizations or dashboards should always be done on the constant keyword fields. Visualizations needing data for the nginx.access dataset should query on `type:logs AND dataset:nginx.access`. As these are constant keywords the prefiltering is very efficient. + +## Security permissions + +Security permissions can be set on different levels. To set special permissions for the access on the prod namespace, use the following index pattern: + +``` +/(logs|metrics)-[^-]+-prod-$/ +``` + +To set specific permissions on the logs index, the following can be used: + +``` +/^(logs|metrics)-.*/ +``` + +Todo: The above queries need to be tested. diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/components/donut_chart.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/components/donut_chart.tsx index 8cd363576aa85..bfa9c80f12851 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/components/donut_chart.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/components/donut_chart.tsx @@ -54,7 +54,7 @@ export const DonutChart = ({ height, width, data }: DonutChartProps) => { .innerRadius(width * 0.36) .outerRadius(Math.min(width, height) / 2) ) - .attr('fill', (d: any) => color(d.data.key)); + .attr('fill', (d: any) => color(d.data.key) as any); } }, [data, height, width]); return ( diff --git a/x-pack/plugins/ingest_manager/server/services/agent_config.ts b/x-pack/plugins/ingest_manager/server/services/agent_config.ts index 62b568b812216..678262ab6dcac 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_config.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_config.ts @@ -15,6 +15,7 @@ import { Datasource, NewAgentConfig, AgentConfig, + AgentConfigSOAttributes, FullAgentConfig, AgentConfigStatus, ListWithKuery, @@ -39,7 +40,7 @@ class AgentConfigService { private async _update( soClient: SavedObjectsClientContract, id: string, - agentConfig: Partial, + agentConfig: Partial, user?: AuthenticatedUser ): Promise { const oldAgentConfig = await this.get(soClient, id, false); @@ -57,7 +58,7 @@ class AgentConfigService { ); } - await soClient.update(SAVED_OBJECT_TYPE, id, { + await soClient.update(SAVED_OBJECT_TYPE, id, { ...agentConfig, revision: oldAgentConfig.revision + 1, updated_at: new Date().toISOString(), @@ -70,7 +71,7 @@ class AgentConfigService { } public async ensureDefaultAgentConfig(soClient: SavedObjectsClientContract) { - const configs = await soClient.find({ + const configs = await soClient.find({ type: AGENT_CONFIG_SAVED_OBJECT_TYPE, filter: `${AGENT_CONFIG_SAVED_OBJECT_TYPE}.attributes.is_default:true`, }); @@ -94,7 +95,7 @@ class AgentConfigService { agentConfig: NewAgentConfig, options?: { id?: string; user?: AuthenticatedUser } ): Promise { - const newSo = await soClient.create( + const newSo = await soClient.create( SAVED_OBJECT_TYPE, { ...agentConfig, @@ -109,10 +110,7 @@ class AgentConfigService { await this.triggerAgentConfigUpdatedEvent(soClient, 'created', newSo.id); } - return { - id: newSo.id, - ...newSo.attributes, - }; + return { id: newSo.id, ...newSo.attributes }; } public async get( @@ -120,7 +118,7 @@ class AgentConfigService { id: string, withDatasources: boolean = true ): Promise { - const agentConfigSO = await soClient.get(SAVED_OBJECT_TYPE, id); + const agentConfigSO = await soClient.get(SAVED_OBJECT_TYPE, id); if (!agentConfigSO) { return null; } @@ -129,10 +127,7 @@ class AgentConfigService { throw new Error(agentConfigSO.error.message); } - const agentConfig: AgentConfig = { - id: agentConfigSO.id, - ...agentConfigSO.attributes, - }; + const agentConfig = { id: agentConfigSO.id, ...agentConfigSO.attributes }; if (withDatasources) { agentConfig.datasources = @@ -151,7 +146,7 @@ class AgentConfigService { ): Promise<{ items: AgentConfig[]; total: number; page: number; perPage: number }> { const { page = 1, perPage = 20, kuery } = options; - const agentConfigs = await soClient.find({ + const agentConfigs = await soClient.find({ type: SAVED_OBJECT_TYPE, page, perPage, @@ -165,12 +160,10 @@ class AgentConfigService { }); return { - items: agentConfigs.saved_objects.map((agentConfigSO) => { - return { - id: agentConfigSO.id, - ...agentConfigSO.attributes, - }; - }), + items: agentConfigs.saved_objects.map((agentConfigSO) => ({ + id: agentConfigSO.id, + ...agentConfigSO.attributes, + })), total: agentConfigs.total, page, perPage, diff --git a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts index 81afa70ecb818..2487035a338aa 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts @@ -42,7 +42,9 @@ export async function enroll( let agent; if (existingAgent) { - await soClient.update(AGENT_SAVED_OBJECT_TYPE, existingAgent.id, agentData); + await soClient.update(AGENT_SAVED_OBJECT_TYPE, existingAgent.id, agentData, { + refresh: false, + }); agent = { ...existingAgent, ...agentData, @@ -52,7 +54,9 @@ export async function enroll( } as Agent; } else { agent = savedObjectToAgent( - await soClient.create(AGENT_SAVED_OBJECT_TYPE, agentData) + await soClient.create(AGENT_SAVED_OBJECT_TYPE, agentData, { + refresh: false, + }) ); } diff --git a/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts b/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts index 6c95dc831aa9a..9e8f1fac4e02b 100644 --- a/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts +++ b/x-pack/plugins/ingest_manager/server/services/api_keys/index.ts @@ -24,8 +24,8 @@ export async function generateOutputApiKey( cluster: ['monitor'], index: [ { - names: ['logs-*', 'metrics-*', 'events-*'], - privileges: ['write', 'create_index'], + names: ['logs-*', 'metrics-*', 'events-*', '.ds-logs-*', '.ds-metrics-*', '.ds-events-*'], + privileges: ['write', 'create_index', 'indices:admin/auto_create'], }, ], }, diff --git a/x-pack/plugins/ingest_manager/server/services/datasource.ts b/x-pack/plugins/ingest_manager/server/services/datasource.ts index c3dba0700bdaf..c559dac0c0dcd 100644 --- a/x-pack/plugins/ingest_manager/server/services/datasource.ts +++ b/x-pack/plugins/ingest_manager/server/services/datasource.ts @@ -13,7 +13,7 @@ import { PackageInfo, } from '../../common'; import { DATASOURCE_SAVED_OBJECT_TYPE } from '../constants'; -import { NewDatasource, Datasource, ListWithKuery } from '../types'; +import { NewDatasource, Datasource, ListWithKuery, DatasourceSOAttributes } from '../types'; import { agentConfigService } from './agent_config'; import { getPackageInfo, getInstallation } from './epm/packages'; import { outputService } from './output'; @@ -32,7 +32,7 @@ class DatasourceService { options?: { id?: string; user?: AuthenticatedUser } ): Promise { const isoDate = new Date().toISOString(); - const newSo = await soClient.create>( + const newSo = await soClient.create( SAVED_OBJECT_TYPE, { ...datasource, @@ -57,7 +57,7 @@ class DatasourceService { } public async get(soClient: SavedObjectsClientContract, id: string): Promise { - const datasourceSO = await soClient.get(SAVED_OBJECT_TYPE, id); + const datasourceSO = await soClient.get(SAVED_OBJECT_TYPE, id); if (!datasourceSO) { return null; } @@ -76,7 +76,7 @@ class DatasourceService { soClient: SavedObjectsClientContract, ids: string[] ): Promise { - const datasourceSO = await soClient.bulkGet( + const datasourceSO = await soClient.bulkGet( ids.map((id) => ({ id, type: SAVED_OBJECT_TYPE, @@ -98,7 +98,7 @@ class DatasourceService { ): Promise<{ items: Datasource[]; total: number; page: number; perPage: number }> { const { page = 1, perPage = 20, kuery } = options; - const datasources = await soClient.find({ + const datasources = await soClient.find({ type: SAVED_OBJECT_TYPE, page, perPage, @@ -112,12 +112,10 @@ class DatasourceService { }); return { - items: datasources.saved_objects.map((datasourceSO) => { - return { - id: datasourceSO.id, - ...datasourceSO.attributes, - }; - }), + items: datasources.saved_objects.map((datasourceSO) => ({ + id: datasourceSO.id, + ...datasourceSO.attributes, + })), total: datasources.total, page, perPage, @@ -136,7 +134,7 @@ class DatasourceService { throw new Error('Datasource not found'); } - await soClient.update(SAVED_OBJECT_TYPE, id, { + await soClient.update(SAVED_OBJECT_TYPE, id, { ...datasource, revision: oldDatasource.revision + 1, updated_at: new Date().toISOString(), diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts index ef3542b7ecffd..b7760a9032aca 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts @@ -310,6 +310,10 @@ export const updateCurrentWriteIndices = async ( return updateAllIndices(allIndices, callCluster); }; +function isCurrentIndex(item: CurrentIndex[] | undefined): item is CurrentIndex[] { + return item !== undefined; +} + const queryIndicesFromTemplates = async ( callCluster: CallESAsCurrentUser, templates: TemplateRef[] @@ -318,7 +322,7 @@ const queryIndicesFromTemplates = async ( return getIndices(callCluster, template); }); const indexObjects = await Promise.all(indexPromises); - return indexObjects.filter((item) => item !== undefined).flat(); + return indexObjects.filter(isCurrentIndex).flat(); }; const getIndices = async ( diff --git a/x-pack/plugins/ingest_manager/server/services/output.ts b/x-pack/plugins/ingest_manager/server/services/output.ts index 618fefd80edaf..b70578efe468c 100644 --- a/x-pack/plugins/ingest_manager/server/services/output.ts +++ b/x-pack/plugins/ingest_manager/server/services/output.ts @@ -4,13 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ import { SavedObjectsClientContract } from 'src/core/server'; -import { NewOutput, Output } from '../types'; +import { NewOutput, Output, OutputSOAttributes } from '../types'; import { DEFAULT_OUTPUT, OUTPUT_SAVED_OBJECT_TYPE } from '../constants'; import { appContextService } from './app_context'; import { decodeCloudId } from '../../common'; const SAVED_OBJECT_TYPE = OUTPUT_SAVED_OBJECT_TYPE; +let cachedAdminUser: null | { username: string; password: string } = null; + class OutputService { public async ensureDefaultOutput(soClient: SavedObjectsClientContract) { const outputs = await soClient.find({ @@ -35,7 +37,6 @@ class OutputService { } return { - id: outputs.saved_objects[0].id, ...outputs.saved_objects[0].attributes, }; } @@ -45,7 +46,7 @@ class OutputService { id: string, data: Partial ) { - await soClient.update(SAVED_OBJECT_TYPE, id, data); + await soClient.update(SAVED_OBJECT_TYPE, id, data); } public async getDefaultOutputId(soClient: SavedObjectsClientContract) { @@ -62,22 +63,28 @@ class OutputService { } public async getAdminUser(soClient: SavedObjectsClientContract) { + if (cachedAdminUser) { + return cachedAdminUser; + } + const defaultOutputId = await this.getDefaultOutputId(soClient); if (!defaultOutputId) { return null; } const so = await appContextService .getEncryptedSavedObjects() - ?.getDecryptedAsInternalUser(OUTPUT_SAVED_OBJECT_TYPE, defaultOutputId); + ?.getDecryptedAsInternalUser(OUTPUT_SAVED_OBJECT_TYPE, defaultOutputId); if (!so || !so.attributes.fleet_enroll_username || !so.attributes.fleet_enroll_password) { return null; } - return { + cachedAdminUser = { username: so!.attributes.fleet_enroll_username, password: so!.attributes.fleet_enroll_password, }; + + return cachedAdminUser; } public async create( @@ -85,7 +92,11 @@ class OutputService { output: NewOutput, options?: { id?: string } ): Promise { - const newSo = await soClient.create(SAVED_OBJECT_TYPE, output as Output, options); + const newSo = await soClient.create( + SAVED_OBJECT_TYPE, + output as Output, + options + ); return { id: newSo.id, @@ -94,7 +105,7 @@ class OutputService { } public async get(soClient: SavedObjectsClientContract, id: string): Promise { - const outputSO = await soClient.get(SAVED_OBJECT_TYPE, id); + const outputSO = await soClient.get(SAVED_OBJECT_TYPE, id); if (outputSO.error) { throw new Error(outputSO.error.message); @@ -107,7 +118,7 @@ class OutputService { } public async update(soClient: SavedObjectsClientContract, id: string, data: Partial) { - const outputSO = await soClient.update(SAVED_OBJECT_TYPE, id, data); + const outputSO = await soClient.update(SAVED_OBJECT_TYPE, id, data); if (outputSO.error) { throw new Error(outputSO.error.message); @@ -115,7 +126,7 @@ class OutputService { } public async list(soClient: SavedObjectsClientContract) { - const outputs = await soClient.find({ + const outputs = await soClient.find({ type: SAVED_OBJECT_TYPE, page: 1, perPage: 1000, @@ -133,6 +144,12 @@ class OutputService { perPage: 1000, }; } + + // Warning! This method is not going to working in a scenario with multiple Kibana instances, + // in this case Kibana should be restarted if the Admin User change + public invalidateCache() { + cachedAdminUser = null; + } } export const outputService = new OutputService(); diff --git a/x-pack/plugins/ingest_manager/server/services/setup.ts b/x-pack/plugins/ingest_manager/server/services/setup.ts index b6e1bca7b9d05..7a81a1db84b60 100644 --- a/x-pack/plugins/ingest_manager/server/services/setup.ts +++ b/x-pack/plugins/ingest_manager/server/services/setup.ts @@ -111,8 +111,8 @@ export async function setupFleet( cluster: ['monitor', 'manage_api_key'], indices: [ { - names: ['logs-*', 'metrics-*', 'events-*'], - privileges: ['write', 'create_index'], + names: ['logs-*', 'metrics-*', 'events-*', '.ds-logs-*', '.ds-metrics-*', '.ds-events-*'], + privileges: ['write', 'create_index', 'indices:admin/auto_create'], }, ], }, @@ -135,6 +135,8 @@ export async function setupFleet( }, }); + await outputService.invalidateCache(); + // save fleet admin user const defaultOutputId = await outputService.getDefaultOutputId(soClient); if (!defaultOutputId) { diff --git a/x-pack/plugins/ingest_manager/server/types/index.tsx b/x-pack/plugins/ingest_manager/server/types/index.tsx index e8ae8146d4fa2..2218d967fa8aa 100644 --- a/x-pack/plugins/ingest_manager/server/types/index.tsx +++ b/x-pack/plugins/ingest_manager/server/types/index.tsx @@ -19,14 +19,17 @@ export { AgentActionSOAttributes, Datasource, NewDatasource, + DatasourceSOAttributes, FullAgentConfigDatasource, FullAgentConfig, AgentConfig, + AgentConfigSOAttributes, NewAgentConfig, AgentConfigStatus, DataStream, Output, NewOutput, + OutputSOAttributes, OutputType, EnrollmentAPIKey, EnrollmentAPIKeySOAttributes, diff --git a/x-pack/plugins/ingest_pipelines/public/shared_imports.ts b/x-pack/plugins/ingest_pipelines/public/shared_imports.ts index a2ee321526052..ab56ae427120b 100644 --- a/x-pack/plugins/ingest_pipelines/public/shared_imports.ts +++ b/x-pack/plugins/ingest_pipelines/public/shared_imports.ts @@ -7,11 +7,18 @@ import { useKibana as _useKibana } from '../../../../src/plugins/kibana_react/pu import { AppServices } from './application'; export { + AuthorizationProvider, + Error, + NotAuthorizedSection, + SectionError, + SectionLoading, + sendRequest, SendRequestConfig, SendRequestResponse, - UseRequestConfig, - sendRequest, + useAuthorizationContext, useRequest, + UseRequestConfig, + WithPrivileges, } from '../../../../src/plugins/es_ui_shared/public/'; export { @@ -41,14 +48,4 @@ export { isEmptyString, } from '../../../../src/plugins/es_ui_shared/static/validators/string'; -export { - SectionLoading, - WithPrivileges, - AuthorizationProvider, - SectionError, - Error, - useAuthorizationContext, - NotAuthorizedSection, -} from '../../../../src/plugins/es_ui_shared/public'; - export const useKibana = () => _useKibana(); diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts b/x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts index 69cba215beafd..e82e05323e644 100644 --- a/x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts +++ b/x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts @@ -5,7 +5,7 @@ */ import { RouteDependencies } from '../../types'; import { API_BASE_PATH, APP_CLUSTER_REQUIRED_PRIVILEGES } from '../../../common/constants'; -import { Privileges } from '../../../../../../src/plugins/es_ui_shared/public'; +import { Privileges } from '../../../../../../src/plugins/es_ui_shared/common'; const extractMissingPrivileges = (privilegesObject: { [key: string]: boolean } = {}): string[] => Object.keys(privilegesObject).reduce((privileges: string[], privilegeName: string): string[] => { diff --git a/x-pack/plugins/lens/public/app_plugin/app.test.tsx b/x-pack/plugins/lens/public/app_plugin/app.test.tsx index 811f42590f07b..53498a8e5afa1 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.test.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.test.tsx @@ -5,6 +5,7 @@ */ import React from 'react'; +import { Observable } from 'rxjs'; import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { App } from './app'; @@ -13,8 +14,11 @@ import { AppMountParameters } from 'kibana/public'; import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { Document, SavedObjectStore } from '../persistence'; import { mount } from 'enzyme'; +import { + SavedObjectSaveModal, + checkForDuplicateTitle, +} from '../../../../../src/plugins/saved_objects/public'; import { createMemoryHistory, History } from 'history'; -import { SavedObjectSaveModal } from '../../../../../src/plugins/saved_objects/public'; import { esFilters, FilterManager, @@ -28,10 +32,20 @@ const dataStartMock = dataPluginMock.createStartContract(); import { navigationPluginMock } from '../../../../../src/plugins/navigation/public/mocks'; import { TopNavMenuData } from '../../../../../src/plugins/navigation/public'; import { coreMock } from 'src/core/public/mocks'; -import { Observable } from 'rxjs'; jest.mock('../persistence'); jest.mock('src/core/public'); +jest.mock('../../../../../src/plugins/saved_objects/public', () => { + // eslint-disable-next-line no-shadow + const { SavedObjectSaveModal, SavedObjectSaveModalOrigin } = jest.requireActual( + '../../../../../src/plugins/saved_objects/public' + ); + return { + SavedObjectSaveModal, + SavedObjectSaveModalOrigin, + checkForDuplicateTitle: jest.fn(), + }; +}); const navigationStartMock = navigationPluginMock.createStartContract(); @@ -644,6 +658,46 @@ describe('Lens App', () => { }); }); + it('checks for duplicate title before saving', async () => { + const args = defaultArgs; + args.editorFrame = frame; + (args.docStorage.save as jest.Mock).mockReturnValue(Promise.resolve({ id: '123' })); + + instance = mount(); + + const onChange = frame.mount.mock.calls[0][1].onChange; + await act(async () => + onChange({ + filterableIndexPatterns: [], + doc: ({ id: '123', expression: 'valid expression' } as unknown) as Document, + }) + ); + instance.update(); + await act(async () => { + getButton(instance).run(instance.getDOMNode()); + }); + instance.update(); + + const onTitleDuplicate = jest.fn(); + + await act(async () => { + instance.find(SavedObjectSaveModal).prop('onSave')({ + onTitleDuplicate, + isTitleDuplicateConfirmed: false, + newCopyOnSave: false, + newDescription: '', + newTitle: 'test', + }); + }); + + expect(checkForDuplicateTitle).toHaveBeenCalledWith( + expect.objectContaining({ id: '123' }), + false, + onTitleDuplicate, + expect.anything() + ); + }); + it('does not show the copy button on first save', async () => { const args = defaultArgs; args.editorFrame = frame; diff --git a/x-pack/plugins/lens/public/app_plugin/app.tsx b/x-pack/plugins/lens/public/app_plugin/app.tsx index f88c1c5aca31d..fc8d5dd9eb395 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.tsx @@ -24,6 +24,7 @@ import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/p import { SavedObjectSaveModalOrigin, OnSaveProps, + checkForDuplicateTitle, } from '../../../../../src/plugins/saved_objects/public'; import { Document, SavedObjectStore } from '../persistence'; import { EditorFrameInstance } from '../types'; @@ -252,9 +253,11 @@ export function App({ // state.persistedDoc, ]); - const runSave = ( + const runSave = async ( saveProps: Omit & { returnToOrigin: boolean; + onTitleDuplicate?: OnSaveProps['onTitleDuplicate']; + newDescription?: string; } ) => { if (!lastKnownDoc) { @@ -276,10 +279,30 @@ export function App({ const doc = { ...lastDocWithoutPinned, + description: saveProps.newDescription, id: saveProps.newCopyOnSave ? undefined : lastKnownDoc.id, title: saveProps.newTitle, }; + await checkForDuplicateTitle( + { + ...doc, + copyOnSave: saveProps.newCopyOnSave, + lastSavedTitle: lastKnownDoc?.title, + getEsType: () => 'lens', + getDisplayName: () => + i18n.translate('xpack.lens.app.saveModalType', { + defaultMessage: 'Lens visualization', + }), + }, + saveProps.isTitleDuplicateConfirmed, + saveProps.onTitleDuplicate, + { + savedObjectsClient: core.savedObjects.client, + overlays: core.overlays, + } + ); + const newlyCreated: boolean = saveProps.newCopyOnSave || !lastKnownDoc?.id; docStorage .save(doc) @@ -492,6 +515,7 @@ export function App({ documentInfo={{ id: lastKnownDoc.id, title: lastKnownDoc.title || '', + description: lastKnownDoc.description || '', }} objectType={i18n.translate('xpack.lens.app.saveModalType', { defaultMessage: 'Lens visualization', diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/save.ts b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/save.ts index b292299c569af..d62f3dbcf029a 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/save.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/save.ts @@ -48,6 +48,7 @@ export function getSavedObjectFormat({ return { id: state.persistedId, title: state.title, + description: state.description, type: 'lens', visualizationType: state.visualization.activeId, expression: expression ? toExpression(expression) : '', diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.test.ts b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.test.ts index 71aabaae3c65c..e1151b92aac51 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.test.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.test.ts @@ -388,6 +388,7 @@ describe('editor_frame state management', () => { filters: [], }, title: 'heyo!', + description: 'My lens', type: 'lens', visualizationType: 'line', }, @@ -406,6 +407,7 @@ describe('editor_frame state management', () => { }, persistedId: 'b', title: 'heyo!', + description: 'My lens', visualization: { activeId: 'line', state: { diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.ts b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.ts index bb6daf5641a64..09674ebf2ade2 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.ts @@ -18,6 +18,7 @@ export interface PreviewState { export interface EditorFrameState extends PreviewState { persistedId?: string; title: string; + description?: string; stagedPreview?: PreviewState; activeDatasourceId: string | null; } @@ -157,6 +158,7 @@ export const reducer = (state: EditorFrameState, action: Action): EditorFrameSta ...state, persistedId: action.doc.id, title: action.doc.title, + description: action.doc.description, datasourceStates: Object.entries(action.doc.state.datasourceStates).reduce( (stateMap, [datasourceId, datasourceState]) => ({ ...stateMap, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index a9e9efa8d1039..4397ad65d63a5 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -467,7 +467,7 @@ describe('IndexPatternDimensionEditorPanel', () => { expect(setState).not.toHaveBeenCalled(); }); - it('should update label on label input changes', () => { + it('should update label and custom label flag on label input changes', () => { wrapper = mount(); act(() => { @@ -485,6 +485,7 @@ describe('IndexPatternDimensionEditorPanel', () => { ...state.layers.first.columns, col1: expect.objectContaining({ label: 'New Label', + customLabel: true, // Other parts of this don't matter for this test }), }, @@ -493,6 +494,104 @@ describe('IndexPatternDimensionEditorPanel', () => { }); }); + it('should not keep the label as long as it is the default label', () => { + wrapper = mount( + + ); + + act(() => { + wrapper.find('button[data-test-subj="lns-indexPatternDimension-min"]').simulate('click'); + }); + + expect(setState).toHaveBeenCalledWith({ + ...state, + layers: { + first: { + ...state.layers.first, + columns: { + ...state.layers.first.columns, + col1: expect.objectContaining({ + label: 'Minimum of bytes', + }), + }, + }, + }, + }); + }); + + it('should keep the label on operation change if it is custom', () => { + wrapper = mount( + + ); + + act(() => { + wrapper.find('button[data-test-subj="lns-indexPatternDimension-min"]').simulate('click'); + }); + + expect(setState).toHaveBeenCalledWith({ + ...state, + layers: { + first: { + ...state.layers.first, + columns: { + ...state.layers.first.columns, + col1: expect.objectContaining({ + label: 'Custom label', + customLabel: true, + }), + }, + }, + }, + }); + }); + describe('transient invalid state', () => { it('should not set the state if selecting an operation incompatible with the current field', () => { wrapper = mount(); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/popover_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/popover_editor.tsx index 6bd4263014b13..7bed770e63fd2 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/popover_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/popover_editor.tsx @@ -314,17 +314,23 @@ export function PopoverEditor(props: PopoverEditorProps) { data-test-subj="indexPattern-label-edit" value={selectedColumn.label} onChange={(e) => { - setState( - changeColumn({ - state, - layerId, - columnId, - newColumn: { - ...selectedColumn, - label: e.target.value, + setState({ + ...state, + layers: { + ...state.layers, + [layerId]: { + ...state.layers[layerId], + columns: { + ...state.layers[layerId].columns, + [columnId]: { + ...selectedColumn, + label: e.target.value, + customLabel: true, + }, + }, }, - }) - ); + }, + }); }} /> diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx index c94dd621b9d19..9c4f6c9b590ce 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx @@ -281,7 +281,6 @@ export function getIndexPatternDatasource({ ) => { render( { changeLayerIndexPattern({ savedObjectsClient, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts index 639e982142f57..3244eeb94d1e2 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts @@ -16,6 +16,7 @@ export interface BaseIndexPatternColumn extends Operation { operationType: string; sourceField: string; suggestedPriority?: DimensionPriority; + customLabel?: boolean; } // Formatting can optionally be added to any column diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.test.ts index 1e3251a8dedd8..074cb8f5bde17 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.test.ts @@ -331,6 +331,61 @@ describe('state_helpers', () => { ); }); + it('should carry over label if customLabel flag is set', () => { + const state: IndexPatternPrivateState = { + indexPatternRefs: [], + existingFields: {}, + indexPatterns: {}, + currentIndexPatternId: '1', + showEmptyFields: false, + layers: { + first: { + indexPatternId: '1', + columnOrder: ['col1'], + columns: { + col1: { + label: 'My custom label', + customLabel: true, + dataType: 'date', + isBucketed: true, + + // Private + operationType: 'date_histogram', + sourceField: 'timestamp', + params: { + interval: 'h', + }, + }, + }, + }, + }, + }; + expect( + changeColumn({ + state, + layerId: 'first', + columnId: 'col2', + newColumn: { + label: 'Date histogram of order_date', + dataType: 'date', + isBucketed: true, + + // Private + operationType: 'date_histogram', + sourceField: 'order_date', + params: { + interval: 'w', + }, + }, + }).layers.first.columns.col1 + ).toEqual( + expect.objectContaining({ + label: 'My custom label', + customLabel: true, + }) + ); + }); + it('should execute adjustments for other columns', () => { const termsColumn: TermsIndexPatternColumn = { label: 'Top values of source', diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.ts b/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.ts index a34d0c4187485..3a1aaaa819dc0 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/state_helpers.ts @@ -87,6 +87,11 @@ export function changeColumn({ ? { ...newColumn, params: oldColumn.params } : newColumn; + if (oldColumn && oldColumn.customLabel) { + updatedColumn.customLabel = true; + updatedColumn.label = oldColumn.label; + } + const newColumns = adjustColumnReferencesForChangedColumn( { ...state.layers[layerId].columns, diff --git a/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts b/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts index 515d008d82586..f7caac6549389 100644 --- a/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts +++ b/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts @@ -25,6 +25,7 @@ describe('LensStore', () => { const { client, store } = testStore('FOO'); const doc = await store.save({ title: 'Hello', + description: 'My doc', visualizationType: 'bar', expression: '', state: { @@ -43,6 +44,7 @@ describe('LensStore', () => { expect(doc).toEqual({ id: 'FOO', title: 'Hello', + description: 'My doc', visualizationType: 'bar', expression: '', state: { @@ -61,6 +63,7 @@ describe('LensStore', () => { expect(client.create).toHaveBeenCalledTimes(1); expect(client.create).toHaveBeenCalledWith('lens', { title: 'Hello', + description: 'My doc', visualizationType: 'bar', expression: '', state: { diff --git a/x-pack/plugins/lens/public/persistence/saved_object_store.ts b/x-pack/plugins/lens/public/persistence/saved_object_store.ts index 015f4b9b825f4..7632be3d82046 100644 --- a/x-pack/plugins/lens/public/persistence/saved_object_store.ts +++ b/x-pack/plugins/lens/public/persistence/saved_object_store.ts @@ -13,6 +13,7 @@ export interface Document { type?: string; visualizationType: string | null; title: string; + description?: string; expression: string | null; state: { datasourceMetaData: { diff --git a/x-pack/plugins/lens/public/vis_type_alias.ts b/x-pack/plugins/lens/public/vis_type_alias.ts index a58288191325c..3bb2dbbae1f9c 100644 --- a/x-pack/plugins/lens/public/vis_type_alias.ts +++ b/x-pack/plugins/lens/public/vis_type_alias.ts @@ -34,10 +34,11 @@ export const getLensAliasConfig = (): VisTypeAlias => ({ searchFields: ['title^3'], toListItem(savedObject) { const { id, type, attributes } = savedObject; - const { title } = attributes as { title: string }; + const { title, description } = attributes as { title: string; description?: string }; return { id, title, + description, editUrl: getEditPath(id), editApp: 'lens', icon: 'lensApp', diff --git a/x-pack/plugins/lens/server/saved_objects.ts b/x-pack/plugins/lens/server/saved_objects.ts index 1f7d22e2b5642..a16cc3dab7967 100644 --- a/x-pack/plugins/lens/server/saved_objects.ts +++ b/x-pack/plugins/lens/server/saved_objects.ts @@ -29,6 +29,9 @@ export function setupSavedObjects(core: CoreSetup) { title: { type: 'text', }, + description: { + type: 'text', + }, visualizationType: { type: 'keyword', }, diff --git a/x-pack/plugins/license_management/public/application/store/actions/start_basic.js b/x-pack/plugins/license_management/public/application/store/actions/start_basic.js index 5ae93bf84c2f8..bce6195caecf0 100644 --- a/x-pack/plugins/license_management/public/application/store/actions/start_basic.js +++ b/x-pack/plugins/license_management/public/application/store/actions/start_basic.js @@ -45,7 +45,8 @@ export const startBasicLicense = (currentLicenseType, ack) => async ( 'xpack.licenseMgmt.replacingCurrentLicenseWithBasicLicenseWarningMessage', { //eslint-disable-next-line - defaultMessage: 'Some functionality will be lost if you replace your {currentLicenseType} license with a BASIC license. Review the list of features below.', + defaultMessage: + 'Some functionality will be lost if you replace your {currentLicenseType} license with a BASIC license. Review the list of features below.', values: { currentLicenseType: currentLicenseType.toUpperCase(), }, diff --git a/x-pack/plugins/lists/README.md b/x-pack/plugins/lists/README.md index cb343c95b0103..cdd7813792fc3 100644 --- a/x-pack/plugins/lists/README.md +++ b/x-pack/plugins/lists/README.md @@ -149,7 +149,7 @@ And you can attach exception list items like so: "malware", "os:linux" ], - "comment": [], + "comments": [], "created_at": "2020-05-28T19:17:21.099Z", "created_by": "yo", "description": "This is a sample endpoint type exception", diff --git a/x-pack/plugins/lists/common/constants.mock.ts b/x-pack/plugins/lists/common/constants.mock.ts index d8e4dfba1599e..0df0aeff593db 100644 --- a/x-pack/plugins/lists/common/constants.mock.ts +++ b/x-pack/plugins/lists/common/constants.mock.ts @@ -31,6 +31,7 @@ export const VALUE_2 = '255.255.255'; export const NAMESPACE_TYPE = 'single'; // Exception List specific +export const ID = 'uuid_here'; export const ENDPOINT_TYPE = 'endpoint'; export const ENTRIES = [ { field: 'some.field', match: 'some value', match_any: undefined, operator: 'included' }, @@ -38,4 +39,4 @@ export const ENTRIES = [ export const ITEM_TYPE = 'simple'; export const _TAGS = []; export const TAGS = []; -export const COMMENT = []; +export const COMMENTS = []; diff --git a/x-pack/plugins/lists/common/schemas/common/schemas.ts b/x-pack/plugins/lists/common/schemas/common/schemas.ts index 7f086647bbc75..3d1f537a9ca41 100644 --- a/x-pack/plugins/lists/common/schemas/common/schemas.ts +++ b/x-pack/plugins/lists/common/schemas/common/schemas.ts @@ -86,12 +86,6 @@ export type ExceptionListItemType = t.TypeOf; export const list_type = t.keyof({ item: null, list: null }); export type ListType = t.TypeOf; -// TODO: Investigate what the deep structure of a comment is really going to be and then change this to use that deep structure with a default array -export const comment = DefaultStringArray; -export type Comment = t.TypeOf; -export const commentOrUndefined = t.union([comment, t.undefined]); -export type CommentOrUndefined = t.TypeOf; - export const item_id = NonEmptyString; export type ItemId = t.TypeOf; export const itemIdOrUndefined = t.union([item_id, t.undefined]); diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts index f9af10245b7ee..0450849931b30 100644 --- a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts +++ b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts @@ -5,7 +5,7 @@ */ import { - COMMENT, + COMMENTS, DESCRIPTION, ENTRIES, ITEM_TYPE, @@ -21,7 +21,7 @@ import { CreateExceptionListItemSchema } from './create_exception_list_item_sche export const getCreateExceptionListItemSchemaMock = (): CreateExceptionListItemSchema => ({ _tags: _TAGS, - comment: COMMENT, + comments: COMMENTS, description: DESCRIPTION, entries: ENTRIES, item_id: undefined, diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts new file mode 100644 index 0000000000000..61437b1f04ce3 --- /dev/null +++ b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts @@ -0,0 +1,189 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; + +import { exactCheck, foldLeftRight, getPaths } from '../../siem_common_deps'; + +import { + CreateExceptionListItemSchema, + createExceptionListItemSchema, +} from './create_exception_list_item_schema'; +import { getCreateExceptionListItemSchemaMock } from './create_exception_list_item_schema.mock'; + +describe('create_exception_list_schema', () => { + test('it should validate a typical exception list item request', () => { + const payload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should not accept an undefined for "description"', () => { + const payload = getCreateExceptionListItemSchemaMock(); + delete payload.description; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "name"', () => { + const payload = getCreateExceptionListItemSchemaMock(); + delete payload.name; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "type"', () => { + const payload = getCreateExceptionListItemSchemaMock(); + delete payload.type; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "list_id"', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.list_id; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete payload.meta; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "comments" but return an array', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.comments; + outputPayload.comments = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "entries" but return an array', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.entries; + outputPayload.entries = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "namespace_type" but return enum "single"', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.namespace_type; + outputPayload.namespace_type = 'single'; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "tags" but return an array', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "_tags" but return an array', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload._tags; + outputPayload._tags = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + outputPayload.item_id = (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "item_id" and auto generate a uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as CreateExceptionListItemSchema).item_id).toMatch( + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i + ); + }); + + test('it should accept an undefined for "item_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateExceptionListItemSchema & { + extraKey?: string; + } = getCreateExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.ts b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.ts index 4322ff4c2801b..f593b5d164035 100644 --- a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.ts +++ b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.ts @@ -14,7 +14,6 @@ import { Tags, _Tags, _tags, - comment, description, exceptionListItemType, list_id, @@ -24,7 +23,7 @@ import { tags, } from '../common/schemas'; import { Identity, RequiredKeepUndefined } from '../../types'; -import { DefaultEntryArray } from '../types'; +import { CommentsPartialArray, DefaultCommentsPartialArray, DefaultEntryArray } from '../types'; import { EntriesArray } from '../types/entries'; import { DefaultUuid } from '../../siem_common_deps'; @@ -40,7 +39,7 @@ export const createExceptionListItemSchema = t.intersection([ t.exact( t.partial({ _tags, // defaults to empty array if not set during decode - comment, // defaults to empty array if not set during decode + comments: DefaultCommentsPartialArray, // defaults to empty array if not set during decode entries: DefaultEntryArray, // defaults to empty array if not set during decode item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode meta, // defaults to undefined if not set during decode @@ -61,9 +60,10 @@ export type CreateExceptionListItemSchema = RequiredKeepUndefined< export type CreateExceptionListItemSchemaDecoded = Identity< Omit< CreateExceptionListItemSchema, - '_tags' | 'tags' | 'item_id' | 'entries' | 'namespace_type' + '_tags' | 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' > & { _tags: _Tags; + comments: CommentsPartialArray; tags: Tags; item_id: ItemId; entries: EntriesArray; diff --git a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.ts b/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.ts index 0a5e861d84483..ee6a2aa0b339a 100644 --- a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.ts +++ b/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.ts @@ -6,9 +6,6 @@ /* eslint-disable @typescript-eslint/camelcase */ -// TODO: You cannot import a stream from common into the front end code! CHANGE THIS -import { Readable } from 'stream'; - import * as t from 'io-ts'; import { file } from '../common/schemas'; @@ -20,17 +17,3 @@ export const importListItemSchema = t.exact( ); export type ImportListItemSchema = t.TypeOf; - -// TODO: You cannot import a stream from common into the front end code! CHANGE THIS -export interface HapiReadableStream extends Readable { - hapi: { - filename: string; - }; -} - -/** - * Special interface since we are streaming in a file through a reader - */ -export interface ImportListItemHapiFileSchema { - file: HapiReadableStream; -} diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts new file mode 100644 index 0000000000000..e8936f0bdc6d4 --- /dev/null +++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { + COMMENTS, + DESCRIPTION, + ENTRIES, + ID, + ITEM_TYPE, + LIST_ITEM_ID, + META, + NAME, + NAMESPACE_TYPE, + TAGS, + _TAGS, +} from '../../constants.mock'; + +import { UpdateExceptionListItemSchema } from './update_exception_list_item_schema'; + +export const getUpdateExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ + _tags: _TAGS, + comments: COMMENTS, + description: DESCRIPTION, + entries: ENTRIES, + id: ID, + item_id: LIST_ITEM_ID, + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + tags: TAGS, + type: ITEM_TYPE, +}); diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts new file mode 100644 index 0000000000000..38541e205598b --- /dev/null +++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts @@ -0,0 +1,183 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; + +import { exactCheck, foldLeftRight, getPaths } from '../../siem_common_deps'; + +import { + UpdateExceptionListItemSchema, + updateExceptionListItemSchema, +} from './update_exception_list_item_schema'; +import { getUpdateExceptionListItemSchemaMock } from './update_exception_list_item_schema.mock'; + +describe('update_exception_list_item_schema', () => { + test('it should validate a typical exception list item request', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not accept an undefined for "description"', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + delete payload.description; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "name"', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + delete payload.name; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "type"', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + delete payload.type; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept a value for "list_id"', () => { + const payload: UpdateExceptionListItemSchema & { + list_id?: string; + } = getUpdateExceptionListItemSchemaMock(); + payload.list_id = 'some new list_id'; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete payload.meta; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "comments" but return an array', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.comments; + outputPayload.comments = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "entries" but return an array', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.entries; + outputPayload.entries = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "namespace_type" but return enum "single"', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.namespace_type; + outputPayload.namespace_type = 'single'; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "tags" but return an array', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "_tags" but return an array', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload._tags; + outputPayload._tags = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + // TODO: Is it expected behavior for it not to auto-generate a uui or throw + // error if item_id is not passed in? + xtest('it should accept an undefined for "item_id" and auto generate a uuid', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as UpdateExceptionListItemSchema).item_id).toMatch( + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i + ); + }); + + test('it should accept an undefined for "item_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as UpdateExceptionListItemSchema).item_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: UpdateExceptionListItemSchema & { + extraKey?: string; + } = getUpdateExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.ts index 3d66dad959c25..c32b15fecb571 100644 --- a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.ts +++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.ts @@ -13,7 +13,6 @@ import { Tags, _Tags, _tags, - comment, description, exceptionListItemType, id, @@ -23,8 +22,12 @@ import { tags, } from '../common/schemas'; import { Identity, RequiredKeepUndefined } from '../../types'; -import { DefaultEntryArray } from '../types'; -import { EntriesArray } from '../types/entries'; +import { + CommentsPartialArray, + DefaultCommentsPartialArray, + DefaultEntryArray, + EntriesArray, +} from '../types'; export const updateExceptionListItemSchema = t.intersection([ t.exact( @@ -37,7 +40,7 @@ export const updateExceptionListItemSchema = t.intersection([ t.exact( t.partial({ _tags, // defaults to empty array if not set during decode - comment, // defaults to empty array if not set during decode + comments: DefaultCommentsPartialArray, // defaults to empty array if not set during decode entries: DefaultEntryArray, // defaults to empty array if not set during decode id, // defaults to undefined if not set during decode item_id: t.union([t.string, t.undefined]), @@ -57,8 +60,12 @@ export type UpdateExceptionListItemSchema = RequiredKeepUndefined< // This type is used after a decode since some things are defaults after a decode. export type UpdateExceptionListItemSchemaDecoded = Identity< - Omit & { + Omit< + UpdateExceptionListItemSchema, + '_tags' | 'tags' | 'entries' | 'namespace_type' | 'comments' + > & { _tags: _Tags; + comments: CommentsPartialArray; tags: Tags; entries: EntriesArray; namespace_type: NamespaceType; diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts index 901715b601b80..663bfc7038330 100644 --- a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts @@ -8,7 +8,7 @@ import { ExceptionListItemSchema } from './exception_list_item_schema'; export const getExceptionListItemSchemaMock = (): ExceptionListItemSchema => ({ _tags: ['endpoint', 'process', 'malware', 'os:linux'], - comment: [], + comments: [], created_at: '2020-04-23T00:19:13.289Z', created_by: 'user_name', description: 'This is a sample endpoint type exception', diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts new file mode 100644 index 0000000000000..b9d142fbccbee --- /dev/null +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts @@ -0,0 +1,230 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; + +import { exactCheck, foldLeftRight, getPaths } from '../../siem_common_deps'; + +import { getExceptionListItemSchemaMock } from './exception_list_item_schema.mock'; +import { ExceptionListItemSchema, exceptionListItemSchema } from './exception_list_item_schema'; + +describe('exception_list_item_schema', () => { + test('it should validate a typical exception list item response', () => { + const payload = getExceptionListItemSchemaMock(); + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.list_id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "item_id"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.item_id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "item_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "comments"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.comments; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "comments"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "entries"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.entries; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "name"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.name; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + // TODO: Should this throw an error? "namespace_type" gets auto-populated + // with default "single", is that desired behavior? + xtest('it should NOT accept an undefined for "namespace_type"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.namespace_type; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "namespace_type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "description"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.description; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.meta; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "created_at"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.created_at; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "created_by"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.created_by; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "tie_breaker_id"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.tie_breaker_id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "tie_breaker_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.type; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_at"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.updated_at; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_by"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.updated_by; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ExceptionListItemSchema & { + extraKey?: string; + } = getExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts index ab405c21d9c77..0de8fd72900af 100644 --- a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.ts @@ -10,7 +10,6 @@ import * as t from 'io-ts'; import { _tags, - commentOrUndefined, created_at, created_by, description, @@ -26,13 +25,13 @@ import { updated_at, updated_by, } from '../common/schemas'; -import { entriesArray } from '../types'; +import { commentsArray, entriesArray } from '../types'; // TODO: Should we use a partial here to reflect that this can JSON serialize meta, comment as non existent? export const exceptionListItemSchema = t.exact( t.type({ _tags, - comment: commentOrUndefined, + comments: commentsArray, created_at, created_by, description, diff --git a/x-pack/plugins/lists/common/schemas/saved_objects/exceptions_list_so_schema.ts b/x-pack/plugins/lists/common/schemas/saved_objects/exceptions_list_so_schema.ts index a08bab65c881c..0b61f122463f3 100644 --- a/x-pack/plugins/lists/common/schemas/saved_objects/exceptions_list_so_schema.ts +++ b/x-pack/plugins/lists/common/schemas/saved_objects/exceptions_list_so_schema.ts @@ -8,10 +8,9 @@ import * as t from 'io-ts'; -import { entriesArrayOrUndefined } from '../types'; +import { commentsArrayOrUndefined, entriesArrayOrUndefined } from '../types'; import { _tags, - commentOrUndefined, created_at, created_by, description, @@ -30,7 +29,7 @@ import { export const exceptionListSoSchema = t.exact( t.type({ _tags, - comment: commentOrUndefined, + comments: commentsArrayOrUndefined, created_at, created_by, description, diff --git a/x-pack/plugins/lists/common/schemas/types/comments.ts b/x-pack/plugins/lists/common/schemas/types/comments.ts new file mode 100644 index 0000000000000..d61608c3508f4 --- /dev/null +++ b/x-pack/plugins/lists/common/schemas/types/comments.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import * as t from 'io-ts'; + +export const comment = t.exact( + t.type({ + comment: t.string, + created_at: t.string, // TODO: Make this into an ISO Date string check, + created_by: t.string, + }) +); + +export const commentsArray = t.array(comment); +export type CommentsArray = t.TypeOf; +export type Comment = t.TypeOf; +export const commentsArrayOrUndefined = t.union([commentsArray, t.undefined]); +export type CommentsArrayOrUndefined = t.TypeOf; + +export const commentPartial = t.intersection([ + t.exact( + t.type({ + comment: t.string, + }) + ), + t.exact( + t.partial({ + created_at: t.string, // TODO: Make this into an ISO Date string check, + created_by: t.string, + }) + ), +]); + +export const commentsPartialArray = t.array(commentPartial); +export type CommentsPartialArray = t.TypeOf; +export type CommentPartial = t.TypeOf; +export const commentsPartialArrayOrUndefined = t.union([commentsPartialArray, t.undefined]); +export type CommentsPartialArrayOrUndefined = t.TypeOf; diff --git a/x-pack/plugins/lists/common/schemas/types/default_comments_array.ts b/x-pack/plugins/lists/common/schemas/types/default_comments_array.ts new file mode 100644 index 0000000000000..a80bb968561f0 --- /dev/null +++ b/x-pack/plugins/lists/common/schemas/types/default_comments_array.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +import { CommentsArray, CommentsPartialArray, comment, commentPartial } from './comments'; + +export type DefaultCommentsArrayC = t.Type; +export type DefaultCommentsPartialArrayC = t.Type< + CommentsPartialArray, + CommentsPartialArray, + unknown +>; + +/** + * Types the DefaultCommentsArray as: + * - If null or undefined, then a default array of type entry will be set + */ +export const DefaultCommentsArray: DefaultCommentsArrayC = new t.Type< + CommentsArray, + CommentsArray, + unknown +>( + 'DefaultCommentsArray', + t.array(comment).is, + (input): Either => + input == null ? t.success([]) : t.array(comment).decode(input), + t.identity +); + +/** + * Types the DefaultCommentsPartialArray as: + * - If null or undefined, then a default array of type entry will be set + */ +export const DefaultCommentsPartialArray: DefaultCommentsPartialArrayC = new t.Type< + CommentsPartialArray, + CommentsPartialArray, + unknown +>( + 'DefaultCommentsPartialArray', + t.array(commentPartial).is, + (input): Either => + input == null ? t.success([]) : t.array(commentPartial).decode(input), + t.identity +); diff --git a/x-pack/plugins/lists/common/schemas/types/index.ts b/x-pack/plugins/lists/common/schemas/types/index.ts index 2f38ff86d4fb2..8e4b28b31d95c 100644 --- a/x-pack/plugins/lists/common/schemas/types/index.ts +++ b/x-pack/plugins/lists/common/schemas/types/index.ts @@ -3,5 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +export * from './default_comments_array'; export * from './default_entries_array'; +export * from './comments'; export * from './entries'; diff --git a/x-pack/plugins/lists/public/exceptions/__mocks__/api.ts b/x-pack/plugins/lists/public/exceptions/__mocks__/api.ts index ecc771279b3ab..9651be0d04e8c 100644 --- a/x-pack/plugins/lists/public/exceptions/__mocks__/api.ts +++ b/x-pack/plugins/lists/public/exceptions/__mocks__/api.ts @@ -54,3 +54,18 @@ export const fetchExceptionListItemById = async ({ signal, }: ApiCallByIdProps): Promise => Promise.resolve(getExceptionListItemSchemaMock()); + +export const deleteExceptionListById = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise => Promise.resolve(getExceptionListSchemaMock()); + +export const deleteExceptionListItemById = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise => + Promise.resolve(getExceptionListItemSchemaMock()); diff --git a/x-pack/plugins/lists/public/exceptions/api.test.ts b/x-pack/plugins/lists/public/exceptions/api.test.ts index b9512bb398745..66c92e0823d62 100644 --- a/x-pack/plugins/lists/public/exceptions/api.test.ts +++ b/x-pack/plugins/lists/public/exceptions/api.test.ts @@ -57,7 +57,7 @@ describe('Exceptions Lists API', () => { method: 'POST', signal: abortCtrl.signal, }); - expect(exceptionResponse).toEqual({ id: '1', ...getExceptionListSchemaMock() }); + expect(exceptionResponse).toEqual(getExceptionListSchemaMock()); }); test('it uses PUT when "list.id" exists', async () => { diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.tsx b/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.tsx new file mode 100644 index 0000000000000..edf65839c07cf --- /dev/null +++ b/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.tsx @@ -0,0 +1,257 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { act, renderHook } from '@testing-library/react-hooks'; + +import * as api from '../api'; +import { createKibanaCoreStartMock } from '../../common/mocks/kibana_core'; +import { getExceptionListSchemaMock } from '../../../common/schemas/response/exception_list_schema.mock'; +import { getExceptionListItemSchemaMock } from '../../../common/schemas/response/exception_list_item_schema.mock'; +import { HttpStart } from '../../../../../../src/core/public'; +import { ApiCallByIdProps } from '../types'; + +import { ExceptionsApi, useApi } from './use_api'; + +jest.mock('../api'); + +const mockKibanaHttpService = createKibanaCoreStartMock().http; + +describe('useApi', () => { + const onErrorMock = jest.fn(); + + afterEach(() => { + onErrorMock.mockClear(); + jest.clearAllMocks(); + }); + + test('it invokes "deleteExceptionListItemById" when "deleteExceptionItem" used', async () => { + const payload = getExceptionListItemSchemaMock(); + const onSuccessMock = jest.fn(); + const spyOnDeleteExceptionListItemById = jest + .spyOn(api, 'deleteExceptionListItemById') + .mockResolvedValue(payload); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = payload; + + await result.current.deleteExceptionItem({ + id, + namespaceType, + onError: jest.fn(), + onSuccess: onSuccessMock, + }); + + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; + + expect(spyOnDeleteExceptionListItemById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); + }); + }); + + test('invokes "onError" callback if "deleteExceptionListItemById" fails', async () => { + const mockError = new Error('failed to delete item'); + jest.spyOn(api, 'deleteExceptionListItemById').mockRejectedValue(mockError); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = getExceptionListItemSchemaMock(); + + await result.current.deleteExceptionItem({ + id, + namespaceType, + onError: onErrorMock, + onSuccess: jest.fn(), + }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); + }); + }); + + test('it invokes "deleteExceptionListById" when "deleteExceptionList" used', async () => { + const payload = getExceptionListSchemaMock(); + const onSuccessMock = jest.fn(); + const spyOnDeleteExceptionListById = jest + .spyOn(api, 'deleteExceptionListById') + .mockResolvedValue(payload); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = payload; + + await result.current.deleteExceptionList({ + id, + namespaceType, + onError: jest.fn(), + onSuccess: onSuccessMock, + }); + + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; + + expect(spyOnDeleteExceptionListById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); + }); + }); + + test('invokes "onError" callback if "deleteExceptionListById" fails', async () => { + const mockError = new Error('failed to delete item'); + jest.spyOn(api, 'deleteExceptionListById').mockRejectedValue(mockError); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + + await result.current.deleteExceptionList({ + id, + namespaceType, + onError: onErrorMock, + onSuccess: jest.fn(), + }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); + }); + }); + + test('it invokes "fetchExceptionListItemById" when "getExceptionItem" used', async () => { + const payload = getExceptionListItemSchemaMock(); + const onSuccessMock = jest.fn(); + const spyOnFetchExceptionListItemById = jest + .spyOn(api, 'fetchExceptionListItemById') + .mockResolvedValue(payload); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = payload; + + await result.current.getExceptionItem({ + id, + namespaceType, + onError: jest.fn(), + onSuccess: onSuccessMock, + }); + + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; + + expect(spyOnFetchExceptionListItemById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); + }); + }); + + test('invokes "onError" callback if "fetchExceptionListItemById" fails', async () => { + const mockError = new Error('failed to delete item'); + jest.spyOn(api, 'fetchExceptionListItemById').mockRejectedValue(mockError); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + + await result.current.getExceptionItem({ + id, + namespaceType, + onError: onErrorMock, + onSuccess: jest.fn(), + }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); + }); + }); + + test('it invokes "fetchExceptionListById" when "getExceptionList" used', async () => { + const payload = getExceptionListSchemaMock(); + const onSuccessMock = jest.fn(); + const spyOnFetchExceptionListById = jest + .spyOn(api, 'fetchExceptionListById') + .mockResolvedValue(payload); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = payload; + + await result.current.getExceptionList({ + id, + namespaceType, + onError: jest.fn(), + onSuccess: onSuccessMock, + }); + + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; + + expect(spyOnFetchExceptionListById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); + }); + }); + + test('invokes "onError" callback if "fetchExceptionListById" fails', async () => { + const mockError = new Error('failed to delete item'); + jest.spyOn(api, 'fetchExceptionListById').mockRejectedValue(mockError); + + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => + useApi(mockKibanaHttpService) + ); + await waitForNextUpdate(); + + const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + + await result.current.getExceptionList({ + id, + namespaceType, + onError: onErrorMock, + onSuccess: jest.fn(), + }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); + }); + }); +}); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.test.tsx b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.test.tsx index fbd43787a822e..eeb3ac63ee318 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.test.tsx @@ -11,7 +11,7 @@ import { createKibanaCoreStartMock } from '../../common/mocks/kibana_core'; import { getExceptionListSchemaMock } from '../../../common/schemas/response/exception_list_schema.mock'; import { getExceptionListItemSchemaMock } from '../../../common/schemas/response/exception_list_item_schema.mock'; import { ExceptionListItemSchema } from '../../../common/schemas'; -import { ExceptionList, UseExceptionListProps } from '../types'; +import { ExceptionList, UseExceptionListProps, UseExceptionListSuccess } from '../types'; import { ReturnExceptionListAndItems, useExceptionList } from './use_exception_list'; @@ -57,6 +57,7 @@ describe('useExceptionList', () => { test('fetch exception list and items', async () => { await act(async () => { + const onSuccessMock = jest.fn(); const { result, waitForNextUpdate } = renderHook< UseExceptionListProps, ReturnExceptionListAndItems @@ -65,6 +66,7 @@ describe('useExceptionList', () => { http: mockKibanaHttpService, lists: [{ id: 'myListId', namespaceType: 'single' }], onError: onErrorMock, + onSuccess: onSuccessMock, }) ); await waitForNextUpdate(); @@ -78,6 +80,12 @@ describe('useExceptionList', () => { { ...getExceptionListItemSchemaMock() }, ]; + const expectedResult: UseExceptionListSuccess = { + exceptions: expectedListItemsResult, + lists: expectedListResult, + pagination: { page: 1, perPage: 20, total: 1 }, + }; + expect(result.current).toEqual([ false, expectedListResult, @@ -89,6 +97,7 @@ describe('useExceptionList', () => { }, result.current[4], ]); + expect(onSuccessMock).toHaveBeenCalledWith(expectedResult); }); }); @@ -100,13 +109,14 @@ describe('useExceptionList', () => { UseExceptionListProps, ReturnExceptionListAndItems >( - ({ filterOptions, http, lists, pagination, onError }) => - useExceptionList({ filterOptions, http, lists, onError, pagination }), + ({ filterOptions, http, lists, pagination, onError, onSuccess }) => + useExceptionList({ filterOptions, http, lists, onError, onSuccess, pagination }), { initialProps: { http: mockKibanaHttpService, lists: [{ id: 'myListId', namespaceType: 'single' }], onError: onErrorMock, + onSuccess: jest.fn(), }, } ); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.tsx b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.tsx index 1d7a63ba880bf..9595cb7b7558e 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.tsx +++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.tsx @@ -23,9 +23,9 @@ export type ReturnExceptionListAndItems = [ * Hook for using to get an ExceptionList and it's ExceptionListItems * * @param http Kibana http service - * @param id desired ExceptionList ID (not list_id) - * @param namespaceType list namespaceType determines list space + * @param lists array of ExceptionIdentifiers for all lists to fetch * @param onError error callback + * @param onSuccess callback when all lists fetched successfully * @param filterOptions optional - filter by fields or tags * @param pagination optional * @@ -43,7 +43,7 @@ export const useExceptionList = ({ tags: [], }, onError, - dispatchListsInReducer, + onSuccess, }: UseExceptionListProps): ReturnExceptionListAndItems => { const [exceptionLists, setExceptionLists] = useState([]); const [exceptionItems, setExceptionListItems] = useState([]); @@ -116,8 +116,8 @@ export const useExceptionList = ({ exceptions = [...exceptions, ...fetchListItemsResult.data]; setExceptionListItems(exceptions); - if (dispatchListsInReducer != null) { - dispatchListsInReducer({ + if (onSuccess != null) { + onSuccess({ exceptions, lists: exceptionListsReturned, pagination: { diff --git a/x-pack/plugins/lists/public/exceptions/types.ts b/x-pack/plugins/lists/public/exceptions/types.ts index 286eb0570ebb8..013788cddc076 100644 --- a/x-pack/plugins/lists/public/exceptions/types.ts +++ b/x-pack/plugins/lists/public/exceptions/types.ts @@ -37,21 +37,19 @@ export interface ExceptionList extends ExceptionListSchema { totalItems: number; } +export interface UseExceptionListSuccess { + lists: ExceptionList[]; + exceptions: ExceptionListItemSchema[]; + pagination: Pagination; +} + export interface UseExceptionListProps { http: HttpStart; lists: ExceptionIdentifiers[]; onError: (arg: Error) => void; filterOptions?: FilterExceptionsOptions; pagination?: Pagination; - dispatchListsInReducer?: ({ - lists, - exceptions, - pagination, - }: { - lists: ExceptionList[]; - exceptions: ExceptionListItemSchema[]; - pagination: Pagination; - }) => void; + onSuccess?: (arg: UseExceptionListSuccess) => void; } export interface ExceptionIdentifiers { diff --git a/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts index e914d816b5e91..2cafd435e0853 100644 --- a/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts +++ b/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts @@ -44,7 +44,7 @@ export const createExceptionListItemRoute = (router: IRouter): void => { _tags, tags, meta, - comment, + comments, description, entries, item_id: itemId, @@ -76,7 +76,7 @@ export const createExceptionListItemRoute = (router: IRouter): void => { } else { const createdList = await exceptionLists.createExceptionListItem({ _tags, - comment, + comments, description, entries, itemId, diff --git a/x-pack/plugins/lists/server/routes/import_list_item_route.ts b/x-pack/plugins/lists/server/routes/import_list_item_route.ts index 36cf9bac373eb..c951c9b337131 100644 --- a/x-pack/plugins/lists/server/routes/import_list_item_route.ts +++ b/x-pack/plugins/lists/server/routes/import_list_item_route.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { Readable } from 'stream'; + import { IRouter } from 'kibana/server'; import { LIST_ITEM_URL } from '../../common/constants'; @@ -13,15 +15,23 @@ import { transformError, validate, } from '../siem_server_deps'; -import { - ImportListItemHapiFileSchema, - importListItemQuerySchema, - importListItemSchema, - listSchema, -} from '../../common/schemas'; +import { importListItemQuerySchema, importListItemSchema, listSchema } from '../../common/schemas'; import { getListClient } from '.'; +export interface HapiReadableStream extends Readable { + hapi: { + filename: string; + }; +} + +/** + * Special interface since we are streaming in a file through a reader + */ +export interface ImportListItemHapiFileSchema { + file: HapiReadableStream; +} + export const importListItemRoute = (router: IRouter): void => { router.post( { diff --git a/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts b/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts index 14b97bbe15206..73392c326056e 100644 --- a/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts +++ b/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts @@ -45,7 +45,7 @@ export const updateExceptionListItemRoute = (router: IRouter): void => { meta, type, _tags, - comment, + comments, entries, item_id: itemId, namespace_type: namespaceType, @@ -54,7 +54,7 @@ export const updateExceptionListItemRoute = (router: IRouter): void => { const exceptionLists = getExceptionListClient(context); const exceptionListItem = await exceptionLists.updateExceptionListItem({ _tags, - comment, + comments, description, entries, id, diff --git a/x-pack/plugins/lists/server/saved_objects/exception_list.ts b/x-pack/plugins/lists/server/saved_objects/exception_list.ts index 9e1a708e0c83b..8fb618c01213c 100644 --- a/x-pack/plugins/lists/server/saved_objects/exception_list.ts +++ b/x-pack/plugins/lists/server/saved_objects/exception_list.ts @@ -66,9 +66,18 @@ export const exceptionListMapping: SavedObjectsType['mappings'] = { export const exceptionListItemMapping: SavedObjectsType['mappings'] = { properties: { - comment: { - // TODO: investigate what the deep mapping structure of this really is - type: 'keyword', + comments: { + properties: { + comment: { + type: 'keyword', + }, + created_at: { + type: 'keyword', + }, + created_by: { + type: 'keyword', + }, + }, }, entries: { properties: { diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json b/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json index c89c7a8f080cf..f1a0dd0fa9c91 100644 --- a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json +++ b/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json @@ -5,7 +5,7 @@ "type": "simple", "description": "This is a sample endpoint type exception that has no item_id so it creates a new id each time", "name": "Sample Endpoint Exception List", - "comment": [], + "comments": [], "entries": [ { "field": "actingProcess.file.signer", diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json b/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json index 3fe4458a73769..ad3fef7e14364 100644 --- a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json +++ b/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json @@ -5,7 +5,7 @@ "type": "simple", "description": "This is a sample detection type exception that has no item_id so it creates a new id each time", "name": "Sample Detection Exception List Item", - "comment": [], + "comments": [{ "comment": "This is a short little comment." }], "entries": [ { "field": "host.name", diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json b/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json index a53079318edfa..27f020c43d1bf 100644 --- a/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json +++ b/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json @@ -5,6 +5,14 @@ "type": "simple", "description": "This is a sample change here this list", "name": "Sample Endpoint Exception List update change", + "comments": [ + { + "comment": "this was an old comment.", + "created_by": "lily", + "created_at": "2020-04-20T15:25:31.830Z" + }, + { "comment": "this is a newly added comment" } + ], "entries": [ { "field": "event.category", diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts index c6d4bc006ef0b..f6a3bca10028d 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts @@ -53,7 +53,7 @@ export const createExceptionList = async ({ const dateNow = new Date().toISOString(); const savedObject = await savedObjectsClient.create(savedObjectType, { _tags, - comment: undefined, + comments: undefined, created_at: dateNow, created_by: user, description, diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts index 44e87ab06f52b..22a9fbcfb53af 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts @@ -8,7 +8,7 @@ import { SavedObjectsClientContract } from 'kibana/server'; import uuid from 'uuid'; import { - CommentOrUndefined, + CommentsPartialArray, Description, EntriesArray, ExceptionListItemSchema, @@ -23,11 +23,15 @@ import { _Tags, } from '../../../common/schemas'; -import { getSavedObjectType, transformSavedObjectToExceptionListItem } from './utils'; +import { + getSavedObjectType, + transformComments, + transformSavedObjectToExceptionListItem, +} from './utils'; interface CreateExceptionListItemOptions { _tags: _Tags; - comment: CommentOrUndefined; + comments: CommentsPartialArray; listId: ListId; itemId: ItemId; savedObjectsClient: SavedObjectsClientContract; @@ -44,7 +48,7 @@ interface CreateExceptionListItemOptions { export const createExceptionListItem = async ({ _tags, - comment, + comments, entries, itemId, listId, @@ -62,7 +66,7 @@ export const createExceptionListItem = async ({ const dateNow = new Date().toISOString(); const savedObject = await savedObjectsClient.create(savedObjectType, { _tags, - comment, + comments: transformComments({ comments, user }), created_at: dateNow, created_by: user, description, diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts index efd117a3c38f4..73c52fb8b3ec9 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts @@ -133,7 +133,7 @@ export class ExceptionListClient { public createExceptionListItem = async ({ _tags, - comment, + comments, description, entries, itemId, @@ -147,7 +147,7 @@ export class ExceptionListClient { const { savedObjectsClient, user } = this; return createExceptionListItem({ _tags, - comment, + comments, description, entries, itemId, @@ -164,7 +164,7 @@ export class ExceptionListClient { public updateExceptionListItem = async ({ _tags, - comment, + comments, description, entries, id, @@ -178,7 +178,7 @@ export class ExceptionListClient { const { savedObjectsClient, user } = this; return updateExceptionListItem({ _tags, - comment, + comments, description, entries, id, diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts index 0ac543afee9f9..03f5de516561b 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts @@ -7,7 +7,7 @@ import { SavedObjectsClientContract } from 'kibana/server'; import { - CommentOrUndefined, + CommentsPartialArray, Description, DescriptionOrUndefined, EntriesArray, @@ -88,7 +88,7 @@ export interface GetExceptionListItemOptions { export interface CreateExceptionListItemOptions { _tags: _Tags; - comment: CommentOrUndefined; + comments: CommentsPartialArray; entries: EntriesArray; itemId: ItemId; listId: ListId; @@ -102,7 +102,7 @@ export interface CreateExceptionListItemOptions { export interface UpdateExceptionListItemOptions { _tags: _TagsOrUndefined; - comment: CommentOrUndefined; + comments: CommentsPartialArray; entries: EntriesArrayOrUndefined; id: IdOrUndefined; itemId: ItemIdOrUndefined; diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts index 6a8fbf3306971..899ed30863770 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts @@ -18,7 +18,7 @@ import { } from '../../../common/schemas'; import { SavedObjectType } from '../../saved_objects'; -import { getSavedObjectType, transformSavedObjectsToFounExceptionList } from './utils'; +import { getSavedObjectType, transformSavedObjectsToFoundExceptionList } from './utils'; interface FindExceptionListOptions { namespaceType: NamespaceType; @@ -48,7 +48,7 @@ export const findExceptionList = async ({ sortOrder, type: savedObjectType, }); - return transformSavedObjectsToFounExceptionList({ namespaceType, savedObjectsFindResponse }); + return transformSavedObjectsToFoundExceptionList({ namespaceType, savedObjectsFindResponse }); }; export const getExceptionListFilter = ({ diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts index c3b09a5f44b15..1c3103ad1db7e 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts @@ -19,7 +19,7 @@ import { } from '../../../common/schemas'; import { SavedObjectType } from '../../saved_objects'; -import { getSavedObjectType, transformSavedObjectsToFounExceptionListItem } from './utils'; +import { getSavedObjectType, transformSavedObjectsToFoundExceptionListItem } from './utils'; import { getExceptionList } from './get_exception_list'; interface FindExceptionListItemOptions { @@ -61,7 +61,7 @@ export const findExceptionListItem = async ({ sortOrder, type: savedObjectType, }); - return transformSavedObjectsToFounExceptionListItem({ + return transformSavedObjectsToFoundExceptionListItem({ namespaceType, savedObjectsFindResponse, }); diff --git a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts b/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts index 39c319a944e38..7ca9bfd83ab64 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts @@ -7,7 +7,7 @@ import { SavedObjectsClientContract } from 'kibana/server'; import { - CommentOrUndefined, + CommentsPartialArray, DescriptionOrUndefined, EntriesArrayOrUndefined, ExceptionListItemSchema, @@ -22,12 +22,16 @@ import { _TagsOrUndefined, } from '../../../common/schemas'; -import { getSavedObjectType, transformSavedObjectUpdateToExceptionListItem } from './utils'; +import { + getSavedObjectType, + transformComments, + transformSavedObjectUpdateToExceptionListItem, +} from './utils'; import { getExceptionListItem } from './get_exception_list_item'; interface UpdateExceptionListItemOptions { id: IdOrUndefined; - comment: CommentOrUndefined; + comments: CommentsPartialArray; _tags: _TagsOrUndefined; name: NameOrUndefined; description: DescriptionOrUndefined; @@ -44,7 +48,7 @@ interface UpdateExceptionListItemOptions { export const updateExceptionListItem = async ({ _tags, - comment, + comments, entries, id, savedObjectsClient, @@ -72,7 +76,7 @@ export const updateExceptionListItem = async ({ exceptionListItem.id, { _tags, - comment, + comments: transformComments({ comments, user }), description, entries, meta, diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils.ts b/x-pack/plugins/lists/server/services/exception_lists/utils.ts index 82a98f4bdd3e2..5690a42bed87e 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/utils.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/utils.ts @@ -7,6 +7,8 @@ import { SavedObject, SavedObjectsFindResponse, SavedObjectsUpdateResponse } from 'kibana/server'; import { + CommentsArrayOrUndefined, + CommentsPartialArrayOrUndefined, ExceptionListItemSchema, ExceptionListSchema, ExceptionListSoSchema, @@ -125,7 +127,7 @@ export const transformSavedObjectToExceptionListItem = ({ const { attributes: { _tags, - comment, + comments, created_at, created_by, description, @@ -147,7 +149,7 @@ export const transformSavedObjectToExceptionListItem = ({ // TODO: Do a throw if item_id or entries is not defined. return { _tags, - comment, + comments: comments ?? [], created_at, created_by, description, @@ -179,7 +181,7 @@ export const transformSavedObjectUpdateToExceptionListItem = ({ const { attributes: { _tags, - comment, + comments, description, entries, meta, @@ -196,7 +198,7 @@ export const transformSavedObjectUpdateToExceptionListItem = ({ // TODO: Do a throw if after the decode this is not the correct "list_type: list" return { _tags: _tags ?? exceptionListItem._tags, - comment: comment ?? exceptionListItem.comment, + comments: comments ?? exceptionListItem.comments, created_at: exceptionListItem.created_at, created_by: exceptionListItem.created_by, description: description ?? exceptionListItem.description, @@ -215,7 +217,7 @@ export const transformSavedObjectUpdateToExceptionListItem = ({ }; }; -export const transformSavedObjectsToFounExceptionListItem = ({ +export const transformSavedObjectsToFoundExceptionListItem = ({ savedObjectsFindResponse, namespaceType, }: { @@ -232,7 +234,7 @@ export const transformSavedObjectsToFounExceptionListItem = ({ }; }; -export const transformSavedObjectsToFounExceptionList = ({ +export const transformSavedObjectsToFoundExceptionList = ({ savedObjectsFindResponse, namespaceType, }: { @@ -248,3 +250,24 @@ export const transformSavedObjectsToFounExceptionList = ({ total: savedObjectsFindResponse.total, }; }; + +export const transformComments = ({ + comments, + user, +}: { + comments: CommentsPartialArrayOrUndefined; + user: string; +}): CommentsArrayOrUndefined => { + const dateNow = new Date().toISOString(); + if (comments != null) { + return comments.map((comment) => { + return { + comment: comment.comment, + created_at: comment.created_at ?? dateNow, + created_by: comment.created_by ?? user, + }; + }); + } else { + return comments; + } +}; diff --git a/x-pack/plugins/lists/server/services/items/buffer_lines.test.ts b/x-pack/plugins/lists/server/services/items/buffer_lines.test.ts index 9413bf9a3d84e..a283269271bd0 100644 --- a/x-pack/plugins/lists/server/services/items/buffer_lines.test.ts +++ b/x-pack/plugins/lists/server/services/items/buffer_lines.test.ts @@ -4,9 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TestReadable } from '../../../common/test_readable.mock'; - import { BufferLines } from './buffer_lines'; +import { TestReadable } from './test_readable.mock'; describe('buffer_lines', () => { test('it can read a single line', (done) => { diff --git a/x-pack/plugins/lists/common/test_readable.mock.ts b/x-pack/plugins/lists/server/services/items/test_readable.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/test_readable.mock.ts rename to x-pack/plugins/lists/server/services/items/test_readable.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts index 3d9902e1d43dd..ccacdfbb5ff65 100644 --- a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts +++ b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts @@ -3,11 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { TestReadable } from '../../../common/test_readable.mock'; import { getCallClusterMock } from '../../../common/get_call_cluster.mock'; import { ImportListItemsToStreamOptions, WriteBufferToItemsOptions } from '../items'; import { LIST_ID, LIST_ITEM_INDEX, META, TYPE, USER } from '../../../common/constants.mock'; +import { TestReadable } from './test_readable.mock'; + export const getImportListItemsToStreamOptionsMock = (): ImportListItemsToStreamOptions => ({ callCluster: getCallClusterMock(), listId: LIST_ID, diff --git a/x-pack/plugins/maps/public/classes/fields/ems_file_field.ts b/x-pack/plugins/maps/public/classes/fields/ems_file_field.ts index 73d6c1ef9f790..2e9c5c9fe60c2 100644 --- a/x-pack/plugins/maps/public/classes/fields/ems_file_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/ems_file_field.ts @@ -30,12 +30,6 @@ export class EMSFileField extends AbstractField implements IField { } async getLabel(): Promise { - const emsFileLayer = await this._source.getEMSFileLayer(); - // TODO remove any and @ts-ignore when emsFileLayer type defined - // @ts-ignore - const emsFields: any[] = emsFileLayer.getFieldsInLanguage(); - // Map EMS field name to language specific label - const emsField = emsFields.find((field) => field.name === this.getName()); - return emsField ? emsField.description : this.getName(); + return this._source.getEmsFieldLabel(this.getName()); } } diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts index a949853d431b2..551e20fc5ceb5 100644 --- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts @@ -109,8 +109,8 @@ function getClusterStyleDescriptor( if (styleName === VECTOR_STYLES.SYMBOLIZE_AS || styleName === VECTOR_STYLES.LABEL_BORDER_SIZE) { // copy none static/dynamic styles to cluster style - // @ts-ignore clusterStyleDescriptor.properties[styleName] = { + // @ts-expect-error options: { ...styleProperty.getOptions() }, }; } else if (styleProperty.isDynamic()) { diff --git a/x-pack/plugins/maps/public/classes/sources/ems_file_source/create_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/ems_file_source/create_source_editor.tsx index e398af4acea3b..a78a49032503b 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_file_source/create_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/ems_file_source/create_source_editor.tsx @@ -8,8 +8,8 @@ import React, { Component } from 'react'; import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -// @ts-ignore -import { getEMSClient } from '../../../meta'; +import { FileLayer } from '@elastic/ems-client'; +import { getEmsFileLayers } from '../../../meta'; import { getEmsUnavailableMessage } from '../ems_unavailable_message'; import { EMSFileSourceDescriptor } from '../../../../common/descriptor_types'; @@ -33,15 +33,10 @@ export class EMSFileCreateSourceEditor extends Component { }; _loadFileOptions = async () => { - // @ts-ignore - const emsClient = getEMSClient(); - // @ts-ignore - const fileLayers: unknown[] = await emsClient.getFileLayers(); + const fileLayers: FileLayer[] = await getEmsFileLayers(); const options = fileLayers.map((fileLayer) => { return { - // @ts-ignore value: fileLayer.getId(), - // @ts-ignore label: fileLayer.getDisplayName(), }; }); diff --git a/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.test.tsx b/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.test.tsx index 24c111a72ac05..52524d0c9a5fa 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.test.tsx @@ -11,17 +11,8 @@ jest.mock('../../layers/vector_layer/vector_layer', () => {}); function makeEMSFileSource(tooltipProperties: string[]) { const emsFileSource = new EMSFileSource({ tooltipProperties }); - emsFileSource.getEMSFileLayer = async () => { - return { - getFieldsInLanguage() { - return [ - { - name: 'iso2', - description: 'ISO 2 CODE', - }, - ]; - }, - }; + emsFileSource.getEmsFieldLabel = async (name: string) => { + return name === 'iso2' ? 'ISO 2 CODE' : name; }; return emsFileSource; } diff --git a/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.tsx b/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.tsx index 94f5bb0d2ba07..f7fb0078764c4 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/ems_file_source/ems_file_source.tsx @@ -8,12 +8,12 @@ import React, { ReactElement } from 'react'; import { i18n } from '@kbn/i18n'; import { Feature } from 'geojson'; import { Adapters } from 'src/plugins/inspector/public'; +import { FileLayer } from '@elastic/ems-client'; import { Attribution, ImmutableSourceProperty, SourceEditorArgs } from '../source'; import { AbstractVectorSource, GeoJsonWithMeta, IVectorSource } from '../vector_source'; import { VECTOR_SHAPE_TYPES } from '../vector_feature_types'; import { SOURCE_TYPES, FIELD_ORIGIN } from '../../../../common/constants'; -// @ts-ignore -import { getEMSClient } from '../../../meta'; +import { getEmsFileLayers } from '../../../meta'; import { getDataSourceLabel } from '../../../../common/i18n_getters'; import { UpdateSourceEditor } from './update_source_editor'; import { EMSFileField } from '../../fields/ems_file_field'; @@ -23,7 +23,7 @@ import { EMSFileSourceDescriptor } from '../../../../common/descriptor_types'; import { ITooltipProperty } from '../../tooltips/tooltip_property'; export interface IEmsFileSource extends IVectorSource { - getEMSFileLayer(): Promise; + getEmsFieldLabel(emsFieldName: string): Promise; createField({ fieldName }: { fieldName: string }): IField; } @@ -72,13 +72,9 @@ export class EMSFileSource extends AbstractVectorSource implements IEmsFileSourc ); } - async getEMSFileLayer(): Promise { - // @ts-ignore - const emsClient = getEMSClient(); - // @ts-ignore - const emsFileLayers = await emsClient.getFileLayers(); + async getEMSFileLayer(): Promise { + const emsFileLayers = await getEmsFileLayers(); const emsFileLayer = emsFileLayers.find( - // @ts-ignore (fileLayer) => fileLayer.getId() === this._descriptor.id ); if (!emsFileLayer) { @@ -94,19 +90,25 @@ export class EMSFileSource extends AbstractVectorSource implements IEmsFileSourc return emsFileLayer; } + // Map EMS field name to language specific label + async getEmsFieldLabel(emsFieldName: string): Promise { + const emsFileLayer = await this.getEMSFileLayer(); + const emsFields = emsFileLayer.getFieldsInLanguage(); + + const emsField = emsFields.find((field) => field.name === emsFieldName); + return emsField ? emsField.description : emsFieldName; + } + async getGeoJsonWithMeta(): Promise { const emsFileLayer = await this.getEMSFileLayer(); // @ts-ignore const featureCollection = await AbstractVectorSource.getGeoJson({ - // @ts-ignore format: emsFileLayer.getDefaultFormatType(), featureCollectionPath: 'data', - // @ts-ignore fetchUrl: emsFileLayer.getDefaultFormatUrl(), }); - // @ts-ignore - const emsIdField = emsFileLayer._config.fields.find((field) => { + const emsIdField = emsFileLayer.getFields().find((field) => { return field.type === 'id'; }); featureCollection.features.forEach((feature: Feature, index: number) => { @@ -123,7 +125,6 @@ export class EMSFileSource extends AbstractVectorSource implements IEmsFileSourc let emsLink; try { const emsFileLayer = await this.getEMSFileLayer(); - // @ts-ignore emsLink = emsFileLayer.getEMSHotLink(); } catch (error) { // ignore error if EMS layer id could not be found @@ -147,7 +148,6 @@ export class EMSFileSource extends AbstractVectorSource implements IEmsFileSourc async getDisplayName(): Promise { try { const emsFileLayer = await this.getEMSFileLayer(); - // @ts-ignore return emsFileLayer.getDisplayName(); } catch (error) { return this._descriptor.id; @@ -156,15 +156,12 @@ export class EMSFileSource extends AbstractVectorSource implements IEmsFileSourc async getAttributions(): Promise { const emsFileLayer = await this.getEMSFileLayer(); - // @ts-ignore return emsFileLayer.getAttributions(); } async getLeftJoinFields() { const emsFileLayer = await this.getEMSFileLayer(); - // @ts-ignore const fields = emsFileLayer.getFieldsInLanguage(); - // @ts-ignore return fields.map((f) => this.createField({ fieldName: f.name })); } diff --git a/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx index daeb1f8bc6b2b..ac69505a9bed5 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx @@ -8,8 +8,7 @@ import React, { Component, Fragment } from 'react'; import { EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { TooltipSelector } from '../../../components/tooltip_selector'; -// @ts-ignore -import { getEMSClient } from '../../../meta'; +import { getEmsFileLayers } from '../../../meta'; import { IEmsFileSource } from './ems_file_source'; import { IField } from '../../fields/field'; import { OnSourceChangeArgs } from '../../../connected_components/layer_panel/view'; @@ -42,22 +41,18 @@ export class UpdateSourceEditor extends Component { } async loadFields() { - let fields; + let fields: IField[] = []; try { - // @ts-ignore - const emsClient = getEMSClient(); - // @ts-ignore - const emsFiles = await emsClient.getFileLayers(); - // @ts-ignore - const taregetEmsFile = emsFiles.find((emsFile) => emsFile.getId() === this.props.layerId); - // @ts-ignore - const emsFields = taregetEmsFile.getFieldsInLanguage(); - // @ts-ignore - fields = emsFields.map((field) => this.props.source.createField({ fieldName: field.name })); + const emsFiles = await getEmsFileLayers(); + const targetEmsFile = emsFiles.find((emsFile) => emsFile.getId() === this.props.layerId); + if (targetEmsFile) { + fields = targetEmsFile + .getFieldsInLanguage() + .map((field) => this.props.source.createField({ fieldName: field.name })); + } } catch (e) { // When a matching EMS-config cannot be found, the source already will have thrown errors during the data request. // This will propagate to the vector-layer and be displayed in the UX - fields = []; } if (this._isMounted) { diff --git a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.js b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.js index 36c9e424a8b22..83c87eb53d4fe 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.js +++ b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.js @@ -7,7 +7,7 @@ import _ from 'lodash'; import React from 'react'; import { AbstractTMSSource } from '../tms_source'; -import { getEMSClient } from '../../../meta'; +import { getEmsTmsServices } from '../../../meta'; import { UpdateSourceEditor } from './update_source_editor'; import { i18n } from '@kbn/i18n'; import { getDataSourceLabel } from '../../../../common/i18n_getters'; @@ -66,8 +66,7 @@ export class EMSTMSSource extends AbstractTMSSource { } async _getEMSTMSService() { - const emsClient = getEMSClient(); - const emsTMSServices = await emsClient.getTMSServices(); + const emsTMSServices = await getEmsTmsServices(); const emsTileLayerId = this.getTileLayerId(); const tmsService = emsTMSServices.find((tmsService) => tmsService.getId() === emsTileLayerId); if (!tmsService) { diff --git a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.test.js b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.test.js index 08c54299d721b..2f466add28262 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.test.js +++ b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/ems_tms_source.test.js @@ -6,7 +6,7 @@ jest.mock('../../../meta', () => { return { - getEMSClient: () => { + getEmsTmsServices: () => { class MockTMSService { constructor(config) { this._config = config; @@ -19,20 +19,16 @@ jest.mock('../../../meta', () => { } } - return { - async getTMSServices() { - return [ - new MockTMSService({ - id: 'road_map', - attributionMarkdown: '[foobar](http://foobar.org) | [foobaz](http://foobaz.org)', - }), - new MockTMSService({ - id: 'satellite', - attributionMarkdown: '[satellite](http://satellite.org)', - }), - ]; - }, - }; + return [ + new MockTMSService({ + id: 'road_map', + attributionMarkdown: '[foobar](http://foobar.org) | [foobaz](http://foobaz.org)', + }), + new MockTMSService({ + id: 'satellite', + attributionMarkdown: '[satellite](http://satellite.org)', + }), + ]; }, }; }); diff --git a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/tile_service_select.js b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/tile_service_select.js index 4d5d6655609c1..3931e441ff254 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/tile_service_select.js +++ b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/tile_service_select.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiSelect, EuiFormRow } from '@elastic/eui'; -import { getEMSClient } from '../../../meta'; +import { getEmsTmsServices } from '../../../meta'; import { getEmsUnavailableMessage } from '../ems_unavailable_message'; import { i18n } from '@kbn/i18n'; @@ -29,8 +29,7 @@ export class TileServiceSelect extends React.Component { } _loadTmsOptions = async () => { - const emsClient = getEMSClient(); - const emsTMSServices = await emsClient.getTMSServices(); + const emsTMSServices = await getEmsTmsServices(); if (!this._isMounted) { return; diff --git a/x-pack/plugins/maps/public/classes/sources/kibana_regionmap_source/kibana_regionmap_layer_wizard.tsx b/x-pack/plugins/maps/public/classes/sources/kibana_regionmap_source/kibana_regionmap_layer_wizard.tsx index b778dc0076459..ca78aaefe404f 100644 --- a/x-pack/plugins/maps/public/classes/sources/kibana_regionmap_source/kibana_regionmap_layer_wizard.tsx +++ b/x-pack/plugins/maps/public/classes/sources/kibana_regionmap_source/kibana_regionmap_layer_wizard.tsx @@ -12,13 +12,12 @@ import { KibanaRegionmapSource, sourceTitle } from './kibana_regionmap_source'; import { VectorLayer } from '../../layers/vector_layer/vector_layer'; // @ts-ignore import { CreateSourceEditor } from './create_source_editor'; -// @ts-ignore import { getKibanaRegionList } from '../../../meta'; export const kibanaRegionMapLayerWizardConfig: LayerWizard = { - checkVisibility: () => { + checkVisibility: async () => { const regions = getKibanaRegionList(); - return regions.length; + return regions.length > 0; }, description: i18n.translate('xpack.maps.source.kbnRegionMapDescription', { defaultMessage: 'Vector data from hosted GeoJSON configured in kibana.yml', diff --git a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_base_map_layer_wizard.tsx b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_base_map_layer_wizard.tsx index 227c0182b98de..84d2e5e74fa9a 100644 --- a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_base_map_layer_wizard.tsx +++ b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_base_map_layer_wizard.tsx @@ -12,12 +12,12 @@ import { CreateSourceEditor } from './create_source_editor'; // @ts-ignore import { KibanaTilemapSource, sourceTitle } from './kibana_tilemap_source'; import { TileLayer } from '../../layers/tile_layer/tile_layer'; -// @ts-ignore import { getKibanaTileMap } from '../../../meta'; export const kibanaBasemapLayerWizardConfig: LayerWizard = { checkVisibility: async () => { const tilemap = getKibanaTileMap(); + // @ts-ignore return !!tilemap.url; }, description: i18n.translate('xpack.maps.source.kbnTMSDescription', { diff --git a/x-pack/plugins/maps/public/meta.js b/x-pack/plugins/maps/public/meta.js deleted file mode 100644 index 46c5e5cda3617..0000000000000 --- a/x-pack/plugins/maps/public/meta.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { - getHttp, - getLicenseId, - getIsEmsEnabled, - getRegionmapLayers, - getTilemap, - getEmsFileApiUrl, - getEmsTileApiUrl, - getEmsLandingPageUrl, - getEmsFontLibraryUrl, - getProxyElasticMapsServiceInMaps, - getKibanaVersion, -} from './kibana_services'; -import { - GIS_API_PATH, - EMS_FILES_CATALOGUE_PATH, - EMS_TILES_CATALOGUE_PATH, - EMS_GLYPHS_PATH, - EMS_APP_NAME, - FONTS_API_PATH, -} from '../common/constants'; -import { i18n } from '@kbn/i18n'; -import { EMSClient } from '@elastic/ems-client'; - -import fetch from 'node-fetch'; - -const GIS_API_RELATIVE = `../${GIS_API_PATH}`; - -export function getKibanaRegionList() { - return getRegionmapLayers(); -} - -export function getKibanaTileMap() { - return getTilemap(); -} - -function relativeToAbsolute(url) { - const a = document.createElement('a'); - a.setAttribute('href', url); - return a.href; -} - -function fetchFunction(...args) { - return fetch(...args); -} - -let emsClient = null; -let latestLicenseId = null; -export function getEMSClient() { - if (!emsClient) { - const isEmsEnabled = getIsEmsEnabled(); - if (isEmsEnabled) { - const proxyElasticMapsServiceInMaps = getProxyElasticMapsServiceInMaps(); - const proxyPath = ''; - const tileApiUrl = proxyElasticMapsServiceInMaps - ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_TILES_CATALOGUE_PATH}`) - : getEmsTileApiUrl(); - const fileApiUrl = proxyElasticMapsServiceInMaps - ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_FILES_CATALOGUE_PATH}`) - : getEmsFileApiUrl(); - - emsClient = new EMSClient({ - language: i18n.getLocale(), - appVersion: getKibanaVersion(), - appName: EMS_APP_NAME, - tileApiUrl, - fileApiUrl, - landingPageUrl: getEmsLandingPageUrl(), - fetchFunction: fetchFunction, //import this from client-side, so the right instance is returned (bootstrapped from common/* would not work - proxyPath, - }); - } else { - //EMS is turned off. Mock API. - emsClient = { - async getFileLayers() { - return []; - }, - async getTMSServices() { - return []; - }, - addQueryParams() {}, - }; - } - } - const licenseId = getLicenseId(); - if (latestLicenseId !== licenseId) { - latestLicenseId = licenseId; - emsClient.addQueryParams({ license: licenseId }); - } - return emsClient; -} - -export function getGlyphUrl() { - if (!getIsEmsEnabled()) { - return getHttp().basePath.prepend(`/${FONTS_API_PATH}/{fontstack}/{range}`); - } - return getProxyElasticMapsServiceInMaps() - ? relativeToAbsolute(`../${GIS_API_PATH}/${EMS_TILES_CATALOGUE_PATH}/${EMS_GLYPHS_PATH}`) + - `/{fontstack}/{range}` - : getEmsFontLibraryUrl(); -} - -export function isRetina() { - return window.devicePixelRatio === 2; -} diff --git a/x-pack/plugins/maps/public/meta.ts b/x-pack/plugins/maps/public/meta.ts new file mode 100644 index 0000000000000..54c5eac7fe1b0 --- /dev/null +++ b/x-pack/plugins/maps/public/meta.ts @@ -0,0 +1,111 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import { EMSClient, FileLayer, TMSService } from '@elastic/ems-client'; + +import fetch from 'node-fetch'; +import { + GIS_API_PATH, + EMS_FILES_CATALOGUE_PATH, + EMS_TILES_CATALOGUE_PATH, + EMS_GLYPHS_PATH, + EMS_APP_NAME, + FONTS_API_PATH, +} from '../common/constants'; +import { + getHttp, + getLicenseId, + getIsEmsEnabled, + getRegionmapLayers, + getTilemap, + getEmsFileApiUrl, + getEmsTileApiUrl, + getEmsLandingPageUrl, + getEmsFontLibraryUrl, + getProxyElasticMapsServiceInMaps, + getKibanaVersion, +} from './kibana_services'; + +const GIS_API_RELATIVE = `../${GIS_API_PATH}`; + +export function getKibanaRegionList(): unknown[] { + return getRegionmapLayers(); +} + +export function getKibanaTileMap(): unknown { + return getTilemap(); +} + +export async function getEmsFileLayers(): Promise { + if (!getIsEmsEnabled()) { + return []; + } + + return getEMSClient().getFileLayers(); +} + +export async function getEmsTmsServices(): Promise { + if (!getIsEmsEnabled()) { + return []; + } + + return getEMSClient().getTMSServices(); +} + +function relativeToAbsolute(url: string): string { + const a = document.createElement('a'); + a.setAttribute('href', url); + return a.href; +} + +let emsClient: EMSClient | null = null; +let latestLicenseId: string | null = null; +export function getEMSClient(): EMSClient { + if (!emsClient) { + const proxyElasticMapsServiceInMaps = getProxyElasticMapsServiceInMaps(); + const proxyPath = ''; + const tileApiUrl = proxyElasticMapsServiceInMaps + ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_TILES_CATALOGUE_PATH}`) + : getEmsTileApiUrl(); + const fileApiUrl = proxyElasticMapsServiceInMaps + ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_FILES_CATALOGUE_PATH}`) + : getEmsFileApiUrl(); + + emsClient = new EMSClient({ + language: i18n.getLocale(), + appVersion: getKibanaVersion(), + appName: EMS_APP_NAME, + tileApiUrl, + fileApiUrl, + landingPageUrl: getEmsLandingPageUrl(), + fetchFunction(url: string) { + return fetch(url); + }, + proxyPath, + }); + } + const licenseId = getLicenseId(); + if (latestLicenseId !== licenseId) { + latestLicenseId = licenseId; + emsClient.addQueryParams({ license: licenseId }); + } + return emsClient; +} + +export function getGlyphUrl(): string { + if (!getIsEmsEnabled()) { + return getHttp().basePath.prepend(`/${FONTS_API_PATH}/{fontstack}/{range}`); + } + return getProxyElasticMapsServiceInMaps() + ? relativeToAbsolute(`../${GIS_API_PATH}/${EMS_TILES_CATALOGUE_PATH}/${EMS_GLYPHS_PATH}`) + + `/{fontstack}/{range}` + : getEmsFontLibraryUrl(); +} + +export function isRetina(): boolean { + return window.devicePixelRatio === 2; +} diff --git a/x-pack/plugins/maps/server/plugin.ts b/x-pack/plugins/maps/server/plugin.ts index a265cf80c73cd..f2331b9a1a960 100644 --- a/x-pack/plugins/maps/server/plugin.ts +++ b/x-pack/plugins/maps/server/plugin.ts @@ -23,7 +23,8 @@ import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/s import { emsBoundariesSpecProvider } from './tutorials/ems'; // @ts-ignore import { initRoutes } from './routes'; -import { ILicense, LicensingPluginSetup } from '../../licensing/public'; +import { ILicense } from '../../licensing/common/types'; +import { LicensingPluginSetup } from '../../licensing/server'; import { HomeServerPluginSetup } from '../../../../src/plugins/home/server'; interface SetupDeps { diff --git a/x-pack/plugins/ml/common/util/errors.test.ts b/x-pack/plugins/ml/common/util/errors.test.ts new file mode 100644 index 0000000000000..00af27248ccce --- /dev/null +++ b/x-pack/plugins/ml/common/util/errors.test.ts @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { + BoomResponse, + extractErrorMessage, + MLCustomHttpResponseOptions, + MLResponseError, +} from './errors'; +import { ResponseError } from 'kibana/server'; + +describe('ML - error message utils', () => { + describe('extractErrorMessage', () => { + test('returns just the error message', () => { + const testMsg = 'Saved object [index-pattern/blahblahblah] not found'; + + const bodyWithNestedErrorMsg: MLCustomHttpResponseOptions = { + body: { + message: { + msg: testMsg, + }, + }, + statusCode: 404, + }; + expect(extractErrorMessage(bodyWithNestedErrorMsg)).toBe(testMsg); + + const bodyWithStringMsg: MLCustomHttpResponseOptions = { + body: { + msg: testMsg, + }, + statusCode: 404, + }; + expect(extractErrorMessage(bodyWithStringMsg)).toBe(testMsg); + + const bodyWithStringMessage: MLCustomHttpResponseOptions = { + body: { + message: testMsg, + }, + statusCode: 404, + }; + expect(extractErrorMessage(bodyWithStringMessage)).toBe(testMsg); + + const bodyWithString: MLCustomHttpResponseOptions = { + body: testMsg, + statusCode: 404, + }; + expect(extractErrorMessage(bodyWithString)).toBe(testMsg); + + const bodyWithError: MLCustomHttpResponseOptions = { + body: new Error(testMsg), + statusCode: 404, + }; + expect(extractErrorMessage(bodyWithError)).toBe(testMsg); + + const bodyWithBoomError: MLCustomHttpResponseOptions = { + statusCode: 404, + body: { + data: [], + isBoom: true, + isServer: false, + output: { + statusCode: 404, + payload: { + statusCode: 404, + error: testMsg, + message: testMsg, + }, + headers: {}, + }, + }, + }; + expect(extractErrorMessage(bodyWithBoomError)).toBe(testMsg); + }); + }); +}); diff --git a/x-pack/plugins/ml/common/util/errors.ts b/x-pack/plugins/ml/common/util/errors.ts index 4446624bf2e7f..e165e15d7c64e 100644 --- a/x-pack/plugins/ml/common/util/errors.ts +++ b/x-pack/plugins/ml/common/util/errors.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ResponseError, ResponseHeaders } from 'kibana/server'; import { isErrorResponse } from '../types/errors'; export function getErrorMessage(error: any) { @@ -17,3 +18,77 @@ export function getErrorMessage(error: any) { return JSON.stringify(error); } + +// Adding temporary types until Kibana ResponseError is updated + +export interface BoomResponse { + data: any; + isBoom: boolean; + isServer: boolean; + output: { + statusCode: number; + payload: { + statusCode: number; + error: string; + message: string; + }; + headers: {}; + }; +} +export type MLResponseError = + | { + message: { + msg: string; + }; + } + | { msg: string }; + +export interface MLCustomHttpResponseOptions< + T extends ResponseError | MLResponseError | BoomResponse +> { + /** HTTP message to send to the client */ + body?: T; + /** HTTP Headers with additional information about response */ + headers?: ResponseHeaders; + statusCode: number; +} + +export const extractErrorMessage = ( + error: + | MLCustomHttpResponseOptions + | undefined + | string +): string => { + // extract only the error message within the response error coming from Kibana, Elasticsearch, and our own ML messages + + if (typeof error === 'string') { + return error; + } + if (error?.body === undefined) return ''; + + if (typeof error.body === 'string') { + return error.body; + } + if ( + typeof error.body === 'object' && + 'output' in error.body && + error.body.output.payload.message + ) { + return error.body.output.payload.message; + } + + if (typeof error.body === 'object' && 'msg' in error.body && typeof error.body.msg === 'string') { + return error.body.msg; + } + + if (typeof error.body === 'object' && 'message' in error.body) { + if (typeof error.body.message === 'string') { + return error.body.message; + } + if (!(error.body.message instanceof Error) && typeof (error.body.message.msg === 'string')) { + return error.body.message.msg; + } + } + // If all else fail return an empty message instead of JSON.stringify + return ''; +}; diff --git a/x-pack/plugins/ml/public/application/components/color_range_legend/use_color_range.ts b/x-pack/plugins/ml/public/application/components/color_range_legend/use_color_range.ts index 83f143b75b388..1d5f5cf3a0309 100644 --- a/x-pack/plugins/ml/public/application/components/color_range_legend/use_color_range.ts +++ b/x-pack/plugins/ml/public/application/components/color_range_legend/use_color_range.ts @@ -152,19 +152,23 @@ export const useColorRange = ( ) => { const euiTheme = useUiSettings().get('theme:darkMode') ? euiThemeDark : euiThemeLight; - const colorRanges = { - [COLOR_RANGE.BLUE]: [d3.rgb(euiTheme.euiColorEmptyShade), d3.rgb(euiTheme.euiColorVis1)], - [COLOR_RANGE.RED]: [d3.rgb(euiTheme.euiColorEmptyShade), d3.rgb(euiTheme.euiColorDanger)], + const colorRanges: Record = { + [COLOR_RANGE.BLUE]: [ + d3.rgb(euiTheme.euiColorEmptyShade).toString(), + d3.rgb(euiTheme.euiColorVis1).toString(), + ], + [COLOR_RANGE.RED]: [ + d3.rgb(euiTheme.euiColorEmptyShade).toString(), + d3.rgb(euiTheme.euiColorDanger).toString(), + ], [COLOR_RANGE.RED_GREEN]: ['red', 'green'], [COLOR_RANGE.GREEN_RED]: ['green', 'red'], [COLOR_RANGE.YELLOW_GREEN_BLUE]: coloursYGB, }; const linearScale = d3.scale - .linear() + .linear() .domain(colorDomains[colorRange]) - // typings for .range() incorrectly don't allow passing in a color extent. - // @ts-ignore .range(colorRanges[colorRange]); const influencerColorScale = influencerColorScaleFactory(featureCount); const influencerScaleLinearWrapper = (n: number) => linearScale(influencerColorScale(n)); @@ -173,7 +177,7 @@ export const useColorRange = ( [COLOR_RANGE_SCALE.LINEAR]: linearScale, [COLOR_RANGE_SCALE.INFLUENCER]: influencerScaleLinearWrapper, [COLOR_RANGE_SCALE.SQRT]: d3.scale - .sqrt() + .sqrt() .domain(colorDomains[colorRange]) // typings for .range() incorrectly don't allow passing in a color extent. // @ts-ignore diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts index ebac6ccb2298e..37ab67e2a33cb 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts @@ -107,7 +107,7 @@ export const useOutlierData = ( if (backgroundColor !== undefined) { setCellProps({ - style: { backgroundColor }, + style: { backgroundColor: String(backgroundColor) }, }); } } diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx index a1f0448b819d1..e8b1cd1a5696a 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx @@ -21,7 +21,7 @@ import { import { State } from '../../hooks/use_create_analytics_form/state'; import { DataFrameAnalyticsListRow } from './common'; import { checkPermission } from '../../../../../capabilities/check_capabilities'; -import { extractErrorMessage } from '../../../../../util/error_utils'; +import { extractErrorMessage } from '../../../../../../../common/util/errors'; interface PropDefinition { /** diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_delete.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_delete.tsx index 2d433f6b18484..38ef00914e8fb 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_delete.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_delete.tsx @@ -18,6 +18,7 @@ import { } from '@elastic/eui'; import { IIndexPattern } from 'src/plugins/data/common'; import { FormattedMessage } from '@kbn/i18n/react'; +import { extractErrorMessage } from '../../../../../../../common/util/errors'; import { deleteAnalytics, deleteAnalyticsAndDestIndex, @@ -29,7 +30,6 @@ import { } from '../../../../../capabilities/check_capabilities'; import { useMlKibana } from '../../../../../contexts/kibana'; import { isDataFrameAnalyticsRunning, DataFrameAnalyticsListRow } from './common'; -import { extractErrorMessage } from '../../../../../util/error_utils'; interface DeleteActionProps { item: DataFrameAnalyticsListRow; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx index bbbda85c45e49..74eb1d0b02782 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx @@ -54,7 +54,7 @@ export const StartAction: FC = ({ item }) => { iconType="play" onClick={openModal} aria-label={buttonStartText} - data-test-sub="mlAnalyticsJobStartButton" + data-test-subj="mlAnalyticsJobStartButton" > {buttonStartText} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx index 72514c91ff58b..ff0658e8daccd 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx @@ -82,7 +82,7 @@ export const getActions = (createAnalyticsForm: CreateAnalyticsFormProps) => { iconType="stop" onClick={() => stopAnalytics(item)} aria-label={buttonStopText} - data-test-sub="mlAnalyticsJobStopButton" + data-test-subj="mlAnalyticsJobStopButton" > {buttonStopText} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts index 26cefff0a3f59..ebd3fa8982604 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { i18n } from '@kbn/i18n'; +import { extractErrorMessage } from '../../../../../../../common/util/errors'; import { getToastNotifications } from '../../../../../util/dependency_cache'; import { ml } from '../../../../../services/ml_api_service'; import { refreshAnalyticsList$, REFRESH_ANALYTICS_LIST_STATE } from '../../../../common'; @@ -11,7 +12,6 @@ import { isDataFrameAnalyticsFailed, DataFrameAnalyticsListRow, } from '../../components/analytics_list/common'; -import { extractErrorMessage } from '../../../../../util/error_utils'; export const deleteAnalytics = async (d: DataFrameAnalyticsListRow) => { const toastNotifications = getToastNotifications(); diff --git a/x-pack/plugins/ml/public/application/services/http_service.ts b/x-pack/plugins/ml/public/application/services/http_service.ts index 34dc89dd5f89b..7144411c2885d 100644 --- a/x-pack/plugins/ml/public/application/services/http_service.ts +++ b/x-pack/plugins/ml/public/application/services/http_service.ts @@ -8,12 +8,11 @@ import { Observable } from 'rxjs'; import { HttpFetchOptionsWithPath, HttpFetchOptions, HttpStart } from 'kibana/public'; import { getHttp } from '../util/dependency_cache'; -function getResultHeaders(headers: HeadersInit): HeadersInit { +function getResultHeaders(headers: HeadersInit) { return { - asSystemRequest: true, 'Content-Type': 'application/json', ...headers, - } as HeadersInit; + }; } function getFetchOptions( @@ -25,6 +24,7 @@ function getFetchOptions( return { path: options.path, fetchOptions: { + asSystemRequest: true, credentials: 'same-origin', method: options.method || 'GET', ...(options.body ? { body: options.body } : {}), @@ -111,7 +111,6 @@ export class HttpService { private getResultHeaders(headers: HeadersInit): HeadersInit { return { - asSystemRequest: true, 'Content-Type': 'application/json', ...headers, } as HeadersInit; @@ -126,6 +125,7 @@ export class HttpService { return { path: options.path, fetchOptions: { + asSystemRequest: true, credentials: 'same-origin', method: options.method || 'GET', ...(options.body ? { body: options.body } : {}), diff --git a/x-pack/plugins/ml/public/application/util/error_utils.ts b/x-pack/plugins/ml/public/application/util/error_utils.ts deleted file mode 100644 index 2ce8f4ffc583a..0000000000000 --- a/x-pack/plugins/ml/public/application/util/error_utils.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { CustomHttpResponseOptions, ResponseError } from 'kibana/server'; - -export const extractErrorMessage = ( - error: CustomHttpResponseOptions | undefined | string -): string | undefined => { - if (typeof error === 'string') { - return error; - } - - if (error?.body) { - if (typeof error.body === 'string') { - return error.body; - } - if (typeof error.body === 'object' && 'message' in error.body) { - if (typeof error.body.message === 'string') { - return error.body.message; - } - // @ts-ignore - if (typeof (error.body.message?.msg === 'string')) { - // @ts-ignore - return error.body.message?.msg; - } - } - } - return undefined; -}; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.test.ts b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.test.ts index 974669325ca43..890c2bde6305d 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.test.ts +++ b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.test.ts @@ -156,8 +156,8 @@ describe('processFilters', () => { minimum_should_match: 1, }, }, - // @ts-ignore $state: { + // @ts-ignore store: 'appState', }, }, @@ -178,8 +178,9 @@ describe('processFilters', () => { instance: 'i-16fd8d2a', }, }, - // @ts-ignore + $state: { + // @ts-ignore store: 'appState', }, }, @@ -196,8 +197,8 @@ describe('processFilters', () => { exists: { field: 'instance', }, - // @ts-ignore $state: { + // @ts-ignore store: 'appState', }, }, @@ -214,8 +215,8 @@ describe('processFilters', () => { exists: { field: 'region', }, - // @ts-ignore $state: { + // @ts-ignore store: 'appState', }, }, diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.ts b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.ts index 74a7b432de267..e704582d5d61a 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.ts +++ b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/swimlane_input_resolver.ts @@ -51,12 +51,12 @@ export function useSwimlaneInputResolver( refresh: Observable, services: [CoreStart, MlStartDependencies, AnomalySwimlaneServices], chartWidth: number -) { +): [string | undefined, OverallSwimlaneData | undefined, TimeBuckets, Error | null | undefined] { const [{ uiSettings }, , { explorerService, anomalyDetectorService }] = services; const [swimlaneData, setSwimlaneData] = useState(); const [swimlaneType, setSwimlaneType] = useState(); - const [error, setError] = useState(); + const [error, setError] = useState(); const chartWidth$ = useMemo(() => new Subject(), []); diff --git a/x-pack/plugins/ml/public/shared.ts b/x-pack/plugins/ml/public/shared.ts index 6821cb7ef0f94..ff83d79adff67 100644 --- a/x-pack/plugins/ml/public/shared.ts +++ b/x-pack/plugins/ml/public/shared.ts @@ -14,6 +14,7 @@ export * from '../common/types/audit_message'; export * from '../common/util/anomaly_utils'; export * from '../common/util/errors'; + export * from '../common/util/validators'; export * from './application/formatters/metric_change_description'; diff --git a/x-pack/plugins/reporting/public/plugin.tsx b/x-pack/plugins/reporting/public/plugin.tsx index 7dd709b956d12..fcaa295a45ecc 100644 --- a/x-pack/plugins/reporting/public/plugin.tsx +++ b/x-pack/plugins/reporting/public/plugin.tsx @@ -111,7 +111,7 @@ export class ReportingPublicPlugin implements Plugin { defaultMessage: 'Manage your reports generated from Discover, Visualize, and Dashboard.', }), icon: 'reportingApp', - path: '/app/management/kibana/reporting', + path: '/app/management/insightsAndAlerting/reporting', showOnHomePage: false, category: FeatureCatalogueCategory.ADMIN, }); diff --git a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts index 246c605f4bfe6..3ce5329e42517 100644 --- a/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts +++ b/x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts @@ -28,22 +28,25 @@ import { getChromeLogLocation } from '../paths'; import { puppeteerLaunch } from '../puppeteer'; import { args } from './args'; -type binaryPath = string; type BrowserConfig = CaptureConfig['browser']['chromium']; type ViewportConfig = CaptureConfig['viewport']; export class HeadlessChromiumDriverFactory { - private binaryPath: binaryPath; + private binaryPath: string; private captureConfig: CaptureConfig; private browserConfig: BrowserConfig; private userDataDir: string; private getChromiumArgs: (viewport: ViewportConfig) => string[]; - constructor(binaryPath: binaryPath, logger: LevelLogger, captureConfig: CaptureConfig) { + constructor(binaryPath: string, captureConfig: CaptureConfig, logger: LevelLogger) { this.binaryPath = binaryPath; this.captureConfig = captureConfig; this.browserConfig = captureConfig.browser.chromium; + if (this.browserConfig.disableSandbox) { + logger.warning(`Enabling the Chromium sandbox provides an additional layer of protection.`); + } + this.userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'chromium-')); this.getChromiumArgs = (viewport: ViewportConfig) => args({ diff --git a/x-pack/plugins/reporting/server/browsers/chromium/index.ts b/x-pack/plugins/reporting/server/browsers/chromium/index.ts index 5f89662c94da2..cebcd228b01c3 100644 --- a/x-pack/plugins/reporting/server/browsers/chromium/index.ts +++ b/x-pack/plugins/reporting/server/browsers/chromium/index.ts @@ -4,16 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ +import { BrowserDownload } from '../'; import { CaptureConfig } from '../../../server/types'; import { LevelLogger } from '../../lib'; import { HeadlessChromiumDriverFactory } from './driver_factory'; +import { paths } from './paths'; -export { paths } from './paths'; - -export async function createDriverFactory( - binaryPath: string, - logger: LevelLogger, - captureConfig: CaptureConfig -): Promise { - return new HeadlessChromiumDriverFactory(binaryPath, logger, captureConfig); -} +export const chromium: BrowserDownload = { + paths, + createDriverFactory: (binaryPath: string, captureConfig: CaptureConfig, logger: LevelLogger) => + new HeadlessChromiumDriverFactory(binaryPath, captureConfig, logger), +}; diff --git a/x-pack/plugins/reporting/server/browsers/create_browser_driver_factory.ts b/x-pack/plugins/reporting/server/browsers/create_browser_driver_factory.ts deleted file mode 100644 index f3486a48ba7b1..0000000000000 --- a/x-pack/plugins/reporting/server/browsers/create_browser_driver_factory.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { first } from 'rxjs/operators'; -import { ReportingConfig } from '../'; -import { LevelLogger } from '../lib'; -import { HeadlessChromiumDriverFactory } from './chromium/driver_factory'; -import { ensureBrowserDownloaded } from './download'; -import { chromium } from './index'; -import { installBrowser } from './install'; - -export async function createBrowserDriverFactory( - config: ReportingConfig, - logger: LevelLogger -): Promise { - const captureConfig = config.get('capture'); - const browserConfig = captureConfig.browser.chromium; - const browserAutoDownload = captureConfig.browser.autoDownload; - const browserType = captureConfig.browser.type; - const dataDir = await config.kbnConfig.get('path', 'data').pipe(first()).toPromise(); - - if (browserConfig.disableSandbox) { - logger.warning(`Enabling the Chromium sandbox provides an additional layer of protection.`); - } - if (browserAutoDownload) { - await ensureBrowserDownloaded(browserType, logger); - } - - try { - const { binaryPath } = await installBrowser(logger, chromium, dataDir); - return chromium.createDriverFactory(binaryPath, logger, captureConfig); - } catch (error) { - if (error.cause && ['EACCES', 'EEXIST'].includes(error.cause.code)) { - logger.error( - `Error code ${error.cause.code}: Insufficient permissions for extracting the browser archive. ` + - `Make sure the Kibana data directory (path.data) is owned by the same user that is running Kibana.` - ); - } - - throw error; // reject the promise with the original error - } -} diff --git a/x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts b/x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts index b334510d71947..add14448e2f1d 100644 --- a/x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts +++ b/x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts @@ -56,7 +56,7 @@ async function ensureDownloaded(browsers: BrowserDownload[], logger: LevelLogger const path = resolvePath(archivesPath, archiveFilename); if (existsSync(path) && (await md5(path)) === archiveChecksum) { - logger.info(`Browser archive exists in ${path}`); + logger.debug(`Browser archive exists in ${path}`); return; } diff --git a/x-pack/plugins/reporting/server/browsers/index.ts b/x-pack/plugins/reporting/server/browsers/index.ts index 7f6e40fb433b6..be5b869ba523b 100644 --- a/x-pack/plugins/reporting/server/browsers/index.ts +++ b/x-pack/plugins/reporting/server/browsers/index.ts @@ -4,20 +4,27 @@ * you may not use this file except in compliance with the Elastic License. */ -import * as chromiumDefinition from './chromium'; +import { first } from 'rxjs/operators'; +import { LevelLogger } from '../lib'; +import { CaptureConfig } from '../types'; +import { chromium } from './chromium'; +import { HeadlessChromiumDriverFactory } from './chromium/driver_factory'; +import { installBrowser } from './install'; +import { ReportingConfig } from '..'; export { ensureAllBrowsersDownloaded } from './download'; -export { createBrowserDriverFactory } from './create_browser_driver_factory'; - export { HeadlessChromiumDriver } from './chromium/driver'; export { HeadlessChromiumDriverFactory } from './chromium/driver_factory'; +export { chromium } from './chromium'; -export const chromium = { - paths: chromiumDefinition.paths, - createDriverFactory: chromiumDefinition.createDriverFactory, -}; +type CreateDriverFactory = ( + binaryPath: string, + captureConfig: CaptureConfig, + logger: LevelLogger +) => HeadlessChromiumDriverFactory; export interface BrowserDownload { + createDriverFactory: CreateDriverFactory; paths: { archivesPath: string; baseUrl: string; @@ -30,3 +37,13 @@ export interface BrowserDownload { }>; }; } + +export const initializeBrowserDriverFactory = async ( + config: ReportingConfig, + logger: LevelLogger +) => { + const { binaryPath$ } = installBrowser(chromium, config, logger); + const binaryPath = await binaryPath$.pipe(first()).toPromise(); + const captureConfig = config.get('capture'); + return chromium.createDriverFactory(binaryPath, captureConfig, logger); +}; diff --git a/x-pack/plugins/reporting/server/browsers/install.ts b/x-pack/plugins/reporting/server/browsers/install.ts index 01526af307022..49361b7b6014d 100644 --- a/x-pack/plugins/reporting/server/browsers/install.ts +++ b/x-pack/plugins/reporting/server/browsers/install.ts @@ -6,9 +6,13 @@ import fs from 'fs'; import path from 'path'; +import * as Rx from 'rxjs'; +import { first } from 'rxjs/operators'; import { promisify } from 'util'; +import { ReportingConfig } from '../'; import { LevelLogger } from '../lib'; import { BrowserDownload } from './'; +import { ensureBrowserDownloaded } from './download'; // @ts-ignore import { md5 } from './download/checksum'; // @ts-ignore @@ -19,37 +23,60 @@ const chmod = promisify(fs.chmod); interface Package { platforms: string[]; } -interface PathResponse { - binaryPath: string; -} /** * "install" a browser by type into installs path by extracting the downloaded * archive. If there is an error extracting the archive an `ExtractError` is thrown */ -export async function installBrowser( - logger: LevelLogger, +export function installBrowser( browser: BrowserDownload, - installsPath: string -): Promise { - const pkg = browser.paths.packages.find((p: Package) => p.platforms.includes(process.platform)); + config: ReportingConfig, + logger: LevelLogger +): { binaryPath$: Rx.Subject } { + const binaryPath$ = new Rx.Subject(); + const backgroundInstall = async () => { + const captureConfig = config.get('capture'); + const { autoDownload, type: browserType } = captureConfig.browser; + if (autoDownload) { + await ensureBrowserDownloaded(browserType, logger); + } + + const pkg = browser.paths.packages.find((p: Package) => p.platforms.includes(process.platform)); + if (!pkg) { + throw new Error(`Unsupported platform: ${JSON.stringify(browser, null, 2)}`); + } + + const dataDir = await config.kbnConfig.get('path', 'data').pipe(first()).toPromise(); + const binaryPath = path.join(dataDir, pkg.binaryRelativePath); + + try { + const binaryChecksum = await md5(binaryPath).catch(() => ''); - if (!pkg) { - throw new Error(`Unsupported platform: ${JSON.stringify(browser, null, 2)}`); - } + if (binaryChecksum !== pkg.binaryChecksum) { + const archive = path.join(browser.paths.archivesPath, pkg.archiveFilename); + logger.info(`Extracting [${archive}] to [${binaryPath}]`); + await extract(archive, dataDir); + await chmod(binaryPath, '755'); + } + } catch (error) { + if (error.cause && ['EACCES', 'EEXIST'].includes(error.cause.code)) { + logger.error( + `Error code ${error.cause.code}: Insufficient permissions for extracting the browser archive. ` + + `Make sure the Kibana data directory (path.data) is owned by the same user that is running Kibana.` + ); + } - const binaryPath = path.join(installsPath, pkg.binaryRelativePath); - const binaryChecksum = await md5(binaryPath).catch(() => ''); + throw error; // reject the promise with the original error + } + + logger.debug(`Browser executable: ${binaryPath}`); + + binaryPath$.next(binaryPath); // subscribers wait for download and extract to complete + }; - if (binaryChecksum !== pkg.binaryChecksum) { - const archive = path.join(browser.paths.archivesPath, pkg.archiveFilename); - logger.debug(`Extracting [${archive}] to [${binaryPath}]`); - await extract(archive, installsPath); - await chmod(binaryPath, '755'); - } + backgroundInstall(); - logger.debug(`Browser installed at ${binaryPath}`); return { - binaryPath, + binaryPath$, }; } diff --git a/x-pack/plugins/reporting/server/config/config.ts b/x-pack/plugins/reporting/server/config/config.ts index 4142ab6f0ae43..2a09ebea9619c 100644 --- a/x-pack/plugins/reporting/server/config/config.ts +++ b/x-pack/plugins/reporting/server/config/config.ts @@ -4,10 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Observable } from 'rxjs'; import { get } from 'lodash'; -import { map } from 'rxjs/operators'; +import { Observable } from 'rxjs'; +import { first, map } from 'rxjs/operators'; import { CoreSetup, PluginInitializerContext } from 'src/core/server'; +import { LevelLogger } from '../lib'; +import { createConfig$ } from './create_config'; import { ReportingConfigType } from './schema'; // make config.get() aware of the value type it returns @@ -55,11 +57,12 @@ export interface ReportingConfig extends Config { kbnConfig: Config; } -export const buildConfig = ( +export const buildConfig = async ( initContext: PluginInitializerContext, core: CoreSetup, - reportingConfig: ReportingConfigType -): ReportingConfig => { + logger: LevelLogger +): Promise => { + const config$ = initContext.config.create(); const { http } = core; const serverInfo = http.getServerInfo(); @@ -77,6 +80,8 @@ export const buildConfig = ( }, }; + const reportingConfig$ = createConfig$(core, config$, logger); + const reportingConfig = await reportingConfig$.pipe(first()).toPromise(); return { get: (...keys: string[]) => get(reportingConfig, keys.join('.'), null), // spreading arguments as an array allows the return type to be known by the compiler kbnConfig: { diff --git a/x-pack/plugins/reporting/server/config/create_config.test.ts b/x-pack/plugins/reporting/server/config/create_config.test.ts index 1c4c840cfa312..8ad8042a93105 100644 --- a/x-pack/plugins/reporting/server/config/create_config.test.ts +++ b/x-pack/plugins/reporting/server/config/create_config.test.ts @@ -45,7 +45,11 @@ describe('Reporting server createConfig$', () => { mockInitContext = makeMockInitContext({ kibanaServer: {}, }); - mockLogger = ({ warn: jest.fn(), debug: jest.fn() } as unknown) as LevelLogger; + mockLogger = ({ + warn: jest.fn(), + debug: jest.fn(), + clone: jest.fn().mockImplementation(() => mockLogger), + } as unknown) as LevelLogger; }); afterEach(() => { diff --git a/x-pack/plugins/reporting/server/config/create_config.ts b/x-pack/plugins/reporting/server/config/create_config.ts index 67df7dacc77ab..5c66bd599dd9a 100644 --- a/x-pack/plugins/reporting/server/config/create_config.ts +++ b/x-pack/plugins/reporting/server/config/create_config.ts @@ -23,8 +23,9 @@ import { ReportingConfigType } from './schema'; export function createConfig$( core: CoreSetup, config$: Observable, - logger: LevelLogger + parentLogger: LevelLogger ) { + const logger = parentLogger.clone(['config']); return config$.pipe( map((config) => { // encryption key diff --git a/x-pack/plugins/reporting/server/config/index.ts b/x-pack/plugins/reporting/server/config/index.ts index caa64a7414005..a89b952702e1b 100644 --- a/x-pack/plugins/reporting/server/config/index.ts +++ b/x-pack/plugins/reporting/server/config/index.ts @@ -7,7 +7,6 @@ import { PluginConfigDescriptor } from 'kibana/server'; import { ConfigSchema, ReportingConfigType } from './schema'; export { buildConfig } from './config'; -export { createConfig$ } from './create_config'; export { ConfigSchema, ReportingConfigType }; export const config: PluginConfigDescriptor = { diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts index e7786b3b753fb..94b138ffcae0b 100644 --- a/x-pack/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -26,7 +26,6 @@ import { ESQueueInstance } from './lib/create_queue'; import { EnqueueJobFn } from './lib/enqueue_job'; export interface ReportingInternalSetup { - browserDriverFactory: HeadlessChromiumDriverFactory; elasticsearch: ElasticsearchServiceSetup; licensing: LicensingPluginSetup; basePath: BasePath['get']; @@ -44,6 +43,7 @@ interface ReportingInternalStart { export class ReportingCore { private pluginSetupDeps?: ReportingInternalSetup; private pluginStartDeps?: ReportingInternalStart; + private browserDriverFactory?: HeadlessChromiumDriverFactory; private readonly pluginSetup$ = new Rx.ReplaySubject(); private readonly pluginStart$ = new Rx.ReplaySubject(); private exportTypesRegistry = getExportTypesRegistry(); @@ -63,6 +63,10 @@ export class ReportingCore { return this.pluginStart$.pipe(first(), mapTo(true)).toPromise(); } + public setBrowserDriverFactory(browserDriverFactory: HeadlessChromiumDriverFactory) { + this.browserDriverFactory = browserDriverFactory; + } + /* * Internal module dependencies */ @@ -93,7 +97,10 @@ export class ReportingCore { } public getScreenshotsObservable(): ScreenshotsObservableFn { - const { browserDriverFactory } = this.getPluginSetupDeps(); + const { browserDriverFactory } = this; + if (!browserDriverFactory) { + throw new Error(`"browserDriverFactory" dependency hasn't initialized yet`); + } return screenshotsObservableFactory(this.config.get('capture'), browserDriverFactory); } diff --git a/x-pack/plugins/reporting/server/lib/validate/index.ts b/x-pack/plugins/reporting/server/lib/validate/index.ts index 404cbcda31a09..7c439d6023d5f 100644 --- a/x-pack/plugins/reporting/server/lib/validate/index.ts +++ b/x-pack/plugins/reporting/server/lib/validate/index.ts @@ -7,8 +7,8 @@ import { i18n } from '@kbn/i18n'; import { ElasticsearchServiceSetup } from 'kibana/server'; import { ReportingConfig } from '../../'; -import { LevelLogger } from '../../lib'; import { HeadlessChromiumDriverFactory } from '../../browsers/chromium/driver_factory'; +import { LevelLogger } from '../../lib'; import { validateBrowser } from './validate_browser'; import { validateMaxContentLength } from './validate_max_content_length'; @@ -16,8 +16,9 @@ export async function runValidations( config: ReportingConfig, elasticsearch: ElasticsearchServiceSetup, browserFactory: HeadlessChromiumDriverFactory, - logger: LevelLogger + parentLogger: LevelLogger ) { + const logger = parentLogger.clone(['validations']); try { await Promise.all([ validateBrowser(browserFactory, logger), diff --git a/x-pack/plugins/reporting/server/plugin.test.ts b/x-pack/plugins/reporting/server/plugin.test.ts new file mode 100644 index 0000000000000..b2bcd6b9c97ce --- /dev/null +++ b/x-pack/plugins/reporting/server/plugin.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +jest.mock('./browsers/install', () => ({ + installBrowser: jest.fn().mockImplementation(() => ({ + binaryPath$: { + pipe: jest.fn().mockImplementation(() => ({ + toPromise: () => Promise.resolve(), + })), + }, + })), +})); + +import { coreMock } from 'src/core/server/mocks'; +import { ReportingPlugin } from './plugin'; +import { createMockConfigSchema } from './test_helpers'; + +const sleep = (time: number) => new Promise((r) => setTimeout(r, time)); + +describe('Reporting Plugin', () => { + let configSchema: any; + let initContext: any; + let coreSetup: any; + let coreStart: any; + let pluginSetup: any; + let pluginStart: any; + + beforeEach(async () => { + configSchema = createMockConfigSchema(); + initContext = coreMock.createPluginInitializerContext(configSchema); + coreSetup = await coreMock.createSetup(configSchema); + coreStart = await coreMock.createStart(); + pluginSetup = ({ + licensing: {}, + usageCollection: { + makeUsageCollector: jest.fn(), + registerCollector: jest.fn(), + }, + security: { + authc: { + getCurrentUser: () => ({ + id: '123', + roles: ['superuser'], + username: 'Tom Riddle', + }), + }, + }, + } as unknown) as any; + pluginStart = ({ + data: { + fieldFormats: {}, + }, + } as unknown) as any; + }); + + it('has a sync setup process', () => { + const plugin = new ReportingPlugin(initContext); + + expect(plugin.setup(coreSetup, pluginSetup)).not.toHaveProperty('then'); + }); + + it('logs setup issues', async () => { + const plugin = new ReportingPlugin(initContext); + // @ts-ignore overloading error logger + plugin.logger.error = jest.fn(); + coreSetup.elasticsearch = null; + plugin.setup(coreSetup, pluginSetup); + + await sleep(5); + + // @ts-ignore overloading error logger + expect(plugin.logger.error.mock.calls[0][0]).toMatch( + /Error in Reporting setup, reporting may not function properly/ + ); + // @ts-ignore overloading error logger + expect(plugin.logger.error).toHaveBeenCalledTimes(2); + }); + + it('has a sync startup process', async () => { + const plugin = new ReportingPlugin(initContext); + plugin.setup(coreSetup, pluginSetup); + await sleep(5); + expect(plugin.start(coreStart, pluginStart)).not.toHaveProperty('then'); + }); + + it('logs start issues', async () => { + const plugin = new ReportingPlugin(initContext); + // @ts-ignore overloading error logger + plugin.logger.error = jest.fn(); + plugin.setup(coreSetup, pluginSetup); + await sleep(5); + plugin.start(null as any, pluginStart); + await sleep(10); + // @ts-ignore overloading error logger + expect(plugin.logger.error.mock.calls[0][0]).toMatch( + /Error in Reporting start, reporting may not function properly/ + ); + // @ts-ignore overloading error logger + expect(plugin.logger.error).toHaveBeenCalledTimes(2); + }); +}); diff --git a/x-pack/plugins/reporting/server/plugin.ts b/x-pack/plugins/reporting/server/plugin.ts index d0d25f6d9e0ae..a3c89c7b8a8ce 100644 --- a/x-pack/plugins/reporting/server/plugin.ts +++ b/x-pack/plugins/reporting/server/plugin.ts @@ -4,13 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Observable } from 'rxjs'; -import { first } from 'rxjs/operators'; +import * as Rx from 'rxjs'; import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'src/core/server'; -import { ReportingCore } from './core'; -import { ReportingConfigType } from './config'; -import { createBrowserDriverFactory } from './browsers'; -import { buildConfig, createConfig$ } from './config'; +import { ReportingCore } from './'; +import { initializeBrowserDriverFactory } from './browsers'; +import { buildConfig, ReportingConfigType } from './config'; import { createQueueFactory, enqueueJobFactory, LevelLogger, runValidations } from './lib'; import { registerRoutes } from './routes'; import { setFieldFormats } from './services'; @@ -22,61 +20,83 @@ export class ReportingPlugin private readonly initializerContext: PluginInitializerContext; private logger: LevelLogger; private reportingCore?: ReportingCore; - private config$: Observable; + + // Setup some observables for modules that need to await setup/start + public readonly setup$ = new Rx.Subject(); + public readonly start$ = new Rx.Subject(); constructor(context: PluginInitializerContext) { this.logger = new LevelLogger(context.logger.get()); this.initializerContext = context; - this.config$ = context.config.create(); } - public async setup(core: CoreSetup, plugins: ReportingSetupDeps) { + public setup(core: CoreSetup, plugins: ReportingSetupDeps) { const { elasticsearch, http } = core; const { licensing, security } = plugins; const { initializerContext: initContext } = this; const router = http.createRouter(); const basePath = http.basePath.get; - const coreConfig = await createConfig$(core, this.config$, this.logger) - .pipe(first()) - .toPromise(); // apply computed defaults to config - const reportingConfig = buildConfig(initContext, core, coreConfig); // combine kbnServer configs - this.reportingCore = new ReportingCore(reportingConfig); - - const browserDriverFactory = await createBrowserDriverFactory(reportingConfig, this.logger); - - this.reportingCore.pluginSetup({ - browserDriverFactory, - elasticsearch, - licensing, - basePath, - router, - security, - }); + // async background setup + (async () => { + const config = await buildConfig(initContext, core, this.logger); + const reportingCore = new ReportingCore(config); + + reportingCore.pluginSetup({ + elasticsearch, + licensing, + basePath, + router, + security, + }); - runValidations(reportingConfig, elasticsearch, browserDriverFactory, this.logger); - registerReportingUsageCollector(this.reportingCore, plugins); - registerRoutes(this.reportingCore, this.logger); + registerReportingUsageCollector(reportingCore, plugins); + registerRoutes(reportingCore, this.logger); + this.reportingCore = reportingCore; + + this.logger.debug('Setup complete'); + this.setup$.next(true); + })().catch((e) => { + this.logger.error(`Error in Reporting setup, reporting may not function properly`); + this.logger.error(e); + }); return {}; } - public async start(core: CoreStart, plugins: ReportingStartDeps) { + public start(core: CoreStart, plugins: ReportingStartDeps) { + // use data plugin for csv formats + setFieldFormats(plugins.data.fieldFormats); + const { logger } = this; const reportingCore = this.getReportingCore(); + const config = reportingCore.getConfig(); + const { elasticsearch } = reportingCore.getPluginSetupDeps(); - const esqueue = await createQueueFactory(reportingCore, logger); - const enqueueJob = enqueueJobFactory(reportingCore, logger); + // async background start + (async () => { + const browserDriverFactory = await initializeBrowserDriverFactory(config, logger); + reportingCore.setBrowserDriverFactory(browserDriverFactory); - reportingCore.pluginStart({ - savedObjects: core.savedObjects, - uiSettings: core.uiSettings, - esqueue, - enqueueJob, - }); + const esqueue = await createQueueFactory(reportingCore, logger); + const enqueueJob = enqueueJobFactory(reportingCore, logger); - setFieldFormats(plugins.data.fieldFormats); - logger.info('reporting plugin started'); + reportingCore.pluginStart({ + savedObjects: core.savedObjects, + uiSettings: core.uiSettings, + esqueue, + enqueueJob, + }); + + // run self-check validations + runValidations(config, elasticsearch, browserDriverFactory, this.logger); + + this.logger.debug('Start complete'); + this.start$.next(true); + })().catch((e) => { + this.logger.error(`Error in Reporting start, reporting may not function properly`); + this.logger.error(e); + }); return {}; } diff --git a/x-pack/plugins/reporting/server/routes/jobs.ts b/x-pack/plugins/reporting/server/routes/jobs.ts index 8c35f79ec0fb4..29cf55bc5c72e 100644 --- a/x-pack/plugins/reporting/server/routes/jobs.ts +++ b/x-pack/plugins/reporting/server/routes/jobs.ts @@ -22,7 +22,7 @@ interface ListQuery { } const MAIN_ENTRY = `${API_BASE_URL}/jobs`; -export async function registerJobInfoRoutes(reporting: ReportingCore) { +export function registerJobInfoRoutes(reporting: ReportingCore) { const config = reporting.getConfig(); const setupDeps = reporting.getPluginSetupDeps(); const userHandler = authorizedUserPreRoutingFactory(reporting); diff --git a/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts index 5b0d740e031ab..97e22e2ca2863 100644 --- a/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts +++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts @@ -6,8 +6,7 @@ import { Page } from 'puppeteer'; import * as Rx from 'rxjs'; -import { HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../browsers'; -import { createDriverFactory } from '../browsers/chromium'; +import { chromium, HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../browsers'; import * as contexts from '../export_types/common/lib/screenshots/constants'; import { LevelLogger } from '../lib'; import { CaptureConfig, ElementsPositionAndAttribute } from '../types'; @@ -113,8 +112,12 @@ export const createMockBrowserDriverFactory = async ( maxAttempts: 1, }; - const binaryPath = '/usr/local/share/common/secure/'; - const mockBrowserDriverFactory = await createDriverFactory(binaryPath, logger, captureConfig); + const binaryPath = '/usr/local/share/common/secure/super_awesome_binary'; + const mockBrowserDriverFactory = await chromium.createDriverFactory( + binaryPath, + captureConfig, + logger + ); const mockPage = {} as Page; const mockBrowserDriver = new HeadlessChromiumDriver(mockPage, { inspect: true, diff --git a/x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts b/x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts index b04e697d0a118..669381a92c522 100644 --- a/x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts +++ b/x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts @@ -7,49 +7,65 @@ jest.mock('../routes'); jest.mock('../usage'); jest.mock('../browsers'); -jest.mock('../browsers'); jest.mock('../lib/create_queue'); jest.mock('../lib/enqueue_job'); jest.mock('../lib/validate'); import { of } from 'rxjs'; +import { first } from 'rxjs/operators'; import { coreMock } from 'src/core/server/mocks'; import { ReportingConfig, ReportingCore } from '../'; +import { + chromium, + HeadlessChromiumDriverFactory, + initializeBrowserDriverFactory, +} from '../browsers'; import { ReportingInternalSetup } from '../core'; import { ReportingPlugin } from '../plugin'; import { ReportingSetupDeps, ReportingStartDeps } from '../types'; +(initializeBrowserDriverFactory as jest.Mock< + Promise +>).mockImplementation(() => Promise.resolve({} as HeadlessChromiumDriverFactory)); + +(chromium as any).createDriverFactory.mockImplementation(() => ({})); + const createMockSetupDeps = (setupMock?: any): ReportingSetupDeps => { return { security: setupMock.security, licensing: { license$: of({ isAvailable: true, isActive: true, type: 'basic' }), } as any, - usageCollection: {} as any, + usageCollection: { + makeUsageCollector: jest.fn(), + registerCollector: jest.fn(), + } as any, }; }; +export const createMockConfigSchema = (overrides?: any) => ({ + index: '.reporting', + kibanaServer: { + hostname: 'localhost', + port: '80', + }, + capture: { + browser: { + chromium: { + disableSandbox: true, + }, + }, + }, + ...overrides, +}); + export const createMockStartDeps = (startMock?: any): ReportingStartDeps => ({ data: startMock.data, }); const createMockReportingPlugin = async (config: ReportingConfig): Promise => { - const mockConfig = { - index: '.reporting', - kibanaServer: { - hostname: 'localhost', - port: '80', - }, - capture: { - browser: { - chromium: { - disableSandbox: true, - }, - }, - }, - ...config, - }; - const plugin = new ReportingPlugin(coreMock.createPluginInitializerContext(mockConfig)); + const mockConfigSchema = createMockConfigSchema(config); + const plugin = new ReportingPlugin(coreMock.createPluginInitializerContext(mockConfigSchema)); const setupMock = coreMock.createSetup(); const coreStartMock = coreMock.createStart(); const startMock = { @@ -57,8 +73,10 @@ const createMockReportingPlugin = async (config: ReportingConfig): Promise } public get dateHistogram() { - const [dateHistogram] = Object.values(this.availableMetrics.date_histogram); + const [dateHistogram] = Object.values(this.availableMetrics.date_histogram); return dateHistogram; } diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx index 1ee1adf41a156..8621b01299e4f 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.tsx @@ -7,6 +7,7 @@ import React, { Component } from 'react'; import { EuiBadge, + EuiBasicTableColumn, EuiButton, EuiButtonIcon, EuiCallOut, @@ -354,7 +355,7 @@ export class APIKeysGridPage extends Component { private getColumnConfig = () => { const { isAdmin } = this.state; - let config = [ + let config: Array> = [ { field: 'name', name: i18n.translate('xpack.security.management.apiKeys.table.nameColumnName', { @@ -390,7 +391,6 @@ export class APIKeysGridPage extends Component { defaultMessage: 'Created', }), sortable: true, - // @ts-ignore render: (creationDateMs: number) => moment(creationDateMs).format(DATE_FORMAT), }, { @@ -399,7 +399,6 @@ export class APIKeysGridPage extends Component { defaultMessage: 'Expires', }), sortable: true, - // @ts-ignore render: (expirationDateMs: number) => { if (expirationDateMs === undefined) { return ( diff --git a/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts b/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts index 10b5b3ce8521c..08561234fd706 100644 --- a/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts +++ b/x-pack/plugins/security/public/management/roles/__fixtures__/kibana_features.ts @@ -10,32 +10,36 @@ export const createFeature = ( config: Pick & { excludeFromBaseAll?: boolean; excludeFromBaseRead?: boolean; + privileges?: FeatureConfig['privileges']; } ) => { - const { excludeFromBaseAll, excludeFromBaseRead, ...rest } = config; + const { excludeFromBaseAll, excludeFromBaseRead, privileges, ...rest } = config; return new Feature({ icon: 'discoverApp', navLinkId: 'discover', app: [], catalogue: [], - privileges: { - all: { - excludeFromBasePrivileges: excludeFromBaseAll, - savedObject: { - all: ['all-type'], - read: ['read-type'], - }, - ui: ['read-ui', 'all-ui', `read-${config.id}`, `all-${config.id}`], - }, - read: { - excludeFromBasePrivileges: excludeFromBaseRead, - savedObject: { - all: [], - read: ['read-type'], - }, - ui: ['read-ui', `read-${config.id}`], - }, - }, + privileges: + privileges === null + ? null + : { + all: { + excludeFromBasePrivileges: excludeFromBaseAll, + savedObject: { + all: ['all-type'], + read: ['read-type'], + }, + ui: ['read-ui', 'all-ui', `read-${config.id}`, `all-${config.id}`], + }, + read: { + excludeFromBasePrivileges: excludeFromBaseRead, + savedObject: { + all: [], + read: ['read-type'], + }, + ui: ['read-ui', `read-${config.id}`], + }, + }, ...rest, }); }; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx index be475398608e0..6bc829f766e58 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx @@ -762,4 +762,88 @@ describe('FeatureTable', () => { }, }); }); + + it('renders a description for features with only reserved privileges (omitting the primary feature controls)', () => { + const role = createRole([ + { + spaces: ['foo'], + base: [], + feature: {}, + }, + ]); + const reservedFeature = createFeature({ + id: 'reserved_feature', + name: 'Reserved Feature', + privileges: null, + reserved: { + description: 'this is my reserved feature description', + privileges: [ + { + id: 'priv_1', + privilege: { + api: [], + savedObject: { all: [], read: [] }, + ui: [], + }, + }, + ], + }, + }); + + const { wrapper } = setup({ + role, + features: [reservedFeature], + privilegeIndex: 0, + calculateDisplayedPrivileges: false, + canCustomizeSubFeaturePrivileges: false, + }); + + expect(findTestSubject(wrapper, 'reservedFeatureDescription').text()).toMatchInlineSnapshot( + `"this is my reserved feature description"` + ); + + expect(findTestSubject(wrapper, 'primaryFeaturePrivilegeControl')).toHaveLength(0); + }); + + it('renders renders the primary feature controls when both primary and reserved privileges are specified', () => { + const role = createRole([ + { + spaces: ['foo'], + base: [], + feature: {}, + }, + ]); + const reservedFeature = createFeature({ + id: 'reserved_feature', + name: 'Reserved Feature with primary feature privileges', + reserved: { + description: 'this is my reserved feature description', + privileges: [ + { + id: 'priv_1', + privilege: { + api: [], + savedObject: { all: [], read: [] }, + ui: [], + }, + }, + ], + }, + }); + + const { displayedPrivileges, wrapper } = setup({ + role, + features: [reservedFeature], + privilegeIndex: 0, + calculateDisplayedPrivileges: true, + canCustomizeSubFeaturePrivileges: false, + }); + + expect(findTestSubject(wrapper, 'reservedFeatureDescription')).toHaveLength(0); + expect(displayedPrivileges).toEqual({ + reserved_feature: { + primaryFeaturePrivilege: 'none', + }, + }); + }); }); diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx index 0776f2af2ddd7..38e4390a2856a 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx @@ -193,12 +193,16 @@ export class FeatureTable extends Component { render: (roleEntry: Role, record: TableRow) => { const { feature } = record; - if (feature.reserved) { - return {feature.reserved.description}; - } - const primaryFeaturePrivileges = feature.getPrimaryFeaturePrivileges(); + if (feature.reserved && primaryFeaturePrivileges.length === 0) { + return ( + + {feature.reserved.description} + + ); + } + if (primaryFeaturePrivileges.length === 0) { return null; } diff --git a/x-pack/plugins/security/public/management/roles/model/kibana_privileges.ts b/x-pack/plugins/security/public/management/roles/model/kibana_privileges.ts index a1617f71a0df8..fd93aaa23194a 100644 --- a/x-pack/plugins/security/public/management/roles/model/kibana_privileges.ts +++ b/x-pack/plugins/security/public/management/roles/model/kibana_privileges.ts @@ -73,9 +73,9 @@ export class KibanaPrivileges { } ); - return [assignedBasePrivileges, assignedFeaturePrivileges].flat(2); + return [assignedBasePrivileges, assignedFeaturePrivileges].flat(2); }) - .flat(); + .flat(); return new PrivilegeCollection(privileges); } diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts index 7db8e57421d02..b0b9d70a76c32 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts @@ -143,6 +143,9 @@ export type Throttle = t.TypeOf; export const throttleOrNull = t.union([throttle, t.null]); export type ThrottleOrNull = t.TypeOf; +export const throttleOrNullOrUndefined = t.union([throttle, t.null, t.undefined]); +export type ThrottleOrUndefinedOrNull = t.TypeOf; + export const anomaly_threshold = PositiveInteger; export type AnomalyThreshold = t.TypeOf; @@ -156,11 +159,8 @@ export const machineLearningJobIdOrUndefined = t.union([machine_learning_job_id, export type MachineLearningJobIdOrUndefined = t.TypeOf; /** - * Note that this is a plain unknown object because we allow the UI - * to send us extra additional information as "meta" which can be anything. - * - * TODO: Strip away extra information and possibly even "freeze" this object - * so we have tighter control over 3rd party data structures. + * Note that this is a non-exact io-ts type as we allow extra meta information + * to be added to the meta object */ export const meta = t.object; export type Meta = t.TypeOf; @@ -192,8 +192,10 @@ export const severityOrUndefined = t.union([severity, t.undefined]); export type SeverityOrUndefined = t.TypeOf; export const status = t.keyof({ open: null, closed: null }); +export type Status = t.TypeOf; export const job_status = t.keyof({ succeeded: null, failed: null, 'going to run': null }); +export type JobStatus = t.TypeOf; // TODO: Create a regular expression type or custom date math part type here export const to = t.string; @@ -307,10 +309,20 @@ export const versionOrUndefined = t.union([version, t.undefined]); export type VersionOrUndefined = t.TypeOf; export const last_success_at = IsoDateString; +export type LastSuccessAt = t.TypeOf; + export const last_success_message = t.string; +export type LastSuccessMessage = t.TypeOf; + export const last_failure_at = IsoDateString; +export type LastFailureAt = t.TypeOf; + export const last_failure_message = t.string; +export type LastFailureMessage = t.TypeOf; + export const status_date = IsoDateString; +export type StatusDate = t.TypeOf; + export const rules_installed = PositiveInteger; export const rules_updated = PositiveInteger; export const status_code = PositiveInteger; diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_schema.mock.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_schema.mock.ts index a9ab6f8959e24..2847bd32df514 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_schema.mock.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_schema.mock.ts @@ -7,19 +7,30 @@ import { CreateRulesSchema, CreateRulesSchemaDecoded } from './create_rules_schema'; import { DEFAULT_MAX_SIGNALS } from '../../../constants'; -export const getCreateRulesSchemaMock = (): CreateRulesSchema => ({ - description: 'some description', +export const getCreateRulesSchemaMock = (ruleId = 'rule-1'): CreateRulesSchema => ({ + description: 'Detecting root and admin users', name: 'Query with a rule id', query: 'user.name: root or user.name: admin', severity: 'high', type: 'query', risk_score: 55, language: 'kuery', - rule_id: 'rule-1', + rule_id: ruleId, }); +export const getCreateMlRulesSchemaMock = (ruleId = 'rule-1') => { + const { query, language, index, ...mlParams } = getCreateRulesSchemaMock(ruleId); + + return { + ...mlParams, + type: 'machine_learning', + anomaly_threshold: 58, + machine_learning_job_id: 'typical-ml-job-id', + }; +}; + export const getCreateRulesSchemaDecodedMock = (): CreateRulesSchemaDecoded => ({ - description: 'some description', + description: 'Detecting root and admin users', name: 'Query with a rule id', query: 'user.name: root or user.name: admin', severity: 'high', diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.mock.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.mock.ts index 92fab202c9ddc..aaeb90ffc5bcf 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.mock.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.mock.ts @@ -7,7 +7,7 @@ import { ImportRulesSchema, ImportRulesSchemaDecoded } from './import_rules_schema'; import { DEFAULT_MAX_SIGNALS } from '../../../constants'; -export const getImportRulesSchemaMock = (): ImportRulesSchema => ({ +export const getImportRulesSchemaMock = (ruleId = 'rule-1'): ImportRulesSchema => ({ description: 'some description', name: 'Query with a rule id', query: 'user.name: root or user.name: admin', @@ -15,7 +15,19 @@ export const getImportRulesSchemaMock = (): ImportRulesSchema => ({ type: 'query', risk_score: 55, language: 'kuery', - rule_id: 'rule-1', + rule_id: ruleId, +}); + +export const getImportRulesWithIdSchemaMock = (ruleId = 'rule-1'): ImportRulesSchema => ({ + id: '6afb8ce1-ea94-4790-8653-fd0b021d2113', + description: 'some description', + name: 'Query with a rule id', + query: 'user.name: root or user.name: admin', + severity: 'high', + type: 'query', + risk_score: 55, + language: 'kuery', + rule_id: ruleId, }); export const getImportRulesSchemaDecodedMock = (): ImportRulesSchemaDecoded => ({ @@ -42,3 +54,22 @@ export const getImportRulesSchemaDecodedMock = (): ImportRulesSchemaDecoded => ( rule_id: 'rule-1', immutable: false, }); + +/** + * Given an array of rules, builds an NDJSON string of rules + * as we might import/export + * @param rules Array of rule objects with which to generate rule JSON + */ +export const rulesToNdJsonString = (rules: ImportRulesSchema[]) => { + return rules.map((rule) => JSON.stringify(rule)).join('\r\n'); +}; + +/** + * Given an array of rule IDs, builds an NDJSON string of rules + * as we might import + * @param ruleIds Array of ruleIds with which to generate rule JSON + */ +export const ruleIdsToNdJsonString = (ruleIds: string[]) => { + const rules = ruleIds.map((ruleId) => getImportRulesSchemaMock(ruleId)); + return rulesToNdJsonString(rules); +}; diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.mocks.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.mocks.ts new file mode 100644 index 0000000000000..52b2de316ddd5 --- /dev/null +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.mocks.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { ErrorSchema } from './error_schema'; + +export const getErrorSchemaMock = ( + id: string = '819eded6-e9c8-445b-a647-519aea39e063' +): ErrorSchema => ({ + id, + error: { + status_code: 404, + message: 'id: "819eded6-e9c8-445b-a647-519aea39e063" not found', + }, +}); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts index 2a4d75522d010..d9e16105351bd 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts @@ -7,15 +7,15 @@ import { left } from 'fp-ts/lib/Either'; import { pipe } from 'fp-ts/lib/pipeable'; -import { getErrorPayload } from './__mocks__/utils'; import { errorSchema, ErrorSchema } from './error_schema'; import { exactCheck } from '../../../exact_check'; import { foldLeftRight, getPaths } from '../../../test_utils'; +import { getErrorSchemaMock } from './error_schema.mocks'; describe('error_schema', () => { test('it should validate an error with a UUID given for id', () => { - const error = getErrorPayload(); - const decoded = errorSchema.decode(getErrorPayload()); + const error = getErrorSchemaMock(); + const decoded = errorSchema.decode(getErrorSchemaMock()); const checked = exactCheck(error, decoded); const message = pipe(checked, foldLeftRight); @@ -24,7 +24,7 @@ describe('error_schema', () => { }); test('it should validate an error with a plain string given for id since sometimes we echo the user id which might not be a UUID back out to them', () => { - const error = getErrorPayload('fake id'); + const error = getErrorSchemaMock('fake id'); const decoded = errorSchema.decode(error); const checked = exactCheck(error, decoded); const message = pipe(checked, foldLeftRight); @@ -35,7 +35,7 @@ describe('error_schema', () => { test('it should NOT validate an error when it has extra data next to a valid payload element', () => { type InvalidError = ErrorSchema & { invalid_extra_data?: string }; - const error: InvalidError = getErrorPayload(); + const error: InvalidError = getErrorSchemaMock(); error.invalid_extra_data = 'invalid_extra_data'; const decoded = errorSchema.decode(error); const checked = exactCheck(error, decoded); @@ -46,7 +46,7 @@ describe('error_schema', () => { }); test('it should NOT validate an error when it has required elements deleted from it', () => { - const error = getErrorPayload(); + const error = getErrorSchemaMock(); delete error.error; const decoded = errorSchema.decode(error); const checked = exactCheck(error, decoded); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.mocks.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.mocks.ts new file mode 100644 index 0000000000000..28c3eea761b40 --- /dev/null +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.mocks.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { FindRulesSchema } from './find_rules_schema'; +import { getRulesSchemaMock } from './rules_schema.mocks'; + +export const getFindRulesSchemaMock = (): FindRulesSchema => ({ + page: 1, + perPage: 1, + total: 1, + data: [getRulesSchemaMock()], +}); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts index 51163c3d76ed6..fc1ab9b87795d 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts @@ -6,31 +6,32 @@ import { findRulesSchema, FindRulesSchema } from './find_rules_schema'; import { pipe } from 'fp-ts/lib/pipeable'; -import { getFindResponseSingle, getBaseResponsePayload } from './__mocks__/utils'; import { left } from 'fp-ts/lib/Either'; import { RulesSchema } from './rules_schema'; import { exactCheck } from '../../../exact_check'; import { foldLeftRight, getPaths } from '../../../test_utils'; +import { getRulesSchemaMock } from './rules_schema.mocks'; +import { getFindRulesSchemaMock } from './find_rules_schema.mocks'; describe('find_rules_schema', () => { test('it should validate a typical single find rules response', () => { - const payload = getFindResponseSingle(); + const payload = getFindRulesSchemaMock(); const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindResponseSingle()); + expect(message.schema).toEqual(getFindRulesSchemaMock()); }); test('it should validate an empty find rules response', () => { - const payload = getFindResponseSingle(); + const payload = getFindRulesSchemaMock(); payload.data = []; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getFindResponseSingle(); + const expected = getFindRulesSchemaMock(); expected.data = []; expect(getPaths(left(message.errors))).toEqual([]); @@ -38,7 +39,7 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if it is has an extra property on it', () => { - const payload: FindRulesSchema & { invalid_data?: 'invalid' } = getFindResponseSingle(); + const payload: FindRulesSchema & { invalid_data?: 'invalid' } = getFindRulesSchemaMock(); payload.invalid_data = 'invalid'; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -49,8 +50,8 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if the rules are invalid within it', () => { - const payload = getFindResponseSingle(); - const invalidRule: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload = getFindRulesSchemaMock(); + const invalidRule: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); invalidRule.invalid_extra_data = 'invalid_data'; payload.data = [invalidRule]; const decoded = findRulesSchema.decode(payload); @@ -62,8 +63,8 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if the rule is missing a required field such as name', () => { - const payload = getFindResponseSingle(); - const invalidRule = getBaseResponsePayload(); + const payload = getFindRulesSchemaMock(); + const invalidRule = getRulesSchemaMock(); delete invalidRule.name; payload.data = [invalidRule]; const decoded = findRulesSchema.decode(payload); @@ -77,7 +78,7 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if it is missing perPage', () => { - const payload = getFindResponseSingle(); + const payload = getFindRulesSchemaMock(); delete payload.perPage; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -90,7 +91,7 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if it has a negative perPage number', () => { - const payload = getFindResponseSingle(); + const payload = getFindRulesSchemaMock(); payload.perPage = -1; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -101,7 +102,7 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if it has a negative page number', () => { - const payload = getFindResponseSingle(); + const payload = getFindRulesSchemaMock(); payload.page = -1; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -112,7 +113,7 @@ describe('find_rules_schema', () => { }); test('it should invalidate a typical single find rules response if it has a negative total', () => { - const payload = getFindResponseSingle(); + const payload = getFindRulesSchemaMock(); payload.total = -1; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.mocks.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.mocks.ts new file mode 100644 index 0000000000000..b55809e6b27ea --- /dev/null +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.mocks.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { RulesBulkSchema } from './rules_bulk_schema'; +import { getRulesSchemaMock } from './rules_schema.mocks'; + +export const getRulesBulkSchemaMock = (): RulesBulkSchema => [getRulesSchemaMock()]; diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts index 04cf012f36dba..a169ac3deb9b9 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts @@ -7,46 +7,48 @@ import { left } from 'fp-ts/lib/Either'; import { pipe } from 'fp-ts/lib/pipeable'; -import { getBaseResponsePayload, getErrorPayload } from './__mocks__/utils'; import { RulesBulkSchema, rulesBulkSchema } from './rules_bulk_schema'; import { RulesSchema } from './rules_schema'; import { ErrorSchema } from './error_schema'; import { exactCheck } from '../../../exact_check'; import { foldLeftRight, getPaths } from '../../../test_utils'; +import { getRulesSchemaMock } from './rules_schema.mocks'; +import { getErrorSchemaMock } from './error_schema.mocks'; + describe('prepackaged_rule_schema', () => { test('it should validate a regular message and and error together with a uuid', () => { - const payload: RulesBulkSchema = [getBaseResponsePayload(), getErrorPayload()]; + const payload: RulesBulkSchema = [getRulesSchemaMock(), getErrorSchemaMock()]; const decoded = rulesBulkSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([getBaseResponsePayload(), getErrorPayload()]); + expect(message.schema).toEqual([getRulesSchemaMock(), getErrorSchemaMock()]); }); test('it should validate a regular message and and error together when the error has a non UUID', () => { - const payload: RulesBulkSchema = [getBaseResponsePayload(), getErrorPayload('fake id')]; + const payload: RulesBulkSchema = [getRulesSchemaMock(), getErrorSchemaMock('fake id')]; const decoded = rulesBulkSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([getBaseResponsePayload(), getErrorPayload('fake id')]); + expect(message.schema).toEqual([getRulesSchemaMock(), getErrorSchemaMock('fake id')]); }); test('it should validate an error', () => { - const payload: RulesBulkSchema = [getErrorPayload('fake id')]; + const payload: RulesBulkSchema = [getErrorSchemaMock('fake id')]; const decoded = rulesBulkSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([getErrorPayload('fake id')]); + expect(message.schema).toEqual([getErrorSchemaMock('fake id')]); }); test('it should NOT validate a rule with a deleted value', () => { - const rule = getBaseResponsePayload(); + const rule = getRulesSchemaMock(); delete rule.name; const payload: RulesBulkSchema = [rule]; const decoded = rulesBulkSchema.decode(payload); @@ -61,7 +63,7 @@ describe('prepackaged_rule_schema', () => { }); test('it should NOT validate an invalid error message with a deleted value', () => { - const error = getErrorPayload('fake id'); + const error = getErrorSchemaMock('fake id'); delete error.error; const payload: RulesBulkSchema = [error]; const decoded = rulesBulkSchema.decode(payload); @@ -76,7 +78,7 @@ describe('prepackaged_rule_schema', () => { }); test('it should NOT validate a type of "query" when it has extra data', () => { - const rule: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const rule: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); rule.invalid_extra_data = 'invalid_extra_data'; const payload: RulesBulkSchema = [rule]; const decoded = rulesBulkSchema.decode(payload); @@ -88,9 +90,9 @@ describe('prepackaged_rule_schema', () => { }); test('it should NOT validate a type of "query" when it has extra data next to a valid error', () => { - const rule: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const rule: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); rule.invalid_extra_data = 'invalid_extra_data'; - const payload: RulesBulkSchema = [getErrorPayload(), rule]; + const payload: RulesBulkSchema = [getErrorSchemaMock(), rule]; const decoded = rulesBulkSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); @@ -101,7 +103,7 @@ describe('prepackaged_rule_schema', () => { test('it should NOT validate an error when it has extra data', () => { type InvalidError = ErrorSchema & { invalid_extra_data?: string }; - const error: InvalidError = getErrorPayload(); + const error: InvalidError = getErrorSchemaMock(); error.invalid_extra_data = 'invalid'; const payload: RulesBulkSchema = [error]; const decoded = rulesBulkSchema.decode(payload); @@ -114,9 +116,9 @@ describe('prepackaged_rule_schema', () => { test('it should NOT validate an error when it has extra data next to a valid payload element', () => { type InvalidError = ErrorSchema & { invalid_extra_data?: string }; - const error: InvalidError = getErrorPayload(); + const error: InvalidError = getErrorSchemaMock(); error.invalid_extra_data = 'invalid'; - const payload: RulesBulkSchema = [getBaseResponsePayload(), error]; + const payload: RulesBulkSchema = [getRulesSchemaMock(), error]; const decoded = rulesBulkSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/__mocks__/utils.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.mocks.ts similarity index 65% rename from x-pack/plugins/security_solution/common/detection_engine/schemas/response/__mocks__/utils.ts rename to x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.mocks.ts index fef6bcf42e49f..ecbf0321cdc67 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/__mocks__/utils.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.mocks.ts @@ -4,14 +4,37 @@ * you may not use this file except in compliance with the Elastic License. */ -import { RulesSchema } from '../rules_schema'; -import { RulesBulkSchema } from '../rules_bulk_schema'; -import { ErrorSchema } from '../error_schema'; -import { FindRulesSchema } from '../find_rules_schema'; +import { RulesSchema } from './rules_schema'; export const ANCHOR_DATE = '2020-02-20T03:57:54.037Z'; -export const getBaseResponsePayload = (anchorDate: string = ANCHOR_DATE): RulesSchema => ({ +export const getPartialRulesSchemaMock = (): Partial => ({ + created_by: 'elastic', + description: 'Detecting root and admin users', + enabled: true, + false_positives: [], + from: 'now-6m', + id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', + immutable: false, + index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], + interval: '5m', + risk_score: 50, + rule_id: 'rule-1', + language: 'kuery', + max_signals: 100, + name: 'Detect Root/Admin Users', + output_index: '.siem-signals', + query: 'user.name: root or user.name: admin', + references: ['http://www.example.com', 'https://ww.example.com'], + severity: 'high', + updated_by: 'elastic', + tags: ['some fake tag 1', 'some fake tag 2'], + to: 'now', + type: 'query', + note: '', +}); + +export const getRulesSchemaMock = (anchorDate: string = ANCHOR_DATE): RulesSchema => ({ id: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', created_at: new Date(anchorDate).toISOString(), updated_at: new Date(anchorDate).toISOString(), @@ -75,10 +98,8 @@ export const getBaseResponsePayload = (anchorDate: string = ANCHOR_DATE): RulesS ], }); -export const getRulesBulkPayload = (): RulesBulkSchema => [getBaseResponsePayload()]; - -export const getMlRuleResponsePayload = (anchorDate: string = ANCHOR_DATE): RulesSchema => { - const basePayload = getBaseResponsePayload(anchorDate); +export const getRulesMlSchemaMock = (anchorDate: string = ANCHOR_DATE): RulesSchema => { + const basePayload = getRulesSchemaMock(anchorDate); const { filters, index, query, language, ...rest } = basePayload; return { @@ -88,20 +109,3 @@ export const getMlRuleResponsePayload = (anchorDate: string = ANCHOR_DATE): Rule machine_learning_job_id: 'some_machine_learning_job_id', }; }; - -export const getErrorPayload = ( - id: string = '819eded6-e9c8-445b-a647-519aea39e063' -): ErrorSchema => ({ - id, - error: { - status_code: 404, - message: 'id: "819eded6-e9c8-445b-a647-519aea39e063" not found', - }, -}); - -export const getFindResponseSingle = (): FindRulesSchema => ({ - page: 1, - perPage: 1, - total: 1, - data: [getBaseResponsePayload()], -}); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts index 8ed9c30507f4f..90aef656db369 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_schema.test.ts @@ -18,28 +18,28 @@ import { addTimelineTitle, addMlFields, } from './rules_schema'; -import { getBaseResponsePayload, getMlRuleResponsePayload } from './__mocks__/utils'; import { exactCheck } from '../../../exact_check'; import { foldLeftRight, getPaths } from '../../../test_utils'; import { TypeAndTimelineOnly } from './type_timeline_only_schema'; +import { getRulesSchemaMock, getRulesMlSchemaMock } from './rules_schema.mocks'; export const ANCHOR_DATE = '2020-02-20T03:57:54.037Z'; describe('rules_schema', () => { test('it should validate a type of "query" without anything extra', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); const decoded = rulesSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expect(getPaths(left(message.errors))).toEqual([]); expect(message.schema).toEqual(expected); }); test('it should NOT validate a type of "query" when it has extra data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.invalid_extra_data = 'invalid_extra_data'; const decoded = rulesSchema.decode(payload); @@ -51,7 +51,7 @@ describe('rules_schema', () => { }); test('it should NOT validate invalid_data for the type', () => { - const payload: Omit & { type: string } = getBaseResponsePayload(); + const payload: Omit & { type: string } = getRulesSchemaMock(); payload.type = 'invalid_data'; const decoded = rulesSchema.decode(payload); @@ -65,7 +65,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "query" with a saved_id together', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'query'; payload.saved_id = 'save id 123'; @@ -78,14 +78,14 @@ describe('rules_schema', () => { }); test('it should validate a type of "saved_query" with a "saved_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'saved_query'; payload.saved_id = 'save id 123'; const decoded = rulesSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expected.type = 'saved_query'; expected.saved_id = 'save id 123'; @@ -95,7 +95,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" without a "saved_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'saved_query'; delete payload.saved_id; @@ -110,7 +110,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" when it has extra data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.type = 'saved_query'; payload.saved_id = 'save id 123'; payload.invalid_extra_data = 'invalid_extra_data'; @@ -124,14 +124,14 @@ describe('rules_schema', () => { }); test('it should validate a type of "timeline_id" if there is a "timeline_title" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; payload.timeline_title = 'some timeline title'; const decoded = rulesSchema.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expected.timeline_id = 'some timeline id'; expected.timeline_title = 'some timeline title'; @@ -140,7 +140,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_id" if there is "timeline_title" dependent when it has extra invalid data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; payload.timeline_title = 'some timeline title'; payload.invalid_extra_data = 'invalid_extra_data'; @@ -154,7 +154,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_id" if there is NOT a "timeline_title" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; const decoded = rulesSchema.decode(payload); @@ -168,7 +168,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_title" if there is NOT a "timeline_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_title = 'some timeline title'; const decoded = rulesSchema.decode(payload); @@ -180,7 +180,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" with a "saved_id" dependent and a "timeline_title" but there is NOT a "timeline_id"', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.saved_id = 'some saved id'; payload.type = 'saved_query'; payload.timeline_title = 'some timeline title'; @@ -194,7 +194,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" with a "saved_id" dependent and a "timeline_id" but there is NOT a "timeline_title"', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.saved_id = 'some saved id'; payload.type = 'saved_query'; payload.timeline_id = 'some timeline id'; @@ -211,19 +211,19 @@ describe('rules_schema', () => { describe('checkTypeDependents', () => { test('it should validate a type of "query" without anything extra', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); const decoded = checkTypeDependents(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expect(getPaths(left(message.errors))).toEqual([]); expect(message.schema).toEqual(expected); }); test('it should NOT validate invalid_data for the type', () => { - const payload: Omit & { type: string } = getBaseResponsePayload(); + const payload: Omit & { type: string } = getRulesSchemaMock(); payload.type = 'invalid_data'; const decoded = checkTypeDependents(payload); @@ -237,7 +237,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "query" with a saved_id together', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'query'; payload.saved_id = 'save id 123'; @@ -250,14 +250,14 @@ describe('rules_schema', () => { }); test('it should validate a type of "saved_query" with a "saved_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'saved_query'; payload.saved_id = 'save id 123'; const decoded = checkTypeDependents(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expected.type = 'saved_query'; expected.saved_id = 'save id 123'; @@ -267,7 +267,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" without a "saved_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'saved_query'; delete payload.saved_id; @@ -282,7 +282,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" when it has extra data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.type = 'saved_query'; payload.saved_id = 'save id 123'; payload.invalid_extra_data = 'invalid_extra_data'; @@ -296,14 +296,14 @@ describe('rules_schema', () => { }); test('it should validate a type of "timeline_id" if there is a "timeline_title" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; payload.timeline_title = 'some timeline title'; const decoded = checkTypeDependents(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expected.timeline_id = 'some timeline id'; expected.timeline_title = 'some timeline title'; @@ -312,7 +312,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_id" if there is "timeline_title" dependent when it has extra invalid data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; payload.timeline_title = 'some timeline title'; payload.invalid_extra_data = 'invalid_extra_data'; @@ -326,7 +326,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_id" if there is NOT a "timeline_title" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; const decoded = checkTypeDependents(payload); @@ -340,7 +340,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_title" if there is NOT a "timeline_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_title = 'some timeline title'; const decoded = checkTypeDependents(payload); @@ -352,7 +352,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" with a "saved_id" dependent and a "timeline_title" but there is NOT a "timeline_id"', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.saved_id = 'some saved id'; payload.type = 'saved_query'; payload.timeline_title = 'some timeline title'; @@ -366,7 +366,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" with a "saved_id" dependent and a "timeline_id" but there is NOT a "timeline_title"', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.saved_id = 'some saved id'; payload.type = 'saved_query'; payload.timeline_id = 'some timeline id'; @@ -384,20 +384,20 @@ describe('rules_schema', () => { describe('getDependents', () => { test('it should validate a type of "query" without anything extra', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); const dependents = getDependents(payload); const decoded = dependents.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expect(getPaths(left(message.errors))).toEqual([]); expect(message.schema).toEqual(expected); }); test('it should NOT validate invalid_data for the type', () => { - const payload: Omit & { type: string } = getBaseResponsePayload(); + const payload: Omit & { type: string } = getRulesSchemaMock(); payload.type = 'invalid_data'; const dependents = getDependents((payload as unknown) as TypeAndTimelineOnly); @@ -412,7 +412,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "query" with a saved_id together', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'query'; payload.saved_id = 'save id 123'; @@ -426,7 +426,7 @@ describe('rules_schema', () => { }); test('it should validate a type of "saved_query" with a "saved_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'saved_query'; payload.saved_id = 'save id 123'; @@ -434,7 +434,7 @@ describe('rules_schema', () => { const decoded = dependents.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expected.type = 'saved_query'; expected.saved_id = 'save id 123'; @@ -444,7 +444,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" without a "saved_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.type = 'saved_query'; delete payload.saved_id; @@ -460,7 +460,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" when it has extra data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.type = 'saved_query'; payload.saved_id = 'save id 123'; payload.invalid_extra_data = 'invalid_extra_data'; @@ -475,7 +475,7 @@ describe('rules_schema', () => { }); test('it should validate a type of "timeline_id" if there is a "timeline_title" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; payload.timeline_title = 'some timeline title'; @@ -483,7 +483,7 @@ describe('rules_schema', () => { const decoded = dependents.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getBaseResponsePayload(); + const expected = getRulesSchemaMock(); expected.timeline_id = 'some timeline id'; expected.timeline_title = 'some timeline title'; @@ -492,7 +492,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_id" if there is "timeline_title" dependent when it has extra invalid data', () => { - const payload: RulesSchema & { invalid_extra_data?: string } = getBaseResponsePayload(); + const payload: RulesSchema & { invalid_extra_data?: string } = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; payload.timeline_title = 'some timeline title'; payload.invalid_extra_data = 'invalid_extra_data'; @@ -507,7 +507,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_id" if there is NOT a "timeline_title" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_id = 'some timeline id'; const dependents = getDependents(payload); @@ -522,7 +522,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "timeline_title" if there is NOT a "timeline_id" dependent', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.timeline_title = 'some timeline title'; const dependents = getDependents(payload); @@ -535,7 +535,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" with a "saved_id" dependent and a "timeline_title" but there is NOT a "timeline_id"', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.saved_id = 'some saved id'; payload.type = 'saved_query'; payload.timeline_title = 'some timeline title'; @@ -549,7 +549,7 @@ describe('rules_schema', () => { }); test('it should NOT validate a type of "saved_query" with a "saved_id" dependent and a "timeline_id" but there is NOT a "timeline_title"', () => { - const payload = getBaseResponsePayload(); + const payload = getRulesSchemaMock(); payload.saved_id = 'some saved id'; payload.type = 'saved_query'; payload.timeline_id = 'some timeline id'; @@ -566,13 +566,13 @@ describe('rules_schema', () => { }); test('it validates an ML rule response', () => { - const payload = getMlRuleResponsePayload(); + const payload = getRulesMlSchemaMock(); const dependents = getDependents(payload); const decoded = dependents.decode(payload); const checked = exactCheck(payload, decoded); const message = pipe(checked, foldLeftRight); - const expected = getMlRuleResponsePayload(); + const expected = getRulesMlSchemaMock(); expect(getPaths(left(message.errors))).toEqual([]); expect(message.schema).toEqual(expected); @@ -580,8 +580,8 @@ describe('rules_schema', () => { test('it rejects a response with both ML and query properties', () => { const payload = { - ...getBaseResponsePayload(), - ...getMlRuleResponsePayload(), + ...getRulesSchemaMock(), + ...getRulesMlSchemaMock(), }; const dependents = getDependents(payload); diff --git a/x-pack/plugins/security_solution/common/exact_check.ts b/x-pack/plugins/security_solution/common/exact_check.ts index 48afc35b56ba1..041d0fb324df7 100644 --- a/x-pack/plugins/security_solution/common/exact_check.ts +++ b/x-pack/plugins/security_solution/common/exact_check.ts @@ -47,7 +47,7 @@ export const exactCheck = ( return pipe(decoded, fold(onLeft, onRight)); }; -export const findDifferencesRecursive = (original: T, decodedValue: T): string[] => { +export const findDifferencesRecursive = (original: unknown, decodedValue: T): string[] => { if (decodedValue === null && original === null) { // both the decodedValue and the original are null which indicates that they are equal // so do not report differences diff --git a/x-pack/plugins/security_solution/cypress/README.md b/x-pack/plugins/security_solution/cypress/README.md index ad3af2aaa4e8a..1a2ae696373b1 100644 --- a/x-pack/plugins/security_solution/cypress/README.md +++ b/x-pack/plugins/security_solution/cypress/README.md @@ -135,6 +135,17 @@ Note that with this type of execution you don't need to have running a kibana an As in this case we want to mimic a CI execution we want to execute the tests with the same set of data, this is why in this case does not make sense to override Cypress environment variables. +Note: To `run-as-ci` with the Cypress UI, update [x-pack/test/security_solution_cypress/runner.ts](https://github.com/elastic/kibana/blob/master/x-pack/test/security_solution_cypress/runner.ts#L25) from +``` ts +args: ['cypress:run'], +``` +to +``` ts +args: ['cypress:open'], +``` +This is helpful for debugging specific failed tests from CI without having to run the entire suite. + +Note: Please don't commit this change. ### Test data As mentioned above, when running the tests as Jenkins the tests are populated with data ("archives") found in: `x-pack/test/security_solution_cypress/es_archives`. diff --git a/x-pack/plugins/security_solution/cypress/test_files/expected_rules_export.ndjson b/x-pack/plugins/security_solution/cypress/test_files/expected_rules_export.ndjson index c2e779feeca77..dcbfa9d0dd16e 100644 --- a/x-pack/plugins/security_solution/cypress/test_files/expected_rules_export.ndjson +++ b/x-pack/plugins/security_solution/cypress/test_files/expected_rules_export.ndjson @@ -1,2 +1,2 @@ -{"actions":[],"created_at":"2020-03-26T10:09:07.569Z","updated_at":"2020-03-26T10:09:08.021Z","created_by":"elastic","description":"Rule 1","enabled":true,"false_positives":[],"filters":[],"from":"now-360s","id":"49db5bd1-bdd5-4821-be26-bb70a815dedb","immutable":false,"index":["apm-*-transaction*","auditbeat-*","endgame-*","filebeat-*","packetbeat-*","winlogbeat-*"],"interval":"5m","rule_id":"0cea4194-03f2-4072-b281-d31b72221d9d","language":"kuery","output_index":".siem-signals-default","max_signals":100,"risk_score":50,"name":"Rule 1","query":"host.name:*","references":[],"meta":{"from":"1m","throttle":"no_actions"},"severity":"low","updated_by":"elastic","tags":["rule1"],"to":"now","type":"query","threat":[],"throttle":"no_actions","version":1} +{"actions":[],"created_at":"2020-03-26T10:09:07.569Z","updated_at":"2020-03-26T10:09:08.021Z","created_by":"elastic","description":"Rule 1","enabled":true,"false_positives":[],"filters":[],"from":"now-360s","id":"49db5bd1-bdd5-4821-be26-bb70a815dedb","immutable":false,"index":["apm-*-transaction*","auditbeat-*","endgame-*","filebeat-*","packetbeat-*","winlogbeat-*"],"interval":"5m","rule_id":"0cea4194-03f2-4072-b281-d31b72221d9d","language":"kuery","output_index":".siem-signals-default","max_signals":100,"risk_score":50,"name":"Rule 1","query":"host.name:*","references":[],"meta":{"from":"1m","throttle":"no_actions"},"severity":"low","updated_by":"elastic","tags":["rule1"],"to":"now","type":"query","threat":[],"throttle":"no_actions","version":1,"exceptions_list":[]} {"exported_count":1,"missing_rules":[],"missing_rules_count":0} diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap deleted file mode 100644 index 31abea53462fa..0000000000000 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/__snapshots__/index.test.tsx.snap +++ /dev/null @@ -1,441 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`description_step StepRuleDescriptionComponent renders correctly against snapshot when columns is "multi" 1`] = ` - - - , - "title": "Severity", - }, - Object { - "description": 21, - "title": "Risk score", - }, - Object { - "description": -
    -
  • - - www.test.co - -
  • -
-
, - "title": "Reference URLs", - }, - ] - } - /> -
- - -
    -
  • - test -
  • -
- , - "title": "False positive examples", - }, - Object { - "description": - - - - - - - - - - - - - - , - "title": "MITRE ATT&CK™", - }, - Object { - "description": - - - tag1 - - - - - tag2 - - - , - "title": "Tags", - }, - Object { - "description": -
- # this is some markdown documentation -
-
, - "title": "Investigation guide", - }, - ] - } - /> -
-
-`; - -exports[`description_step StepRuleDescriptionComponent renders correctly against snapshot when columns is "single" 1`] = ` - - - , - "title": "Severity", - }, - Object { - "description": 21, - "title": "Risk score", - }, - Object { - "description": -
    -
  • - - www.test.co - -
  • -
-
, - "title": "Reference URLs", - }, - Object { - "description": -
    -
  • - test -
  • -
-
, - "title": "False positive examples", - }, - Object { - "description": - - - - - - - - - - - - - - , - "title": "MITRE ATT&CK™", - }, - Object { - "description": - - - tag1 - - - - - tag2 - - - , - "title": "Tags", - }, - Object { - "description": -
- # this is some markdown documentation -
-
, - "title": "Investigation guide", - }, - ] - } - /> -
-
-`; - -exports[`description_step StepRuleDescriptionComponent renders correctly against snapshot when columns is "singleSplit 1`] = ` - - - , - "title": "Severity", - }, - Object { - "description": 21, - "title": "Risk score", - }, - Object { - "description": -
    -
  • - - www.test.co - -
  • -
-
, - "title": "Reference URLs", - }, - Object { - "description": -
    -
  • - test -
  • -
-
, - "title": "False positive examples", - }, - Object { - "description": - - - - - - - - - - - - - - , - "title": "MITRE ATT&CK™", - }, - Object { - "description": - - - tag1 - - - - - tag2 - - - , - "title": "Tags", - }, - Object { - "description": -
- # this is some markdown documentation -
-
, - "title": "Investigation guide", - }, - ] - } - type="column" - /> -
-
-`; diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.tsx index 091065eedfc22..a0d43c3abf5c1 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/helpers.tsx @@ -225,6 +225,10 @@ export const buildSeverityDescription = (label: string, value: string): ListItem }, ]; +const MyRefUrlLink = styled(EuiLink)` + word-break: break-word; +`; + export const buildUrlsDescription = (label: string, values: string[]): ListItems[] => { if (isNotEmptyArray(values)) { return [ @@ -237,9 +241,9 @@ export const buildUrlsDescription = (label: string, values: string[]): ListItems .filter((v) => !isEmpty(v)) .map((val, index) => (
  • - + {val} - +
  • ))} diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.test.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.test.tsx index b8f81f6d7e5f7..2bd90f17daf0c 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.test.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/description_step/index.test.tsx @@ -54,27 +54,24 @@ describe('description_step', () => { }); describe('StepRuleDescriptionComponent', () => { - test('renders correctly against snapshot when columns is "multi"', () => { + test('renders tow columns when "columns" is "multi"', () => { const wrapper = shallow( ); - expect(wrapper).toMatchSnapshot(); expect(wrapper.find('[data-test-subj="listItemColumnStepRuleDescription"]')).toHaveLength(2); }); - test('renders correctly against snapshot when columns is "single"', () => { + test('renders single column when "columns" is "single"', () => { const wrapper = shallow( ); - expect(wrapper).toMatchSnapshot(); expect(wrapper.find('[data-test-subj="listItemColumnStepRuleDescription"]')).toHaveLength(1); }); - test('renders correctly against snapshot when columns is "singleSplit', () => { + test('renders one column with title and description split when "columns" is "singleSplit', () => { const wrapper = shallow( ); - expect(wrapper).toMatchSnapshot(); expect(wrapper.find('[data-test-subj="listItemColumnStepRuleDescription"]')).toHaveLength(1); expect( wrapper.find('[data-test-subj="singleSplitStepRuleDescriptionList"]').at(0).prop('type') diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx index 0e527bf4dfc72..0021cd2f20a4b 100644 --- a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx @@ -6,6 +6,7 @@ /* eslint-disable react-hooks/rules-of-hooks */ /* eslint-disable complexity */ +// TODO: Disabling complexity is temporary till this component is refactored as part of lists UI integration import { EuiButton, diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/__examples__/exceptions_search.stories.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/__examples__/exceptions_search.stories.tsx deleted file mode 100644 index 29cded8f69165..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/__examples__/exceptions_search.stories.tsx +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -import { storiesOf } from '@storybook/react'; -import React from 'react'; -import { ThemeProvider } from 'styled-components'; -import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; - -import { ExceptionsViewerHeader } from '../viewer/exceptions_viewer_header'; -import { ExceptionListType } from '../types'; - -storiesOf('ExceptionsViewerHeader', module) - .add('loading', () => { - return ( - ({ eui: euiLightVars, darkMode: false })}> - {}} - onAddExceptionClick={() => {}} - /> - - ); - }) - .add('all lists', () => { - return ( - ({ eui: euiLightVars, darkMode: false })}> - {}} - onAddExceptionClick={() => {}} - /> - - ); - }) - .add('endpoint only', () => { - return ( - ({ eui: euiLightVars, darkMode: false })}> - {}} - onAddExceptionClick={() => {}} - /> - - ); - }) - .add('detections only', () => { - return ( - ({ eui: euiLightVars, darkMode: false })}> - {}} - onAddExceptionClick={() => {}} - /> - - ); - }); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx index 2893c7dc961f2..d86a84996a34f 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx @@ -439,7 +439,7 @@ describe('Exception helpers', () => { describe('#getFormattedComments', () => { test('it returns formatted comment object with username and timestamp', () => { - const payload = getExceptionItemMock().comment; + const payload = getExceptionItemMock().comments; const result = getFormattedComments(payload); expect(result[0].username).toEqual('user_name'); @@ -447,7 +447,7 @@ describe('Exception helpers', () => { }); test('it returns formatted timeline icon with comment users initial', () => { - const payload = getExceptionItemMock().comment; + const payload = getExceptionItemMock().comments; const result = getFormattedComments(payload); const wrapper = mount(result[0].timelineIcon as React.ReactElement); @@ -456,7 +456,7 @@ describe('Exception helpers', () => { }); test('it returns comment text', () => { - const payload = getExceptionItemMock().comment; + const payload = getExceptionItemMock().comments; const result = getFormattedComments(payload); const wrapper = mount(result[0].children as React.ReactElement); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx index 155c8a3e2926c..9bc39d72322ae 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx @@ -184,9 +184,9 @@ export const getDescriptionListContent = ( */ export const getFormattedComments = (comments: Comment[]): EuiCommentProps[] => comments.map((comment) => ({ - username: comment.user, - timestamp: moment(comment.timestamp).format('on MMM Do YYYY @ HH:mm:ss'), + username: comment.created_by, + timestamp: moment(comment.created_at).format('on MMM Do YYYY @ HH:mm:ss'), event: i18n.COMMENT_EVENT, - timelineIcon: , + timelineIcon: , children: {comment.comment}, })); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/mocks.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/mocks.ts index 0dba3fd26c487..f5577560a680a 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/mocks.ts +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/mocks.ts @@ -63,10 +63,10 @@ export const getExceptionItemMock = (): ExceptionListItemSchema => ({ namespace_type: 'single', name: '', description: 'This is a description', - comment: [ + comments: [ { - user: 'user_name', - timestamp: '2020-04-23T00:19:13.289Z', + created_by: 'user_name', + created_at: '2020-04-23T00:19:13.289Z', comment: 'Comment goes here', }, ], diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/translations.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/translations.ts index 23e9f64caf695..27dab7cf9db29 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/translations.ts @@ -135,5 +135,5 @@ export const REFRESH = i18n.translate('xpack.securitySolution.exceptions.utility export const SHOWING_EXCEPTIONS = (items: number) => i18n.translate('xpack.securitySolution.exceptions.utilityNumberExceptionsLabel', { values: { items }, - defaultMessage: 'Showing {items} exceptions', + defaultMessage: 'Showing {items} {items, plural, =1 {exception} other {exceptions}}', }); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts index d60d1ef71e502..86485e308b59f 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/types.ts @@ -57,8 +57,8 @@ export interface DescriptionListItem { } export interface Comment { - user: string; - timestamp: string; + created_by: string; + created_at: string; comment: string; } @@ -106,7 +106,7 @@ export interface ExceptionsPagination { // TODO: Delete once types are updated export interface ExceptionListItemSchema { _tags: string[]; - comment: Comment[]; + comments: Comment[]; created_at: string; created_by: string; description?: string; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx index c5d2ffc7ac2bf..b49615e24d052 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.test.tsx @@ -24,7 +24,7 @@ describe('ExceptionDetails', () => { test('it renders no comments button if no comments exist', () => { const exceptionItem = getExceptionItemMock(); - exceptionItem.comment = []; + exceptionItem.comments = []; const wrapper = mount( ({ eui: euiLightVars, darkMode: false })}> @@ -77,15 +77,15 @@ describe('ExceptionDetails', () => { test('it renders comments plural if more than one', () => { const exceptionItem = getExceptionItemMock(); - exceptionItem.comment = [ + exceptionItem.comments = [ { - user: 'user_1', - timestamp: '2020-04-23T00:19:13.289Z', + created_by: 'user_1', + created_at: '2020-04-23T00:19:13.289Z', comment: 'Comment goes here', }, { - user: 'user_2', - timestamp: '2020-04-23T00:19:13.289Z', + created_by: 'user_2', + created_at: '2020-04-23T00:19:13.289Z', comment: 'Comment goes here', }, ]; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx index 12287f7cd0fa9..7144bf8044704 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_details.tsx @@ -19,7 +19,7 @@ import { DescriptionListItem, ExceptionListItemSchema } from '../../types'; import { getDescriptionListContent } from '../../helpers'; import * as i18n from '../../translations'; -const StyledExceptionDetails = styled(EuiFlexItem)` +const MyExceptionDetails = styled(EuiFlexItem)` ${({ theme }) => css` background-color: ${theme.eui.euiColorLightestShade}; padding: ${theme.eui.euiSize}; @@ -49,9 +49,8 @@ const ExceptionDetailsComponent = ({ ); const commentsSection = useMemo((): JSX.Element => { - // TODO: return back to exceptionItem.comments once updated - const { comment } = exceptionItem; - if (comment.length > 0) { + const { comments } = exceptionItem; + if (comments.length > 0) { return ( - {!showComments ? i18n.COMMENTS_SHOW(comment.length) : i18n.COMMENTS_HIDE(comment.length)} + {!showComments + ? i18n.COMMENTS_SHOW(comments.length) + : i18n.COMMENTS_HIDE(comments.length)} ); } else { @@ -68,7 +69,7 @@ const ExceptionDetailsComponent = ({ }, [showComments, onCommentsClick, exceptionItem]); return ( - + @@ -82,7 +83,7 @@ const ExceptionDetailsComponent = ({ {commentsSection} - + ); }; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx index b2408a654b1c6..2d022591d9980 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.test.tsx @@ -44,7 +44,7 @@ describe('ExceptionEntries', () => { expect(wrapper.find('[data-test-subj="exceptionsViewerAndBadge"]')).toHaveLength(1); }); - test('it invokes "handlEdit" when edit button clicked', () => { + test('it invokes "onEdit" when edit button clicked', () => { const mockOnEdit = jest.fn(); const wrapper = mount( ({ eui: euiLightVars, darkMode: false })}> @@ -80,6 +80,39 @@ describe('ExceptionEntries', () => { expect(mockOnDelete).toHaveBeenCalledTimes(1); }); + test('it renders edit button disabled if "disableDelete" is "true"', () => { + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + const editBtn = wrapper.find('[data-test-subj="exceptionsViewerEditBtn"] button').at(0); + + expect(editBtn.prop('disabled')).toBeTruthy(); + }); + + test('it renders delete button in loading state if "disableDelete" is "true"', () => { + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + const deleteBtn = wrapper.find('[data-test-subj="exceptionsViewerDeleteBtn"] button').at(0); + + expect(deleteBtn.prop('disabled')).toBeTruthy(); + expect(deleteBtn.find('.euiLoadingSpinner')).toBeTruthy(); + }); + test('it renders nested entry', () => { const parentEntry = getFormattedEntryMock(); parentEntry.operator = null; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.tsx index 8c758e3b84f42..58667f1f78b0d 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/exception_entries.tsx @@ -22,11 +22,11 @@ import { getEmptyValue } from '../../../empty_value'; import * as i18n from '../../translations'; import { FormattedEntry } from '../../types'; -const EntriesDetails = styled(EuiFlexItem)` +const MyEntriesDetails = styled(EuiFlexItem)` padding: ${({ theme }) => theme.eui.euiSize}; `; -const StyledEditButton = styled(EuiButton)` +const MyEditButton = styled(EuiButton)` ${({ theme }) => css` background-color: ${transparentize(0.9, theme.eui.euiColorPrimary)}; border: none; @@ -34,7 +34,7 @@ const StyledEditButton = styled(EuiButton)` `} `; -const StyledRemoveButton = styled(EuiButton)` +const MyRemoveButton = styled(EuiButton)` ${({ theme }) => css` background-color: ${transparentize(0.9, theme.eui.euiColorDanger)}; border: none; @@ -42,7 +42,7 @@ const StyledRemoveButton = styled(EuiButton)` `} `; -const AndOrBadgeContainer = styled(EuiFlexItem)` +const MyAndOrBadgeContainer = styled(EuiFlexItem)` padding-top: ${({ theme }) => theme.eui.euiSizeXL}; `; @@ -118,19 +118,19 @@ const ExceptionEntriesComponent = ({ ); return ( - + {entries.length > 1 && ( - + - + )} @@ -147,7 +147,7 @@ const ExceptionEntriesComponent = ({ - {i18n.EDIT} - + - {i18n.REMOVE} - + - + ); }; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/__examples__/exception_item.stories.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx similarity index 64% rename from x-pack/plugins/security_solution/public/common/components/exceptions/__examples__/exception_item.stories.tsx rename to x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx index 5f2b0b93e9df0..3eb333966f267 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/__examples__/exception_item.stories.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx @@ -3,25 +3,25 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { storiesOf } from '@storybook/react'; -import React, { ReactNode } from 'react'; +import { storiesOf, addDecorator } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import React from 'react'; import { ThemeProvider } from 'styled-components'; import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; -import { ExceptionItem } from '../viewer/exception_item'; -import { Operator } from '../types'; -import { getExceptionItemMock } from '../mocks'; +import { ExceptionItem } from './'; +import { Operator } from '../../types'; +import { getExceptionItemMock } from '../../mocks'; -const withTheme = (storyFn: () => ReactNode) => ( +addDecorator((storyFn) => ( ({ eui: euiLightVars, darkMode: false })}>{storyFn()} -); +)); -storiesOf('ExceptionItem', module) - .addDecorator(withTheme) - .add('ExceptionItem/with os', () => { +storiesOf('Components|ExceptionItem', module) + .add('with os', () => { const payload = getExceptionItemMock(); payload.description = ''; - payload.comment = []; + payload.comments = []; payload.entries = [ { field: 'actingProcess.file.signer', @@ -36,15 +36,15 @@ storiesOf('ExceptionItem', module) loadingItemIds={[]} commentsAccordionId={'accordion--comments'} exceptionItem={payload} - onDeleteException={() => {}} - onEditException={() => {}} + onDeleteException={action('onClick')} + onEditException={action('onClick')} /> ); }) .add('with description', () => { const payload = getExceptionItemMock(); payload._tags = []; - payload.comment = []; + payload.comments = []; payload.entries = [ { field: 'actingProcess.file.signer', @@ -59,8 +59,8 @@ storiesOf('ExceptionItem', module) loadingItemIds={[]} commentsAccordionId={'accordion--comments'} exceptionItem={payload} - onDeleteException={() => {}} - onEditException={() => {}} + onDeleteException={action('onClick')} + onEditException={action('onClick')} /> ); }) @@ -82,8 +82,8 @@ storiesOf('ExceptionItem', module) loadingItemIds={[]} commentsAccordionId={'accordion--comments'} exceptionItem={payload} - onDeleteException={() => {}} - onEditException={() => {}} + onDeleteException={action('onClick')} + onEditException={action('onClick')} /> ); }) @@ -91,15 +91,15 @@ storiesOf('ExceptionItem', module) const payload = getExceptionItemMock(); payload._tags = []; payload.description = ''; - payload.comment = []; + payload.comments = []; return ( {}} - onEditException={() => {}} + onDeleteException={action('onClick')} + onEditException={action('onClick')} /> ); }) @@ -111,8 +111,21 @@ storiesOf('ExceptionItem', module) loadingItemIds={[]} commentsAccordionId={'accordion--comments'} exceptionItem={payload} - onDeleteException={() => {}} - onEditException={() => {}} + onDeleteException={action('onClick')} + onEditException={action('onClick')} + /> + ); + }) + .add('with loadingItemIds', () => { + const { id, namespace_type, ...rest } = getExceptionItemMock(); + + return ( + ); }); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx index dca3afe4f9069..b4de3639944b1 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx @@ -51,7 +51,7 @@ describe('ExceptionItem', () => { const editBtn = wrapper.find('[data-test-subj="exceptionsViewerEditBtn"] button').at(0); editBtn.simulate('click'); - expect(mockOnEditException).toHaveBeenCalledTimes(1); + expect(mockOnEditException).toHaveBeenCalledWith(getExceptionItemMock()); }); it('it invokes "onDeleteException" when delete button clicked', () => { @@ -73,7 +73,10 @@ describe('ExceptionItem', () => { const editBtn = wrapper.find('[data-test-subj="exceptionsViewerDeleteBtn"] button').at(0); editBtn.simulate('click'); - expect(mockOnDeleteException).toHaveBeenCalledTimes(1); + expect(mockOnDeleteException).toHaveBeenCalledWith({ + id: 'uuid_here', + namespaceType: 'single', + }); }); it('it renders comment accordion closed to begin with', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx index ba6ffb109be04..08cdfd491d84c 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.tsx @@ -63,8 +63,7 @@ const ExceptionItemComponent = ({ }, [setShowComments, showComments]); const formattedComments = useMemo((): EuiCommentProps[] => { - // TODO: return back to exceptionItem.comments once updated - return getFormattedComments(exceptionItem.comment); + return getFormattedComments(exceptionItem.comments); }, [exceptionItem]); const disableDelete = useMemo((): boolean => { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_pagination.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_pagination.tsx index 0953a5c666c5d..2920f1a85eee7 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_pagination.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_pagination.tsx @@ -29,13 +29,14 @@ const ExceptionsViewerPaginationComponent = ({ }: ExceptionsViewerPaginationProps): JSX.Element => { const [isOpen, setIsOpen] = useState(false); - const closePerPageMenu = useCallback((): void => setIsOpen(false), [setIsOpen]); + const handleClosePerPageMenu = useCallback((): void => setIsOpen(false), [setIsOpen]); - const onPerPageMenuClick = useCallback((): void => setIsOpen((isPopoverOpen) => !isPopoverOpen), [ - setIsOpen, - ]); + const handlePerPageMenuClick = useCallback( + (): void => setIsOpen((isPopoverOpen) => !isPopoverOpen), + [setIsOpen] + ); - const onPageClick = useCallback( + const handlePageClick = useCallback( (pageIndex: number): void => { onPaginationChange({ filter: {}, @@ -63,14 +64,14 @@ const ExceptionsViewerPaginationComponent = ({ totalItemCount: pagination.totalItemCount, }, }); - closePerPageMenu(); + handleClosePerPageMenu(); }} data-test-subj="exceptionsPerPageItem" > {i18n.NUMBER_OF_ITEMS(rows)} )); - }, [pagination, onPaginationChange, closePerPageMenu]); + }, [pagination, onPaginationChange, handleClosePerPageMenu]); const totalPages = useMemo((): number => { if (pagination.totalItemCount > 0) { @@ -90,14 +91,14 @@ const ExceptionsViewerPaginationComponent = ({ color="text" iconType="arrowDown" iconSide="right" - onClick={onPerPageMenuClick} + onClick={handlePerPageMenuClick} data-test-subj="exceptionsPerPageBtn" > {i18n.ITEMS_PER_PAGE(pagination.pageSize)} } isOpen={isOpen} - closePopover={closePerPageMenu} + closePopover={handleClosePerPageMenu} panelPaddingSize="none" > @@ -108,7 +109,7 @@ const ExceptionsViewerPaginationComponent = ({ diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx new file mode 100644 index 0000000000000..d697023b2ced4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx @@ -0,0 +1,174 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { ThemeProvider } from 'styled-components'; +import { mountWithIntl } from 'test_utils/enzyme_helpers'; +import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; + +import { ExceptionsViewerUtility } from './exceptions_utility'; + +describe('ExceptionsViewerUtility', () => { + it('it renders correct pluralized text when more than one exception exists', () => { + const wrapper = mountWithIntl( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsShowing"]').at(0).text()).toEqual( + 'Showing 2 exceptions' + ); + }); + + it('it renders correct singular text when less than two exceptions exists', () => { + const wrapper = mountWithIntl( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsShowing"]').at(0).text()).toEqual( + 'Showing 1 exception' + ); + }); + + it('it invokes "onRefreshClick" when refresh button clicked', () => { + const mockOnRefreshClick = jest.fn(); + const wrapper = mountWithIntl( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + wrapper.find('[data-test-subj="exceptionsRefresh"] button').simulate('click'); + + expect(mockOnRefreshClick).toHaveBeenCalledTimes(1); + }); + + it('it does not render any messages when "showEndpointList" and "showDetectionsList" are "false"', () => { + const wrapper = mountWithIntl( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsEndpointMessage"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="exceptionsDetectionsMessage"]').exists()).toBeFalsy(); + }); + + it('it does render detections messages when "showDetectionsList" is "true"', () => { + const wrapper = mountWithIntl( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsEndpointMessage"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="exceptionsDetectionsMessage"]').exists()).toBeTruthy(); + }); + + it('it does render endpoint messages when "showEndpointList" is "true"', () => { + const wrapper = mountWithIntl( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsEndpointMessage"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="exceptionsDetectionsMessage"]').exists()).toBeFalsy(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx new file mode 100644 index 0000000000000..9ab4e170f4090 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx @@ -0,0 +1,111 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { EuiText, EuiLink, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { FormattedMessage } from 'react-intl'; +import styled from 'styled-components'; + +import * as i18n from '../translations'; +import { ExceptionsPagination, FilterOptions } from '../types'; +import { + UtilityBar, + UtilityBarSection, + UtilityBarGroup, + UtilityBarText, + UtilityBarAction, +} from '../../utility_bar'; + +const StyledText = styled(EuiText)` + font-style: italic; +`; + +const MyUtilities = styled(EuiFlexGroup)` + height: 50px; +`; + +interface ExceptionsViewerUtilityProps { + pagination: ExceptionsPagination; + filterOptions: FilterOptions; + ruleSettingsUrl: string; + onRefreshClick: () => void; +} + +const ExceptionsViewerUtilityComponent: React.FC = ({ + pagination, + filterOptions, + ruleSettingsUrl, + onRefreshClick, +}): JSX.Element => ( + + + + + + + {i18n.SHOWING_EXCEPTIONS(pagination.totalItemCount ?? 0)} + + + + + + {i18n.REFRESH} + + + + + + + + {filterOptions.showEndpointList && ( + + + + ), + }} + /> + )} + {filterOptions.showDetectionsList && ( + + + + ), + }} + /> + )} + + + +); + +ExceptionsViewerUtilityComponent.displayName = 'ExceptionsViewerUtilityComponent'; + +export const ExceptionsViewerUtility = React.memo(ExceptionsViewerUtilityComponent); + +ExceptionsViewerUtility.displayName = 'ExceptionsViewerUtility'; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.stories.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.stories.tsx new file mode 100644 index 0000000000000..796af7cd760e2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.stories.tsx @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { storiesOf, addDecorator } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import React from 'react'; +import { ThemeProvider } from 'styled-components'; +import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; + +import { ExceptionsViewerHeader } from './exceptions_viewer_header'; +import { ExceptionListType } from '../types'; + +addDecorator((storyFn) => ( + ({ eui: euiLightVars, darkMode: false })}>{storyFn()} +)); + +storiesOf('Components|ExceptionsViewerHeader', module) + .add('loading', () => { + return ( + + ); + }) + .add('all lists', () => { + return ( + + ); + }) + .add('endpoint only', () => { + return ( + + ); + }) + .add('detections only', () => { + return ( + + ); + }); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.test.tsx index bdc99370a6293..c609a2296b83d 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.test.tsx @@ -269,7 +269,7 @@ describe('ExceptionsViewerHeader', () => { expect(mockOnAddExceptionClick).toHaveBeenCalledTimes(1); }); - it('it invokes "onFilterChange" with filter value when search used', () => { + it('it invokes "onFilterChange" when search used and "Enter" pressed', () => { const mockOnFilterChange = jest.fn(); const wrapper = mount( ({ eui: euiLightVars, darkMode: false })}> @@ -284,54 +284,12 @@ describe('ExceptionsViewerHeader', () => { ); - wrapper - .find('input[data-test-subj="exceptionsHeaderSearch"]') - .at(0) - .simulate('change', { - target: { value: 'host' }, - }); - - expect(mockOnFilterChange).toHaveBeenCalledWith({ - filter: { - filter: 'host', - showDetectionsList: false, - showEndpointList: false, - tags: [], - }, - pagination: {}, + wrapper.find('EuiFieldSearch').at(0).simulate('keyup', { + charCode: 13, + code: 'Enter', + key: 'Enter', }); - }); - - it('it invokes "onFilterChange" with tags values when search value includes "tags:..."', () => { - const mockOnFilterChange = jest.fn(); - const wrapper = mount( - ({ eui: euiLightVars, darkMode: false })}> - - - ); - - wrapper - .find('input[data-test-subj="exceptionsHeaderSearch"]') - .at(0) - .simulate('change', { - target: { value: 'tags:malware' }, - }); - expect(mockOnFilterChange).toHaveBeenCalledWith({ - filter: { - filter: '', - showDetectionsList: false, - showEndpointList: false, - tags: ['malware'], - }, - pagination: {}, - }); + expect(mockOnFilterChange).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.tsx index 92a8830310b51..0a630414e3267 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_header.tsx @@ -69,8 +69,7 @@ const ExceptionsViewerHeaderComponent = ({ }, [showEndpointList, setShowEndpointList, setShowDetectionsList]); const handleOnSearch = useCallback( - (event: React.ChangeEvent): void => { - const searchValue = event.target.value; + (searchValue: string): void => { const tagsRegex = /(tags:[^\s]*)/i; const tagsMatch = searchValue.match(tagsRegex); const foundTags: string = tagsMatch != null ? tagsMatch[0].split(':')[1] : ''; @@ -121,7 +120,7 @@ const ExceptionsViewerHeaderComponent = ({ data-test-subj="exceptionsHeaderSearch" aria-label={i18n.SEARCH_DEFAULT} placeholder={i18n.SEARCH_DEFAULT} - onChange={handleOnSearch} + onSearch={handleOnSearch} disabled={isInitLoading} incremental={false} fullWidth diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_item.test.tsx new file mode 100644 index 0000000000000..dbcae20eb1385 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_item.test.tsx @@ -0,0 +1,147 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { ThemeProvider } from 'styled-components'; +import { mount } from 'enzyme'; +import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; + +import { getExceptionItemMock } from '../mocks'; +import { ExceptionsViewerItems } from './exceptions_viewer_items'; + +describe('ExceptionsViewerItems', () => { + it('it renders empty prompt if "showEmpty" is "true"', () => { + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsEmptyPrompt"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="exceptionsContainer"]').exists()).toBeFalsy(); + }); + + it('it renders exceptions if "showEmpty" and "isInitLoading" is "false", and exceptions exist', () => { + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsContainer"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="exceptionsEmptyPrompt"]').exists()).toBeFalsy(); + }); + + it('it does not render exceptions if "isInitLoading" is "true"', () => { + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionsContainer"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="exceptionsEmptyPrompt"]').exists()).toBeTruthy(); + }); + + it('it does not render or badge for first exception displayed', () => { + const exception1 = getExceptionItemMock(); + const exception2 = getExceptionItemMock(); + exception2.id = 'newId'; + + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + const firstExceptionItem = wrapper.find('[data-test-subj="exceptionItemContainer"]').at(0); + + expect(firstExceptionItem.find('[data-test-subj="exceptionItemOrBadge"]').exists()).toBeFalsy(); + }); + + it('it does render or badge with exception displayed', () => { + const exception1 = getExceptionItemMock(); + const exception2 = getExceptionItemMock(); + exception2.id = 'newId'; + + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + const notFirstExceptionItem = wrapper.find('[data-test-subj="exceptionItemContainer"]').at(1); + + expect( + notFirstExceptionItem.find('[data-test-subj="exceptionItemOrBadge"]').exists() + ).toBeFalsy(); + }); + + it('it invokes "onDeleteException" when delete button is clicked', () => { + const mockOnDeleteException = jest.fn(); + + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + wrapper.find('[data-test-subj="exceptionsViewerDeleteBtn"] button').at(0).simulate('click'); + + expect(mockOnDeleteException).toHaveBeenCalledWith({ + id: 'uuid_here', + namespaceType: 'single', + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx new file mode 100644 index 0000000000000..e1ef3c10188b3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_viewer_items.tsx @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import styled from 'styled-components'; + +import * as i18n from '../translations'; +import { ExceptionListItemSchema, ApiProps } from '../types'; +import { ExceptionItem } from './exception_item'; +import { AndOrBadge } from '../../and_or_badge'; + +const MyFlexItem = styled(EuiFlexItem)` + margin: ${({ theme }) => `${theme.eui.euiSize} 0`}; + + &:first-child { + margin: ${({ theme }) => `${theme.eui.euiSizeXS} 0 ${theme.eui.euiSize}`}; + } +`; + +const MyExceptionsContainer = styled(EuiFlexGroup)` + height: 600px; + overflow: hidden; +`; + +const MyExceptionItemContainer = styled(EuiFlexGroup)` + margin: ${({ theme }) => `0 ${theme.eui.euiSize} ${theme.eui.euiSize} 0`}; +`; + +interface ExceptionsViewerItemsProps { + showEmpty: boolean; + isInitLoading: boolean; + exceptions: ExceptionListItemSchema[]; + loadingItemIds: ApiProps[]; + commentsAccordionId: string; + onDeleteException: (arg: ApiProps) => void; + onEditExceptionItem: (item: ExceptionListItemSchema) => void; +} + +const ExceptionsViewerItemsComponent: React.FC = ({ + showEmpty, + isInitLoading, + exceptions, + loadingItemIds, + commentsAccordionId, + onDeleteException, + onEditExceptionItem, +}): JSX.Element => ( + + {showEmpty || isInitLoading ? ( + + {i18n.EXCEPTION_EMPTY_PROMPT_TITLE}} + body={

    {i18n.EXCEPTION_EMPTY_PROMPT_BODY}

    } + data-test-subj="exceptionsEmptyPrompt" + /> +
    + ) : ( + + + {!isInitLoading && + exceptions.length > 0 && + exceptions.map((exception, index) => ( + + {index !== 0 ? ( + <> + + + + ) : ( + + )} + + + ))} + + + )} +
    +); + +ExceptionsViewerItemsComponent.displayName = 'ExceptionsViewerItemsComponent'; + +export const ExceptionsViewerItems = React.memo(ExceptionsViewerItemsComponent); + +ExceptionsViewerItems.displayName = 'ExceptionsViewerItems'; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx index cc8e8111064bc..b77b8380c39f1 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx @@ -46,7 +46,7 @@ describe('ExceptionsViewer', () => { ]); }); - it('it renders loader if "initLoading" is true', () => { + it('it renders loader if "loadingList" is true', () => { (useExceptionList as jest.Mock).mockReturnValue([ true, [], diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx index 3cf59c7dda023..1051962852219 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx @@ -4,21 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useCallback, useState, useMemo, useEffect, useReducer } from 'react'; -import { - EuiEmptyPrompt, - EuiText, - EuiLink, - EuiOverlayMask, - EuiModal, - EuiModalBody, - EuiCodeBlock, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, -} from '@elastic/eui'; -import { FormattedMessage } from 'react-intl'; -import styled from 'styled-components'; +import React, { useCallback, useMemo, useEffect, useReducer } from 'react'; +import { EuiOverlayMask, EuiModal, EuiModalBody, EuiCodeBlock, EuiSpacer } from '@elastic/eui'; import uuid from 'uuid'; import * as i18n from '../translations'; @@ -40,25 +27,9 @@ import { ExceptionIdentifiers, useApi, } from '../../../../../public/lists_plugin_deps'; -import { ExceptionItem } from './exception_item'; -import { AndOrBadge } from '../../and_or_badge'; import { ExceptionsViewerPagination } from './exceptions_pagination'; -import { - UtilityBar, - UtilityBarSection, - UtilityBarGroup, - UtilityBarText, - UtilityBarAction, -} from '../../utility_bar'; - -const StyledText = styled(EuiText)` - font-style: italic; -`; - -const MyExceptionsContainer = styled.div` - height: 600px; - overflow: hidden; -`; +import { ExceptionsViewerUtility } from './exceptions_utility'; +import { ExceptionsViewerItems } from './exceptions_viewer_items'; const initialState: State = { filterOptions: { filter: '', showEndpointList: false, showDetectionsList: false, tags: [] }, @@ -73,7 +44,9 @@ const initialState: State = { allExceptions: [], exceptions: [], exceptionToEdit: null, + loadingLists: [], loadingItemIds: [], + isInitLoading: true, isModalOpen: false, }; @@ -99,7 +72,6 @@ const ExceptionsViewerComponent = ({ }: ExceptionsViewerProps): JSX.Element => { const { services } = useKibana(); const [, dispatchToaster] = useStateToaster(); - const [initLoading, setInitLoading] = useState(true); const onDispatchToaster = useCallback( ({ title, color, iconType }) => (): void => { dispatchToaster({ @@ -114,7 +86,6 @@ const ExceptionsViewerComponent = ({ }, [dispatchToaster] ); - const { deleteExceptionItem } = useApi(services.http); const [ { endpointList, @@ -122,13 +93,15 @@ const ExceptionsViewerComponent = ({ exceptions, filterOptions, pagination, + loadingLists, loadingItemIds, + isInitLoading, isModalOpen, }, dispatch, - ] = useReducer(allExceptionItemsReducer(), initialState); + ] = useReducer(allExceptionItemsReducer(), { ...initialState, loadingLists: exceptionListsMeta }); + const { deleteExceptionItem } = useApi(services.http); - // TODO: Update icky typing once api updated const setExceptions = useCallback( ({ lists: newLists, @@ -146,14 +119,14 @@ const ExceptionsViewerComponent = ({ ); const [loadingList, , , , fetchList] = useExceptionList({ http: services.http, - lists: exceptionListsMeta, + lists: loadingLists, filterOptions, pagination: { page: pagination.pageIndex + 1, perPage: pagination.pageSize, total: pagination.totalItemCount, }, - dispatchListsInReducer: setExceptions, + onSuccess: setExceptions, onError: onDispatchToaster({ color: 'danger', title: i18n.FETCH_LIST_ERROR, @@ -171,24 +144,25 @@ const ExceptionsViewerComponent = ({ [dispatch] ); - const onFetchList = useCallback((): void => { + const handleFetchList = useCallback((): void => { if (fetchList != null) { fetchList(); } }, [fetchList]); - const onFiltersChange = useCallback( + const handleFilterChange = useCallback( ({ filter, pagination: pag }: Filter): void => { dispatch({ type: 'updateFilterOptions', filterOptions: filter, pagination: pag, + allLists: exceptionListsMeta, }); }, - [dispatch] + [dispatch, exceptionListsMeta] ); - const onAddException = useCallback( + const handleAddException = useCallback( (type: ExceptionListType): void => { setIsModalOpen(true); }, @@ -219,9 +193,9 @@ const ExceptionsViewerComponent = ({ onAssociateList(listId); } - onFetchList(); + handleFetchList(); }, - [setIsModalOpen, onFetchList, onAssociateList] + [setIsModalOpen, handleFetchList, onAssociateList] ); const setLoadingItemIds = useCallback( @@ -236,12 +210,14 @@ const ExceptionsViewerComponent = ({ const handleDeleteException = useCallback( ({ id, namespaceType }: ApiProps) => { + setLoadingItemIds([{ id, namespaceType }]); + deleteExceptionItem({ id, namespaceType, onSuccess: () => { setLoadingItemIds(loadingItemIds.filter((t) => t.id !== id)); - onFetchList(); + handleFetchList(); }, onError: () => { const dispatchToasterError = onDispatchToaster({ @@ -255,65 +231,29 @@ const ExceptionsViewerComponent = ({ }, }); }, - [setLoadingItemIds, deleteExceptionItem, loadingItemIds, onFetchList, onDispatchToaster] + [setLoadingItemIds, deleteExceptionItem, loadingItemIds, handleFetchList, onDispatchToaster] ); // Logic for initial render useEffect((): void => { - if (initLoading && !loadingList && (exceptions.length === 0 || exceptions != null)) { - setInitLoading(false); + if (isInitLoading && !loadingList && (exceptions.length === 0 || exceptions != null)) { + dispatch({ + type: 'updateIsInitLoading', + loading: false, + }); } - }, [initLoading, exceptions, loadingList]); + }, [isInitLoading, exceptions, loadingList, dispatch]); + // Used in utility bar info text const ruleSettingsUrl = useMemo((): string => { return services.application.getUrlForApp( `security#/detections/rules/id/${encodeURI(ruleId)}/edit` ); }, [ruleId, services.application]); - const exceptionsSubtext = useMemo((): JSX.Element => { - if (filterOptions.showEndpointList) { - return ( - - - - ), - }} - /> - ); - } else if (filterOptions.showDetectionsList) { - return ( - - - - ), - }} - /> - ); - } else { - return <>; - } - }, [filterOptions.showEndpointList, filterOptions.showDetectionsList, ruleSettingsUrl]); - const showEmpty = useMemo((): boolean => { - return !initLoading && !loadingList && exceptions.length === 0; - }, [initLoading, exceptions.length, loadingList]); + return !isInitLoading && !loadingList && exceptions.length === 0; + }, [isInitLoading, exceptions.length, loadingList]); return ( <> @@ -329,80 +269,43 @@ const ExceptionsViewerComponent = ({ )} - - {initLoading && } + + {(isInitLoading || loadingList) && ( + + )} - {(filterOptions.showEndpointList || filterOptions.showDetectionsList) && ( - <> - - {exceptionsSubtext} - - )} - - - - - - {i18n.SHOWING_EXCEPTIONS(pagination.totalItemCount ?? 0)} - - - - - - {i18n.REFRESH} - - - - - - - - - {showEmpty && ( - {i18n.EXCEPTION_EMPTY_PROMPT_TITLE}} - body={

    {i18n.EXCEPTION_EMPTY_PROMPT_BODY}

    } - data-test-subj="exceptionsEmptyPrompt" - /> - )} - - - - - {!initLoading && - exceptions.length > 0 && - exceptions.map((exception, index) => ( - - {index !== 0 && ( - <> - - - - )} - - - ))} - -
    - + + + + +
    ); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts index 40d5bb5f0a297..538207458f0ed 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/reducer.ts @@ -10,7 +10,7 @@ import { ExceptionListItemSchema, Pagination, } from '../types'; -import { ExceptionList } from '../../../../../public/lists_plugin_deps'; +import { ExceptionList, ExceptionIdentifiers } from '../../../../../public/lists_plugin_deps'; export interface State { filterOptions: FilterOptions; @@ -20,7 +20,9 @@ export interface State { allExceptions: ExceptionListItemSchema[]; exceptions: ExceptionListItemSchema[]; exceptionToEdit: ExceptionListItemSchema | null; + loadingLists: ExceptionIdentifiers[]; loadingItemIds: ApiProps[]; + isInitLoading: boolean; isModalOpen: boolean; } @@ -35,7 +37,9 @@ export type Action = type: 'updateFilterOptions'; filterOptions: Partial; pagination: Partial; + allLists: ExceptionIdentifiers[]; } + | { type: 'updateIsInitLoading'; loading: boolean } | { type: 'updateModalOpen'; isOpen: boolean } | { type: 'updateExceptionToEdit'; exception: ExceptionListItemSchema } | { type: 'updateLoadingItemIds'; items: ApiProps[] }; @@ -78,26 +82,34 @@ export const allExceptionItemsReducer = () => (state: State, action: Action): St }; if (action.filterOptions.showEndpointList) { - const exceptions = state.allExceptions.filter((t) => t._tags.includes('endpoint')); + const list = action.allLists.filter((t) => t.type === 'endpoint'); return { ...returnState, - exceptions, + loadingLists: list, + exceptions: list.length === 0 ? [] : [...state.exceptions], }; } else if (action.filterOptions.showDetectionsList) { - const exceptions = state.allExceptions.filter((t) => t._tags.includes('detection')); + const list = action.allLists.filter((t) => t.type === 'detection'); return { ...returnState, - exceptions, + loadingLists: list, + exceptions: list.length === 0 ? [] : [...state.exceptions], }; } else { return { ...returnState, - exceptions: state.allExceptions, + loadingLists: action.allLists, }; } } + case 'updateIsInitLoading': { + return { + ...state, + isInitLoading: action.loading, + }; + } case 'updateLoadingItemIds': { return { ...state, diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx index 0beecc500e722..76270a7c08cd6 100644 --- a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx @@ -66,7 +66,7 @@ export const AnomaliesQueryTabBody = ({ startDate={startDate} endDate={endDate} skip={skip} - type={type as never} + type={type} narrowDateRange={narrowDateRange} flowTarget={flowTarget} ip={ip} diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts index ecf4c3590a42c..a2009809a9916 100644 --- a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts +++ b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts @@ -11,8 +11,6 @@ import { SetQuery } from '../../../../hosts/pages/navigation/types'; import { FlowTarget } from '../../../../graphql/types'; import { HostsType } from '../../../../hosts/store/model'; import { NetworkType } from '../../../../network/store//model'; -import { AnomaliesHostTable } from '../../../components/ml/tables/anomalies_host_table'; -import { AnomaliesNetworkTable } from '../../../components/ml/tables/anomalies_network_table'; interface QueryTabBodyProps { type: HostsType | NetworkType; @@ -21,7 +19,8 @@ interface QueryTabBodyProps { export type AnomaliesQueryTabBodyProps = QueryTabBodyProps & { anomaliesFilterQuery?: object; - AnomaliesTableComponent: typeof AnomaliesHostTable | typeof AnomaliesNetworkTable; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + AnomaliesTableComponent: React.NamedExoticComponent; deleteQuery?: ({ id }: { id: string }) => void; endDate: number; flowTarget?: FlowTarget; diff --git a/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx b/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx index 4fbbcfc8d948a..8f7e0e06fb7a1 100644 --- a/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx +++ b/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx @@ -35,8 +35,7 @@ export const ManagementPageView = memo>((options) => href: getManagementUrl({ name: 'policyList' }), }, ]; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [tabName]); + }, [options.viewType, tabName]); return ; }); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx index 6c447df618791..9b0ca73cf021f 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx @@ -137,15 +137,14 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { description: details.agent.version, }, ]; - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ - details.agent.version, details.endpoint.policy.id, - details.host.hostname, details.host.ip, - policyResponseUri.search, - policyStatusClickHandler, + details.host.hostname, + details.agent.version, policyStatus, + policyResponseUri, + policyStatusClickHandler, ]); return ( diff --git a/x-pack/plugins/security_solution/public/management/store/reducer.ts b/x-pack/plugins/security_solution/public/management/store/reducer.ts index e00b3ec9e0f5b..2ed3dfe86d2f8 100644 --- a/x-pack/plugins/security_solution/public/management/store/reducer.ts +++ b/x-pack/plugins/security_solution/public/management/store/reducer.ts @@ -40,6 +40,5 @@ export const mockManagementState: Immutable = { export const managementReducer = immutableCombineReducers({ [MANAGEMENT_STORE_POLICY_LIST_NAMESPACE]: policyListReducer, [MANAGEMENT_STORE_POLICY_DETAILS_NAMESPACE]: policyDetailsReducer, - // @ts-ignore [MANAGEMENT_STORE_ENDPOINTS_NAMESPACE]: hostListReducer, }); diff --git a/x-pack/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts b/x-pack/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts index be0895dbec4fe..aaca6770e157a 100644 --- a/x-pack/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts +++ b/x-pack/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts @@ -38,5 +38,5 @@ export function mockProcessEvent(parts: DeepPartial): Legac }, }, parts - ); + ) as LegacyEndpointEvent; } diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx index 2228963a7eb44..3384165392dc8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx @@ -122,7 +122,7 @@ const AddressLinksComponent: React.FC<{ /> ) : ( - + ) } truncate={truncate} diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts index f521ffa9b6b5d..c8a47798f169c 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts @@ -221,7 +221,7 @@ export const queryTimelineById = ({ variables: { id: timelineId }, }) // eslint-disable-next-line - .then(result => { + .then((result) => { const timelineToOpen: TimelineResult = omitTypenameInTimeline( getOr({}, 'data.getOneTimeline', result) ); diff --git a/x-pack/plugins/security_solution/server/endpoint/alerts/handlers/lib/index.ts b/x-pack/plugins/security_solution/server/endpoint/alerts/handlers/lib/index.ts index 4f0a7ba2450dc..e398e70f1d7b7 100644 --- a/x-pack/plugins/security_solution/server/endpoint/alerts/handlers/lib/index.ts +++ b/x-pack/plugins/security_solution/server/endpoint/alerts/handlers/lib/index.ts @@ -6,7 +6,7 @@ import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; import { AlertEvent } from '../../../../../common/endpoint/types'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; import { esQuery } from '../../../../../../../../src/plugins/data/server'; import { AlertAPIOrdering, diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/base.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/base.ts index 440b578bde413..debb455ac728f 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/base.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/base.ts @@ -7,7 +7,7 @@ import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; import { ResolverEvent } from '../../../../../common/endpoint/types'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; import { legacyEventIndexPattern } from './legacy_event_index_pattern'; import { MSearchQuery } from './multi_searcher'; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/children.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/children.ts index e4b2559a1780c..f357ac1a43d72 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/children.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/children.ts @@ -7,7 +7,7 @@ import { SearchResponse } from 'elasticsearch'; import { ResolverEvent } from '../../../../../common/endpoint/types'; import { ResolverQuery } from './base'; import { PaginationBuilder, PaginatedResults } from '../utils/pagination'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; /** * Builds a query for retrieving descendants of a node. diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts index e14b222500d7c..04202cfd007f9 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts @@ -7,7 +7,7 @@ import { SearchResponse } from 'elasticsearch'; import { ResolverEvent } from '../../../../../common/endpoint/types'; import { ResolverQuery } from './base'; import { PaginationBuilder, PaginatedResults } from '../utils/pagination'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; /** * Builds a query for retrieving related events for a node. diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/lifecycle.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/lifecycle.ts index 74fe44f39615c..93910293b00af 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/lifecycle.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/lifecycle.ts @@ -5,7 +5,7 @@ */ import { SearchResponse } from 'elasticsearch'; import { ResolverQuery } from './base'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; import { ResolverEvent } from '../../../../../common/endpoint/types'; /** diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/multi_searcher.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/multi_searcher.ts index 7f55fafeafb59..4c0e1a5126e7c 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/multi_searcher.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/multi_searcher.ts @@ -7,7 +7,7 @@ import { IScopedClusterClient } from 'kibana/server'; import { MSearchResponse } from 'elasticsearch'; import { ResolverEvent } from '../../../../../common/endpoint/types'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; /** * Contract for queries to be compatible with ES multi search api diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/stats.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/stats.ts index 359445f514b77..a728054bef219 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/stats.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/stats.ts @@ -6,7 +6,7 @@ import { SearchResponse } from 'elasticsearch'; import { ResolverQuery } from './base'; import { ResolverEvent, EventStats } from '../../../../../common/endpoint/types'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; import { AggBucket } from '../utils/pagination'; export interface StatsResult { diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts index 9a852d47e0e85..61cb5bdb8f146 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts @@ -6,7 +6,7 @@ import { ResolverEvent } from '../../../../../common/endpoint/types'; import { eventId } from '../../../../../common/endpoint/models/event'; -import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/common'; /** * Represents a single result bucket of an aggregation diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/rules_notification_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/rules_notification_alert_type.ts index 5a2a950f21bcf..cf5a6aa01f29e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/rules_notification_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/rules_notification_alert_type.ts @@ -64,7 +64,8 @@ export const rulesNotificationAlertType = ({ from: fromInMs, to: toInMs, id: ruleAlertSavedObject.id, - kibanaSiemAppUrl: ruleAlertParams.meta?.kibana_siem_app_url, + kibanaSiemAppUrl: (ruleAlertParams.meta as { kibana_siem_app_url?: string }) + .kibana_siem_app_url, }); logger.info( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts index 23d5d7eb8d385..fe66496f70dcd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts @@ -22,34 +22,11 @@ import { IRuleSavedAttributesSavedObjectAttributes, HapiReadableStream, } from '../../rules/types'; -import { RuleAlertParamsRest } from '../../types'; import { requestMock } from './request'; import { RuleNotificationAlertType } from '../../notifications/types'; import { QuerySignalsSchemaDecoded } from '../../../../../common/detection_engine/schemas/request/query_signals_index_schema'; import { SetSignalsStatusSchemaDecoded } from '../../../../../common/detection_engine/schemas/request/set_signal_status_schema'; - -export const typicalPayload = (): Partial => ({ - rule_id: 'rule-1', - description: 'Detecting root and admin users', - index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], - interval: '5m', - name: 'Detect Root/Admin Users', - output_index: '.siem-signals', - risk_score: 50, - type: 'query', - from: 'now-6m', - to: 'now', - severity: 'high', - query: 'user.name: root or user.name: admin', - language: 'kuery', - threat: [ - { - framework: 'fake', - tactic: { id: 'fakeId', name: 'fakeName', reference: 'fakeRef' }, - technique: [{ id: 'techniqueId', name: 'techniqueName', reference: 'techniqueRef' }], - }, - ], -}); +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; export const typicalSetStatusSignalByIdsPayload = (): SetSignalsStatusSchemaDecoded => ({ signal_ids: ['somefakeid1', 'somefakeid2'], @@ -77,14 +54,14 @@ export const getUpdateRequest = () => requestMock.create({ method: 'put', path: DETECTION_ENGINE_RULES_URL, - body: typicalPayload(), + body: getCreateRulesSchemaMock(), }); export const getPatchRequest = () => requestMock.create({ method: 'patch', path: DETECTION_ENGINE_RULES_URL, - body: typicalPayload(), + body: getCreateRulesSchemaMock(), }); export const getReadRequest = () => @@ -104,21 +81,21 @@ export const getReadBulkRequest = () => requestMock.create({ method: 'post', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_create`, - body: [typicalPayload()], + body: [getCreateRulesSchemaMock()], }); export const getUpdateBulkRequest = () => requestMock.create({ method: 'put', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [typicalPayload()], + body: [getCreateRulesSchemaMock()], }); export const getPatchBulkRequest = () => requestMock.create({ method: 'patch', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [typicalPayload()], + body: [getCreateRulesSchemaMock()], }); export const getDeleteBulkRequest = () => @@ -254,11 +231,12 @@ export const getCreateRequest = () => requestMock.create({ method: 'post', path: DETECTION_ENGINE_RULES_URL, - body: typicalPayload(), + body: getCreateRulesSchemaMock(), }); +// TODO: Replace this with the mocks version from the mocks file export const typicalMlRulePayload = () => { - const { query, language, index, ...mlParams } = typicalPayload(); + const { query, language, index, ...mlParams } = getCreateRulesSchemaMock(); return { ...mlParams, @@ -284,8 +262,9 @@ export const createBulkMlRuleRequest = () => { }); }; +// TODO: Replace this with a mocks file version export const createRuleWithActionsRequest = () => { - const payload = typicalPayload(); + const payload = getCreateRulesSchemaMock(); return requestMock.create({ method: 'post', @@ -369,6 +348,7 @@ export const getResult = (): RuleAlertType => ({ falsePositives: [], from: 'now-6m', immutable: false, + savedId: undefined, query: 'user.name: root or user.name: admin', language: 'kuery', machineLearningJobId: undefined, @@ -560,9 +540,9 @@ export const getFindResultStatus = (): SavedObjectsFindResponse< alertId: '1ea5a820-4da1-4e82-92a1-2b43a7bece08', statusDate: '2020-02-18T15:26:49.783Z', status: 'succeeded', - lastFailureAt: null, + lastFailureAt: undefined, lastSuccessAt: '2020-02-18T15:26:49.783Z', - lastFailureMessage: null, + lastFailureMessage: undefined, lastSuccessMessage: 'succeeded', lastLookBackDate: new Date('2020-02-18T15:14:58.806Z').toISOString(), gap: '500.32', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts index 41a28bfe8967d..063c9dffd66dd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts @@ -6,70 +6,8 @@ import { Readable } from 'stream'; -import { OutputRuleAlertRest } from '../../types'; import { HapiReadableStream } from '../../rules/types'; - -/** - * This is a typical simple rule for testing that is easy for most basic testing - * @param ruleId - */ -export const getSimpleRule = (ruleId = 'rule-1'): Partial => ({ - name: 'Simple Rule Query', - description: 'Simple Rule Query', - risk_score: 1, - rule_id: ruleId, - severity: 'high', - type: 'query', - query: 'user.name: root or user.name: admin', -}); - -/** - * This is a typical ML rule for testing - * @param ruleId - */ -export const getSimpleMlRule = (ruleId = 'rule-1'): Partial => ({ - name: 'Simple Rule Query', - description: 'Simple Rule Query', - risk_score: 1, - rule_id: ruleId, - severity: 'high', - type: 'machine_learning', - anomaly_threshold: 44, - machine_learning_job_id: 'some_job_id', -}); - -/** - * This is a typical simple rule for testing that is easy for most basic testing - * @param ruleId - */ -export const getSimpleRuleWithId = (id = 'rule-1'): Partial => ({ - name: 'Simple Rule Query', - description: 'Simple Rule Query', - risk_score: 1, - id, - severity: 'high', - type: 'query', - query: 'user.name: root or user.name: admin', -}); - -/** - * Given an array of rules, builds an NDJSON string of rules - * as we might import/export - * @param rules Array of rule objects with which to generate rule JSON - */ -export const rulesToNdJsonString = (rules: Array>) => { - return rules.map((rule) => JSON.stringify(rule)).join('\r\n'); -}; - -/** - * Given an array of rule IDs, builds an NDJSON string of rules - * as we might import/export - * @param ruleIds Array of ruleIds with which to generate rule JSON - */ -export const ruleIdsToNdJsonString = (ruleIds: string[]) => { - const rules = ruleIds.map((ruleId) => getSimpleRule(ruleId)); - return rulesToNdJsonString(rules); -}; +import { RulesSchema } from '../../../../../common/detection_engine/schemas/response/rules_schema'; /** * Given a string, builds a hapi stream as our @@ -94,7 +32,7 @@ export const buildHapiStream = (string: string, filename = 'file.ndjson'): HapiR }; export const getOutputRuleAlertForRest = (): Omit< - OutputRuleAlertRest, + RulesSchema, 'machine_learning_job_id' | 'anomaly_threshold' > => ({ actions: [], diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts index 1df6070bc33a6..11a4543e2fa12 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts @@ -8,7 +8,6 @@ import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { mlServicesMock, mlAuthzMock as mockMlAuthzFactory } from '../../../machine_learning/mocks'; import { buildMlAuthz } from '../../../machine_learning/authz'; import { - typicalPayload, getReadBulkRequest, getEmptyIndex, getNonEmptyIndex, @@ -20,6 +19,7 @@ import { import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { createRulesBulkRoute } from './create_rules_bulk_route'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); @@ -98,8 +98,7 @@ describe('create_rules_bulk', () => { expect(response.body).toEqual([ { error: { - message: - 'To create a rule, the index must exist first. Index .siem-signals does not exist', + message: 'To create a rule, the index must exist first. Index undefined does not exist', status_code: 400, }, rule_id: 'rule-1', @@ -143,7 +142,7 @@ describe('create_rules_bulk', () => { const request = requestMock.create({ method: 'post', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_create`, - body: [typicalPayload(), typicalPayload()], + body: [getCreateRulesSchemaMock(), getCreateRulesSchemaMock()], }); const response = await server.inject(request, context); @@ -164,7 +163,7 @@ describe('create_rules_bulk', () => { const request = requestMock.create({ method: 'post', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_create`, - body: [{ ...typicalPayload(), type: 'query' }], + body: [{ ...getCreateRulesSchemaMock(), type: 'query' }], }); const result = server.validate(request); @@ -175,7 +174,7 @@ describe('create_rules_bulk', () => { const request = requestMock.create({ method: 'post', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_create`, - body: [{ ...typicalPayload(), type: 'unexpected_type' }], + body: [{ ...getCreateRulesSchemaMock(), type: 'unexpected_type' }], }); const result = server.validate(request); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts index 5abd7b1e76a76..37500572d1386 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts @@ -9,7 +9,6 @@ import { getEmptyFindResult, getResult, getCreateRequest, - typicalPayload, getFindResultStatus, getNonEmptyIndex, getEmptyIndex, @@ -22,6 +21,7 @@ import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { createRulesRoute } from './create_rules_route'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; import { updateRulesNotifications } from '../../rules/update_rules_notifications'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; jest.mock('../../rules/update_rules_notifications'); jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); @@ -114,7 +114,7 @@ describe('create_rules', () => { expect(response.status).toEqual(400); expect(response.body).toEqual({ - message: 'To create a rule, the index must exist first. Index .siem-signals does not exist', + message: 'To create a rule, the index must exist first. Index undefined does not exist', status_code: 400, }); }); @@ -149,7 +149,7 @@ describe('create_rules', () => { method: 'post', path: DETECTION_ENGINE_RULES_URL, body: { - ...typicalPayload(), + ...getCreateRulesSchemaMock(), type: 'query', }, }); @@ -163,7 +163,7 @@ describe('create_rules', () => { method: 'post', path: DETECTION_ENGINE_RULES_URL, body: { - ...typicalPayload(), + ...getCreateRulesSchemaMock(), type: 'unexpected_type', }, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts index 0762fbc7dd6e3..84148231431a1 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts @@ -4,12 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - buildHapiStream, - ruleIdsToNdJsonString, - rulesToNdJsonString, - getSimpleRuleWithId, -} from '../__mocks__/utils'; +import { buildHapiStream } from '../__mocks__/utils'; import { getImportRulesRequest, getImportRulesRequestOverwriteTrue, @@ -25,6 +20,11 @@ import { buildMlAuthz } from '../../../machine_learning/authz'; import { importRulesRoute } from './import_rules_route'; import * as createRulesStreamFromNdJson from '../../rules/create_rules_stream_from_ndjson'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; +import { + getImportRulesWithIdSchemaMock, + ruleIdsToNdJsonString, + rulesToNdJsonString, +} from '../../../../../common/detection_engine/schemas/request/import_rules_schema.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); @@ -239,7 +239,11 @@ describe('import_rules_route', () => { }); test('returns 200 with errors if all rules are missing rule_ids and import fails on validation', async () => { - const rulesWithoutRuleIds = ['rule-1', 'rule-2'].map((ruleId) => getSimpleRuleWithId(ruleId)); + const rulesWithoutRuleIds = ['rule-1', 'rule-2'].map((ruleId) => + getImportRulesWithIdSchemaMock(ruleId) + ); + delete rulesWithoutRuleIds[0].rule_id; + delete rulesWithoutRuleIds[1].rule_id; const badPayload = buildHapiStream(rulesToNdJsonString(rulesWithoutRuleIds)); const badRequest = getImportRulesRequest(badPayload); @@ -251,7 +255,7 @@ describe('import_rules_route', () => { { error: { // TODO: Change the formatter to do better than output [object Object] - message: '[object Object],[object Object]', + message: '[object Object]', status_code: 400, }, rule_id: '(unknown id)', @@ -259,7 +263,7 @@ describe('import_rules_route', () => { { error: { // TODO: Change the formatter to do better than output [object Object] - message: '[object Object],[object Object]', + message: '[object Object]', status_code: 400, }, rule_id: '(unknown id)', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts index d5145e1dceae0..24fd5e151e485 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts @@ -9,7 +9,6 @@ import { mlServicesMock, mlAuthzMock as mockMlAuthzFactory } from '../../../mach import { buildMlAuthz } from '../../../machine_learning/authz'; import { getEmptyFindResult, - typicalPayload, getFindResultWithSingleHit, getPatchBulkRequest, getResult, @@ -18,6 +17,7 @@ import { import { serverMock, requestContextMock, requestMock } from '../__mocks__'; import { patchRulesBulkRoute } from './patch_rules_bulk_route'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); @@ -153,7 +153,7 @@ describe('patch_rules_bulk', () => { const request = requestMock.create({ method: 'patch', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [{ ...typicalPayload(), rule_id: undefined }], + body: [{ ...getCreateRulesSchemaMock(), rule_id: undefined }], }); const response = await server.inject(request, context); @@ -173,7 +173,7 @@ describe('patch_rules_bulk', () => { const request = requestMock.create({ method: 'patch', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [{ ...typicalPayload(), type: 'query' }], + body: [{ ...getCreateRulesSchemaMock(), type: 'query' }], }); const result = server.validate(request); @@ -184,7 +184,7 @@ describe('patch_rules_bulk', () => { const request = requestMock.create({ method: 'patch', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [{ ...typicalPayload(), type: 'unknown_type' }], + body: [{ ...getCreateRulesSchemaMock(), type: 'unknown_type' }], }); const result = server.validate(request); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts index 09230d45ee785..1b225f6dd93c3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts @@ -12,7 +12,6 @@ import { getFindResultStatus, getResult, getPatchRequest, - typicalPayload, getFindResultWithSingleHit, nonRuleFindResult, typicalMlRulePayload, @@ -20,6 +19,7 @@ import { import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { patchRulesRoute } from './patch_rules_route'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); @@ -165,7 +165,7 @@ describe('patch_rules', () => { const request = requestMock.create({ method: 'patch', path: DETECTION_ENGINE_RULES_URL, - body: { ...typicalPayload(), rule_id: undefined }, + body: { ...getCreateRulesSchemaMock(), rule_id: undefined }, }); const response = await server.inject(request, context); expect(response.body).toEqual({ @@ -178,7 +178,7 @@ describe('patch_rules', () => { const request = requestMock.create({ method: 'patch', path: DETECTION_ENGINE_RULES_URL, - body: { ...typicalPayload(), type: 'query' }, + body: { ...getCreateRulesSchemaMock(), type: 'query' }, }); const result = server.validate(request); @@ -189,7 +189,7 @@ describe('patch_rules', () => { const request = requestMock.create({ method: 'patch', path: DETECTION_ENGINE_RULES_URL, - body: { ...typicalPayload(), type: 'unknown_type' }, + body: { ...getCreateRulesSchemaMock(), type: 'unknown_type' }, }); const result = server.validate(request); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts index 2f331938e3ca8..582bf1a9aa22b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts @@ -10,7 +10,6 @@ import { buildMlAuthz } from '../../../machine_learning/authz'; import { getEmptyFindResult, getResult, - typicalPayload, getFindResultWithSingleHit, getUpdateBulkRequest, getFindResultStatus, @@ -20,6 +19,7 @@ import { serverMock, requestContextMock, requestMock } from '../__mocks__'; import { updateRulesBulkRoute } from './update_rules_bulk_route'; import { BulkError } from '../utils'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); @@ -129,7 +129,7 @@ describe('update_rules_bulk', () => { const noIdRequest = requestMock.create({ method: 'put', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [{ ...typicalPayload(), rule_id: undefined }], + body: [{ ...getCreateRulesSchemaMock(), rule_id: undefined }], }); const response = await server.inject(noIdRequest, context); expect(response.body).toEqual([ @@ -144,7 +144,7 @@ describe('update_rules_bulk', () => { const request = requestMock.create({ method: 'put', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [{ ...typicalPayload(), type: 'query' }], + body: [{ ...getCreateRulesSchemaMock(), type: 'query' }], }); const result = server.validate(request); @@ -155,7 +155,7 @@ describe('update_rules_bulk', () => { const request = requestMock.create({ method: 'put', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_update`, - body: [{ ...typicalPayload(), type: 'unknown_type' }], + body: [{ ...getCreateRulesSchemaMock(), type: 'unknown_type' }], }); const result = server.validate(request); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts index f8b7636080b1b..bbe65ff36a3e5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts @@ -10,7 +10,6 @@ import { getEmptyFindResult, getResult, getUpdateRequest, - typicalPayload, getFindResultWithSingleHit, getFindResultStatusEmpty, nonRuleFindResult, @@ -21,6 +20,7 @@ import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; import { updateRulesNotifications } from '../../rules/update_rules_notifications'; import { updateRulesRoute } from './update_rules_route'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); jest.mock('../../rules/update_rules_notifications'); @@ -139,7 +139,7 @@ describe('update_rules', () => { method: 'put', path: DETECTION_ENGINE_RULES_URL, body: { - ...typicalPayload(), + ...getCreateRulesSchemaMock(), rule_id: undefined, }, }); @@ -154,7 +154,7 @@ describe('update_rules', () => { const request = requestMock.create({ method: 'put', path: DETECTION_ENGINE_RULES_URL, - body: { ...typicalPayload(), type: 'query' }, + body: { ...getCreateRulesSchemaMock(), type: 'query' }, }); const result = await server.validate(request); @@ -165,7 +165,7 @@ describe('update_rules', () => { const request = requestMock.create({ method: 'put', path: DETECTION_ENGINE_RULES_URL, - body: { ...typicalPayload(), type: 'unknown type' }, + body: { ...getCreateRulesSchemaMock(), type: 'unknown type' }, }); const result = await server.validate(request); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts index 3b2750bbbf664..3b514b92e1479 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts @@ -21,7 +21,7 @@ import { getResult } from '../__mocks__/request_responses'; import { INTERNAL_IDENTIFIER } from '../../../../../common/constants'; import { RuleTypeParams } from '../../types'; import { BulkError, ImportSuccessError } from '../utils'; -import { getSimpleRule, getOutputRuleAlertForRest } from '../__mocks__/utils'; +import { getOutputRuleAlertForRest } from '../__mocks__/utils'; import { createPromiseFromStreams } from '../../../../../../../../src/legacy/utils/streams'; import { PartialAlert } from '../../../../../../alerts/server'; import { SanitizedAlert } from '../../../../../../alerts/server/types'; @@ -30,6 +30,7 @@ import { RuleAlertType } from '../../rules/types'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; import { CreateRulesBulkSchemaDecoded } from '../../../../../common/detection_engine/schemas/request/create_rules_bulk_schema'; import { ImportRulesSchemaDecoded } from '../../../../../common/detection_engine/schemas/request/import_rules_schema'; +import { getCreateRulesSchemaMock } from '../../../../../common/detection_engine/schemas/request/create_rules_schema.mock'; type PromiseFromStreams = ImportRulesSchemaDecoded | Error; @@ -62,14 +63,6 @@ describe('utils', () => { expect(rule).toEqual(expectedWithoutFromWithoutLanguage); }); - test('should omit query if query is null', () => { - const fullRule = getResult(); - fullRule.params.query = null; - const rule = transformAlertToRule(fullRule); - const { query, ...expectedWithoutQuery } = getOutputRuleAlertForRest(); - expect(rule).toEqual(expectedWithoutQuery); - }); - test('should omit query if query is undefined', () => { const fullRule = getResult(); fullRule.params.query = undefined; @@ -81,7 +74,7 @@ describe('utils', () => { test('should omit a mix of undefined, null, and missing fields', () => { const fullRule = getResult(); fullRule.params.query = undefined; - fullRule.params.language = null; + fullRule.params.language = undefined; const { from, ...omitParams } = fullRule.params; fullRule.params = omitParams as RuleTypeParams; const { enabled, ...omitEnabled } = fullRule; @@ -532,8 +525,8 @@ describe('utils', () => { }); test('returns tuple of duplicate conflict error and single rule when rules with matching rule-ids passed in and `overwrite` is false', async () => { - const rule = getSimpleRule('rule-1'); - const rule2 = getSimpleRule('rule-1'); + const rule = getCreateRulesSchemaMock('rule-1'); + const rule2 = getCreateRulesSchemaMock('rule-1'); const ndJsonStream = new Readable({ read() { this.push(`${JSON.stringify(rule)}\n`); @@ -561,9 +554,9 @@ describe('utils', () => { }); test('returns tuple of duplicate conflict error and single rule when rules with matching ids passed in and `overwrite` is false', async () => { - const rule = getSimpleRule('rule-1'); + const rule = getCreateRulesSchemaMock('rule-1'); delete rule.rule_id; - const rule2 = getSimpleRule('rule-1'); + const rule2 = getCreateRulesSchemaMock('rule-1'); delete rule2.rule_id; const ndJsonStream = new Readable({ read() { @@ -585,8 +578,8 @@ describe('utils', () => { }); test('returns tuple of empty duplicate errors array and single rule when rules with matching rule-ids passed in and `overwrite` is true', async () => { - const rule = getSimpleRule('rule-1'); - const rule2 = getSimpleRule('rule-1'); + const rule = getCreateRulesSchemaMock('rule-1'); + const rule2 = getCreateRulesSchemaMock('rule-1'); const ndJsonStream = new Readable({ read() { this.push(`${JSON.stringify(rule)}\n`); @@ -606,7 +599,7 @@ describe('utils', () => { }); test('returns tuple of empty duplicate errors array and single rule when rules without a rule-id is passed in', async () => { - const simpleRule = getSimpleRule(); + const simpleRule = getCreateRulesSchemaMock(); delete simpleRule.rule_id; const multipartPayload = `${JSON.stringify(simpleRule)}\n`; const ndJsonStream = new Readable({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts index 3ed45bd8367fc..9320eba26df0b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts @@ -8,6 +8,7 @@ import { pickBy, countBy } from 'lodash/fp'; import { SavedObject, SavedObjectsFindResponse } from 'kibana/server'; import uuid from 'uuid'; +import { RulesSchema } from '../../../../../common/detection_engine/schemas/response/rules_schema'; import { ImportRulesSchemaDecoded } from '../../../../../common/detection_engine/schemas/request/import_rules_schema'; import { CreateRulesBulkSchemaDecoded } from '../../../../../common/detection_engine/schemas/request/create_rules_bulk_schema'; import { PartialAlert, FindResult } from '../../../../../../alerts/server'; @@ -21,7 +22,6 @@ import { isRuleStatusFindTypes, isRuleStatusSavedObjectType, } from '../../rules/types'; -import { OutputRuleAlertRest } from '../../types'; import { createBulkErrorObject, BulkError, @@ -30,7 +30,6 @@ import { createImportErrorObject, OutputError, } from '../utils'; -import { hasListsFeature } from '../../feature_flags'; import { RuleActions } from '../../rule_actions/types'; type PromiseFromStreams = ImportRulesSchemaDecoded | Error; @@ -104,12 +103,12 @@ export const transformAlertToRule = ( alert: RuleAlertType, ruleActions?: RuleActions | null, ruleStatus?: SavedObject -): Partial => { - return pickBy((value: unknown) => value != null, { +): Partial => { + return pickBy((value: unknown) => value != null, { actions: ruleActions?.actions ?? [], created_at: alert.createdAt.toISOString(), updated_at: alert.updatedAt.toISOString(), - created_by: alert.createdBy, + created_by: alert.createdBy ?? 'elastic', description: alert.params.description, enabled: alert.enabled, anomaly_threshold: alert.params.anomalyThreshold, @@ -134,28 +133,25 @@ export const transformAlertToRule = ( timeline_title: alert.params.timelineTitle, meta: alert.params.meta, severity: alert.params.severity, - updated_by: alert.updatedBy, + updated_by: alert.updatedBy ?? 'elastic', tags: transformTags(alert.tags), to: alert.params.to, type: alert.params.type, - threat: alert.params.threat, + threat: alert.params.threat ?? [], throttle: ruleActions?.ruleThrottle || 'no_actions', note: alert.params.note, version: alert.params.version, - status: ruleStatus?.attributes.status, + status: ruleStatus?.attributes.status ?? undefined, status_date: ruleStatus?.attributes.statusDate, - last_failure_at: ruleStatus?.attributes.lastFailureAt, - last_success_at: ruleStatus?.attributes.lastSuccessAt, - last_failure_message: ruleStatus?.attributes.lastFailureMessage, - last_success_message: ruleStatus?.attributes.lastSuccessMessage, - // TODO: (LIST-FEATURE) Remove hasListsFeature() check once we have lists available for a release - exceptions_list: hasListsFeature() ? alert.params.exceptionsList : null, + last_failure_at: ruleStatus?.attributes.lastFailureAt ?? undefined, + last_success_at: ruleStatus?.attributes.lastSuccessAt ?? undefined, + last_failure_message: ruleStatus?.attributes.lastFailureMessage ?? undefined, + last_success_message: ruleStatus?.attributes.lastSuccessMessage ?? undefined, + exceptions_list: alert.params.exceptionsList ?? [], }); }; -export const transformAlertsToRules = ( - alerts: RuleAlertType[] -): Array> => { +export const transformAlertsToRules = (alerts: RuleAlertType[]): Array> => { return alerts.map((alert) => transformAlertToRule(alert)); }; @@ -167,7 +163,7 @@ export const transformFindAlerts = ( page: number; perPage: number; total: number; - data: Array>; + data: Array>; } | null => { if (!ruleStatuses && isAlertTypes(findResults.data)) { return { @@ -194,7 +190,7 @@ export const transform = ( alert: PartialAlert, ruleActions?: RuleActions | null, ruleStatus?: SavedObject -): Partial | null => { +): Partial | null => { if (isAlertType(alert)) { return transformAlertToRule( alert, @@ -211,7 +207,7 @@ export const transformOrBulkError = ( alert: PartialAlert, ruleActions: RuleActions, ruleStatus?: unknown -): Partial | BulkError => { +): Partial | BulkError => { if (isAlertType(alert)) { if (isRuleStatusFindType(ruleStatus) && ruleStatus?.saved_objects.length > 0) { return transformAlertToRule(alert, ruleActions, ruleStatus?.saved_objects[0] ?? ruleStatus); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts index 5fc239ed48263..7b0bf5997d12f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts @@ -22,7 +22,6 @@ import { IRuleSavedAttributesSavedObjectAttributes, isRuleStatusFindType, } from '../../rules/types'; -import { OutputRuleAlertRest } from '../../types'; import { createBulkErrorObject, BulkError } from '../utils'; import { transformFindAlerts, transform, transformAlertToRule } from './utils'; import { RuleActions } from '../../rule_actions/types'; @@ -36,7 +35,7 @@ export const transformValidateFindAlerts = ( page: number; perPage: number; total: number; - data: Array>; + data: Array>; } | null, string | null ] => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts index 1a965842348ac..747cf82510460 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts @@ -4,17 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ +import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; import { AlertsClient } from '../../../../../alerts/server'; import { getExportDetailsNdjson } from './get_export_details_ndjson'; import { isAlertType } from '../rules/types'; import { readRules } from './read_rules'; import { transformAlertToRule } from '../routes/rules/utils'; -import { OutputRuleAlertRest } from '../types'; import { transformDataToNdjson } from '../../../utils/read_stream/create_stream_from_ndjson'; -interface ExportSuccesRule { +interface ExportSuccessRule { statusCode: 200; - rule: Partial; + rule: Partial; } interface ExportFailedRule { @@ -22,12 +22,12 @@ interface ExportFailedRule { missingRuleId: { rule_id: string }; } -type ExportRules = ExportSuccesRule | ExportFailedRule; +type ExportRules = ExportSuccessRule | ExportFailedRule; export interface RulesErrors { exportedCount: number; missingRules: Array<{ rule_id: string }>; - rules: Array>; + rules: Array>; } export const getExportByObjectIds = async ( @@ -80,7 +80,7 @@ export const getRulesFromObjects = async ( ) as ExportFailedRule[]; const exportedRules = alertsAndErrors.filter( (resp) => resp.statusCode === 200 - ) as ExportSuccesRule[]; + ) as ExportSuccessRule[]; return { exportedCount: exportedRules.length, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts index 431b3776fd9e2..848abc3febf35 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts @@ -4,18 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ -import { sampleRule } from '../signals/__mocks__/es_results'; import { getExportDetailsNdjson } from './get_export_details_ndjson'; +import { getRulesSchemaMock } from '../../../../common/detection_engine/schemas/response/rules_schema.mocks'; describe('getExportDetailsNdjson', () => { test('it ends with a new line character', () => { - const rule = sampleRule(); + const rule = getRulesSchemaMock(); const details = getExportDetailsNdjson([rule]); expect(details.endsWith('\n')).toEqual(true); }); test('it exports a correct count given a single rule and no missing rules', () => { - const rule = sampleRule(); + const rule = getRulesSchemaMock(); const details = getExportDetailsNdjson([rule]); const reParsed = JSON.parse(details); expect(reParsed).toEqual({ @@ -37,8 +37,8 @@ describe('getExportDetailsNdjson', () => { }); test('it exports a correct count given multiple rules and multiple missing rules', () => { - const rule1 = sampleRule(); - const rule2 = sampleRule(); + const rule1 = getRulesSchemaMock(); + const rule2 = getRulesSchemaMock(); rule2.rule_id = 'some other id'; rule2.id = 'some other id'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.ts index a39541d044bc3..0a685cab9b450 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_details_ndjson.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OutputRuleAlertRest } from '../types'; +import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; export const getExportDetailsNdjson = ( - rules: Array>, + rules: Array>, missingRules: Array<{ rule_id: string }> = [] ): string => { const stringified = JSON.stringify({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts index 3796df353abb8..0c103b7176db4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts @@ -11,7 +11,6 @@ import { PatchRulesOptions } from './types'; import { addTags } from './add_tags'; import { calculateVersion, calculateName, calculateInterval } from './utils'; import { ruleStatusSavedObjectsClientFactory } from '../signals/rule_status_saved_objects_client'; -import { Meta } from '../types'; export const patchRules = async ({ alertsClient, @@ -60,7 +59,7 @@ export const patchRules = async ({ savedId, timelineId, timelineTitle, - meta: meta as Meta | undefined, // TODO: Remove this cast once we fix the types for calculate version and patch, + meta, filters, from, index, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts index 8bdb1287c6df2..4b84057f6d795 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts @@ -69,11 +69,17 @@ import { QueryFilterOrUndefined, FieldsOrUndefined, SortOrderOrUndefined, + JobStatus, + LastSuccessAt, + StatusDate, + LastSuccessMessage, + LastFailureAt, + LastFailureMessage, } from '../../../../common/detection_engine/schemas/common/schemas'; import { AlertsClient, PartialAlert } from '../../../../../alerts/server'; import { Alert, SanitizedAlert } from '../../../../../alerts/common'; import { SIGNALS_ID } from '../../../../common/constants'; -import { RuleAlertParams, RuleTypeParams, PartialFilter } from '../types'; +import { RuleTypeParams, PartialFilter } from '../types'; export interface RuleAlertType extends Alert { params: RuleTypeParams; @@ -82,12 +88,12 @@ export interface RuleAlertType extends Alert { // eslint-disable-next-line @typescript-eslint/no-explicit-any export interface IRuleStatusAttributes extends Record { alertId: string; // created alert id. - statusDate: string; - lastFailureAt: string | null | undefined; - lastFailureMessage: string | null | undefined; - lastSuccessAt: string | null | undefined; - lastSuccessMessage: string | null | undefined; - status: RuleStatusString | null | undefined; + statusDate: StatusDate; + lastFailureAt: LastFailureAt | null | undefined; + lastFailureMessage: LastFailureMessage | null | undefined; + lastSuccessAt: LastSuccessAt | null | undefined; + lastSuccessMessage: LastSuccessMessage | null | undefined; + status: JobStatus | null | undefined; lastLookBackDate: string | null | undefined; gap: string | null | undefined; bulkCreateTimeDurations: string[] | null | undefined; @@ -121,8 +127,6 @@ export interface IRuleStatusFindType { saved_objects: IRuleStatusSavedObject[]; } -export type RuleStatusString = 'succeeded' | 'failed' | 'going to run'; - export interface HapiReadableStream extends Readable { hapi: { filename: string; @@ -133,12 +137,6 @@ export interface Clients { alertsClient: AlertsClient; } -// TODO: Try and remove this patch -export type PatchRuleParams = Partial> & { - rule: SanitizedAlert | null; - savedObjectsClient: SavedObjectsClientContract; -} & Clients; - export const isAlertTypes = (partialAlert: PartialAlert[]): partialAlert is RuleAlertType[] => { return partialAlert.every((rule) => isAlertType(rule)); }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts index 0236c357988d5..b3f327857dbb3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts @@ -12,7 +12,6 @@ import { addTags } from './add_tags'; import { calculateVersion } from './utils'; import { hasListsFeature } from '../feature_flags'; import { ruleStatusSavedObjectsClientFactory } from '../signals/rule_status_saved_objects_client'; -import { Meta } from '../types'; export const updateRules = async ({ alertsClient, @@ -63,7 +62,7 @@ export const updateRules = async ({ savedId, timelineId, timelineTitle, - meta: meta as Meta, // TODO: Remove this cast once we fix the types for calculate version and patch + meta, filters, from, index, @@ -81,6 +80,7 @@ export const updateRules = async ({ note, anomalyThreshold, machineLearningJobId, + exceptionsList, }); // TODO: Remove this and use regular exceptions_list once the feature is stable for a release diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts index b7c36b20f44be..0f65b2a78ec4c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts @@ -5,7 +5,6 @@ */ import { calculateInterval, calculateVersion, calculateName } from './utils'; -import { PatchRuleParams } from './types'; describe('utils', () => { describe('#calculateInterval', () => { @@ -27,24 +26,104 @@ describe('utils', () => { describe('#calculateVersion', () => { test('returning the same version number if given an immutable but no updated version number', () => { - expect(calculateVersion(true, 1, { description: 'some description change' })).toEqual(1); + expect( + calculateVersion(true, 1, { + description: 'some description change', + falsePositives: undefined, + query: undefined, + language: undefined, + outputIndex: undefined, + savedId: undefined, + timelineId: undefined, + timelineTitle: undefined, + meta: undefined, + filters: [], + from: undefined, + index: undefined, + interval: undefined, + maxSignals: undefined, + riskScore: undefined, + name: undefined, + severity: undefined, + tags: undefined, + threat: undefined, + to: undefined, + type: undefined, + references: undefined, + version: undefined, + note: undefined, + anomalyThreshold: undefined, + machineLearningJobId: undefined, + exceptionsList: [], + }) + ).toEqual(1); }); test('returning an updated version number if given an immutable and an updated version number', () => { - expect(calculateVersion(true, 2, { description: 'some description change' })).toEqual(2); + expect( + calculateVersion(true, 2, { + description: 'some description change', + falsePositives: undefined, + query: undefined, + language: undefined, + outputIndex: undefined, + savedId: undefined, + timelineId: undefined, + timelineTitle: undefined, + meta: undefined, + filters: [], + from: undefined, + index: undefined, + interval: undefined, + maxSignals: undefined, + riskScore: undefined, + name: undefined, + severity: undefined, + tags: undefined, + threat: undefined, + to: undefined, + type: undefined, + references: undefined, + version: undefined, + note: undefined, + anomalyThreshold: undefined, + machineLearningJobId: undefined, + exceptionsList: [], + }) + ).toEqual(2); }); test('returning an updated version number if not given an immutable but but an updated description', () => { - expect(calculateVersion(false, 1, { description: 'some description change' })).toEqual(2); - }); - - test('returning the same version number but a undefined description', () => { - expect(calculateVersion(false, 1, { description: undefined })).toEqual(1); - }); - - test('returning an updated version number if not given an immutable but an updated falsy value', () => { expect( - calculateVersion(false, 1, ({ description: false } as unknown) as PatchRuleParams) + calculateVersion(false, 1, { + description: 'some description change', + falsePositives: undefined, + query: undefined, + language: undefined, + outputIndex: undefined, + savedId: undefined, + timelineId: undefined, + timelineTitle: undefined, + meta: undefined, + filters: [], + from: undefined, + index: undefined, + interval: undefined, + maxSignals: undefined, + riskScore: undefined, + name: undefined, + severity: undefined, + tags: undefined, + threat: undefined, + to: undefined, + type: undefined, + references: undefined, + version: undefined, + note: undefined, + anomalyThreshold: undefined, + machineLearningJobId: undefined, + exceptionsList: [], + }) ).toEqual(2); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts index 7d6091f6b97fa..d40cb5d96669b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts @@ -5,7 +5,35 @@ */ import { pickBy, isEmpty } from 'lodash/fp'; -import { PatchRuleParams } from './types'; +import { + DescriptionOrUndefined, + AnomalyThresholdOrUndefined, + QueryOrUndefined, + LanguageOrUndefined, + SavedIdOrUndefined, + TimelineIdOrUndefined, + TimelineTitleOrUndefined, + MachineLearningJobIdOrUndefined, + IndexOrUndefined, + NoteOrUndefined, + MetaOrUndefined, + VersionOrUndefined, + FalsePositivesOrUndefined, + FromOrUndefined, + OutputIndexOrUndefined, + IntervalOrUndefined, + MaxSignalsOrUndefined, + RiskScoreOrUndefined, + NameOrUndefined, + SeverityOrUndefined, + TagsOrUndefined, + ToOrUndefined, + ThreatOrUndefined, + TypeOrUndefined, + ReferencesOrUndefined, + ListAndOrUndefined, +} from '../../../../common/detection_engine/schemas/common/schemas'; +import { PartialFilter } from '../types'; export const calculateInterval = ( interval: string | undefined, @@ -20,10 +48,40 @@ export const calculateInterval = ( } }; +export interface UpdateProperties { + description: DescriptionOrUndefined; + falsePositives: FalsePositivesOrUndefined; + from: FromOrUndefined; + query: QueryOrUndefined; + language: LanguageOrUndefined; + savedId: SavedIdOrUndefined; + timelineId: TimelineIdOrUndefined; + timelineTitle: TimelineTitleOrUndefined; + meta: MetaOrUndefined; + machineLearningJobId: MachineLearningJobIdOrUndefined; + filters: PartialFilter[]; + index: IndexOrUndefined; + interval: IntervalOrUndefined; + maxSignals: MaxSignalsOrUndefined; + riskScore: RiskScoreOrUndefined; + outputIndex: OutputIndexOrUndefined; + name: NameOrUndefined; + severity: SeverityOrUndefined; + tags: TagsOrUndefined; + threat: ThreatOrUndefined; + to: ToOrUndefined; + type: TypeOrUndefined; + references: ReferencesOrUndefined; + note: NoteOrUndefined; + version: VersionOrUndefined; + exceptionsList: ListAndOrUndefined; + anomalyThreshold: AnomalyThresholdOrUndefined; +} + export const calculateVersion = ( immutable: boolean, currentVersion: number, - updateProperties: Partial> + updateProperties: UpdateProperties ): number => { // early return if we are pre-packaged/immutable rule to be safe. We are never responsible // for changing the version number of an immutable. Immutables are only responsible for changing @@ -44,7 +102,7 @@ export const calculateVersion = ( // the version number if only the enabled/disabled flag is being set. Likewise if we get other // properties we are not expecting such as updatedAt we do not to cause a version number bump // on that either. - const removedNullValues = pickBy( + const removedNullValues = pickBy( (value: unknown) => value != null, updateProperties ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts index 46a16e7dca153..6056e692854af 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts @@ -11,7 +11,7 @@ import { SavedObjectsFindResponse, } from '../../../../../../../../src/core/server'; import { loggingServiceMock } from '../../../../../../../../src/core/server/mocks'; -import { RuleTypeParams, OutputRuleAlertRest } from '../../types'; +import { RuleTypeParams } from '../../types'; import { IRuleStatusAttributes } from '../../rules/types'; import { ruleStatusSavedObjectType } from '../../rules/saved_object_mappings'; @@ -364,34 +364,6 @@ export const sampleDocSearchResultsWithSortId = ( export const sampleRuleGuid = '04128c15-0d1b-4716-a4c5-46997ac7f3bd'; export const sampleIdGuid = 'e1e08ddc-5e37-49ff-a258-5393aa44435a'; -export const sampleRule = (): Partial => { - return { - created_by: 'elastic', - description: 'Detecting root and admin users', - enabled: true, - false_positives: [], - from: 'now-6m', - id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', - immutable: false, - index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], - interval: '5m', - risk_score: 50, - rule_id: 'rule-1', - language: 'kuery', - max_signals: 100, - name: 'Detect Root/Admin Users', - output_index: '.siem-signals', - query: 'user.name: root or user.name: admin', - references: ['http://www.example.com', 'https://ww.example.com'], - severity: 'high', - updated_by: 'elastic', - tags: ['some fake tag 1', 'some fake tag 2'], - to: 'now', - type: 'query', - note: '', - }; -}; - export const exampleRuleStatus: () => SavedObject = () => ({ type: ruleStatusSavedObjectType, id: '042e6d90-7069-11ea-af8b-0f8ae4fa817e', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts index df9d282b71e5e..80c2441193a0c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts @@ -18,7 +18,7 @@ describe('buildBulkBody', () => { jest.clearAllMocks(); }); - test('if bulk body builds well-defined body', () => { + test('bulk body builds well-defined body', () => { const sampleParams = sampleRuleAlertParams(); const fakeSignalSourceHit = buildBulkBody({ doc: sampleDocNoSortId(), @@ -80,6 +80,7 @@ describe('buildBulkBody', () => { references: ['http://google.com'], severity: 'high', tags: ['some fake tag 1', 'some fake tag 2'], + threat: [], throttle: 'no_actions', type: 'query', to: 'now', @@ -128,7 +129,7 @@ describe('buildBulkBody', () => { expect(fakeSignalSourceHit).toEqual(expected); }); - test('if bulk body builds original_event if it exists on the event to begin with', () => { + test('bulk body builds original_event if it exists on the event to begin with', () => { const sampleParams = sampleRuleAlertParams(); const doc = sampleDocNoSortId(); doc._source.event = { @@ -216,6 +217,7 @@ describe('buildBulkBody', () => { created_at: fakeSignalSourceHit.signal.rule?.created_at, updated_at: fakeSignalSourceHit.signal.rule?.updated_at, throttle: 'no_actions', + threat: [], exceptions_list: [ { field: 'source.ip', @@ -254,7 +256,7 @@ describe('buildBulkBody', () => { expect(fakeSignalSourceHit).toEqual(expected); }); - test('if bulk body builds original_event if it exists on the event to begin with but no kind information', () => { + test('bulk body builds original_event if it exists on the event to begin with but no kind information', () => { const sampleParams = sampleRuleAlertParams(); const doc = sampleDocNoSortId(); doc._source.event = { @@ -329,6 +331,7 @@ describe('buildBulkBody', () => { query: 'user.name: root or user.name: admin', references: ['http://google.com'], severity: 'high', + threat: [], tags: ['some fake tag 1', 'some fake tag 2'], type: 'query', to: 'now', @@ -378,7 +381,7 @@ describe('buildBulkBody', () => { expect(fakeSignalSourceHit).toEqual(expected); }); - test('if bulk body builds original_event if it exists on the event to begin with with only kind information', () => { + test('bulk body builds original_event if it exists on the event to begin with with only kind information', () => { const sampleParams = sampleRuleAlertParams(); const doc = sampleDocNoSortId(); doc._source.event = { @@ -447,6 +450,7 @@ describe('buildBulkBody', () => { references: ['http://google.com'], severity: 'high', tags: ['some fake tag 1', 'some fake tag 2'], + threat: [], type: 'query', to: 'now', note: '', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.test.ts index 772ebd932698b..07adfde71c1a9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.test.ts @@ -1147,17 +1147,6 @@ describe('build_exceptions_query', () => { }); describe('buildQueryExceptions', () => { - test('it returns original query if no lists exist', () => { - const query = buildQueryExceptions({ - query: 'host.name: *', - language: 'kuery', - lists: undefined, - }); - const expectedQuery = 'host.name: *'; - - expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); - }); - test('it returns original query if lists is empty array', () => { const query = buildQueryExceptions({ query: 'host.name: *', language: 'kuery', lists: [] }); const expectedQuery = 'host.name: *'; @@ -1165,24 +1154,6 @@ describe('build_exceptions_query', () => { expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); }); - test('it returns original query if lists is null', () => { - const query = buildQueryExceptions({ query: 'host.name: *', language: 'kuery', lists: null }); - const expectedQuery = 'host.name: *'; - - expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); - }); - - test('it returns original query if lists is undefined', () => { - const query = buildQueryExceptions({ - query: 'host.name: *', - language: 'kuery', - lists: undefined, - }); - const expectedQuery = 'host.name: *'; - - expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); - }); - test('it returns expected query when lists exist and language is "kuery"', () => { // Equal to query && !((b || !c || d) && e) -> ((query AND NOT b AND c AND NOT d) OR (query AND NOT e) // https://www.dcode.fr/boolean-expressions-calculator diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.ts index d4efd9a2e8a1a..233b20792299b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_exceptions_query.ts @@ -3,13 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { + ListAndOrUndefined, + Language, + Query, +} from '../../../../common/detection_engine/schemas/common/schemas'; import { ListOperator, ListValues, List, } from '../../../../common/detection_engine/schemas/types/lists_default_array'; -import { Query } from '../../../../../../../src/plugins/data/server'; -import { RuleAlertParams, Language } from '../types'; +import { Query as DataQuery } from '../../../../../../../src/plugins/data/server'; type Operators = 'and' | 'or' | 'not'; type LuceneOperators = 'AND' | 'OR' | 'NOT'; @@ -187,10 +191,10 @@ export const buildQueryExceptions = ({ language, lists, }: { - query: string; + query: Query; language: Language; - lists: RuleAlertParams['exceptionsList']; -}): Query[] => { + lists: ListAndOrUndefined; +}): DataQuery[] => { if (lists && lists !== null) { const exceptions = buildExceptions({ lists, language, query }); const formattedQuery = formatQuery({ exceptions, language, query }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.test.ts index b3586c884d0c7..eb87976a6fbab 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.test.ts @@ -6,7 +6,7 @@ import { buildRule } from './build_rule'; import { sampleRuleAlertParams, sampleRuleGuid } from './__mocks__/es_results'; -import { OutputRuleAlertRest } from '../types'; +import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; describe('buildRule', () => { beforeEach(() => { @@ -40,7 +40,7 @@ describe('buildRule', () => { tags: ['some fake tag 1', 'some fake tag 2'], throttle: 'no_actions', }); - const expected: Partial = { + const expected: Partial = { actions: [], created_by: 'elastic', description: 'Detecting root and admin users', @@ -61,6 +61,7 @@ describe('buildRule', () => { rule_id: 'rule-1', severity: 'high', tags: ['some fake tag 1', 'some fake tag 2'], + threat: [], to: 'now', type: 'query', note: '', @@ -133,7 +134,7 @@ describe('buildRule', () => { tags: ['some fake tag 1', 'some fake tag 2'], throttle: 'no_actions', }); - const expected: Partial = { + const expected: Partial = { actions: [], created_by: 'elastic', description: 'Detecting root and admin users', @@ -154,6 +155,7 @@ describe('buildRule', () => { rule_id: 'rule-1', severity: 'high', tags: ['some fake tag 1', 'some fake tag 2'], + threat: [], to: 'now', type: 'query', note: '', @@ -215,7 +217,7 @@ describe('buildRule', () => { tags: ['some fake tag 1', 'some fake tag 2'], throttle: 'no_actions', }); - const expected: Partial = { + const expected: Partial = { actions: [], created_by: 'elastic', description: 'Detecting root and admin users', @@ -237,6 +239,7 @@ describe('buildRule', () => { rule_id: 'rule-1', severity: 'high', tags: ['some fake tag 1', 'some fake tag 2'], + threat: [], to: 'now', type: 'query', updated_by: 'elastic', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.ts index de8de1bc513e3..bde9c970b0c8c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_rule.ts @@ -5,8 +5,9 @@ */ import { pickBy } from 'lodash/fp'; +import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; -import { RuleTypeParams, OutputRuleAlertRest } from '../types'; +import { RuleTypeParams } from '../types'; interface BuildRuleParams { ruleParams: RuleTypeParams; @@ -36,10 +37,10 @@ export const buildRule = ({ interval, tags, throttle, -}: BuildRuleParams): Partial => { - return pickBy((value: unknown) => value != null, { +}: BuildRuleParams): Partial => { + return pickBy((value: unknown) => value != null, { id, - rule_id: ruleParams.ruleId, + rule_id: ruleParams.ruleId ?? '(unknown rule_id)', actions, false_positives: ruleParams.falsePositives, saved_id: ruleParams.savedId, @@ -67,12 +68,12 @@ export const buildRule = ({ filters: ruleParams.filters, created_by: createdBy, updated_by: updatedBy, - threat: ruleParams.threat, + threat: ruleParams.threat ?? [], throttle, version: ruleParams.version, created_at: createdAt, updated_at: updatedAt, - exceptions_list: ruleParams.exceptionsList, + exceptions_list: ruleParams.exceptionsList ?? [], machine_learning_job_id: ruleParams.machineLearningJobId, anomaly_threshold: ruleParams.anomalyThreshold, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.test.ts index f3f4ab60e4db6..6aebf8815659a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { sampleDocNoSortId, sampleRule } from './__mocks__/es_results'; +import { sampleDocNoSortId } from './__mocks__/es_results'; import { buildSignal, buildAncestor, @@ -13,6 +13,7 @@ import { } from './build_signal'; import { Signal, Ancestor } from './types'; import { INTERNAL_RULE_ID_KEY, INTERNAL_IMMUTABLE_KEY } from '../../../../common/constants'; +import { getPartialRulesSchemaMock } from '../../../../common/detection_engine/schemas/response/rules_schema.mocks'; describe('buildSignal', () => { beforeEach(() => { @@ -22,7 +23,7 @@ describe('buildSignal', () => { test('it builds a signal as expected without original_event if event does not exist', () => { const doc = sampleDocNoSortId('d5e8eb51-a6a0-456d-8a15-4b79bfec3d71'); delete doc._source.event; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const signal = buildSignal(doc, rule); const expected: Signal = { parent: { @@ -82,7 +83,7 @@ describe('buildSignal', () => { kind: 'event', module: 'system', }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const signal = buildSignal(doc, rule); const expected: Signal = { parent: { @@ -148,7 +149,7 @@ describe('buildSignal', () => { kind: 'event', module: 'system', }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); rule.tags = [ 'some fake tag 1', 'some fake tag 2', @@ -220,7 +221,7 @@ describe('buildSignal', () => { kind: 'event', module: 'system', }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const signal = buildAncestor(doc, rule); const expected: Ancestor = { rule: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', @@ -258,7 +259,7 @@ describe('buildSignal', () => { }, ], }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const signal = buildAncestor(doc, rule); const expected: Ancestor = { rule: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', @@ -296,7 +297,7 @@ describe('buildSignal', () => { }, ], }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); rule.tags = [ 'some fake tag 1', 'some fake tag 2', @@ -323,7 +324,7 @@ describe('buildSignal', () => { kind: 'event', module: 'system', }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const signal = buildAncestorsSignal(doc, rule); const expected: Ancestor[] = [ { @@ -363,7 +364,7 @@ describe('buildSignal', () => { }, ], }; - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const signal = buildAncestorsSignal(doc, rule); const expected: Ancestor[] = [ { @@ -385,7 +386,7 @@ describe('buildSignal', () => { }); test('it removes internal tags from a typical rule', () => { - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); rule.tags = [ 'some fake tag 1', 'some fake tag 2', @@ -393,29 +394,29 @@ describe('buildSignal', () => { `${INTERNAL_IMMUTABLE_KEY}:true`, ]; const noInternals = removeInternalTagsFromRule(rule); - expect(noInternals).toEqual(sampleRule()); + expect(noInternals).toEqual(getPartialRulesSchemaMock()); }); test('it works with an empty array', () => { - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); rule.tags = []; const noInternals = removeInternalTagsFromRule(rule); - const expected = sampleRule(); + const expected = getPartialRulesSchemaMock(); expected.tags = []; expect(noInternals).toEqual(expected); }); test('it works if tags does not exist', () => { - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); delete rule.tags; const noInternals = removeInternalTagsFromRule(rule); - const expected = sampleRule(); + const expected = getPartialRulesSchemaMock(); delete expected.tags; expect(noInternals).toEqual(expected); }); test('it works if tags contains normal values and no internal values', () => { - const rule = sampleRule(); + const rule = getPartialRulesSchemaMock(); const noInternals = removeInternalTagsFromRule(rule); expect(noInternals).toEqual(rule); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts index a0551d75d2750..77a63c63ff97a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts @@ -4,14 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; import { INTERNAL_IDENTIFIER } from '../../../../common/constants'; import { SignalSourceHit, Signal, Ancestor } from './types'; -import { OutputRuleAlertRest } from '../types'; -export const buildAncestor = ( - doc: SignalSourceHit, - rule: Partial -): Ancestor => { +export const buildAncestor = (doc: SignalSourceHit, rule: Partial): Ancestor => { const existingSignal = doc._source.signal?.parent; if (existingSignal != null) { return { @@ -34,7 +31,7 @@ export const buildAncestor = ( export const buildAncestorsSignal = ( doc: SignalSourceHit, - rule: Partial + rule: Partial ): Signal['ancestors'] => { const newAncestor = buildAncestor(doc, rule); const existingAncestors = doc._source.signal?.ancestors; @@ -45,7 +42,7 @@ export const buildAncestorsSignal = ( } }; -export const buildSignal = (doc: SignalSourceHit, rule: Partial): Signal => { +export const buildSignal = (doc: SignalSourceHit, rule: Partial): Signal => { const ruleWithoutInternalTags = removeInternalTagsFromRule(rule); const parent = buildAncestor(doc, rule); const ancestors = buildAncestorsSignal(doc, rule); @@ -62,13 +59,11 @@ export const buildSignal = (doc: SignalSourceHit, rule: Partial -): Partial => { +export const removeInternalTagsFromRule = (rule: Partial): Partial => { if (rule.tags == null) { return rule; } else { - const ruleWithoutInternalTags: Partial = { + const ruleWithoutInternalTags: Partial = { ...rule, tags: rule.tags.filter((tag) => !tag.startsWith(INTERNAL_IDENTIFIER)), }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.test.ts index d56e167f59e4c..4e9eb8587484f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.test.ts @@ -21,11 +21,11 @@ describe('filterEventsAgainstList', () => { listClient.getListItemByValues = jest.fn().mockResolvedValue([]); }); - it('should respond with eventSearchResult if exceptionList is empty', async () => { + it('should respond with eventSearchResult if exceptionList is empty array', async () => { const res = await filterEventsAgainstList({ logger: mockLogger, listClient, - exceptionsList: undefined, + exceptionsList: [], eventSearchResult: repeatedSearchResultsWithSortId(4, 4, someGuids.slice(0, 3), [ '1.1.1.1', '2.2.2.2', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.ts index 29b8b54d162df..48b120d1b5806 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/filter_events_with_list.ts @@ -6,15 +6,15 @@ import { get } from 'lodash/fp'; import { Logger } from 'src/core/server'; +import { ListAndOrUndefined } from '../../../../common/detection_engine/schemas/common/schemas'; import { List } from '../../../../common/detection_engine/schemas/types/lists_default_array'; import { type } from '../../../../../lists/common/schemas/common'; import { ListClient } from '../../../../../lists/server'; import { SignalSearchResponse, SearchTypes } from './types'; -import { RuleAlertParams } from '../types'; interface FilterEventsAgainstList { listClient: ListClient; - exceptionsList: RuleAlertParams['exceptionsList']; + exceptionsList: ListAndOrUndefined; logger: Logger; eventSearchResult: SignalSearchResponse; } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.test.ts index 0930fbdb534f5..b1500e47db843 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.test.ts @@ -449,20 +449,6 @@ describe('get_filter', () => { }); }); - test('it should work when lists has value null', () => { - const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*'], null); - expect(esQuery).toEqual({ - bool: { - filter: [ - { bool: { minimum_should_match: 1, should: [{ match: { 'host.name': 'linux' } }] } }, - ], - must: [], - must_not: [], - should: [], - }, - }); - }); - test('it should work when lists has value undefined', () => { const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*'], undefined); expect(esQuery).toEqual({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts index c464238715afd..3e9f79c67d8ca 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/get_filter.ts @@ -4,32 +4,43 @@ * you may not use this file except in compliance with the Elastic License. */ +import { + LanguageOrUndefined, + QueryOrUndefined, + Type, + SavedIdOrUndefined, + IndexOrUndefined, + ListAndOrUndefined, + Language, + Index, + Query, +} from '../../../../common/detection_engine/schemas/common/schemas'; import { AlertServices } from '../../../../../alerts/server'; import { assertUnreachable } from '../../../utils/build_query'; import { Filter, - Query, + Query as DataQuery, esQuery, esFilters, IIndexPattern, } from '../../../../../../../src/plugins/data/server'; -import { PartialFilter, RuleAlertParams, Language } from '../types'; +import { PartialFilter } from '../types'; import { BadRequestError } from '../errors/bad_request_error'; import { buildQueryExceptions } from './build_exceptions_query'; export const getQueryFilter = ( - query: string, + query: Query, language: Language, filters: PartialFilter[], - index: string[], - lists: RuleAlertParams['exceptionsList'] + index: Index, + lists: ListAndOrUndefined ) => { const indexPattern = { fields: [], title: index.join(), } as IIndexPattern; - const queries: Query[] = buildQueryExceptions({ query, language, lists }); + const queries: DataQuery[] = buildQueryExceptions({ query, language, lists }); const config = { allowLeadingWildcards: true, @@ -46,14 +57,14 @@ export const getQueryFilter = ( }; interface GetFilterArgs { - type: RuleAlertParams['type']; - filters: PartialFilter[] | undefined | null; - language: Language | undefined | null; - query: string | undefined | null; - savedId: string | undefined | null; + type: Type; + filters: PartialFilter[] | undefined; + language: LanguageOrUndefined; + query: QueryOrUndefined; + savedId: SavedIdOrUndefined; services: AlertServices; - index: string[] | undefined | null; - lists: RuleAlertParams['exceptionsList']; + index: IndexOrUndefined; + lists: ListAndOrUndefined; } interface QueryAttributes { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/rule_status_service.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/rule_status_service.ts index 9430dfe7bfe23..0f4b8d1472b3f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/rule_status_service.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/rule_status_service.ts @@ -4,8 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { JobStatus } from '../../../../common/detection_engine/schemas/common/schemas'; import { assertUnreachable } from '../../../utils/build_query'; -import { IRuleStatusAttributes, RuleStatusString } from '../rules/types'; +import { IRuleStatusAttributes } from '../rules/types'; import { getOrCreateRuleStatuses } from './get_or_create_rule_statuses'; import { RuleStatusSavedObjectsClient } from './rule_status_saved_objects_client'; @@ -26,7 +27,7 @@ export interface RuleStatusService { } export const buildRuleStatusAttributes: ( - status: RuleStatusString, + status: JobStatus, message?: string, attributes?: Attributes ) => Partial = (status, message, attributes = {}) => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts index b7bea906475db..65679dc23e64f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts @@ -4,10 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ListAndOrUndefined } from '../../../../common/detection_engine/schemas/common/schemas'; import { AlertServices } from '../../../../../alerts/server'; import { ListClient } from '../../../../../lists/server'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; -import { RuleTypeParams, RefreshTypes, RuleAlertParams } from '../types'; +import { RuleTypeParams, RefreshTypes } from '../types'; import { Logger } from '../../../../../../../src/core/server'; import { singleSearchAfter } from './single_search_after'; import { singleBulkCreate } from './single_bulk_create'; @@ -18,7 +19,7 @@ interface SearchAfterAndBulkCreateParams { ruleParams: RuleTypeParams; services: AlertServices; listClient: ListClient | undefined; // TODO: undefined is for temporary development, remove before merged - exceptionsList: RuleAlertParams['exceptionsList']; + exceptionsList: ListAndOrUndefined; logger: Logger; id: string; inputIndexPattern: string[]; @@ -103,6 +104,7 @@ export const searchAfterAndBulkCreate = async ({ try { logger.debug(`sortIds: ${sortId}`); const { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/35546 searchResult, searchDuration, }: { searchResult: SignalSearchResponse; searchDuration: string } = await singleSearchAfter({ @@ -140,7 +142,7 @@ export const searchAfterAndBulkCreate = async ({ // filter out the search results that match with the values found in the list. // the resulting set are valid signals that are not on the allowlist. - const filteredEvents = + const filteredEvents: SignalSearchResponse = listClient != null ? await filterEventsAgainstList({ listClient, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_params_schema.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_params_schema.ts index d42ba8fe57005..461b2589babcc 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_params_schema.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_params_schema.ts @@ -4,40 +4,43 @@ * you may not use this file except in compliance with the Elastic License. */ -import { schema } from '@kbn/config-schema'; +import { schema, TypeOf } from '@kbn/config-schema'; import { DEFAULT_MAX_SIGNALS } from '../../../../common/constants'; +const signalSchema = schema.object({ + anomalyThreshold: schema.maybe(schema.number()), + description: schema.string(), + note: schema.nullable(schema.string()), + falsePositives: schema.arrayOf(schema.string(), { defaultValue: [] }), + from: schema.string(), + ruleId: schema.string(), + immutable: schema.boolean({ defaultValue: false }), + index: schema.nullable(schema.arrayOf(schema.string())), + language: schema.nullable(schema.string()), + outputIndex: schema.nullable(schema.string()), + savedId: schema.nullable(schema.string()), + timelineId: schema.nullable(schema.string()), + timelineTitle: schema.nullable(schema.string()), + meta: schema.nullable(schema.object({}, { unknowns: 'allow' })), + machineLearningJobId: schema.maybe(schema.string()), + query: schema.nullable(schema.string()), + filters: schema.nullable(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + maxSignals: schema.number({ defaultValue: DEFAULT_MAX_SIGNALS }), + riskScore: schema.number(), + severity: schema.string(), + threat: schema.nullable(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + to: schema.string(), + type: schema.string(), + references: schema.arrayOf(schema.string(), { defaultValue: [] }), + version: schema.number({ defaultValue: 1 }), + exceptionsList: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), +}); + /** * This is the schema for the Alert Rule that represents the SIEM alert for signals * that index into the .siem-signals-${space-id} */ -export const signalParamsSchema = () => - schema.object({ - anomalyThreshold: schema.maybe(schema.number()), - description: schema.string(), - note: schema.nullable(schema.string()), - falsePositives: schema.arrayOf(schema.string(), { defaultValue: [] }), - from: schema.string(), - ruleId: schema.string(), - immutable: schema.boolean({ defaultValue: false }), - index: schema.nullable(schema.arrayOf(schema.string())), - language: schema.nullable(schema.string()), - outputIndex: schema.nullable(schema.string()), - savedId: schema.nullable(schema.string()), - timelineId: schema.nullable(schema.string()), - timelineTitle: schema.nullable(schema.string()), - meta: schema.nullable(schema.object({}, { unknowns: 'allow' })), - machineLearningJobId: schema.maybe(schema.string()), - query: schema.nullable(schema.string()), - filters: schema.nullable(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - maxSignals: schema.number({ defaultValue: DEFAULT_MAX_SIGNALS }), - riskScore: schema.number(), - severity: schema.string(), - threat: schema.nullable(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - to: schema.string(), - type: schema.string(), - references: schema.arrayOf(schema.string(), { defaultValue: [] }), - version: schema.number({ defaultValue: 1 }), - exceptionsList: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - }); +export const signalParamsSchema = () => signalSchema; + +export type SignalParamsSchema = TypeOf; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts index f94eb7006829e..a2dc33ba1c2bf 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts @@ -39,8 +39,6 @@ const getPayload = (ruleAlert: RuleAlertType, services: AlertServicesMock) => ({ name: ruleAlert.name, tags: ruleAlert.tags, throttle: ruleAlert.throttle, - scrollSize: 10, - scrollLock: '0', }, state: {}, spaceId: '', @@ -105,7 +103,7 @@ describe('rules_notification_alert_type', () => { attributes: ruleAlert, }); - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; alert = signalRulesAlertType({ logger, @@ -196,7 +194,7 @@ describe('rules_notification_alert_type', () => { describe('ML rule', () => { it('should throw an error if ML plugin was not available', async () => { const ruleAlert = getMlResult(); - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; alert = signalRulesAlertType({ logger, version, @@ -213,7 +211,7 @@ describe('rules_notification_alert_type', () => { it('should throw an error if machineLearningJobId or anomalyThreshold was not null', async () => { const ruleAlert = getMlResult(); ruleAlert.params.anomalyThreshold = undefined; - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; await alert.executor(payload); expect(logger.error).toHaveBeenCalled(); expect(logger.error.mock.calls[0][0]).toContain( @@ -223,7 +221,7 @@ describe('rules_notification_alert_type', () => { it('should throw an error if Machine learning job summary was null', async () => { const ruleAlert = getMlResult(); - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; jobsSummaryMock.mockResolvedValue([]); await alert.executor(payload); expect(logger.warn).toHaveBeenCalled(); @@ -236,7 +234,7 @@ describe('rules_notification_alert_type', () => { it('should log an error if Machine learning job was not started', async () => { const ruleAlert = getMlResult(); - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; jobsSummaryMock.mockResolvedValue([ { id: 'some_job_id', @@ -260,7 +258,7 @@ describe('rules_notification_alert_type', () => { it('should not call ruleStatusService.success if no anomalies were found', async () => { const ruleAlert = getMlResult(); - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; jobsSummaryMock.mockResolvedValue([]); (findMlSignals as jest.Mock).mockResolvedValue({ hits: { @@ -278,7 +276,7 @@ describe('rules_notification_alert_type', () => { it('should call ruleStatusService.success if signals were created', async () => { const ruleAlert = getMlResult(); - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; jobsSummaryMock.mockResolvedValue([ { id: 'some_job_id', @@ -313,7 +311,7 @@ describe('rules_notification_alert_type', () => { id: '99403909-ca9b-49ba-9d7a-7e5320e68d05', }, ]; - payload = getPayload(ruleAlert, alertServices); + payload = getPayload(ruleAlert, alertServices) as jest.Mocked; alertServices.savedObjectsClient.get.mockResolvedValue({ id: 'id', type: 'type', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts index 567274be6a9f8..091ee54e3174e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts @@ -275,7 +275,7 @@ export const signalRulesAlertType = ({ from: fromInMs, to: toInMs, id: savedObject.id, - kibanaSiemAppUrl: meta?.kibana_siem_app_url, + kibanaSiemAppUrl: (meta as { kibana_siem_app_url?: string }).kibana_siem_app_url, }); logger.info( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts index 869c81f640561..082211df28320 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts @@ -4,21 +4,23 @@ * you may not use this file except in compliance with the Elastic License. */ +import { Status } from '../../../../common/detection_engine/schemas/common/schemas'; +import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; import { AlertType, State, AlertExecutorOptions } from '../../../../../alerts/server'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; -import { RuleAlertParams, OutputRuleAlertRest } from '../types'; +import { RuleTypeParams } from '../types'; import { SearchResponse } from '../../types'; export interface SignalsParams { signalIds: string[] | undefined | null; query: object | undefined | null; - status: 'open' | 'closed'; + status: Status; } export interface SignalsStatusParams { signalIds: string[] | undefined | null; query: object | undefined | null; - status: 'open' | 'closed'; + status: Status; } export type SearchTypes = @@ -91,10 +93,7 @@ export type SignalSearchResponse = SearchResponse; export type SignalSourceHit = SignalSearchResponse['hits']['hits'][number]; export type RuleExecutorOptions = Omit & { - params: RuleAlertParams & { - scrollSize: number; - scrollLock: string; - }; + params: RuleTypeParams; }; // This returns true because by default a RuleAlertTypeDefinition is an AlertType @@ -116,12 +115,12 @@ export interface Ancestor { } export interface Signal { - rule: Partial; + rule: Partial; parent: Ancestor; ancestors: Ancestor[]; original_time: string; original_event?: SearchTypes; - status: 'open' | 'closed'; + status: Status; } export interface SignalHit { @@ -145,12 +144,7 @@ export interface AlertAttributes { } export interface RuleAlertAttributes extends AlertAttributes { - params: Omit< - RuleAlertParams, - 'ruleId' | 'name' | 'enabled' | 'interval' | 'tags' | 'actions' | 'throttle' - > & { - ruleId: string; - }; + params: RuleTypeParams; } export type BulkResponseErrorAggregation = Record; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts index 9062de49fa6ce..6e284908e3358 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts @@ -4,131 +4,67 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ListsDefaultArraySchema } from '../../../common/detection_engine/schemas/types/lists_default_array'; +import { + AnomalyThresholdOrUndefined, + Description, + NoteOrUndefined, + ThreatOrUndefined, + FalsePositives, + From, + Immutable, + IndexOrUndefined, + LanguageOrUndefined, + MaxSignals, + MachineLearningJobIdOrUndefined, + RiskScore, + OutputIndex, + QueryOrUndefined, + References, + SavedIdOrUndefined, + Severity, + To, + TimelineIdOrUndefined, + TimelineTitleOrUndefined, + Version, + MetaOrUndefined, + RuleId, + ListAndOrUndefined, +} from '../../../common/detection_engine/schemas/common/schemas'; import { CallAPIOptions } from '../../../../../../src/core/server'; import { Filter } from '../../../../../../src/plugins/data/server'; -import { IRuleStatusAttributes } from './rules/types'; -import { RuleAlertAction, RuleType } from '../../../common/detection_engine/types'; +import { RuleType } from '../../../common/detection_engine/types'; export type PartialFilter = Partial; -export interface IMitreAttack { - id: string; - name: string; - reference: string; -} - -export interface ThreatParams { - framework: string; - tactic: IMitreAttack; - technique: IMitreAttack[]; -} - -// Notice below we are using lists: ListsAndArraySchema[]; which is coming directly from the response output section. -// TODO: Eventually this whole RuleAlertParams will be replaced with io-ts. For now we can slowly strangle it out and reduce duplicate types -// We don't have the input types defined through io-ts just yet but as we being introducing types from there we will more and more remove -// types and share them between input and output schema but have an input Rule Schema and an output Rule Schema. - -export interface Meta { - [key: string]: {} | string | undefined | null; - kibana_siem_app_url?: string | undefined; -} - -export type Language = 'kuery' | 'lucene'; - -export interface RuleAlertParams { - actions: RuleAlertAction[]; - anomalyThreshold: number | undefined; - description: string; - note: string | undefined | null; - enabled: boolean; - falsePositives: string[]; - filters: PartialFilter[] | undefined | null; - from: string; - immutable: boolean; - index: string[] | undefined | null; - interval: string; - ruleId: string | undefined | null; - language: Language | undefined | null; - maxSignals: number; - machineLearningJobId: string | undefined; - riskScore: number; - outputIndex: string; - name: string; - query: string | undefined | null; - references: string[]; - savedId?: string | undefined | null; - meta: Meta | undefined | null; - severity: string; - tags: string[]; - to: string; - timelineId: string | undefined | null; - timelineTitle: string | undefined | null; - threat: ThreatParams[] | undefined | null; +export interface RuleTypeParams { + anomalyThreshold: AnomalyThresholdOrUndefined; + description: Description; + note: NoteOrUndefined; + falsePositives: FalsePositives; + from: From; + ruleId: RuleId; + immutable: Immutable; + index: IndexOrUndefined; + language: LanguageOrUndefined; + outputIndex: OutputIndex; + savedId: SavedIdOrUndefined; + timelineId: TimelineIdOrUndefined; + timelineTitle: TimelineTitleOrUndefined; + meta: MetaOrUndefined; + machineLearningJobId: MachineLearningJobIdOrUndefined; + query: QueryOrUndefined; + filters: PartialFilter[] | undefined; + maxSignals: MaxSignals; + riskScore: RiskScore; + severity: Severity; + threat: ThreatOrUndefined; + to: To; type: RuleType; - version: number; - throttle: string | undefined | null; - exceptionsList: ListsDefaultArraySchema | null | undefined; + references: References; + version: Version; + exceptionsList: ListAndOrUndefined; } -export type RuleTypeParams = Omit< - RuleAlertParams, - 'name' | 'enabled' | 'interval' | 'tags' | 'actions' | 'throttle' ->; - -export type RuleAlertParamsRest = Omit< - RuleAlertParams, - | 'anomalyThreshold' - | 'ruleId' - | 'falsePositives' - | 'immutable' - | 'maxSignals' - | 'exceptionsList' - | 'machineLearningJobId' - | 'savedId' - | 'riskScore' - | 'timelineId' - | 'timelineTitle' - | 'outputIndex' -> & - Omit< - IRuleStatusAttributes, - | 'status' - | 'alertId' - | 'statusDate' - | 'lastFailureAt' - | 'lastSuccessAt' - | 'lastSuccessMessage' - | 'lastFailureMessage' - > & { - anomaly_threshold: RuleAlertParams['anomalyThreshold']; - exceptions_list: RuleAlertParams['exceptionsList']; - rule_id: RuleAlertParams['ruleId']; - false_positives: RuleAlertParams['falsePositives']; - saved_id?: RuleAlertParams['savedId']; - timeline_id: RuleAlertParams['timelineId']; - timeline_title: RuleAlertParams['timelineTitle']; - max_signals: RuleAlertParams['maxSignals']; - machine_learning_job_id: RuleAlertParams['machineLearningJobId']; - risk_score: RuleAlertParams['riskScore']; - output_index: RuleAlertParams['outputIndex']; - created_at: string; - updated_at: string; - status?: IRuleStatusAttributes['status'] | undefined; - status_date?: IRuleStatusAttributes['statusDate'] | undefined; - last_failure_at?: IRuleStatusAttributes['lastFailureAt'] | undefined; - last_success_at?: IRuleStatusAttributes['lastSuccessAt'] | undefined; - last_failure_message?: IRuleStatusAttributes['lastFailureMessage'] | undefined; - last_success_message?: IRuleStatusAttributes['lastSuccessMessage'] | undefined; - }; - -export type OutputRuleAlertRest = RuleAlertParamsRest & { - id: string; - created_by: string | undefined | null; - updated_by: string | undefined | null; - immutable: boolean; -}; - // eslint-disable-next-line @typescript-eslint/no-explicit-any export type CallWithRequest, V> = ( endpoint: string, diff --git a/x-pack/plugins/security_solution/server/lib/types.ts b/x-pack/plugins/security_solution/server/lib/types.ts index 2a897806dc628..ff89512124b66 100644 --- a/x-pack/plugins/security_solution/server/lib/types.ts +++ b/x-pack/plugins/security_solution/server/lib/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AuthenticatedUser } from '../../../security/public'; +import { AuthenticatedUser } from '../../../security/common/model'; import { RequestHandlerContext } from '../../../../../src/core/server'; export { ConfigType as Configuration } from '../config'; diff --git a/x-pack/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.test.ts b/x-pack/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.test.ts index ca2f881d6abd8..a1902202d983d 100644 --- a/x-pack/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.test.ts +++ b/x-pack/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ import { transformDataToNdjson } from './create_stream_from_ndjson'; -import { sampleRule } from '../../lib/detection_engine/signals/__mocks__/es_results'; import { ImportRulesSchemaDecoded } from '../../../common/detection_engine/schemas/request/import_rules_schema'; +import { getRulesSchemaMock } from '../../../common/detection_engine/schemas/response/rules_schema.mocks'; export const getOutputSample = (): Partial => ({ rule_id: 'rule-1', @@ -33,14 +33,14 @@ describe('create_rules_stream_from_ndjson', () => { }); test('single rule will transform with new line ending character for ndjson', () => { - const rule = sampleRule(); + const rule = getRulesSchemaMock(); const ruleNdjson = transformDataToNdjson([rule]); expect(ruleNdjson.endsWith('\n')).toBe(true); }); test('multiple rules will transform with two new line ending characters for ndjson', () => { - const result1 = sampleRule(); - const result2 = sampleRule(); + const result1 = getRulesSchemaMock(); + const result2 = getRulesSchemaMock(); result2.id = 'some other id'; result2.rule_id = 'some other id'; result2.name = 'Some other rule'; @@ -52,8 +52,8 @@ describe('create_rules_stream_from_ndjson', () => { }); test('you can parse two rules back out without errors', () => { - const result1 = sampleRule(); - const result2 = sampleRule(); + const result1 = getRulesSchemaMock(); + const result2 = getRulesSchemaMock(); result2.id = 'some other id'; result2.rule_id = 'some other id'; result2.name = 'Some other rule'; diff --git a/x-pack/plugins/security_solution/server/utils/serialized_query.ts b/x-pack/plugins/security_solution/server/utils/serialized_query.ts index 09b227d8c5a32..357aec1db480b 100644 --- a/x-pack/plugins/security_solution/server/utils/serialized_query.ts +++ b/x-pack/plugins/security_solution/server/utils/serialized_query.ts @@ -7,7 +7,7 @@ import { UserInputError } from 'apollo-server-errors'; import { isEmpty, isPlainObject, isString } from 'lodash/fp'; -import { JsonObject } from '../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../src/plugins/kibana_utils/common'; export const parseFilterQuery = (filterQuery: string): JsonObject => { try { diff --git a/x-pack/plugins/snapshot_restore/public/shared_imports.ts b/x-pack/plugins/snapshot_restore/public/shared_imports.ts index e0024ea8e0c12..cad8ce147bd25 100644 --- a/x-pack/plugins/snapshot_restore/public/shared_imports.ts +++ b/x-pack/plugins/snapshot_restore/public/shared_imports.ts @@ -5,17 +5,17 @@ */ export { - SendRequestConfig, - SendRequestResponse, - UseRequestConfig, - sendRequest, - useRequest, + AuthorizationProvider, CronEditor, DAY, - SectionError, Error, - WithPrivileges, - useAuthorizationContext, NotAuthorizedSection, - AuthorizationProvider, + SectionError, + sendRequest, + SendRequestConfig, + SendRequestResponse, + useAuthorizationContext, + useRequest, + UseRequestConfig, + WithPrivileges, } from '../../../../src/plugins/es_ui_shared/public'; diff --git a/x-pack/plugins/snapshot_restore/server/routes/api/app.ts b/x-pack/plugins/snapshot_restore/server/routes/api/app.ts index f9714bcc02e47..e978fae0af5bc 100644 --- a/x-pack/plugins/snapshot_restore/server/routes/api/app.ts +++ b/x-pack/plugins/snapshot_restore/server/routes/api/app.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { Privileges } from '../../../../../../src/plugins/es_ui_shared/public'; +import { Privileges } from '../../../../../../src/plugins/es_ui_shared/common'; import { APP_REQUIRED_CLUSTER_PRIVILEGES, diff --git a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts index a7428d90b25ee..fa1a81fe080f8 100644 --- a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts +++ b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts @@ -44,7 +44,7 @@ async function getSpacesUsage( spacesAvailable: boolean ) { if (!spacesAvailable) { - return {} as UsageStats; + return null; } const knownFeatureIds = features.getFeatures().map((feature) => feature.id); @@ -76,7 +76,7 @@ async function getSpacesUsage( }); } catch (err) { if (err.status === 404) { - return {} as UsageStats; + return null; } throw err; diff --git a/x-pack/plugins/transform/common/index.ts b/x-pack/plugins/transform/common/index.ts index d7a791e78b3ab..79ff6298a2ca2 100644 --- a/x-pack/plugins/transform/common/index.ts +++ b/x-pack/plugins/transform/common/index.ts @@ -38,3 +38,20 @@ export interface ResultData { export interface TransformEndpointResult { [key: string]: ResultData; } + +export interface DeleteTransformEndpointRequest { + transformsInfo: TransformEndpointRequest[]; + deleteDestIndex?: boolean; + deleteDestIndexPattern?: boolean; +} + +export interface DeleteTransformStatus { + transformDeleted: ResultData; + destIndexDeleted?: ResultData; + destIndexPatternDeleted?: ResultData; + destinationIndex?: string | undefined; +} + +export interface DeleteTransformEndpointResult { + [key: string]: DeleteTransformStatus; +} diff --git a/x-pack/plugins/transform/public/app/components/toast_notification_text.tsx b/x-pack/plugins/transform/public/app/components/toast_notification_text.tsx index 1044081670523..3f664cf8bb09b 100644 --- a/x-pack/plugins/transform/public/app/components/toast_notification_text.tsx +++ b/x-pack/plugins/transform/public/app/components/toast_notification_text.tsx @@ -29,9 +29,14 @@ const MAX_SIMPLE_MESSAGE_LENGTH = 140; interface ToastNotificationTextProps { overlays: CoreStart['overlays']; text: any; + previewTextLength?: number; } -export const ToastNotificationText: FC = ({ overlays, text }) => { +export const ToastNotificationText: FC = ({ + overlays, + text, + previewTextLength, +}) => { if (typeof text === 'string' && text.length <= MAX_SIMPLE_MESSAGE_LENGTH) { return text; } @@ -46,8 +51,9 @@ export const ToastNotificationText: FC = ({ overlays const unformattedText = text.message ? text.message : text; const formattedText = typeof unformattedText === 'object' ? JSON.stringify(text, null, 2) : text; - const previewText = `${formattedText.substring(0, 140)}${ - formattedText.length > 140 ? ' ...' : '' + const textLength = previewTextLength ?? 140; + const previewText = `${formattedText.substring(0, textLength)}${ + formattedText.length > textLength ? ' ...' : '' }`; const openModal = () => { diff --git a/x-pack/plugins/transform/public/app/hooks/index.ts b/x-pack/plugins/transform/public/app/hooks/index.ts index a36550bcd8e57..b439afe2b2165 100644 --- a/x-pack/plugins/transform/public/app/hooks/index.ts +++ b/x-pack/plugins/transform/public/app/hooks/index.ts @@ -6,7 +6,7 @@ export { useApi } from './use_api'; export { useGetTransforms } from './use_get_transforms'; -export { useDeleteTransforms } from './use_delete_transform'; +export { useDeleteTransforms, useDeleteIndexAndTargetIndex } from './use_delete_transform'; export { useStartTransforms } from './use_start_transform'; export { useStopTransforms } from './use_stop_transform'; export { useRequest } from './use_request'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_api.ts b/x-pack/plugins/transform/public/app/hooks/use_api.ts index f3c35d358f1f2..5d7839cf5fba7 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_api.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_api.ts @@ -5,7 +5,12 @@ */ import { useMemo } from 'react'; -import { TransformEndpointRequest, TransformEndpointResult, TransformId } from '../../../common'; +import { + TransformId, + TransformEndpointRequest, + TransformEndpointResult, + DeleteTransformEndpointResult, +} from '../../../common'; import { API_BASE_PATH } from '../../../common/constants'; import { useAppDependencies } from '../app_dependencies'; @@ -40,10 +45,12 @@ export const useApi = () => { }); }, deleteTransforms( - transformsInfo: TransformEndpointRequest[] - ): Promise { + transformsInfo: TransformEndpointRequest[], + deleteDestIndex: boolean | undefined, + deleteDestIndexPattern: boolean | undefined + ): Promise { return http.post(`${API_BASE_PATH}delete_transforms`, { - body: JSON.stringify(transformsInfo), + body: JSON.stringify({ transformsInfo, deleteDestIndex, deleteDestIndexPattern }), }); }, getTransformsPreview(obj: PreviewRequestBody): Promise { diff --git a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx index 0215d723188b1..1f395e67b7d31 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx @@ -4,52 +4,257 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; - +import React, { useCallback, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; - -import { TransformEndpointRequest, TransformEndpointResult } from '../../../common'; - -import { getErrorMessage } from '../../shared_imports'; - +import { + TransformEndpointRequest, + DeleteTransformEndpointResult, + DeleteTransformStatus, +} from '../../../common'; +import { getErrorMessage, extractErrorMessage } from '../../shared_imports'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; import { TransformListRow, refreshTransformList$, REFRESH_TRANSFORM_LIST_STATE } from '../common'; import { ToastNotificationText } from '../components'; - import { useApi } from './use_api'; +import { indexService } from '../services/es_index_service'; + +export const useDeleteIndexAndTargetIndex = (items: TransformListRow[]) => { + const { http, savedObjects } = useAppDependencies(); + const toastNotifications = useToastNotifications(); + + const [deleteDestIndex, setDeleteDestIndex] = useState(true); + const [deleteIndexPattern, setDeleteIndexPattern] = useState(true); + const [userCanDeleteIndex, setUserCanDeleteIndex] = useState(false); + const [indexPatternExists, setIndexPatternExists] = useState(false); + const toggleDeleteIndex = useCallback(() => setDeleteDestIndex(!deleteDestIndex), [ + deleteDestIndex, + ]); + const toggleDeleteIndexPattern = useCallback(() => setDeleteIndexPattern(!deleteIndexPattern), [ + deleteIndexPattern, + ]); + + const checkIndexPatternExists = useCallback( + async (indexName: string) => { + try { + if (await indexService.indexPatternExists(savedObjects.client, indexName)) { + setIndexPatternExists(true); + } + } catch (e) { + const error = extractErrorMessage(e); + + toastNotifications.addDanger( + i18n.translate( + 'xpack.transform.deleteTransform.errorWithCheckingIfIndexPatternExistsNotificationErrorMessage', + { + defaultMessage: + 'An error occurred checking if index pattern {indexPattern} exists: {error}', + values: { indexPattern: indexName, error }, + } + ) + ); + } + }, + [savedObjects.client, toastNotifications] + ); + + const checkUserIndexPermission = useCallback(async () => { + try { + const userCanDelete = await indexService.canDeleteIndex(http); + if (userCanDelete) { + setUserCanDeleteIndex(true); + } + } catch (e) { + toastNotifications.addDanger( + i18n.translate( + 'xpack.transform.transformList.errorWithCheckingIfUserCanDeleteIndexNotificationErrorMessage', + { + defaultMessage: 'An error occurred checking if user can delete destination index', + } + ) + ); + } + }, [http, toastNotifications]); + + useEffect(() => { + checkUserIndexPermission(); + + if (items.length === 1) { + const config = items[0].config; + const destinationIndex = Array.isArray(config.dest.index) + ? config.dest.index[0] + : config.dest.index; + checkIndexPatternExists(destinationIndex); + } else { + setIndexPatternExists(true); + } + }, [checkIndexPatternExists, checkUserIndexPermission, items]); + + return { + userCanDeleteIndex, + deleteDestIndex, + indexPatternExists, + deleteIndexPattern, + toggleDeleteIndex, + toggleDeleteIndexPattern, + }; +}; + +type SuccessCountField = keyof Omit; export const useDeleteTransforms = () => { const { overlays } = useAppDependencies(); const toastNotifications = useToastNotifications(); const api = useApi(); - return async (transforms: TransformListRow[]) => { + return async ( + transforms: TransformListRow[], + shouldDeleteDestIndex: boolean, + shouldDeleteDestIndexPattern: boolean + ) => { const transformsInfo: TransformEndpointRequest[] = transforms.map((tf) => ({ id: tf.config.id, state: tf.stats.state, })); try { - const results: TransformEndpointResult = await api.deleteTransforms(transformsInfo); + const results: DeleteTransformEndpointResult = await api.deleteTransforms( + transformsInfo, + shouldDeleteDestIndex, + shouldDeleteDestIndexPattern + ); + const isBulk = Object.keys(results).length > 1; + const successCount: Record = { + transformDeleted: 0, + destIndexDeleted: 0, + destIndexPatternDeleted: 0, + }; for (const transformId in results) { // hasOwnProperty check to ensure only properties on object itself, and not its prototypes if (results.hasOwnProperty(transformId)) { - if (results[transformId].success === true) { - toastNotifications.addSuccess( - i18n.translate('xpack.transform.transformList.deleteTransformSuccessMessage', { - defaultMessage: 'Request to delete transform {transformId} acknowledged.', - values: { transformId }, - }) - ); + const status = results[transformId]; + const destinationIndex = status.destinationIndex; + + // if we are only deleting one transform, show the success toast messages + if (!isBulk && status.transformDeleted) { + if (status.transformDeleted?.success) { + toastNotifications.addSuccess( + i18n.translate('xpack.transform.transformList.deleteTransformSuccessMessage', { + defaultMessage: 'Request to delete transform {transformId} acknowledged.', + values: { transformId }, + }) + ); + } + if (status.destIndexDeleted?.success) { + toastNotifications.addSuccess( + i18n.translate( + 'xpack.transform.deleteTransform.deleteAnalyticsWithIndexSuccessMessage', + { + defaultMessage: + 'Request to delete destination index {destinationIndex} acknowledged.', + values: { destinationIndex }, + } + ) + ); + } + if (status.destIndexPatternDeleted?.success) { + toastNotifications.addSuccess( + i18n.translate( + 'xpack.transform.deleteTransform.deleteAnalyticsWithIndexPatternSuccessMessage', + { + defaultMessage: + 'Request to delete index pattern {destinationIndex} acknowledged.', + values: { destinationIndex }, + } + ) + ); + } } else { - toastNotifications.addDanger( - i18n.translate('xpack.transform.transformList.deleteTransformErrorMessage', { + (Object.keys(successCount) as SuccessCountField[]).forEach((key) => { + if (status[key]?.success) { + successCount[key] = successCount[key] + 1; + } + }); + } + if (status.transformDeleted?.error) { + const error = extractErrorMessage(status.transformDeleted.error); + toastNotifications.addDanger({ + title: i18n.translate('xpack.transform.transformList.deleteTransformErrorMessage', { defaultMessage: 'An error occurred deleting the transform {transformId}', values: { transformId }, - }) - ); + }), + text: toMountPoint( + + ), + }); } + + if (status.destIndexDeleted?.error) { + const error = extractErrorMessage(status.destIndexDeleted.error); + toastNotifications.addDanger({ + title: i18n.translate( + 'xpack.transform.deleteTransform.deleteAnalyticsWithIndexErrorMessage', + { + defaultMessage: 'An error occurred deleting destination index {destinationIndex}', + values: { destinationIndex }, + } + ), + text: toMountPoint( + + ), + }); + } + + if (status.destIndexPatternDeleted?.error) { + const error = extractErrorMessage(status.destIndexPatternDeleted.error); + toastNotifications.addDanger({ + title: i18n.translate( + 'xpack.transform.deleteTransform.deleteAnalyticsWithIndexPatternErrorMessage', + { + defaultMessage: 'An error occurred deleting index pattern {destinationIndex}', + values: { destinationIndex }, + } + ), + text: toMountPoint( + + ), + }); + } + } + } + + // if we are deleting multiple transforms, combine the success messages + if (isBulk) { + if (successCount.transformDeleted > 0) { + toastNotifications.addSuccess( + i18n.translate('xpack.transform.transformList.bulkDeleteTransformSuccessMessage', { + defaultMessage: + 'Successfully deleted {count} {count, plural, one {transform} other {transforms}}.', + values: { count: successCount.transformDeleted }, + }) + ); + } + + if (successCount.destIndexDeleted > 0) { + toastNotifications.addSuccess( + i18n.translate('xpack.transform.transformList.bulkDeleteDestIndexSuccessMessage', { + defaultMessage: + 'Successfully deleted {count} destination {count, plural, one {index} other {indices}}.', + values: { count: successCount.destIndexDeleted }, + }) + ); + } + if (successCount.destIndexPatternDeleted > 0) { + toastNotifications.addSuccess( + i18n.translate( + 'xpack.transform.transformList.bulkDeleteDestIndexPatternSuccessMessage', + { + defaultMessage: + 'Successfully deleted {count} destination index {count, plural, one {pattern} other {patterns}}.', + values: { count: successCount.destIndexPatternDeleted }, + } + ) + ); } } @@ -59,7 +264,13 @@ export const useDeleteTransforms = () => { title: i18n.translate('xpack.transform.transformList.deleteTransformGenericErrorMessage', { defaultMessage: 'An error occurred calling the API endpoint to delete transforms.', }), - text: toMountPoint(), + text: toMountPoint( + + ), }); } }; diff --git a/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx b/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx index 373faee3b46ed..19ba31d36e6e9 100644 --- a/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx +++ b/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx @@ -74,7 +74,7 @@ export const CloneTransformSection: FC = ({ match }) => { const transformId = match.params.transformId; const [transformConfig, setTransformConfig] = useState(); - const [errorMessage, setErrorMessage] = useState(); + const [errorMessage, setErrorMessage] = useState(); const [isInitialized, setIsInitialized] = useState(false); const { getIndexPatternIdByTitle, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx index 5e5aace4139f0..255a245081d5a 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx @@ -59,11 +59,12 @@ interface Props { transformId: string; transformConfig: any; overrides: StepDetailsExposedState; + timeFieldName?: string | undefined; onChange(s: StepDetailsExposedState): void; } export const StepCreateForm: FC = React.memo( - ({ createIndexPattern, transformConfig, transformId, onChange, overrides }) => { + ({ createIndexPattern, transformConfig, transformId, onChange, overrides, timeFieldName }) => { const defaults = { ...getDefaultStepCreateState(), ...overrides }; const [redirectToTransformManagement, setRedirectToTransformManagement] = useState(false); @@ -187,8 +188,8 @@ export const StepCreateForm: FC = React.memo( Object.assign(newIndexPattern, { id: '', title: indexPatternName, + timeFieldName, }); - const id = await newIndexPattern.create(); await indexPatterns.clearCache(); diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx index afda7bf75fa34..271fde27f519a 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx @@ -23,10 +23,17 @@ import { ToastNotificationText } from '../../../../components'; import { useDocumentationLinks } from '../../../../hooks/use_documentation_links'; import { SearchItems } from '../../../../hooks/use_search_items'; import { useApi } from '../../../../hooks/use_api'; - -import { isTransformIdValid, TransformPivotConfig } from '../../../../common'; +import { StepDetailsTimeField } from './step_details_time_field'; +import { + getPivotQuery, + getPreviewRequestBody, + isTransformIdValid, + TransformPivotConfig, +} from '../../../../common'; import { EsIndexName, IndexPatternTitle } from './common'; import { delayValidator } from '../../../../common/validators'; +import { StepDefineExposedState } from '../step_define/common'; +import { dictionaryToArray } from '../../../../../../common/types/common'; export interface StepDetailsExposedState { continuousModeDateField: string; @@ -38,6 +45,7 @@ export interface StepDetailsExposedState { transformId: TransformId; transformDescription: string; valid: boolean; + indexPatternDateField?: string | undefined; } export function getDefaultStepDetailsState(): StepDetailsExposedState { @@ -51,6 +59,7 @@ export function getDefaultStepDetailsState(): StepDetailsExposedState { destinationIndex: '', touched: false, valid: false, + indexPatternDateField: undefined, }; } @@ -74,10 +83,11 @@ interface Props { overrides?: StepDetailsExposedState; onChange(s: StepDetailsExposedState): void; searchItems: SearchItems; + stepDefineState: StepDefineExposedState; } export const StepDetailsForm: FC = React.memo( - ({ overrides = {}, onChange, searchItems }) => { + ({ overrides = {}, onChange, searchItems, stepDefineState }) => { const deps = useAppDependencies(); const toastNotifications = useToastNotifications(); const { esIndicesCreateIndex } = useDocumentationLinks(); @@ -93,8 +103,28 @@ export const StepDetailsForm: FC = React.memo( ); const [transformIds, setTransformIds] = useState([]); const [indexNames, setIndexNames] = useState([]); + + // Index pattern state const [indexPatternTitles, setIndexPatternTitles] = useState([]); const [createIndexPattern, setCreateIndexPattern] = useState(defaults.createIndexPattern); + const [previewDateColumns, setPreviewDateColumns] = useState([]); + const [indexPatternDateField, setIndexPatternDateField] = useState(); + + const onTimeFieldChanged = React.useCallback( + (e: React.ChangeEvent) => { + const value = e.target.value; + // If the value is an empty string, it's not a valid selection + if (value === '') { + return; + } + // Find the time field based on the selected value + // this is to account for undefined when user chooses not to use a date field + const timeField = previewDateColumns.find((col) => col === value); + + setIndexPatternDateField(timeField); + }, + [setIndexPatternDateField, previewDateColumns] + ); // Continuous mode state const [isContinuousModeEnabled, setContinuousModeEnabled] = useState( @@ -107,6 +137,37 @@ export const StepDetailsForm: FC = React.memo( useEffect(() => { // use an IIFE to avoid returning a Promise to useEffect. (async function () { + try { + const { searchQuery, groupByList, aggList } = stepDefineState; + const pivotAggsArr = dictionaryToArray(aggList); + const pivotGroupByArr = dictionaryToArray(groupByList); + const pivotQuery = getPivotQuery(searchQuery); + const previewRequest = getPreviewRequestBody( + searchItems.indexPattern.title, + pivotQuery, + pivotGroupByArr, + pivotAggsArr + ); + + const transformPreview = await api.getTransformsPreview(previewRequest); + const properties = transformPreview.generated_dest_index.mappings.properties; + const datetimeColumns: string[] = Object.keys(properties).filter( + (col) => properties[col].type === 'date' + ); + + setPreviewDateColumns(datetimeColumns); + setIndexPatternDateField(datetimeColumns[0]); + } catch (e) { + toastNotifications.addDanger({ + title: i18n.translate('xpack.transform.stepDetailsForm.errorGettingTransformPreview', { + defaultMessage: 'An error occurred getting transform preview', + }), + text: toMountPoint( + + ), + }); + } + try { setTransformIds( (await api.getTransforms()).transforms.map( @@ -198,6 +259,7 @@ export const StepDetailsForm: FC = React.memo( destinationIndex, touched: true, valid, + indexPatternDateField, }); // custom comparison /* eslint-disable react-hooks/exhaustive-deps */ @@ -210,6 +272,7 @@ export const StepDetailsForm: FC = React.memo( transformDescription, destinationIndex, valid, + indexPatternDateField, /* eslint-enable react-hooks/exhaustive-deps */ ]); @@ -318,6 +381,7 @@ export const StepDetailsForm: FC = React.memo( data-test-subj="transformDestinationIndexInput" /> + = React.memo( data-test-subj="transformCreateIndexPatternSwitch" /> + {createIndexPattern && !indexPatternTitleExists && previewDateColumns.length > 0 && ( + + )} = React.memo( )} > ({ text }))} + options={dateFieldNames.map((text: string) => ({ text }))} value={continuousModeDateField} onChange={(e) => setContinuousModeDateField(e.target.value)} data-test-subj="transformContinuousDateFieldSelect" diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx index 7d4d25c1d05cf..bd6dc8f709e99 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiFieldText, EuiFormRow } from '@elastic/eui'; +import { EuiFieldText, EuiFormRow, EuiSelect } from '@elastic/eui'; import { StepDetailsExposedState } from './step_details_form'; @@ -21,6 +21,7 @@ export const StepDetailsSummary: FC = React.memo( transformDescription, destinationIndex, touched, + indexPatternDateField, }) => { if (touched === false) { return null; @@ -56,6 +57,21 @@ export const StepDetailsSummary: FC = React.memo( > + + + + {isContinuousModeEnabled && ( ) => void; +} + +export const StepDetailsTimeField: FC = ({ + previewDateColumns, + indexPatternDateField, + onTimeFieldChanged, +}) => { + const noTimeFieldLabel = i18n.translate( + 'xpack.transform.stepDetailsForm.noTimeFieldOptionLabel', + { + defaultMessage: "I don't want to use the Time Filter", + } + ); + + const noTimeFieldOption = { + text: noTimeFieldLabel, + value: undefined, + }; + + const disabledDividerOption = { + disabled: true, + text: '───', + value: '', + }; + + return ( + + } + helpText={ + + } + > + ({ text })), + disabledDividerOption, + noTimeFieldOption, + ]} + value={indexPatternDateField} + onChange={onTimeFieldChanged} + data-test-subj="transformIndexPatternDateFieldSelect" + /> + + ); +}; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx index 5c34eb0d3fdf4..806dcbfa75604 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx @@ -91,6 +91,8 @@ export const CreateTransformWizardContext = createContext<{ indexPattern: IndexP }); export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) => { + const { indexPattern } = searchItems; + // The current WIZARD_STEP const [currentStep, setCurrentStep] = useState(WIZARD_STEPS.DEFINE); @@ -110,6 +112,7 @@ export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) onChange={setStepDetailsState} overrides={stepDetailsState} searchItems={searchItems} + stepDefineState={stepDefineState} /> ) : ( @@ -146,8 +149,6 @@ export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) } }, []); - const { indexPattern } = searchItems; - const transformConfig = getCreateRequestBody( indexPattern.title, stepDefineState, @@ -162,6 +163,7 @@ export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) transformConfig={transformConfig} onChange={setStepCreateState} overrides={stepCreateState} + timeFieldName={stepDetailsState.indexPatternDateField} /> ) : ( diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/action_delete.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/action_delete.tsx index c20feba29f582..d7db55990d333 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/action_delete.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/action_delete.tsx @@ -12,11 +12,14 @@ import { EuiOverlayMask, EuiToolTip, EUI_MODAL_CONFIRM_BUTTON, + EuiFlexGroup, + EuiFlexItem, + EuiSwitch, + EuiSpacer, } from '@elastic/eui'; - +import { FormattedMessage } from '@kbn/i18n/react'; import { TRANSFORM_STATE } from '../../../../../../common'; - -import { useDeleteTransforms } from '../../../../hooks'; +import { useDeleteTransforms, useDeleteIndexAndTargetIndex } from '../../../../hooks'; import { createCapabilityFailureMessage, AuthorizationContext, @@ -35,13 +38,25 @@ export const DeleteAction: FC = ({ items, forceDisable }) => const { canDeleteTransform } = useContext(AuthorizationContext).capabilities; const deleteTransforms = useDeleteTransforms(); + const { + userCanDeleteIndex, + deleteDestIndex, + indexPatternExists, + deleteIndexPattern, + toggleDeleteIndex, + toggleDeleteIndexPattern, + } = useDeleteIndexAndTargetIndex(items); const [isModalVisible, setModalVisible] = useState(false); const closeModal = () => setModalVisible(false); const deleteAndCloseModal = () => { setModalVisible(false); - deleteTransforms(items); + + const shouldDeleteDestIndex = userCanDeleteIndex && deleteDestIndex; + const shouldDeleteDestIndexPattern = + userCanDeleteIndex && indexPatternExists && deleteIndexPattern; + deleteTransforms(items, shouldDeleteDestIndex, shouldDeleteDestIndexPattern); }; const openModal = () => setModalVisible(true); @@ -71,17 +86,96 @@ export const DeleteAction: FC = ({ items, forceDisable }) => defaultMessage: 'Delete {transformId}', values: { transformId: items[0] && items[0].config.id }, }); - const bulkDeleteModalMessage = i18n.translate( - 'xpack.transform.transformList.bulkDeleteModalBody', - { - defaultMessage: - "Are you sure you want to delete {count, plural, one {this} other {these}} {count} {count, plural, one {transform} other {transforms}}? The transform's destination index and optional Kibana index pattern will not be deleted.", - values: { count: items.length }, - } + const bulkDeleteModalContent = ( + <> +

    + +

    + + + { + + } + + + + { + + } + + + + ); + + const deleteModalContent = ( + <> +

    + +

    + + + {userCanDeleteIndex && ( + + )} + + {userCanDeleteIndex && indexPatternExists && ( + + + + + )} + + ); - const deleteModalMessage = i18n.translate('xpack.transform.transformList.deleteModalBody', { - defaultMessage: `Are you sure you want to delete this transform? The transform's destination index and optional Kibana index pattern will not be deleted.`, - }); let deleteButton = ( = ({ items, forceDisable }) => if (disabled || !canDeleteTransform) { let content; if (disabled) { - content = isBulkAction === true ? bulkDeleteButtonDisabledText : deleteButtonDisabledText; + content = isBulkAction ? bulkDeleteButtonDisabledText : deleteButtonDisabledText; } else { content = createCapabilityFailureMessage('canDeleteTransform'); } @@ -117,7 +211,7 @@ export const DeleteAction: FC = ({ items, forceDisable }) => {isModalVisible && ( = ({ items, forceDisable }) => defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON} buttonColor="danger" > -

    {isBulkAction === true ? bulkDeleteModalMessage : deleteModalMessage}

    + {isBulkAction ? bulkDeleteModalContent : deleteModalContent}
    )} diff --git a/x-pack/plugins/transform/public/app/services/es_index_service.ts b/x-pack/plugins/transform/public/app/services/es_index_service.ts new file mode 100644 index 0000000000000..491213d0ddbe7 --- /dev/null +++ b/x-pack/plugins/transform/public/app/services/es_index_service.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { HttpSetup, SavedObjectsClientContract } from 'kibana/public'; +import { API_BASE_PATH } from '../../../common/constants'; +import { IIndexPattern } from '../../../../../../src/plugins/data/common/index_patterns'; + +export class IndexService { + async canDeleteIndex(http: HttpSetup) { + const privilege = await http.get(`${API_BASE_PATH}privileges`); + if (!privilege) { + return false; + } + return privilege.hasAllPrivileges; + } + + async indexPatternExists(savedObjectsClient: SavedObjectsClientContract, indexName: string) { + const response = await savedObjectsClient.find({ + type: 'index-pattern', + perPage: 1, + search: `"${indexName}"`, + searchFields: ['title'], + fields: ['title'], + }); + const ip = response.savedObjects.find((obj) => obj.attributes.title === indexName); + return ip !== undefined; + } +} + +export const indexService = new IndexService(); diff --git a/x-pack/plugins/transform/public/shared_imports.ts b/x-pack/plugins/transform/public/shared_imports.ts index 56be8d7bb7de7..ca3fb52cc02c3 100644 --- a/x-pack/plugins/transform/public/shared_imports.ts +++ b/x-pack/plugins/transform/public/shared_imports.ts @@ -15,6 +15,7 @@ export { export { getErrorMessage, + extractErrorMessage, getDataGridSchemaFromKibanaFieldType, getFieldsFromKibanaIndexPattern, multiColumnSortFactory, diff --git a/x-pack/plugins/transform/server/routes/api/error_utils.ts b/x-pack/plugins/transform/server/routes/api/error_utils.ts index 295375794c04e..5a479e4f429f6 100644 --- a/x-pack/plugins/transform/server/routes/api/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/api/error_utils.ts @@ -10,7 +10,11 @@ import { i18n } from '@kbn/i18n'; import { ResponseError, CustomHttpResponseOptions } from 'src/core/server'; -import { TransformEndpointRequest, TransformEndpointResult } from '../../../common'; +import { + TransformEndpointRequest, + TransformEndpointResult, + DeleteTransformEndpointResult, +} from '../../../common'; const REQUEST_TIMEOUT = 'RequestTimeout'; @@ -19,7 +23,7 @@ export function isRequestTimeout(error: any) { } interface Params { - results: TransformEndpointResult; + results: TransformEndpointResult | DeleteTransformEndpointResult; id: string; items: TransformEndpointRequest[]; action: string; @@ -59,7 +63,7 @@ export function fillResultsWithTimeouts({ results, id, items, action }: Params) }, }; - const newResults: TransformEndpointResult = {}; + const newResults: TransformEndpointResult | DeleteTransformEndpointResult = {}; return items.reduce((accumResults, currentVal) => { if (results[currentVal.id] === undefined) { diff --git a/x-pack/plugins/transform/server/routes/api/schema.ts b/x-pack/plugins/transform/server/routes/api/schema.ts index 0b994406d324d..cf39f2e3829ea 100644 --- a/x-pack/plugins/transform/server/routes/api/schema.ts +++ b/x-pack/plugins/transform/server/routes/api/schema.ts @@ -14,3 +14,17 @@ export const schemaTransformId = { export interface SchemaTransformId { transformId: string; } + +export const deleteTransformSchema = schema.object({ + /** + * Delete Transform & Destination Index + */ + transformsInfo: schema.arrayOf( + schema.object({ + id: schema.string(), + state: schema.maybe(schema.string()), + }) + ), + deleteDestIndex: schema.maybe(schema.boolean()), + deleteDestIndexPattern: schema.maybe(schema.boolean()), +}); diff --git a/x-pack/plugins/transform/server/routes/api/transforms.ts b/x-pack/plugins/transform/server/routes/api/transforms.ts index 55b2469a7f3a7..93fda56d319ad 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms.ts @@ -5,7 +5,12 @@ */ import { schema } from '@kbn/config-schema'; -import { RequestHandler } from 'kibana/server'; +import { + KibanaResponseFactory, + RequestHandler, + RequestHandlerContext, + SavedObjectsClientContract, +} from 'kibana/server'; import { CallCluster } from 'src/legacy/core_plugins/elasticsearch'; import { wrapEsError } from '../../../../../legacy/server/lib/create_router/error_wrappers'; @@ -14,6 +19,9 @@ import { TransformEndpointResult, TransformId, TRANSFORM_STATE, + DeleteTransformEndpointRequest, + DeleteTransformStatus, + ResultData, } from '../../../common'; import { RouteDependencies } from '../../types'; @@ -21,8 +29,9 @@ import { RouteDependencies } from '../../types'; import { addBasePath } from '../index'; import { isRequestTimeout, fillResultsWithTimeouts, wrapError } from './error_utils'; -import { schemaTransformId, SchemaTransformId } from './schema'; +import { deleteTransformSchema, schemaTransformId, SchemaTransformId } from './schema'; import { registerTransformsAuditMessagesRoutes } from './transforms_audit_messages'; +import { IIndexPattern } from '../../../../../../src/plugins/data/common/index_patterns'; enum TRANSFORM_ACTIONS { STOP = 'stop', @@ -173,15 +182,37 @@ export function registerTransformsRoutes(routeDependencies: RouteDependencies) { { path: addBasePath('delete_transforms'), validate: { - body: schema.maybe(schema.any()), + body: deleteTransformSchema, }, }, license.guardApiRoute(async (ctx, req, res) => { - const transformsInfo = req.body as TransformEndpointRequest[]; + const { + transformsInfo, + deleteDestIndex, + deleteDestIndexPattern, + } = req.body as DeleteTransformEndpointRequest; try { + const body = await deleteTransforms( + transformsInfo, + deleteDestIndex, + deleteDestIndexPattern, + ctx, + license, + res + ); + + if (body && body.status) { + if (body.status === 404) { + return res.notFound(); + } + if (body.status === 403) { + return res.forbidden(); + } + } + return res.ok({ - body: await deleteTransforms(transformsInfo, ctx.transform!.dataClient.callAsCurrentUser), + body, }); } catch (e) { return res.customError(wrapError(wrapEsError(e))); @@ -238,18 +269,51 @@ const getTransforms = async (options: { transformId?: string }, callAsCurrentUse return await callAsCurrentUser('transform.getTransforms', options); }; +async function getIndexPatternId( + indexName: string, + savedObjectsClient: SavedObjectsClientContract +) { + const response = await savedObjectsClient.find({ + type: 'index-pattern', + perPage: 1, + search: `"${indexName}"`, + searchFields: ['title'], + fields: ['title'], + }); + const ip = response.saved_objects.find((obj) => obj.attributes.title === indexName); + return ip?.id; +} + +async function deleteDestIndexPatternById( + indexPatternId: string, + savedObjectsClient: SavedObjectsClientContract +) { + return await savedObjectsClient.delete('index-pattern', indexPatternId); +} + async function deleteTransforms( transformsInfo: TransformEndpointRequest[], - callAsCurrentUser: CallCluster + deleteDestIndex: boolean | undefined, + deleteDestIndexPattern: boolean | undefined, + ctx: RequestHandlerContext, + license: RouteDependencies['license'], + response: KibanaResponseFactory ) { - const results: TransformEndpointResult = {}; + const tempResults: TransformEndpointResult = {}; + const results: Record = {}; for (const transformInfo of transformsInfo) { + let destinationIndex: string | undefined; + const transformDeleted: ResultData = { success: false }; + const destIndexDeleted: ResultData = { success: false }; + const destIndexPatternDeleted: ResultData = { + success: false, + }; const transformId = transformInfo.id; try { if (transformInfo.state === TRANSFORM_STATE.FAILED) { try { - await callAsCurrentUser('transform.stopTransform', { + await ctx.transform!.dataClient.callAsCurrentUser('transform.stopTransform', { transformId, force: true, waitForCompletion: true, @@ -257,7 +321,7 @@ async function deleteTransforms( } catch (e) { if (isRequestTimeout(e)) { return fillResultsWithTimeouts({ - results, + results: tempResults, id: transformId, items: transformsInfo, action: TRANSFORM_ACTIONS.DELETE, @@ -265,9 +329,75 @@ async function deleteTransforms( } } } + // Grab destination index info to delete + try { + const transformConfigs = await getTransforms( + { transformId }, + ctx.transform!.dataClient.callAsCurrentUser + ); + const transformConfig = transformConfigs.transforms[0]; + destinationIndex = Array.isArray(transformConfig.dest.index) + ? transformConfig.dest.index[0] + : transformConfig.dest.index; + } catch (getTransformConfigError) { + transformDeleted.error = wrapError(getTransformConfigError); + results[transformId] = { + transformDeleted, + destIndexDeleted, + destIndexPatternDeleted, + destinationIndex, + }; + continue; + } + + // If user checks box to delete the destinationIndex associated with the job + if (destinationIndex && deleteDestIndex) { + try { + // If user does have privilege to delete the index, then delete the index + // if no permission then return 403 forbidden + await ctx.transform!.dataClient.callAsCurrentUser('indices.delete', { + index: destinationIndex, + }); + destIndexDeleted.success = true; + } catch (deleteIndexError) { + destIndexDeleted.error = wrapError(deleteIndexError); + } + } + + // Delete the index pattern if there's an index pattern that matches the name of dest index + if (destinationIndex && deleteDestIndexPattern) { + try { + const indexPatternId = await getIndexPatternId( + destinationIndex, + ctx.core.savedObjects.client + ); + if (indexPatternId) { + await deleteDestIndexPatternById(indexPatternId, ctx.core.savedObjects.client); + destIndexPatternDeleted.success = true; + } + } catch (deleteDestIndexPatternError) { + destIndexPatternDeleted.error = wrapError(deleteDestIndexPatternError); + } + } - await callAsCurrentUser('transform.deleteTransform', { transformId }); - results[transformId] = { success: true }; + try { + await ctx.transform!.dataClient.callAsCurrentUser('transform.deleteTransform', { + transformId, + }); + transformDeleted.success = true; + } catch (deleteTransformJobError) { + transformDeleted.error = wrapError(deleteTransformJobError); + if (transformDeleted.error.statusCode === 403) { + return response.forbidden(); + } + } + + results[transformId] = { + transformDeleted, + destIndexDeleted, + destIndexPatternDeleted, + destinationIndex, + }; } catch (e) { if (isRequestTimeout(e)) { return fillResultsWithTimeouts({ @@ -277,7 +407,7 @@ async function deleteTransforms( action: TRANSFORM_ACTIONS.DELETE, }); } - results[transformId] = { success: false, error: JSON.stringify(e) }; + results[transformId] = { transformDeleted: { success: false, error: JSON.stringify(e) } }; } } return results; diff --git a/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts b/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts index e82ebd9a5a4ad..0d6e9743f0f4b 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts @@ -13,9 +13,7 @@ import { mount } from 'enzyme'; import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers'; import { CustomTimeRangeAction } from './custom_time_range_action'; /* eslint-disable */ -import { - HelloWorldContainer, -} from '../../../../src/plugins/embeddable/public/lib/test_samples'; +import { HelloWorldContainer } from '../../../../src/plugins/embeddable/public/lib/test_samples'; /* eslint-enable */ import { diff --git a/x-pack/plugins/uptime/public/components/common/charts/donut_chart.tsx b/x-pack/plugins/uptime/public/components/common/charts/donut_chart.tsx index 7f08d5c00bcdc..b4d6864423dfc 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/donut_chart.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/donut_chart.tsx @@ -76,7 +76,7 @@ export const DonutChart = ({ height, down, up, width }: DonutChartProps) => { .innerRadius(width * 0.28) .outerRadius(Math.min(width, height) / 2 - 10) ) - .attr('fill', (d: any) => color(d.data.key)); + .attr('fill', (d: any) => color(d.data.key) as any); } }, [danger, down, gray, height, upCount, width]); diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx index ca9e1376aac4f..fc5d62030b803 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx @@ -85,7 +85,7 @@ export const WatchActionsAccordion: React.FunctionComponent = ({ if (actions && actions.length >= 1) { return actions.map((action: any) => { - const FieldsComponent = actionFieldsComponentMap[action.type]; + const FieldsComponent = actionFieldsComponentMap[action.type] as any; const errors = actionErrors[action.id]; const hasErrors = !!Object.keys(errors).find((errorKey) => errors[errorKey].length >= 1); diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index c120e1f780761..37b22a687741e 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -6,7 +6,7 @@ const alwaysImportedTests = [ require.resolve('../test/functional/config.js'), - require.resolve('../test/functional_endpoint/config.ts'), + require.resolve('../test/security_solution_endpoint/config.ts'), require.resolve('../test/functional_with_es_ssl/config.ts'), require.resolve('../test/functional/config_security_basic.ts'), require.resolve('../test/functional/config_security_trial.ts'), diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json index 128b75aaa0509..50016592ba1ac 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json index b1076437ef37f..84e4783072f31 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json index 53abf490ad376..7796538997de1 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json index be3b542ed7b52..5b486da23c9e4 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "3.9.5" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/api_integration/apis/endpoint/alerts/index.ts b/x-pack/test/api_integration/apis/endpoint/alerts/index.ts index 9ad83f509fc50..d0580c1fdca9a 100644 --- a/x-pack/test/api_integration/apis/endpoint/alerts/index.ts +++ b/x-pack/test/api_integration/apis/endpoint/alerts/index.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect/expect.js'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { AlertData } from '../../../../../plugins/security_solution/common/endpoint_alerts/types'; -import { AlertId } from '../../../../../plugins/security_solution/server/endpoint/alerts/handlers/lib/index'; +import { deleteEventsStream, deleteMetadataStream } from '../data_stream_helper'; /** * The number of alert documents in the es archive. @@ -66,26 +66,25 @@ export default function ({ getService }: FtrProviderContext) { const nextPrevPrefixOrder = 'order=desc'; const nextPrevPrefixPageSize = 'page_size=10'; const nextPrevPrefix = `${nextPrevPrefixQuery}&${nextPrevPrefixDateRange}&${nextPrevPrefixSort}&${nextPrevPrefixOrder}&${nextPrevPrefixPageSize}`; - const alertIndex = 'events-endpoint-1'; let nullableEventId = ''; - // SKIPPED as it is failing ES PROMOTION: https://github.com/elastic/kibana/issues/68613 - describe.skip('Endpoint alert API', () => { + describe('Endpoint alert API', () => { describe('when data is in elasticsearch', () => { before(async () => { - await esArchiver.load('endpoint/alerts/api_feature'); - await esArchiver.load('endpoint/alerts/host_api_feature'); + await esArchiver.load('endpoint/alerts/api_feature', { useCreate: true }); + await esArchiver.load('endpoint/alerts/host_api_feature', { useCreate: true }); const res = await es.search({ - index: alertIndex, + index: 'events-endpoint-*', body: ES_QUERY_MISSING, }); nullableEventId = res.hits.hits[0]._source.event.id; }); after(async () => { - await esArchiver.unload('endpoint/alerts/api_feature'); - await esArchiver.unload('endpoint/alerts/host_api_feature'); + // the endpoint uses data streams and es archiver does not support deleting them at the moment so we need + // to do it manually + await Promise.all([deleteEventsStream(getService), deleteMetadataStream(getService)]); }); it('should not support POST requests', async () => { @@ -375,40 +374,6 @@ export default function ({ getService }: FtrProviderContext) { expect(body.result_from_index).to.eql(0); }); - it('should return alert details by id, getting last alert', async () => { - const documentID = new AlertId(alertIndex, 'zbNm0HABdD75WLjLYgcB'); - const prevDocumentID = new AlertId(alertIndex, '2rNm0HABdD75WLjLYgcU'); - const { body } = await supertest - .get(`/api/endpoint/alerts/${documentID.toString()}`) - .set('kbn-xsrf', 'xxx') - .expect(200); - expect(body.id).to.eql(documentID.toString()); - expect(body.prev).to.eql(`/api/endpoint/alerts/${prevDocumentID.toString()}`); - expect(body.next).to.eql(null); // last alert, no more beyond this - expect(body.state.host_metadata.host.id).to.eql(body.host.id); - }); - - it('should return alert details by id, getting first alert', async () => { - const documentID = new AlertId(alertIndex, 'p7Nm0HABdD75WLjLYghv'); - const nextDocumentID = new AlertId(alertIndex, 'mbNm0HABdD75WLjLYgho'); - const { body } = await supertest - .get(`/api/endpoint/alerts/${documentID.toString()}`) - .set('kbn-xsrf', 'xxx') - .expect(200); - expect(body.id).to.eql(documentID.toString()); - expect(body.next).to.eql(`/api/endpoint/alerts/${nextDocumentID.toString()}`); - expect(body.prev).to.eql(null); // first alert, no more before this - }); - - it('should return 404 when alert is not found', async () => { - const documentID = new AlertId(alertIndex, 'does-not-exit'); - - await supertest - .get(`/api/endpoint/alerts/${documentID.toString()}`) - .set('kbn-xsrf', 'xxx') - .expect(404); - }); - it('should return 400 when alert id is not valid', async () => { await supertest .get('/api/endpoint/alerts/does-not-exist') diff --git a/x-pack/test/api_integration/apis/endpoint/data_stream_helper.ts b/x-pack/test/api_integration/apis/endpoint/data_stream_helper.ts new file mode 100644 index 0000000000000..bb8fbd4f296f8 --- /dev/null +++ b/x-pack/test/api_integration/apis/endpoint/data_stream_helper.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { Client } from '@elastic/elasticsearch'; + +export async function deleteDataStream(getService: (serviceName: 'es') => Client, index: string) { + const client = getService('es'); + await client.transport.request( + { + method: 'DELETE', + path: `_data_stream/${index}`, + }, + { + ignore: [404], + } + ); +} + +export async function deleteMetadataStream(getService: (serviceName: 'es') => Client) { + await deleteDataStream(getService, 'metrics-endpoint.metadata-*'); +} + +export async function deleteEventsStream(getService: (serviceName: 'es') => Client) { + await deleteDataStream(getService, 'events-endpoint-*'); +} + +export async function deletePolicyStream(getService: (serviceName: 'es') => Client) { + await deleteDataStream(getService, 'metrics-endpoint.policy-*'); +} diff --git a/x-pack/test/api_integration/apis/endpoint/metadata.ts b/x-pack/test/api_integration/apis/endpoint/metadata.ts index e48db70fd0124..6c6db10729ab6 100644 --- a/x-pack/test/api_integration/apis/endpoint/metadata.ts +++ b/x-pack/test/api_integration/apis/endpoint/metadata.ts @@ -5,6 +5,7 @@ */ import expect from '@kbn/expect/expect.js'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { deleteMetadataStream } from './data_stream_helper'; /** * The number of host documents in the es archive. @@ -14,11 +15,12 @@ const numberOfHostsInFixture = 3; export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); - // SKIPPED as it is failing on ES PROMOTION: https://github.com/elastic/kibana/issues/68584 - describe.skip('test metadata api', () => { + describe('test metadata api', () => { describe('POST /api/endpoint/metadata when index is empty', () => { it('metadata api should return empty result when index is empty', async () => { - await esArchiver.unload('endpoint/metadata/api_feature'); + // the endpoint uses data streams and es archiver does not support deleting them at the moment so we need + // to do it manually + await deleteMetadataStream(getService); const { body } = await supertest .post('/api/endpoint/metadata') .set('kbn-xsrf', 'xxx') @@ -32,8 +34,12 @@ export default function ({ getService }: FtrProviderContext) { }); describe('POST /api/endpoint/metadata when index is not empty', () => { - before(() => esArchiver.load('endpoint/metadata/api_feature')); - after(() => esArchiver.unload('endpoint/metadata/api_feature')); + before( + async () => await esArchiver.load('endpoint/metadata/api_feature', { useCreate: true }) + ); + // the endpoint uses data streams and es archiver does not support deleting them at the moment so we need + // to do it manually + after(async () => await deleteMetadataStream(getService)); it('metadata api should return one entry for each host with default paging', async () => { const { body } = await supertest .post('/api/endpoint/metadata') diff --git a/x-pack/test/api_integration/apis/endpoint/policy.ts b/x-pack/test/api_integration/apis/endpoint/policy.ts index c3e95f2db1bc0..711762cc20abb 100644 --- a/x-pack/test/api_integration/apis/endpoint/policy.ts +++ b/x-pack/test/api_integration/apis/endpoint/policy.ts @@ -6,16 +6,18 @@ import expect from '@kbn/expect/expect.js'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { deletePolicyStream } from './data_stream_helper'; export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); - // SKIPPED as it is failing ES PROMOTION: https://github.com/elastic/kibana/issues/68638 - describe.skip('Endpoint policy api', () => { + describe('Endpoint policy api', () => { describe('GET /api/endpoint/policy_response', () => { - before(async () => await esArchiver.load('endpoint/policy')); + before(async () => await esArchiver.load('endpoint/policy', { useCreate: true })); - after(async () => await esArchiver.unload('endpoint/policy')); + // the endpoint uses data streams and es archiver does not support deleting them at the moment so we need + // to do it manually + after(async () => await deletePolicyStream(getService)); it('should return one policy response for host', async () => { const expectedHostId = '4f3b9858-a96d-49d8-a326-230d7763d767'; diff --git a/x-pack/test/api_integration/apis/endpoint/resolver.ts b/x-pack/test/api_integration/apis/endpoint/resolver.ts index 43f42f700a4c8..650585293dadf 100644 --- a/x-pack/test/api_integration/apis/endpoint/resolver.ts +++ b/x-pack/test/api_integration/apis/endpoint/resolver.ts @@ -216,6 +216,7 @@ export default function resolverAPIIntegrationTests({ getService }: FtrProviderC }); after(async () => { await resolver.deleteTrees(resolverTrees); + // this unload is for an endgame-* index so it does not use data streams await esArchiver.unload('endpoint/resolver/api_feature'); }); diff --git a/x-pack/test/api_integration/apis/fleet/setup.ts b/x-pack/test/api_integration/apis/fleet/setup.ts index bfcd7df702648..4fcf39886e202 100644 --- a/x-pack/test/api_integration/apis/fleet/setup.ts +++ b/x-pack/test/api_integration/apis/fleet/setup.ts @@ -56,8 +56,15 @@ export default function ({ getService }: FtrProviderContext) { cluster: ['monitor', 'manage_api_key'], indices: [ { - names: ['logs-*', 'metrics-*', 'events-*'], - privileges: ['write', 'create_index'], + names: [ + 'logs-*', + 'metrics-*', + 'events-*', + '.ds-logs-*', + '.ds-metrics-*', + '.ds-events-*', + ], + privileges: ['write', 'create_index', 'indices:admin/auto_create'], allow_restricted_indices: false, }, ], diff --git a/x-pack/test/api_integration/apis/index.js b/x-pack/test/api_integration/apis/index.js index 2719486d0c502..b79dc3f3ffe59 100644 --- a/x-pack/test/api_integration/apis/index.js +++ b/x-pack/test/api_integration/apis/index.js @@ -30,5 +30,6 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./ingest_manager')); loadTestFile(require.resolve('./endpoint')); loadTestFile(require.resolve('./ml')); + loadTestFile(require.resolve('./transform')); }); } diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts index 23bff0d0c2855..dc0ccfdc53a18 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts @@ -197,7 +197,7 @@ export default ({ getService }: FtrProviderContext) => { await ml.testResources.deleteIndexPattern(destinationIndex); }); - it('deletes job, target index, and index pattern by id', async () => { + it('should delete job, target index, and index pattern by id', async () => { const { body } = await supertest .delete(`/api/ml/data_frame/analytics/${analyticsId}`) .query({ deleteDestIndex: true, deleteDestIndexPattern: true }) diff --git a/x-pack/test/api_integration/apis/transform/delete_transforms.ts b/x-pack/test/api_integration/apis/transform/delete_transforms.ts new file mode 100644 index 0000000000000..40300c981ee2e --- /dev/null +++ b/x-pack/test/api_integration/apis/transform/delete_transforms.ts @@ -0,0 +1,318 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import expect from '@kbn/expect'; +import { TransformEndpointRequest } from '../../../../plugins/transform/common'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { COMMON_REQUEST_HEADERS } from '../../../functional/services/ml/common'; +import { USER } from '../../../functional/services/transform/security_common'; + +async function asyncForEach(array: any[], callback: Function) { + for (let index = 0; index < array.length; index++) { + await callback(array[index], index, array); + } +} + +// eslint-disable-next-line import/no-default-export +export default ({ getService }: FtrProviderContext) => { + const esArchiver = getService('esArchiver'); + const supertest = getService('supertestWithoutAuth'); + const transform = getService('transform'); + + function generateDestIndex(transformId: string): string { + return `user-${transformId}`; + } + + async function createTransform(transformId: string, destinationIndex: string) { + const config = { + id: transformId, + source: { index: ['farequote-*'] }, + pivot: { + group_by: { airline: { terms: { field: 'airline' } } }, + aggregations: { '@timestamp.value_count': { value_count: { field: '@timestamp' } } }, + }, + dest: { index: destinationIndex }, + }; + + await transform.api.createTransform(config); + } + + describe('delete_transforms', function () { + before(async () => { + await esArchiver.loadIfNeeded('ml/farequote'); + await transform.testResources.setKibanaTimeZoneToUTC(); + }); + + after(async () => { + await transform.api.cleanTransformIndices(); + }); + + describe('single transform deletion', function () { + const transformId = 'test1'; + const destinationIndex = generateDestIndex(transformId); + + beforeEach(async () => { + await createTransform(transformId, destinationIndex); + await transform.api.createIndices(destinationIndex); + }); + + afterEach(async () => { + await transform.api.deleteIndices(destinationIndex); + }); + + it('should delete transform by transformId', async () => { + const transformsInfo: TransformEndpointRequest[] = [{ id: transformId }]; + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + }) + .expect(200); + + expect(body[transformId].transformDeleted.success).to.eql(true); + expect(body[transformId].destIndexDeleted.success).to.eql(false); + expect(body[transformId].destIndexPatternDeleted.success).to.eql(false); + await transform.api.waitForTransformNotToExist(transformId); + await transform.api.waitForIndicesToExist(destinationIndex); + }); + + it('should return 403 for unauthorized user', async () => { + const transformsInfo: TransformEndpointRequest[] = [{ id: transformId }]; + await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_VIEWER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_VIEWER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + }) + .expect(403); + await transform.api.waitForTransformToExist(transformId); + await transform.api.waitForIndicesToExist(destinationIndex); + }); + }); + + describe('single transform deletion with invalid transformId', function () { + it('should return 200 with error in response if invalid transformId', async () => { + const transformsInfo: TransformEndpointRequest[] = [{ id: 'invalid_transform_id' }]; + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + }) + .expect(200); + expect(body.invalid_transform_id.transformDeleted.success).to.eql(false); + expect(body.invalid_transform_id.transformDeleted).to.have.property('error'); + }); + }); + + describe('bulk deletion', function () { + const transformsInfo: TransformEndpointRequest[] = [ + { id: 'bulk_delete_test_1' }, + { id: 'bulk_delete_test_2' }, + ]; + const destinationIndices = transformsInfo.map((d) => generateDestIndex(d.id)); + + beforeEach(async () => { + await asyncForEach(transformsInfo, async ({ id }: { id: string }, idx: number) => { + await createTransform(id, destinationIndices[idx]); + await transform.api.createIndices(destinationIndices[idx]); + }); + }); + + afterEach(async () => { + await asyncForEach(destinationIndices, async (destinationIndex: string) => { + await transform.api.deleteIndices(destinationIndex); + }); + }); + + it('should delete multiple transforms by transformIds', async () => { + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + }) + .expect(200); + + await asyncForEach( + transformsInfo, + async ({ id: transformId }: { id: string }, idx: number) => { + expect(body[transformId].transformDeleted.success).to.eql(true); + expect(body[transformId].destIndexDeleted.success).to.eql(false); + expect(body[transformId].destIndexPatternDeleted.success).to.eql(false); + await transform.api.waitForTransformNotToExist(transformId); + await transform.api.waitForIndicesToExist(destinationIndices[idx]); + } + ); + }); + + it('should delete multiple transforms by transformIds, even if one of the transformIds is invalid', async () => { + const invalidTransformId = 'invalid_transform_id'; + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo: [ + { id: transformsInfo[0].id }, + { id: invalidTransformId }, + { id: transformsInfo[1].id }, + ], + }) + .expect(200); + + await asyncForEach( + transformsInfo, + async ({ id: transformId }: { id: string }, idx: number) => { + expect(body[transformId].transformDeleted.success).to.eql(true); + expect(body[transformId].destIndexDeleted.success).to.eql(false); + expect(body[transformId].destIndexPatternDeleted.success).to.eql(false); + await transform.api.waitForTransformNotToExist(transformId); + await transform.api.waitForIndicesToExist(destinationIndices[idx]); + } + ); + + expect(body[invalidTransformId].transformDeleted.success).to.eql(false); + expect(body[invalidTransformId].transformDeleted).to.have.property('error'); + }); + }); + + describe('with deleteDestIndex setting', function () { + const transformId = 'test2'; + const destinationIndex = generateDestIndex(transformId); + + before(async () => { + await createTransform(transformId, destinationIndex); + await transform.api.createIndices(destinationIndex); + }); + + after(async () => { + await transform.api.deleteIndices(destinationIndex); + }); + + it('should delete transform and destination index', async () => { + const transformsInfo: TransformEndpointRequest[] = [{ id: transformId }]; + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + deleteDestIndex: true, + }) + .expect(200); + + expect(body[transformId].transformDeleted.success).to.eql(true); + expect(body[transformId].destIndexDeleted.success).to.eql(true); + expect(body[transformId].destIndexPatternDeleted.success).to.eql(false); + await transform.api.waitForTransformNotToExist(transformId); + await transform.api.waitForIndicesNotToExist(destinationIndex); + }); + }); + + describe('with deleteDestIndexPattern setting', function () { + const transformId = 'test3'; + const destinationIndex = generateDestIndex(transformId); + + before(async () => { + await createTransform(transformId, destinationIndex); + await transform.api.createIndices(destinationIndex); + await transform.testResources.createIndexPatternIfNeeded(destinationIndex); + }); + + after(async () => { + await transform.api.deleteIndices(destinationIndex); + await transform.testResources.deleteIndexPattern(destinationIndex); + }); + + it('should delete transform and destination index pattern', async () => { + const transformsInfo: TransformEndpointRequest[] = [{ id: transformId }]; + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + deleteDestIndex: false, + deleteDestIndexPattern: true, + }) + .expect(200); + + expect(body[transformId].transformDeleted.success).to.eql(true); + expect(body[transformId].destIndexDeleted.success).to.eql(false); + expect(body[transformId].destIndexPatternDeleted.success).to.eql(true); + await transform.api.waitForTransformNotToExist(transformId); + await transform.api.waitForIndicesToExist(destinationIndex); + await transform.testResources.assertIndexPatternNotExist(destinationIndex); + }); + }); + + describe('with deleteDestIndex & deleteDestIndexPattern setting', function () { + const transformId = 'test4'; + const destinationIndex = generateDestIndex(transformId); + + before(async () => { + await createTransform(transformId, destinationIndex); + await transform.api.createIndices(destinationIndex); + await transform.testResources.createIndexPatternIfNeeded(destinationIndex); + }); + + after(async () => { + await transform.api.deleteIndices(destinationIndex); + await transform.testResources.deleteIndexPattern(destinationIndex); + }); + + it('should delete transform, destination index, & destination index pattern', async () => { + const transformsInfo: TransformEndpointRequest[] = [{ id: transformId }]; + const { body } = await supertest + .post(`/api/transform/delete_transforms`) + .auth( + USER.TRANSFORM_POWERUSER, + transform.securityCommon.getPasswordForUser(USER.TRANSFORM_POWERUSER) + ) + .set(COMMON_REQUEST_HEADERS) + .send({ + transformsInfo, + deleteDestIndex: true, + deleteDestIndexPattern: true, + }) + .expect(200); + + expect(body[transformId].transformDeleted.success).to.eql(true); + expect(body[transformId].destIndexDeleted.success).to.eql(true); + expect(body[transformId].destIndexPatternDeleted.success).to.eql(true); + await transform.api.waitForTransformNotToExist(transformId); + await transform.api.waitForIndicesNotToExist(destinationIndex); + await transform.testResources.assertIndexPatternNotExist(destinationIndex); + }); + }); + }); +}; diff --git a/x-pack/test/api_integration/apis/transform/index.ts b/x-pack/test/api_integration/apis/transform/index.ts new file mode 100644 index 0000000000000..93a951a55ece1 --- /dev/null +++ b/x-pack/test/api_integration/apis/transform/index.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, loadTestFile }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const transform = getService('transform'); + + describe('Machine Learning', function () { + this.tags(['transform']); + + before(async () => { + await transform.securityCommon.createTransformRoles(); + await transform.securityCommon.createTransformUsers(); + }); + + after(async () => { + await transform.securityCommon.cleanTransformUsers(); + await transform.securityCommon.cleanTransformRoles(); + + await esArchiver.unload('ml/farequote'); + + await transform.testResources.resetKibanaTimeZone(); + }); + + loadTestFile(require.resolve('./delete_transforms')); + }); +} diff --git a/x-pack/test/api_integration/services/index.ts b/x-pack/test/api_integration/services/index.ts index e7e166237c602..2a0327ff57104 100644 --- a/x-pack/test/api_integration/services/index.ts +++ b/x-pack/test/api_integration/services/index.ts @@ -28,6 +28,7 @@ import { InfraLogSourceConfigurationProvider } from './infra_log_source_configur import { MachineLearningProvider } from './ml'; import { IngestManagerProvider } from './ingest_manager'; import { ResolverGeneratorProvider } from './resolver'; +import { TransformProvider } from './transform'; export const services = { ...commonServices, @@ -48,4 +49,5 @@ export const services = { ml: MachineLearningProvider, ingestManager: IngestManagerProvider, resolverGenerator: ResolverGeneratorProvider, + transform: TransformProvider, }; diff --git a/x-pack/test/api_integration/services/transform.ts b/x-pack/test/api_integration/services/transform.ts new file mode 100644 index 0000000000000..1403d5d2d67f0 --- /dev/null +++ b/x-pack/test/api_integration/services/transform.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { FtrProviderContext } from '../../functional/ftr_provider_context'; + +import { TransformAPIProvider } from '../../functional/services/transform/api'; +import { TransformSecurityCommonProvider } from '../../functional/services/transform/security_common'; +import { MachineLearningTestResourcesProvider } from '../../functional/services/ml/test_resources'; + +export function TransformProvider(context: FtrProviderContext) { + const api = TransformAPIProvider(context); + const securityCommon = TransformSecurityCommonProvider(context); + const testResources = MachineLearningTestResourcesProvider(context); + + return { + api, + securityCommon, + testResources, + }; +} diff --git a/x-pack/test/detection_engine_api_integration/basic/tests/update_rules.ts b/x-pack/test/detection_engine_api_integration/basic/tests/update_rules.ts index 127f688dfbc28..9cda6271d427f 100644 --- a/x-pack/test/detection_engine_api_integration/basic/tests/update_rules.ts +++ b/x-pack/test/detection_engine_api_integration/basic/tests/update_rules.ts @@ -12,12 +12,12 @@ import { createSignalsIndex, deleteAllAlerts, deleteSignalsIndex, - getSimpleRule, getSimpleRuleOutput, removeServerGeneratedProperties, removeServerGeneratedPropertiesIncludingRuleId, getSimpleRuleOutputWithoutRuleId, - getSimpleMlRule, + getSimpleRuleUpdate, + getSimpleMlRuleUpdate, } from '../../utils'; // eslint-disable-next-line import/no-default-export @@ -41,11 +41,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.rule_id = 'rule-1'; updatedRule.name = 'some other name'; delete updatedRule.id; @@ -68,11 +68,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's type to try to be a machine learning job type - const updatedRule = getSimpleMlRule('rule-1'); + const updatedRule = getSimpleMlRuleUpdate('rule-1'); updatedRule.rule_id = 'rule-1'; updatedRule.name = 'some other name'; delete updatedRule.id; @@ -90,7 +90,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should update a single rule property of name using an auto-generated rule_id', async () => { - const rule = getSimpleRule('rule-1'); + const rule = getSimpleRuleUpdate('rule-1'); delete rule.rule_id; // create a simple rule const { body: createRuleBody } = await supertest @@ -100,7 +100,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); // update a simple rule's name - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.rule_id = createRuleBody.rule_id; updatedRule.name = 'some other name'; delete updatedRule.id; @@ -123,11 +123,11 @@ export default ({ getService }: FtrProviderContext) => { const { body: createdBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.name = 'some other name'; updatedRule.id = createdBody.id; delete updatedRule.rule_id; @@ -150,11 +150,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's enabled to false and another property - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.severity = 'low'; updatedRule.enabled = false; @@ -178,10 +178,10 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.timeline_title = 'some title'; ruleUpdate.timeline_id = 'some id'; @@ -192,7 +192,7 @@ export default ({ getService }: FtrProviderContext) => { .send(ruleUpdate) .expect(200); - const ruleUpdate2 = getSimpleRule('rule-1'); + const ruleUpdate2 = getSimpleRuleUpdate('rule-1'); ruleUpdate2.name = 'some other name'; // update a simple rule's name @@ -211,7 +211,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should give a 404 if it is given a fake id', async () => { - const simpleRule = getSimpleRule(); + const simpleRule = getSimpleRuleUpdate(); simpleRule.id = '5096dec6-b6b9-4d8d-8f93-6c2602079d9d'; delete simpleRule.rule_id; @@ -228,7 +228,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should give a 404 if it is given a fake rule_id', async () => { - const simpleRule = getSimpleRule(); + const simpleRule = getSimpleRuleUpdate(); simpleRule.rule_id = 'fake_id'; delete simpleRule.id; diff --git a/x-pack/test/detection_engine_api_integration/basic/tests/update_rules_bulk.ts b/x-pack/test/detection_engine_api_integration/basic/tests/update_rules_bulk.ts index 54f29939fb6b4..24eee8deaf3d4 100644 --- a/x-pack/test/detection_engine_api_integration/basic/tests/update_rules_bulk.ts +++ b/x-pack/test/detection_engine_api_integration/basic/tests/update_rules_bulk.ts @@ -12,11 +12,11 @@ import { createSignalsIndex, deleteAllAlerts, deleteSignalsIndex, - getSimpleRule, getSimpleRuleOutput, removeServerGeneratedProperties, getSimpleRuleOutputWithoutRuleId, removeServerGeneratedPropertiesIncludingRuleId, + getSimpleRuleUpdate, } from '../../utils'; // eslint-disable-next-line import/no-default-export @@ -40,10 +40,10 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.name = 'some other name'; // update a simple rule's name @@ -65,20 +65,20 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // create a second simple rule await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-2')) + .send(getSimpleRuleUpdate('rule-2')) .expect(200); - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.name = 'some other name'; - const updatedRule2 = getSimpleRule('rule-2'); + const updatedRule2 = getSimpleRuleUpdate('rule-2'); updatedRule2.name = 'some other name'; // update both rule names @@ -107,11 +107,11 @@ export default ({ getService }: FtrProviderContext) => { const { body: createRuleBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.id = createRuleBody.id; updatedRule1.name = 'some other name'; delete updatedRule1.rule_id; @@ -134,23 +134,23 @@ export default ({ getService }: FtrProviderContext) => { const { body: createRule1 } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // create a second simple rule const { body: createRule2 } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-2')) + .send(getSimpleRuleUpdate('rule-2')) .expect(200); // update both rule names - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.id = createRule1.id; updatedRule1.name = 'some other name'; delete updatedRule1.rule_id; - const updatedRule2 = getSimpleRule('rule-1'); + const updatedRule2 = getSimpleRuleUpdate('rule-1'); updatedRule2.id = createRule2.id; updatedRule2.name = 'some other name'; delete updatedRule2.rule_id; @@ -180,11 +180,11 @@ export default ({ getService }: FtrProviderContext) => { const { body: createdBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.id = createdBody.id; updatedRule1.name = 'some other name'; delete updatedRule1.rule_id; @@ -207,11 +207,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's enabled to false and another property - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.severity = 'low'; updatedRule1.enabled = false; @@ -235,11 +235,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's timeline_title - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.timeline_title = 'some title'; ruleUpdate.timeline_id = 'some id'; @@ -250,7 +250,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); // update a simple rule's name - const ruleUpdate2 = getSimpleRule('rule-1'); + const ruleUpdate2 = getSimpleRuleUpdate('rule-1'); ruleUpdate2.name = 'some other name'; const { body } = await supertest @@ -268,7 +268,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should return a 200 but give a 404 in the message if it is given a fake id', async () => { - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.id = '1fd52120-d3a9-4e7a-b23c-96c0e1a74ae5'; delete ruleUpdate.rule_id; @@ -290,7 +290,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should return a 200 but give a 404 in the message if it is given a fake rule_id', async () => { - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.rule_id = 'fake_id'; delete ruleUpdate.id; @@ -313,14 +313,14 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.name = 'some other name'; delete ruleUpdate.id; - const ruleUpdate2 = getSimpleRule('fake_id'); + const ruleUpdate2 = getSimpleRuleUpdate('fake_id'); ruleUpdate2.name = 'some other name'; delete ruleUpdate.id; @@ -353,16 +353,16 @@ export default ({ getService }: FtrProviderContext) => { const { body: createdBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update one rule name and give a fake id for the second - const rule1 = getSimpleRule(); + const rule1 = getSimpleRuleUpdate(); delete rule1.rule_id; rule1.id = createdBody.id; rule1.name = 'some other name'; - const rule2 = getSimpleRule(); + const rule2 = getSimpleRuleUpdate(); delete rule2.rule_id; rule2.id = 'b3aa019a-656c-4311-b13b-4d9852e24347'; rule2.name = 'some other name'; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts index 0b1b49e379d17..279158f09f273 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts @@ -12,13 +12,14 @@ import { createSignalsIndex, deleteAllAlerts, deleteSignalsIndex, - getSimpleRule, getSimpleRuleOutput, removeServerGeneratedProperties, removeServerGeneratedPropertiesIncludingRuleId, getSimpleRuleOutputWithoutRuleId, getSimpleMlRule, getSimpleMlRuleOutput, + getSimpleRuleUpdate, + getSimpleMlRuleUpdate, } from '../../utils'; // eslint-disable-next-line import/no-default-export @@ -42,11 +43,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.rule_id = 'rule-1'; updatedRule.name = 'some other name'; delete updatedRule.id; @@ -73,7 +74,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); // update a simple rule's name - const updatedRule = getSimpleMlRule('rule-1'); + const updatedRule = getSimpleMlRuleUpdate('rule-1'); updatedRule.rule_id = 'rule-1'; updatedRule.name = 'some other name'; delete updatedRule.id; @@ -92,7 +93,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should update a single rule property of name using an auto-generated rule_id', async () => { - const rule = getSimpleRule('rule-1'); + const rule = getSimpleRuleUpdate('rule-1'); delete rule.rule_id; // create a simple rule const { body: createRuleBody } = await supertest @@ -102,7 +103,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); // update a simple rule's name - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.rule_id = createRuleBody.rule_id; updatedRule.name = 'some other name'; delete updatedRule.id; @@ -125,11 +126,11 @@ export default ({ getService }: FtrProviderContext) => { const { body: createdBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.name = 'some other name'; updatedRule.id = createdBody.id; delete updatedRule.rule_id; @@ -152,11 +153,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's enabled to false and another property - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.severity = 'low'; updatedRule.enabled = false; @@ -180,10 +181,10 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.timeline_title = 'some title'; ruleUpdate.timeline_id = 'some id'; @@ -194,7 +195,7 @@ export default ({ getService }: FtrProviderContext) => { .send(ruleUpdate) .expect(200); - const ruleUpdate2 = getSimpleRule('rule-1'); + const ruleUpdate2 = getSimpleRuleUpdate('rule-1'); ruleUpdate2.name = 'some other name'; // update a simple rule's name @@ -213,7 +214,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should give a 404 if it is given a fake id', async () => { - const simpleRule = getSimpleRule(); + const simpleRule = getSimpleRuleUpdate(); simpleRule.id = '5096dec6-b6b9-4d8d-8f93-6c2602079d9d'; delete simpleRule.rule_id; @@ -230,7 +231,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should give a 404 if it is given a fake rule_id', async () => { - const simpleRule = getSimpleRule(); + const simpleRule = getSimpleRuleUpdate(); simpleRule.rule_id = 'fake_id'; delete simpleRule.id; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts index 54f29939fb6b4..24eee8deaf3d4 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts @@ -12,11 +12,11 @@ import { createSignalsIndex, deleteAllAlerts, deleteSignalsIndex, - getSimpleRule, getSimpleRuleOutput, removeServerGeneratedProperties, getSimpleRuleOutputWithoutRuleId, removeServerGeneratedPropertiesIncludingRuleId, + getSimpleRuleUpdate, } from '../../utils'; // eslint-disable-next-line import/no-default-export @@ -40,10 +40,10 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); - const updatedRule = getSimpleRule('rule-1'); + const updatedRule = getSimpleRuleUpdate('rule-1'); updatedRule.name = 'some other name'; // update a simple rule's name @@ -65,20 +65,20 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // create a second simple rule await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-2')) + .send(getSimpleRuleUpdate('rule-2')) .expect(200); - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.name = 'some other name'; - const updatedRule2 = getSimpleRule('rule-2'); + const updatedRule2 = getSimpleRuleUpdate('rule-2'); updatedRule2.name = 'some other name'; // update both rule names @@ -107,11 +107,11 @@ export default ({ getService }: FtrProviderContext) => { const { body: createRuleBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.id = createRuleBody.id; updatedRule1.name = 'some other name'; delete updatedRule1.rule_id; @@ -134,23 +134,23 @@ export default ({ getService }: FtrProviderContext) => { const { body: createRule1 } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // create a second simple rule const { body: createRule2 } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-2')) + .send(getSimpleRuleUpdate('rule-2')) .expect(200); // update both rule names - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.id = createRule1.id; updatedRule1.name = 'some other name'; delete updatedRule1.rule_id; - const updatedRule2 = getSimpleRule('rule-1'); + const updatedRule2 = getSimpleRuleUpdate('rule-1'); updatedRule2.id = createRule2.id; updatedRule2.name = 'some other name'; delete updatedRule2.rule_id; @@ -180,11 +180,11 @@ export default ({ getService }: FtrProviderContext) => { const { body: createdBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's name - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.id = createdBody.id; updatedRule1.name = 'some other name'; delete updatedRule1.rule_id; @@ -207,11 +207,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's enabled to false and another property - const updatedRule1 = getSimpleRule('rule-1'); + const updatedRule1 = getSimpleRuleUpdate('rule-1'); updatedRule1.severity = 'low'; updatedRule1.enabled = false; @@ -235,11 +235,11 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update a simple rule's timeline_title - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.timeline_title = 'some title'; ruleUpdate.timeline_id = 'some id'; @@ -250,7 +250,7 @@ export default ({ getService }: FtrProviderContext) => { .expect(200); // update a simple rule's name - const ruleUpdate2 = getSimpleRule('rule-1'); + const ruleUpdate2 = getSimpleRuleUpdate('rule-1'); ruleUpdate2.name = 'some other name'; const { body } = await supertest @@ -268,7 +268,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should return a 200 but give a 404 in the message if it is given a fake id', async () => { - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.id = '1fd52120-d3a9-4e7a-b23c-96c0e1a74ae5'; delete ruleUpdate.rule_id; @@ -290,7 +290,7 @@ export default ({ getService }: FtrProviderContext) => { }); it('should return a 200 but give a 404 in the message if it is given a fake rule_id', async () => { - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.rule_id = 'fake_id'; delete ruleUpdate.id; @@ -313,14 +313,14 @@ export default ({ getService }: FtrProviderContext) => { await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); - const ruleUpdate = getSimpleRule('rule-1'); + const ruleUpdate = getSimpleRuleUpdate('rule-1'); ruleUpdate.name = 'some other name'; delete ruleUpdate.id; - const ruleUpdate2 = getSimpleRule('fake_id'); + const ruleUpdate2 = getSimpleRuleUpdate('fake_id'); ruleUpdate2.name = 'some other name'; delete ruleUpdate.id; @@ -353,16 +353,16 @@ export default ({ getService }: FtrProviderContext) => { const { body: createdBody } = await supertest .post(DETECTION_ENGINE_RULES_URL) .set('kbn-xsrf', 'true') - .send(getSimpleRule('rule-1')) + .send(getSimpleRuleUpdate('rule-1')) .expect(200); // update one rule name and give a fake id for the second - const rule1 = getSimpleRule(); + const rule1 = getSimpleRuleUpdate(); delete rule1.rule_id; rule1.id = createdBody.id; rule1.name = 'some other name'; - const rule2 = getSimpleRule(); + const rule2 = getSimpleRuleUpdate(); delete rule2.rule_id; rule2.id = 'b3aa019a-656c-4311-b13b-4d9852e24347'; rule2.name = 'some other name'; diff --git a/x-pack/test/detection_engine_api_integration/utils.ts b/x-pack/test/detection_engine_api_integration/utils.ts index b4330ce5d3912..b58089e30e930 100644 --- a/x-pack/test/detection_engine_api_integration/utils.ts +++ b/x-pack/test/detection_engine_api_integration/utils.ts @@ -7,7 +7,9 @@ import { Client } from '@elastic/elasticsearch'; import { SuperTest } from 'supertest'; import supertestAsPromised from 'supertest-as-promised'; -import { OutputRuleAlertRest } from '../../plugins/security_solution/server/lib/detection_engine/types'; +import { CreateRulesSchema } from '../../plugins/security_solution/common/detection_engine/schemas/request/create_rules_schema'; +import { UpdateRulesSchema } from '../../plugins/security_solution/common/detection_engine/schemas/request/update_rules_schema'; +import { RulesSchema } from '../../plugins/security_solution/common/detection_engine/schemas/response/rules_schema'; import { DETECTION_ENGINE_INDEX_URL } from '../../plugins/security_solution/common/constants'; /** @@ -15,8 +17,8 @@ import { DETECTION_ENGINE_INDEX_URL } from '../../plugins/security_solution/comm * @param rule Rule to pass in to remove typical server generated properties */ export const removeServerGeneratedProperties = ( - rule: Partial -): Partial => { + rule: Partial +): Partial => { const { created_at, updated_at, @@ -37,8 +39,8 @@ export const removeServerGeneratedProperties = ( * @param rule Rule to pass in to remove typical server generated properties */ export const removeServerGeneratedPropertiesIncludingRuleId = ( - rule: Partial -): Partial => { + rule: Partial +): Partial => { const ruleWithRemovedProperties = removeServerGeneratedProperties(rule); const { rule_id, ...additionalRuledIdRemoved } = ruleWithRemovedProperties; return additionalRuledIdRemoved; @@ -48,7 +50,22 @@ export const removeServerGeneratedPropertiesIncludingRuleId = ( * This is a typical simple rule for testing that is easy for most basic testing * @param ruleId */ -export const getSimpleRule = (ruleId = 'rule-1'): Partial => ({ +export const getSimpleRule = (ruleId = 'rule-1'): CreateRulesSchema => ({ + name: 'Simple Rule Query', + description: 'Simple Rule Query', + risk_score: 1, + rule_id: ruleId, + severity: 'high', + index: ['auditbeat-*'], + type: 'query', + query: 'user.name: root or user.name: admin', +}); + +/** + * This is a typical simple rule for testing that is easy for most basic testing + * @param ruleId + */ +export const getSimpleRuleUpdate = (ruleId = 'rule-1'): UpdateRulesSchema => ({ name: 'Simple Rule Query', description: 'Simple Rule Query', risk_score: 1, @@ -63,7 +80,18 @@ export const getSimpleRule = (ruleId = 'rule-1'): Partial = * This is a representative ML rule payload as expected by the server * @param ruleId */ -export const getSimpleMlRule = (ruleId = 'rule-1'): Partial => ({ +export const getSimpleMlRule = (ruleId = 'rule-1'): CreateRulesSchema => ({ + name: 'Simple ML Rule', + description: 'Simple Machine Learning Rule', + anomaly_threshold: 44, + risk_score: 1, + rule_id: ruleId, + severity: 'high', + machine_learning_job_id: 'some_job_id', + type: 'machine_learning', +}); + +export const getSimpleMlRuleUpdate = (ruleId = 'rule-1'): UpdateRulesSchema => ({ name: 'Simple ML Rule', description: 'Simple Machine Learning Rule', anomaly_threshold: 44, @@ -107,7 +135,7 @@ export const getSignalStatusEmptyResponse = () => ({ /** * This is a typical simple rule for testing that is easy for most basic testing */ -export const getSimpleRuleWithoutRuleId = (): Partial => { +export const getSimpleRuleWithoutRuleId = (): CreateRulesSchema => { const simpleRule = getSimpleRule(); const { rule_id, ...ruleWithoutId } = simpleRule; return ruleWithoutId; @@ -130,9 +158,10 @@ export const binaryToString = (res: any, callback: any): void => { }; /** - * This is the typical output of a simple rule that Kibana will output with all the defaults. + * This is the typical output of a simple rule that Kibana will output with all the defaults + * except for the server generated properties. Useful for testing end to end tests. */ -export const getSimpleRuleOutput = (ruleId = 'rule-1'): Partial => ({ +export const getSimpleRuleOutput = (ruleId = 'rule-1'): Partial => ({ actions: [], created_by: 'elastic', description: 'Simple Rule Query', @@ -162,17 +191,16 @@ export const getSimpleRuleOutput = (ruleId = 'rule-1'): Partial => { +export const getSimpleRuleOutputWithoutRuleId = (ruleId = 'rule-1'): Partial => { const rule = getSimpleRuleOutput(ruleId); const { rule_id, ...ruleWithoutRuleId } = rule; return ruleWithoutRuleId; }; -export const getSimpleMlRuleOutput = (ruleId = 'rule-1'): Partial => { +export const getSimpleMlRuleOutput = (ruleId = 'rule-1'): Partial => { const rule = getSimpleRuleOutput(ruleId); const { query, language, index, ...rest } = rule; @@ -252,7 +280,7 @@ export const getSimpleRuleAsNdjson = (ruleIds: string[]): Buffer => { * testing upload features. * @param rule The rule to convert to ndjson */ -export const ruleToNdjson = (rule: Partial): Buffer => { +export const ruleToNdjson = (rule: Partial): Buffer => { const stringified = JSON.stringify(rule); return Buffer.from(`${stringified}\n`); }; @@ -261,7 +289,7 @@ export const ruleToNdjson = (rule: Partial): Buffer => { * This will return a complex rule with all the outputs possible * @param ruleId The ruleId to set which is optional and defaults to rule-1 */ -export const getComplexRule = (ruleId = 'rule-1'): Partial => ({ +export const getComplexRule = (ruleId = 'rule-1'): Partial => ({ actions: [], name: 'Complex Rule Query', description: 'Complex Rule Query', @@ -345,7 +373,7 @@ export const getComplexRule = (ruleId = 'rule-1'): Partial * This will return a complex rule with all the outputs possible * @param ruleId The ruleId to set which is optional and defaults to rule-1 */ -export const getComplexRuleOutput = (ruleId = 'rule-1'): Partial => ({ +export const getComplexRuleOutput = (ruleId = 'rule-1'): Partial => ({ actions: [], created_by: 'elastic', name: 'Complex Rule Query', diff --git a/x-pack/test/functional/apps/lens/smokescreen.ts b/x-pack/test/functional/apps/lens/smokescreen.ts index 239da3ea8c693..181d41d77b4cb 100644 --- a/x-pack/test/functional/apps/lens/smokescreen.ts +++ b/x-pack/test/functional/apps/lens/smokescreen.ts @@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); const testSubjects = getService('testSubjects'); const filterBar = getService('filterBar'); + const listingTable = getService('listingTable'); async function assertExpectedMetric(metricCount: string = '19,986') { await PageObjects.lens.assertExactText( @@ -60,14 +61,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { async function clickOnBarHistogram() { const el = await elasticChart.getCanvas(); - await browser.getActions().move({ x: 5, y: 5, origin: el._webElement }).click().perform(); } - // FLAKY: https://github.com/elastic/kibana/issues/67838 - describe.skip('lens smokescreen tests', () => { + describe('lens smokescreen tests', () => { it('should allow editing saved visualizations', async () => { await PageObjects.visualize.gotoVisualizationLandingPage(); + await listingTable.searchForItemWithName('Artistpreviouslyknownaslens'); await PageObjects.lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens'); await PageObjects.lens.goToTimeRange(); await assertExpectedMetric(); @@ -77,6 +77,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.clickOpenAddPanel(); + await dashboardAddPanel.filterEmbeddableNames('Artistpreviouslyknownaslens'); await find.clickByButtonText('Artistpreviouslyknownaslens'); await dashboardAddPanel.closeAddPanel(); await PageObjects.lens.goToTimeRange(); @@ -87,6 +88,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.clickOpenAddPanel(); + await dashboardAddPanel.filterEmbeddableNames('lnsXYvis'); await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); await PageObjects.lens.goToTimeRange(); @@ -101,6 +103,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should allow seamless transition to and from table view', async () => { await PageObjects.visualize.gotoVisualizationLandingPage(); + await listingTable.searchForItemWithName('Artistpreviouslyknownaslens'); await PageObjects.lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens'); await PageObjects.lens.goToTimeRange(); await assertExpectedMetric(); @@ -152,6 +155,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Ensure the visualization shows up in the visualize list, and takes // us back to the visualization as we configured it. await PageObjects.visualize.gotoVisualizationLandingPage(); + await listingTable.searchForItemWithName('Afancilenstest'); await PageObjects.lens.clickVisualizeListItemTitle('Afancilenstest'); await PageObjects.lens.goToTimeRange(); diff --git a/x-pack/test/functional/es_archives/endpoint/alerts/api_feature/mappings.json b/x-pack/test/functional/es_archives/endpoint/alerts/api_feature/mappings.json deleted file mode 100644 index 7068c24a4b26c..0000000000000 --- a/x-pack/test/functional/es_archives/endpoint/alerts/api_feature/mappings.json +++ /dev/null @@ -1,2373 +0,0 @@ -{ - "type": "index", - "value": { - "aliases": {}, - "index": "events-endpoint-1", - "mappings": { - "_meta": { - "version": "1.5.0-dev" - }, - "date_detection": false, - "dynamic": "false", - "dynamic_templates": [ - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" - } - } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "agent": { - "properties": { - "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "dll": { - "properties": { - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "compile_time": { - "type": "date" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "mapped_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "mapped_size": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "endpoint": { - "properties": { - "artifact": { - "properties": { - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "policy": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "event": { - "properties": { - "action": { - "ignore_above": 1024, - "type": "keyword" - }, - "category": { - "ignore_above": 1024, - "type": "keyword" - }, - "created": { - "type": "date" - }, - "dataset": { - "ignore_above": 1024, - "type": "keyword" - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ingested": { - "type": "date" - }, - "kind": { - "ignore_above": 1024, - "type": "keyword" - }, - "module": { - "ignore_above": 1024, - "type": "keyword" - }, - "outcome": { - "ignore_above": 1024, - "type": "keyword" - }, - "sequence": { - "type": "long" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "file": { - "properties": { - "accessed": { - "type": "date" - }, - "attributes": { - "ignore_above": 1024, - "type": "keyword" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "created": { - "type": "date" - }, - "ctime": { - "type": "date" - }, - "device": { - "ignore_above": 1024, - "type": "keyword" - }, - "directory": { - "ignore_above": 1024, - "type": "keyword" - }, - "drive_letter": { - "ignore_above": 1, - "type": "keyword" - }, - "entry_modified": { - "type": "double" - }, - "extension": { - "ignore_above": 1024, - "type": "keyword" - }, - "gid": { - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "inode": { - "ignore_above": 1024, - "type": "keyword" - }, - "macro": { - "properties": { - "code_page": { - "type": "long" - }, - "collection": { - "properties": { - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "errors": { - "properties": { - "count": { - "type": "long" - }, - "error_type": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "file_extension": { - "ignore_above": 1024, - "type": "keyword" - }, - "project_file": { - "properties": { - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "stream": { - "properties": { - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "raw_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "raw_code_size": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "mode": { - "ignore_above": 1024, - "type": "keyword" - }, - "mtime": { - "type": "date" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "owner": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "size": { - "type": "long" - }, - "target_path": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "temp_file_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "uid": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "host": { - "properties": { - "architecture": { - "ignore_above": 1024, - "type": "keyword" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - }, - "user": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "email": { - "ignore_above": 1024, - "type": "keyword" - }, - "full_name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "process": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "cpu_percent": { - "type": "double" - }, - "cwd": { - "ignore_above": 1024, - "type": "keyword" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "env_variables": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "handles": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "memory_percent": { - "type": "double" - }, - "memory_region": { - "properties": { - "allocation_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "allocation_protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram": { - "properties": { - "histogram_array": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_flavor": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_resolution": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "length": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "permission": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_tag": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "unbacked_on_disk": { - "type": "boolean" - } - }, - "type": "nested" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "num_threads": { - "type": "long" - }, - "parent": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "pgid": { - "type": "long" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pgid": { - "type": "long" - }, - "phys_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "services": { - "ignore_above": 1024, - "type": "keyword" - }, - "session_id": { - "type": "long" - }, - "short_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "call_stack": { - "properties": { - "instruction_pointer": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_section": { - "properties": { - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "rva": { - "ignore_above": 1024, - "type": "keyword" - }, - "symbol_info": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "tty_device": { - "properties": { - "major_number": { - "type": "integer" - }, - "minor_number": { - "type": "integer" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - }, - "virt_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "rule": { - "properties": { - "category": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "reference": { - "ignore_above": 1024, - "type": "keyword" - }, - "ruleset": { - "ignore_above": 1024, - "type": "keyword" - }, - "uuid": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "target": { - "properties": { - "dll": { - "properties": { - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "compile_time": { - "type": "date" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "mapped_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "mapped_size": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "process": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "cpu_percent": { - "type": "double" - }, - "cwd": { - "ignore_above": 1024, - "type": "keyword" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "env_variables": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "handles": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "memory_percent": { - "type": "double" - }, - "memory_region": { - "properties": { - "allocation_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "allocation_protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram": { - "properties": { - "histogram_array": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_flavor": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_resolution": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "length": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "permission": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_tag": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "unbacked_on_disk": { - "type": "boolean" - } - }, - "type": "nested" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "num_threads": { - "type": "long" - }, - "parent": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "pgid": { - "type": "long" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pgid": { - "type": "long" - }, - "phys_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "services": { - "ignore_above": 1024, - "type": "keyword" - }, - "session_id": { - "type": "long" - }, - "short_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "call_stack": { - "properties": { - "instruction_pointer": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_section": { - "properties": { - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "rva": { - "ignore_above": 1024, - "type": "keyword" - }, - "symbol_info": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "tty_device": { - "properties": { - "major_number": { - "type": "integer" - }, - "minor_number": { - "type": "integer" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - }, - "virt_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "threat": { - "properties": { - "framework": { - "ignore_above": 1024, - "type": "keyword" - }, - "tactic": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "reference": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "technique": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "reference": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "user": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "email": { - "ignore_above": 1024, - "type": "keyword" - }, - "full_name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "settings": { - "index": { - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "number_of_replicas": "1", - "number_of_shards": "1", - "refresh_interval": "5s" - } - } - } -} diff --git a/x-pack/test/functional/es_archives/endpoint/alerts/host_api_feature/mappings.json b/x-pack/test/functional/es_archives/endpoint/alerts/host_api_feature/mappings.json deleted file mode 100644 index ffd64ab3bb939..0000000000000 --- a/x-pack/test/functional/es_archives/endpoint/alerts/host_api_feature/mappings.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "type": "index", - "value": { - "aliases": {}, - "index": "metrics-endpoint.metadata-default-1", - "mappings": { - "_meta": { - "version": "1.5.0-dev" - }, - "date_detection": false, - "dynamic_templates": [ - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" - } - } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "elastic": { - "properties": { - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "object" - } - } - }, - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "endpoint": { - "properties": { - "policy": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "object" - } - } - }, - "event": { - "properties": { - "created": { - "type": "date" - } - } - }, - "host": { - "properties": { - "architecture": { - "ignore_above": 1024, - "type": "keyword" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "full": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "variant": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - } - } - }, - "order": 1, - "settings": { - "index": { - "mapping": { - "total_fields": { - "limit": 10000 - } - }, - "refresh_interval": "5s" - } - } - } -} diff --git a/x-pack/test/functional/es_archives/endpoint/metadata/api_feature/mappings.json b/x-pack/test/functional/es_archives/endpoint/metadata/api_feature/mappings.json deleted file mode 100644 index ffd64ab3bb939..0000000000000 --- a/x-pack/test/functional/es_archives/endpoint/metadata/api_feature/mappings.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "type": "index", - "value": { - "aliases": {}, - "index": "metrics-endpoint.metadata-default-1", - "mappings": { - "_meta": { - "version": "1.5.0-dev" - }, - "date_detection": false, - "dynamic_templates": [ - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" - } - } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "elastic": { - "properties": { - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "object" - } - } - }, - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "endpoint": { - "properties": { - "policy": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "object" - } - } - }, - "event": { - "properties": { - "created": { - "type": "date" - } - } - }, - "host": { - "properties": { - "architecture": { - "ignore_above": 1024, - "type": "keyword" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "full": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "variant": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - } - } - }, - "order": 1, - "settings": { - "index": { - "mapping": { - "total_fields": { - "limit": 10000 - } - }, - "refresh_interval": "5s" - } - } - } -} diff --git a/x-pack/test/functional/es_archives/endpoint/policy/mappings.json b/x-pack/test/functional/es_archives/endpoint/policy/mappings.json deleted file mode 100644 index 828085809ad1f..0000000000000 --- a/x-pack/test/functional/es_archives/endpoint/policy/mappings.json +++ /dev/null @@ -1,511 +0,0 @@ -{ - "type": "index", - "value": { - "aliases": { - }, - "index": "metrics-endpoint.policy-default-1", - "mappings": { - "_meta": { - "version": "1.6.0-dev" - }, - "date_detection": false, - "dynamic_templates": [ - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" - } - } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "elastic": { - "properties": { - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "endpoint": { - "properties": { - "policy": { - "properties": { - "applied": { - "properties": { - "actions": { - "properties": { - "configure_elasticsearch_connection": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "configure_kernel": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "configure_logging": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "configure_malware": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "connect_kernel": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "detect_file_open_events": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "detect_file_write_events": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "detect_image_load_events": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "detect_process_events": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "download_global_artifacts": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "download_model": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "ingest_events_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "load_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "load_malware_model": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "read_elasticsearch_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "read_events_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "read_kernel_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "read_logging_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "read_malware_config": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "workflow": { - "properties": { - "message": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "configurations": { - "properties": { - "events": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "logging": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "streaming": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "policy": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "response": { - "properties": { - "configurations": { - "properties": { - "events": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "logging": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "streaming": { - "properties": { - "concerned_actions": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - } - } - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - } - } - }, - "event": { - "properties": { - "created": { - "type": "date" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "kind": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "host": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "stream": { - "properties": { - "dataset": { - "type": "constant_keyword" - }, - "namespace": { - "type": "constant_keyword" - }, - "type": { - "type": "constant_keyword" - } - } - } - } - }, - "settings": { - "index": { - "codec": "best_compression", - "lifecycle": { - "name": "metrics-default" - }, - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "number_of_replicas": "1", - "number_of_shards": "1", - "query": { - "default_field": [ - "message" - ] - }, - "refresh_interval": "5s" - } - } - } -} diff --git a/x-pack/test/functional/es_archives/endpoint/resolver/api_feature/mappings.json b/x-pack/test/functional/es_archives/endpoint/resolver/api_feature/mappings.json index e1c41ed7111ba..0a1ab1f036d2a 100644 --- a/x-pack/test/functional/es_archives/endpoint/resolver/api_feature/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/resolver/api_feature/mappings.json @@ -2700,4 +2700,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/mappings.json b/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/mappings.json deleted file mode 100644 index e69471c212ec0..0000000000000 --- a/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/mappings.json +++ /dev/null @@ -1,2904 +0,0 @@ -{ - "type": "index", - "value": { - "aliases": { - }, - "index": "events-endpoint-1", - "mappings": { - "_meta": { - "version": "1.5.0-dev" - }, - "date_detection": false, - "dynamic": "false", - "dynamic_templates": [ - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" - } - } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "agent": { - "properties": { - "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "destination": { - "properties": { - "address": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "packets": { - "type": "long" - }, - "port": { - "type": "long" - }, - "registered_domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "top_level_domain": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "dll": { - "properties": { - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "compile_time": { - "type": "date" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "mapped_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "mapped_size": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "dns": { - "properties": { - "question": { - "properties": { - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "registered_domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "subdomain": { - "ignore_above": 1024, - "type": "keyword" - }, - "top_level_domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "resolved_ip": { - "type": "ip" - } - } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "endpoint": { - "properties": { - "artifact": { - "properties": { - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "file": { - "type": "object" - }, - "group": { - "type": "object" - }, - "policy": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "process": { - "type": "object" - }, - "user": { - "type": "object" - } - } - }, - "event": { - "properties": { - "action": { - "ignore_above": 1024, - "type": "keyword" - }, - "category": { - "ignore_above": 1024, - "type": "keyword" - }, - "created": { - "type": "date" - }, - "dataset": { - "ignore_above": 1024, - "type": "keyword" - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ingested": { - "type": "date" - }, - "kind": { - "ignore_above": 1024, - "type": "keyword" - }, - "module": { - "ignore_above": 1024, - "type": "keyword" - }, - "outcome": { - "ignore_above": 1024, - "type": "keyword" - }, - "sequence": { - "type": "long" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "file": { - "properties": { - "accessed": { - "type": "date" - }, - "attributes": { - "ignore_above": 1024, - "type": "keyword" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "created": { - "type": "date" - }, - "ctime": { - "type": "date" - }, - "device": { - "ignore_above": 1024, - "type": "keyword" - }, - "directory": { - "ignore_above": 1024, - "type": "keyword" - }, - "drive_letter": { - "ignore_above": 1, - "type": "keyword" - }, - "entry_modified": { - "type": "double" - }, - "extension": { - "ignore_above": 1024, - "type": "keyword" - }, - "gid": { - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "inode": { - "ignore_above": 1024, - "type": "keyword" - }, - "macro": { - "properties": { - "code_page": { - "type": "long" - }, - "collection": { - "properties": { - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "errors": { - "properties": { - "count": { - "type": "long" - }, - "error_type": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "file_extension": { - "ignore_above": 1024, - "type": "keyword" - }, - "project_file": { - "properties": { - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "stream": { - "properties": { - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "raw_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "raw_code_size": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "mode": { - "ignore_above": 1024, - "type": "keyword" - }, - "mtime": { - "type": "date" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "owner": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "size": { - "type": "long" - }, - "target_path": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "temp_file_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "uid": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "group": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "host": { - "properties": { - "architecture": { - "ignore_above": 1024, - "type": "keyword" - }, - "containerized": { - "type": "boolean" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "build": { - "ignore_above": 1024, - "type": "keyword" - }, - "codename": { - "ignore_above": 1024, - "type": "keyword" - }, - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "variant": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - }, - "user": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "email": { - "ignore_above": 1024, - "type": "keyword" - }, - "full_name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "http": { - "properties": { - "request": { - "properties": { - "body": { - "properties": { - "bytes": { - "type": "long" - }, - "content": { - "fields": { - "text": { - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "bytes": { - "type": "long" - } - } - }, - "response": { - "properties": { - "body": { - "properties": { - "bytes": { - "type": "long" - }, - "content": { - "fields": { - "text": { - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "bytes": { - "type": "long" - }, - "status_code": { - "type": "long" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "message": { - "type": "text" - }, - "network": { - "properties": { - "bytes": { - "type": "long" - }, - "community_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "direction": { - "ignore_above": 1024, - "type": "keyword" - }, - "iana_number": { - "ignore_above": 1024, - "type": "keyword" - }, - "packets": { - "type": "long" - }, - "protocol": { - "ignore_above": 1024, - "type": "keyword" - }, - "transport": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "package": { - "properties": { - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "process": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "cpu_percent": { - "type": "double" - }, - "cwd": { - "ignore_above": 1024, - "type": "keyword" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "env_variables": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "handles": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "memory_percent": { - "type": "double" - }, - "memory_region": { - "properties": { - "allocation_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "allocation_protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram": { - "properties": { - "histogram_array": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_flavor": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_resolution": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "length": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "permission": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_tag": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "unbacked_on_disk": { - "type": "boolean" - } - }, - "type": "nested" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "num_threads": { - "type": "long" - }, - "parent": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "pgid": { - "type": "long" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pgid": { - "type": "long" - }, - "phys_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "services": { - "ignore_above": 1024, - "type": "keyword" - }, - "session_id": { - "type": "long" - }, - "short_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "call_stack": { - "properties": { - "instruction_pointer": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_section": { - "properties": { - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "rva": { - "ignore_above": 1024, - "type": "keyword" - }, - "symbol_info": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "elevation": { - "type": "boolean" - }, - "elevation_type": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "tty_device": { - "properties": { - "major_number": { - "type": "integer" - }, - "minor_number": { - "type": "integer" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - }, - "virt_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "registry": { - "properties": { - "data": { - "properties": { - "bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "strings": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hive": { - "ignore_above": 1024, - "type": "keyword" - }, - "key": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "value": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "rule": { - "properties": { - "category": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "reference": { - "ignore_above": 1024, - "type": "keyword" - }, - "ruleset": { - "ignore_above": 1024, - "type": "keyword" - }, - "uuid": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "source": { - "properties": { - "address": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "packets": { - "type": "long" - }, - "port": { - "type": "long" - }, - "registered_domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "top_level_domain": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "stream": { - "properties": { - "dataset": { - "type": "constant_keyword" - }, - "namespace": { - "type": "constant_keyword" - }, - "type": { - "type": "constant_keyword" - } - } - }, - "target": { - "properties": { - "dll": { - "properties": { - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "compile_time": { - "type": "date" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "mapped_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "mapped_size": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "process": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "cpu_percent": { - "type": "double" - }, - "cwd": { - "ignore_above": 1024, - "type": "keyword" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "env_variables": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "handles": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "malware_classification": { - "properties": { - "features": { - "properties": { - "data": { - "properties": { - "buffer": { - "ignore_above": 1024, - "type": "keyword" - }, - "decompressed_size": { - "type": "integer" - }, - "encoding": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "identifier": { - "ignore_above": 1024, - "type": "keyword" - }, - "score": { - "type": "double" - }, - "threshold": { - "type": "double" - }, - "upx_packed": { - "type": "boolean" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "memory_percent": { - "type": "double" - }, - "memory_region": { - "properties": { - "allocation_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "allocation_protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram": { - "properties": { - "histogram_array": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_flavor": { - "ignore_above": 1024, - "type": "keyword" - }, - "histogram_resolution": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "length": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "permission": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_base": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_tag": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "unbacked_on_disk": { - "type": "boolean" - } - }, - "type": "nested" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "num_threads": { - "type": "long" - }, - "parent": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "args_count": { - "type": "long" - }, - "code_signature": { - "properties": { - "exists": { - "type": "boolean" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "subject_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "trusted": { - "type": "boolean" - }, - "valid": { - "type": "boolean" - } - } - }, - "command_line": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "entity_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "exit_code": { - "type": "long" - }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "pgid": { - "type": "long" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "uptime": { - "type": "long" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pe": { - "properties": { - "company": { - "ignore_above": 1024, - "type": "keyword" - }, - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "file_version": { - "ignore_above": 1024, - "type": "keyword" - }, - "original_file_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "product": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "pgid": { - "type": "long" - }, - "phys_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "services": { - "ignore_above": 1024, - "type": "keyword" - }, - "session_id": { - "type": "long" - }, - "short_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "call_stack": { - "properties": { - "instruction_pointer": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_section": { - "properties": { - "memory_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "memory_size": { - "ignore_above": 1024, - "type": "keyword" - }, - "protection": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "module_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "rva": { - "ignore_above": 1024, - "type": "keyword" - }, - "symbol_info": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "entrypoint": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "service": { - "ignore_above": 1024, - "type": "keyword" - }, - "start": { - "type": "date" - }, - "start_address": { - "ignore_above": 1024, - "type": "keyword" - }, - "start_address_module": { - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - } - } - }, - "title": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "token": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "elevation": { - "type": "boolean" - }, - "elevation_type": { - "ignore_above": 1024, - "type": "keyword" - }, - "impersonation_level": { - "ignore_above": 1024, - "type": "keyword" - }, - "integrity_level": { - "type": "long" - }, - "integrity_level_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "is_appcontainer": { - "type": "boolean" - }, - "privileges": { - "properties": { - "description": { - "ignore_above": 1024, - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - }, - "type": "nested" - }, - "sid": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "tty_device": { - "properties": { - "major_number": { - "type": "integer" - }, - "minor_number": { - "type": "integer" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "uptime": { - "type": "long" - }, - "user": { - "ignore_above": 1024, - "type": "keyword" - }, - "virt_memory_bytes": { - "ignore_above": 1024, - "type": "keyword" - }, - "working_directory": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "threat": { - "properties": { - "framework": { - "ignore_above": 1024, - "type": "keyword" - }, - "tactic": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "reference": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "technique": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "reference": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "user": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "email": { - "ignore_above": 1024, - "type": "keyword" - }, - "full_name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "settings": { - "index": { - "codec": "best_compression", - "lifecycle": { - "name": "events-default" - }, - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "number_of_replicas": "1", - "number_of_shards": "1", - "query": { - "default_field": [ - "message" - ] - }, - "refresh_interval": "5s" - } - } - } -} - -{ - "type": "index", - "value": { - "aliases": { - }, - "index": "metrics-endpoint-default-1", - "mappings": { - "_meta": { - "version": "1.5.0-dev" - }, - "date_detection": false, - "dynamic_templates": [ - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" - } - } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "agent": { - "properties": { - "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "elastic": { - "properties": { - "agent": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "endpoint": { - "properties": { - "policy": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - } - } - }, - "event": { - "properties": { - "created": { - "type": "date" - } - } - }, - "host": { - "properties": { - "architecture": { - "ignore_above": 1024, - "type": "keyword" - }, - "containerized": { - "type": "boolean" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "build": { - "ignore_above": 1024, - "type": "keyword" - }, - "codename": { - "ignore_above": 1024, - "type": "keyword" - }, - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "fields": { - "text": { - "norms": false, - "type": "text" - } - }, - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "variant": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "stream": { - "properties": { - "dataset": { - "type": "constant_keyword" - }, - "namespace": { - "type": "constant_keyword" - }, - "type": { - "type": "constant_keyword" - } - } - } - } - }, - "settings": { - "index": { - "codec": "best_compression", - "lifecycle": { - "name": "metrics-default" - }, - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "number_of_replicas": "1", - "number_of_shards": "1", - "query": { - "default_field": [ - "message" - ] - }, - "refresh_interval": "5s" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/services/transform/api.ts b/x-pack/test/functional/services/transform/api.ts index a805f5a3b6013..697020fafb196 100644 --- a/x-pack/test/functional/services/transform/api.ts +++ b/x-pack/test/functional/services/transform/api.ts @@ -20,6 +20,21 @@ export function TransformAPIProvider({ getService }: FtrProviderContext) { const esSupertest = getService('esSupertest'); return { + async createIndices(indices: string) { + log.debug(`Creating indices: '${indices}'...`); + if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === true) { + log.debug(`Indices '${indices}' already exist. Nothing to create.`); + return; + } + + const createResponse = await es.indices.create({ index: indices }); + expect(createResponse) + .to.have.property('acknowledged') + .eql(true, 'Response for create request indices should be acknowledged.'); + + await this.waitForIndicesToExist(indices, `expected ${indices} to be created`); + }, + async deleteIndices(indices: string) { log.debug(`Deleting indices: '${indices}'...`); if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === false) { @@ -34,11 +49,25 @@ export function TransformAPIProvider({ getService }: FtrProviderContext) { .to.have.property('acknowledged') .eql(true, 'Response for delete request should be acknowledged'); - await retry.waitForWithTimeout(`'${indices}' indices to be deleted`, 30 * 1000, async () => { + await this.waitForIndicesNotToExist(indices, `expected indices '${indices}' to be deleted`); + }, + + async waitForIndicesToExist(indices: string, errorMsg?: string) { + await retry.tryForTime(30 * 1000, async () => { + if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === true) { + return true; + } else { + throw new Error(errorMsg || `indices '${indices}' should exist`); + } + }); + }, + + async waitForIndicesNotToExist(indices: string, errorMsg?: string) { + await retry.tryForTime(30 * 1000, async () => { if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === false) { return true; } else { - throw new Error(`expected indices '${indices}' to be deleted`); + throw new Error(errorMsg || `indices '${indices}' should not exist`); } }); }, @@ -63,9 +92,7 @@ export function TransformAPIProvider({ getService }: FtrProviderContext) { async getTransformState(transformId: string): Promise { const stats = await this.getTransformStats(transformId); - const state: TRANSFORM_STATE = stats.state; - - return state; + return stats.state; }, async waitForTransformState(transformId: string, expectedState: TRANSFORM_STATE) { @@ -96,8 +123,8 @@ export function TransformAPIProvider({ getService }: FtrProviderContext) { }); }, - async getTransform(transformId: string) { - return await esSupertest.get(`/_transform/${transformId}`).expect(200); + async getTransform(transformId: string, expectedCode = 200) { + return await esSupertest.get(`/_transform/${transformId}`).expect(expectedCode); }, async createTransform(transformConfig: TransformPivotConfig) { @@ -105,11 +132,27 @@ export function TransformAPIProvider({ getService }: FtrProviderContext) { log.debug(`Creating transform with id '${transformId}'...`); await esSupertest.put(`/_transform/${transformId}`).send(transformConfig).expect(200); - await retry.waitForWithTimeout(`'${transformId}' to be created`, 5 * 1000, async () => { - if (await this.getTransform(transformId)) { + await this.waitForTransformToExist( + transformId, + `expected transform '${transformId}' to be created` + ); + }, + + async waitForTransformToExist(transformId: string, errorMsg?: string) { + await retry.waitForWithTimeout(`'${transformId}' to exist`, 5 * 1000, async () => { + if (await this.getTransform(transformId, 200)) { + return true; + } else { + throw new Error(errorMsg || `expected transform '${transformId}' to exist`); + } + }); + }, + async waitForTransformNotToExist(transformId: string, errorMsg?: string) { + await retry.waitForWithTimeout(`'${transformId}' to exist`, 5 * 1000, async () => { + if (await this.getTransform(transformId, 404)) { return true; } else { - throw new Error(`expected transform '${transformId}' to be created`); + throw new Error(errorMsg || `expected transform '${transformId}' to not exist`); } }); }, diff --git a/x-pack/test/functional_endpoint/page_objects/page_utils.ts b/x-pack/test/functional_endpoint/page_objects/page_utils.ts deleted file mode 100644 index daf66464f7e1e..0000000000000 --- a/x-pack/test/functional_endpoint/page_objects/page_utils.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { FtrProviderContext } from '../ftr_provider_context'; - -export function EndpointPageUtils({ getService }: FtrProviderContext) { - const find = getService('find'); - - return { - /** - * Finds a given EuiCheckbox by test subject and clicks on it - * - * @param euiCheckBoxTestId - */ - async clickOnEuiCheckbox(euiCheckBoxTestId: string) { - // This utility is needed because EuiCheckbox forwards the test subject on to - // the actual `` which is not actually visible/accessible on the page. - // In order to actually cause the state of the checkbox to change, the `