diff --git a/.buildkite/pipelines/performance/daily.yml b/.buildkite/pipelines/performance/daily.yml index 28f58d6c814ef..fdc4ae17d69a2 100644 --- a/.buildkite/pipelines/performance/daily.yml +++ b/.buildkite/pipelines/performance/daily.yml @@ -19,11 +19,11 @@ steps: depends_on: build key: tests - - label: ':shipit: Performance Tests dataset extraction for scalability benchmarking' - command: .buildkite/scripts/steps/functional/scalability_dataset_extraction.sh - agents: - queue: n2-2 - depends_on: tests + # - label: ':shipit: Performance Tests dataset extraction for scalability benchmarking' + # command: .buildkite/scripts/steps/functional/scalability_dataset_extraction.sh + # agents: + # queue: n2-2 + # depends_on: tests - label: ':chart_with_upwards_trend: Report performance metrics to ci-stats' command: .buildkite/scripts/steps/functional/report_performance_metrics.sh diff --git a/.buildkite/pipelines/pull_request/base.yml b/.buildkite/pipelines/pull_request/base.yml index eca8e8280d8e8..36989003428e2 100644 --- a/.buildkite/pipelines/pull_request/base.yml +++ b/.buildkite/pipelines/pull_request/base.yml @@ -75,10 +75,3 @@ steps: automatic: - exit_status: '-1' limit: 3 - - - command: .buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh - label: 'Build Webpack Bundle Analyzer reports' - agents: - queue: c2-16 - key: webpack_bundle_analyzer - timeout_in_minutes: 60 diff --git a/.buildkite/pipelines/pull_request/deploy_cloud.yml b/.buildkite/pipelines/pull_request/deploy_cloud.yml index c6a15ec32e179..7185911953232 100644 --- a/.buildkite/pipelines/pull_request/deploy_cloud.yml +++ b/.buildkite/pipelines/pull_request/deploy_cloud.yml @@ -2,6 +2,10 @@ steps: - command: .buildkite/scripts/steps/cloud/build_and_deploy.sh label: 'Build and Deploy to Cloud' agents: - queue: n2-2 + queue: n2-2-spot depends_on: build timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '-1' + limit: 3 diff --git a/.buildkite/pipelines/pull_request/webpack_bundle_analyzer.yml b/.buildkite/pipelines/pull_request/webpack_bundle_analyzer.yml new file mode 100644 index 0000000000000..f1e61875fa254 --- /dev/null +++ b/.buildkite/pipelines/pull_request/webpack_bundle_analyzer.yml @@ -0,0 +1,7 @@ +steps: + - command: .buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh + label: 'Build Webpack Bundle Analyzer reports' + agents: + queue: n2-4-spot + key: webpack_bundle_analyzer + timeout_in_minutes: 60 diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 0777eca88dca8..025a8b497c544 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -126,6 +126,10 @@ const uploadPipeline = (pipelineContent: string | object) => { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/deploy_cloud.yml')); } + if (GITHUB_PR_LABELS.includes('ci:build-webpack-bundle-analyzer')) { + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/webpack_bundle_analyzer.yml')); + } + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml')); uploadPipeline(pipeline.join('\n')); diff --git a/.buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh b/.buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh index 4374cce2281f8..24d08f7d5dc0a 100755 --- a/.buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh +++ b/.buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh @@ -4,6 +4,8 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh +export NODE_OPTIONS="--max-old-space-size=8192" + node scripts/build_kibana_platform_plugins.js --dist --profile mkdir -p built_assets/webpack_bundle_analyzer diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2c39e3171b754..7377ea3ffe353 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -331,7 +331,7 @@ # Kibana Platform Security /packages/kbn-crypto/ @elastic/kibana-security /packages/kbn-handlebars/ @elastic/kibana-security -/src/core/server/http/csp/ @elastic/kibana-security @elastic/kibana-core +/packages/core/http/core-http-server-internal/src/csp/ @elastic/kibana-security @elastic/kibana-core /src/plugins/interactive_setup/ @elastic/kibana-security /test/interactive_setup_api_integration/ @elastic/kibana-security /test/interactive_setup_functional/ @elastic/kibana-security diff --git a/.github/workflows/on-merge.yml b/.github/workflows/on-merge.yml index 34e95749a9c5e..072767f0000eb 100644 --- a/.github/workflows/on-merge.yml +++ b/.github/workflows/on-merge.yml @@ -1,7 +1,5 @@ on: pull_request_target: - branches: - - main types: - closed - labeled @@ -12,12 +10,7 @@ jobs: runs-on: ubuntu-latest if: | github.event.pull_request.merged == true - && ( - contains(github.event.pull_request.labels.*.name, 'backport:prev-minor') - || contains(github.event.pull_request.labels.*.name, 'backport:prev-major') - || contains(github.event.pull_request.labels.*.name, 'backport:all-open') - || contains(github.event.pull_request.labels.*.name, 'backport:auto-version') - ) + && !contains(github.event.pull_request.labels.*.name, 'auto-backport') && ( ( github.event.action == 'labeled' && ( diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 6a3c68ad48d58..b37fe3df21ad2 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github summary: API docs for the actions plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 9bb5fe3d5b4cc..d7284bf2ba87a 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github summary: API docs for the advancedSettings plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index aeab63cb6ec32..618ea5e1eb78d 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github summary: API docs for the aiops plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 6de83d9c2f0ae..7b86f41380cf8 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github summary: API docs for the alerting plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index 1174fcd7766b5..1e52586d92225 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github summary: API docs for the apm plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index a9128dcfbe534..60a50ae742061 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github summary: API docs for the banners plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index a55e23a53a276..d11bfb0ab67a5 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github summary: API docs for the bfetch plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 7225e5901480f..e647d472c91f9 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github summary: API docs for the canvas plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 8130986f8f37c..2aa643e48d15b 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github summary: API docs for the cases plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 94d2a09976d0d..9671ccbe8af2f 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github summary: API docs for the charts plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index c930bf640a69f..01ec58337accf 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github summary: API docs for the cloud plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 66d945d6270ae..21e18763c07cc 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github summary: API docs for the cloudSecurityPosture plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 8cc43448bdab2..bf2db61245112 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github summary: API docs for the console plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index ee8efdd416512..fc1869da56022 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github summary: API docs for the controls plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 437959d2b9df7..1ca2a7bd7646b 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github summary: API docs for the core plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index 7435423973865..73e1cc4df37c8 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-application title: "core.application" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.application plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.application'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index 9472473f24b9d..38935d4adbf2c 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-chrome title: "core.chrome" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.chrome plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.chrome'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_http.mdx b/api_docs/core_http.mdx index 079c924163450..3dca29910f474 100644 --- a/api_docs/core_http.mdx +++ b/api_docs/core_http.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-http title: "core.http" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.http plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.http'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index 87e86a6d4dff9..ef05af39d188d 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-savedObjects title: "core.savedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.savedObjects plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.savedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 93aed293adba1..ee0b3ef00b9be 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github summary: API docs for the customIntegrations plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index bb93d6c8ea90c..17a5f089230cd 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github summary: API docs for the dashboard plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 6d9fedd99c3d4..cb8a65c67c0e3 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the dashboardEnhanced plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 264d88e0a80a7..f6c01d22f9c87 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github summary: API docs for the data plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index ee01b530880cf..50c49ba0251eb 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.query plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 46644a6ce3a47..b141bc3f7fa82 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.search plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 6b36aa2a4838f..a0dfcb172f2c8 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewEditor plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index ea9c70bc46ca1..59bf59eefe9bd 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewFieldEditor plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index 5ae395f21c8f1..d1f57d8a709de 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewManagement plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index d23739df18cd4..affa6f0e564e2 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViews plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index a89043f6918c0..7c3260f17f381 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataVisualizer plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index bea1e416fbb83..671d479bbccc2 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index a1a9497c770b5..fab0384a628df 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 2acb315e3c738..8d5fe5e1eae5d 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team summary: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index d0bd126888036..aa54cbe4f050e 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github summary: API docs for the devTools plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 63ef2090d99be..f65c671bed195 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github summary: API docs for the discover plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 32c9ef7baaad4..0e9c5ec48c255 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the discoverEnhanced plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/elastic_apm_synthtrace.mdx b/api_docs/elastic_apm_synthtrace.mdx index f3a52beef90e5..5ca22a26a6e36 100644 --- a/api_docs/elastic_apm_synthtrace.mdx +++ b/api_docs/elastic_apm_synthtrace.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/elastic-apm-synthtrace title: "@elastic/apm-synthtrace" image: https://source.unsplash.com/400x175/?github summary: API docs for the @elastic/apm-synthtrace plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-synthtrace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index c04fd527e5e5f..80b1999d682a5 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -2513,6 +2513,21 @@ ], "returnComment": [] }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.reportsEmbeddableLoad", + "type": "Function", + "tags": [], + "label": "reportsEmbeddableLoad", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "embeddable", "id": "def-public.Embeddable.refreshInputFromParent", @@ -6200,6 +6215,50 @@ "deprecated": false } ] + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableChildPanelProps.onPanelStatusChange", + "type": "Function", + "tags": [], + "label": "onPanelStatusChange", + "description": [], + "signature": [ + "((info: ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.EmbeddablePhaseEvent", + "text": "EmbeddablePhaseEvent" + }, + ") => void) | undefined" + ], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableChildPanelProps.onPanelStatusChange.$1", + "type": "Object", + "tags": [], + "label": "info", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.EmbeddablePhaseEvent", + "text": "EmbeddablePhaseEvent" + } + ], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false @@ -6917,6 +6976,19 @@ "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableOutput.rendered", + "type": "CompoundType", + "tags": [], + "label": "rendered", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false + }, { "parentPluginId": "embeddable", "id": "def-public.EmbeddableOutput.error", @@ -7116,6 +7188,72 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddablePhaseEvent", + "type": "Interface", + "tags": [], + "label": "EmbeddablePhaseEvent", + "description": [], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddablePhaseEvent.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddablePhaseEvent.status", + "type": "CompoundType", + "tags": [], + "label": "status", + "description": [], + "signature": [ + "\"loading\" | \"error\" | \"loaded\" | \"rendered\"" + ], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddablePhaseEvent.error", + "type": "CompoundType", + "tags": [], + "label": "error", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ErrorLike", + "text": "ErrorLike" + }, + " | undefined" + ], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddablePhaseEvent.timeToEvent", + "type": "number", + "tags": [], + "label": "timeToEvent", + "description": [], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "embeddable", "id": "def-public.EmbeddableSetupDependencies", @@ -8082,6 +8220,23 @@ "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false }, + { + "parentPluginId": "embeddable", + "id": "def-public.IEmbeddable.reportsEmbeddableLoad", + "type": "Function", + "tags": [], + "label": "reportsEmbeddableLoad", + "description": [ + "\nThis method returns false by default.\nIt should be set to true for any embeddable type that utilizes the `loading` and `rendered`\noutput variables to notify a container of their loading progress. If set to false, a container should assume\nthe embeddable is loaded immediately." + ], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.getIsContainer", @@ -9197,6 +9352,20 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddablePhase", + "type": "Type", + "tags": [], + "label": "EmbeddablePhase", + "description": [], + "signature": [ + "\"loading\" | \"error\" | \"loaded\" | \"rendered\"" + ], + "path": "src/plugins/embeddable/public/lib/containers/embeddable_child_panel.tsx", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "embeddable", "id": "def-public.EmbeddableRendererProps", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 6823ec57019c5..e4131ab27841b 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github summary: API docs for the embeddable plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 494 | 0 | 403 | 3 | +| 505 | 0 | 413 | 3 | ## Client diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index eafa8561e09f3..57a314069ec80 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the embeddableEnhanced plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 85d2f0d185835..6d81ac8710d6d 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the encryptedSavedObjects plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/enterprise_search.devdocs.json b/api_docs/enterprise_search.devdocs.json index fdbc357cfd7a5..18f9b884e77d7 100644 --- a/api_docs/enterprise_search.devdocs.json +++ b/api_docs/enterprise_search.devdocs.json @@ -41,6 +41,34 @@ "path": "x-pack/plugins/enterprise_search/server/index.ts", "deprecated": false, "initialIsOpen": false + }, + { + "parentPluginId": "enterpriseSearch", + "id": "def-server.CONNECTORS_JOBS_INDEX", + "type": "string", + "tags": [], + "label": "CONNECTORS_JOBS_INDEX", + "description": [], + "signature": [ + "\".elastic-connectors-sync-jobs\"" + ], + "path": "x-pack/plugins/enterprise_search/server/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "enterpriseSearch", + "id": "def-server.CONNECTORS_VERSION", + "type": "string", + "tags": [], + "label": "CONNECTORS_VERSION", + "description": [], + "signature": [ + "\"1\"" + ], + "path": "x-pack/plugins/enterprise_search/server/index.ts", + "deprecated": false, + "initialIsOpen": false } ], "objects": [ diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index d5564539277ec..e63cd6c903d56 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the enterpriseSearch plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-sea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 3 | 0 | +| 5 | 0 | 5 | 0 | ## Server diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 12156e65690e1..9af8efc8273f8 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github summary: API docs for the esUiShared plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 267cea8167c2a..ef1af364265bd 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github summary: API docs for the eventAnnotation plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 7fbf7901119f2..8f4e382d5481b 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github summary: API docs for the eventLog plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index ff4b2a24ecb2f..51094be114475 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionError plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index db52c844525a6..e50484b266e4c 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionGauge plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 1b2331648d3cb..685f99a7ba9e0 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionHeatmap plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 43ad3c539dc2c..2e1f71c8bdd5c 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionImage plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 5cff7dee72072..9e6300966a37f 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionLegacyMetricVis plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index 4684cb5b973fd..e8985aa1d6ed7 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionMetric plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index b1e2f1471edda..ed1d2c1b8385d 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionMetricVis plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 3924654b91170..0dc3ea7c83883 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionPartitionVis plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 030403bcbbdaa..fff23cee1715b 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionRepeatImage plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index cdb11e20cfb8b..03329e37a283c 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionRevealImage plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 369245d5ac060..e9b3fd2668ae8 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionShape plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 14b9723a63d1a..1cf371bedce39 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionTagcloud plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_x_y.devdocs.json b/api_docs/expression_x_y.devdocs.json index befebac94be4d..8e4323a0f0114 100644 --- a/api_docs/expression_x_y.devdocs.json +++ b/api_docs/expression_x_y.devdocs.json @@ -595,13 +595,13 @@ }, { "parentPluginId": "expressionXY", - "id": "def-common.DataLayerArgs.splitAccessor", - "type": "CompoundType", + "id": "def-common.DataLayerArgs.splitAccessors", + "type": "Array", "tags": [], - "label": "splitAccessor", + "label": "splitAccessors", "description": [], "signature": [ - "string | ", + "(string | ", { "pluginId": "visualizations", "scope": "common", @@ -609,7 +609,7 @@ "section": "def-common.ExpressionValueVisDimension", "text": "ExpressionValueVisDimension" }, - " | undefined" + ")[] | undefined" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index b80f2be3cc15d..07590478a7e0e 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionXY plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 011781bbddfaf..f8c304a1aeab4 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressions plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 9ac804b9c7f97..d6353777ae421 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github summary: API docs for the features plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 636a253a8f9c5..3f308b1e45891 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github summary: API docs for the fieldFormats plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index b66cb5c8b9b8f..0a0984a7c1b61 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github summary: API docs for the fileUpload plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index a450ab9b36268..0e8db05a8eb7a 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -12195,7 +12195,7 @@ "label": "developer", "description": [], "signature": [ - "{ disableRegistryVersionCheck?: boolean | undefined; allowAgentUpgradeSourceUri?: boolean | undefined; bundledPackageLocation?: string | undefined; } | undefined" + "{ disableRegistryVersionCheck?: boolean | undefined; bundledPackageLocation?: string | undefined; } | undefined" ], "path": "x-pack/plugins/fleet/common/types/index.ts", "deprecated": false @@ -13263,7 +13263,7 @@ "label": "agent", "description": [], "signature": [ - "{ monitoring: { namespace?: string | undefined; use_output?: string | undefined; enabled: boolean; metrics: boolean; logs: boolean; }; } | undefined" + "{ monitoring: { namespace?: string | undefined; use_output?: string | undefined; enabled: boolean; metrics: boolean; logs: boolean; }; download: { source_uri: string; }; } | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", "deprecated": false @@ -16030,6 +16030,19 @@ ], "path": "x-pack/plugins/fleet/common/types/models/agent.ts", "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.NewAgentAction.source_uri", + "type": "string", + "tags": [], + "label": "source_uri", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/fleet/common/types/models/agent.ts", + "deprecated": false } ], "initialIsOpen": false @@ -20597,7 +20610,7 @@ "label": "DEFAULT_DOWNLOAD_SOURCE", "description": [], "signature": [ - "\"artifactory.elastic.co\"" + "\"https://artifacts.elastic.co\"" ], "path": "x-pack/plugins/fleet/common/constants/download_source.ts", "deprecated": false, diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 1d5d8cf4433d3..9e4d8abbf4299 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github summary: API docs for the fleet plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1521 | 8 | 1389 | 10 | +| 1522 | 8 | 1390 | 10 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 4375bd831943c..dd60d001c83c5 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the globalSearch plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/home.mdx b/api_docs/home.mdx index f29525b9660c6..dcf20af6a1d11 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github summary: API docs for the home plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index 67947a561bb54..c806e66c7e64b 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the indexLifecycleManagement plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 73c9bfe87d846..05e767cf2fc4c 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the indexManagement plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 222c23bdb6509..d2c9347b374b5 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github summary: API docs for the infra plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index c0a93d711a7f7..db6eb55ddad01 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github summary: API docs for the inspector plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index b4b19e9562ba3..632870059bc83 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github summary: API docs for the interactiveSetup plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 778ed11e62f8b..d33da0ffedfeb 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ace plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index 96576bb02deb9..67908b73aaf91 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/aiops-components plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index 09f193d8a9537..16b93b3725319 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/aiops-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index 91a14011423e6..50b568cc1982a 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/alerts plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 0f7755bfc8062..13aa2734bd079 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index 332fdb73fd3a4..276c72a842dfc 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-client plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index 529dfc5acacab..4b9a8759b2b1b 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 9c3967a0fecb5..7e0390fc7d255 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index 667256e28f64d..8e9c1a191211b 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 54ae769be4ae3..17813d56492b2 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 14852dc700709..5c00309bd8842 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/apm-config-loader plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 1ff4abd0f55ce..5203af444072a 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/apm-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index b202a9a9cfdef..c94abfadcbe05 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/axe-config plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_bazel_packages.devdocs.json b/api_docs/kbn_bazel_packages.devdocs.json index 993554aca7636..23cf46d140b55 100644 --- a/api_docs/kbn_bazel_packages.devdocs.json +++ b/api_docs/kbn_bazel_packages.devdocs.json @@ -273,7 +273,7 @@ "\nResolve all the BAZEL_PACKAGE_DIRS to absolute paths" ], "signature": [ - "() => EntryInternal[] & string[]" + "() => string[]" ], "path": "packages/kbn-bazel-packages/src/bazel_package_dirs.ts", "deprecated": false, diff --git a/api_docs/kbn_bazel_packages.mdx b/api_docs/kbn_bazel_packages.mdx index d19ab27d92791..99c31ede3a39d 100644 --- a/api_docs/kbn_bazel_packages.mdx +++ b/api_docs/kbn_bazel_packages.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-bazel-packages title: "@kbn/bazel-packages" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/bazel-packages plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bazel-packages'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_bazel_runner.mdx b/api_docs/kbn_bazel_runner.mdx index b1fd1876c09ba..6d99f6c5f5299 100644 --- a/api_docs/kbn_bazel_runner.mdx +++ b/api_docs/kbn_bazel_runner.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-bazel-runner title: "@kbn/bazel-runner" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/bazel-runner plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bazel-runner'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index 2facf632dafac..dc14fb459eb97 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ci-stats-core plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index b2874a4da8d9f..38dc0a15f5175 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index 7439499dff91b..869643ad84802 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ci-stats-reporter plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index 37279e889ea88..15587ab667343 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/cli-dev-mode plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index d2dc78fec048b..471a883e4db00 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/coloring plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index d4a5758d97d36..e3f717c4d980a 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index f57c62bce7588..c8d686e8deda8 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index c34ce93917eca..a9387c456838b 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config-schema plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 54e272ba8f24a..2fc459ffbbe1a 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 238466b0bc836..c28cc9230262a 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 4ee730630133b..c3dea4bb4fec1 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 23f971a7fa394..f2f99d527dd31 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index d8449d6fb77ba..e6e247e4970ab 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 5f5424903ca16..92e3d24c1bedb 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 13a20f7bf2651..ad6288df80ee0 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index 3d12c39483629..ba1e4abd15ae2 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-common plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index 949707ddb21cd..c7d4e0c80c19e 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index 14c0ed2fbdd9d..d2b99c2f95faf 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-base-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 43c40203cab67..9c7741208effb 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-config-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 267a92638519d..1a969e948111d 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 7d08334721f27..cd9441faafeae 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index d5899796f92a5..e960e0a78e180 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index 914b5e628d8fe..6fcdb8e176c21 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index b7f620d289b32..51a204698e524 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-environment-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index f92206181f315..d430edc47a08a 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-environment-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 67180407420af..83698a759bb1b 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 9a47c6234f5f5..ea919a39c9a6d 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 7b070bb886e74..05abf8327f857 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index b3029382d72f3..959a2dbc027ba 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-common plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index 85a04d37b8516..a88ed431d022f 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index c90863c336653..22d3cdf2819ec 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index cbb0cf2b71184..368b325e127a5 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 3f5f0b109b441..a7b2329ec2369 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index a6477204a3a97..bfea5fb0095d6 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 291d5de25b786..742d0816a7548 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index d6a148344a269..c6859f2ef93e6 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-browser-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index 0f45a7c9b362c..df680225c6251 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index 7919a429d38d1..97ec4742c8089 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-common plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 7e649339c0607..80871a81a9d25 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-http-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index a91021ebc1dfc..fd5dc5578ec45 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-i18n-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index fbce78c64125f..451a717d03e00 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index ccc520c13af17..e1277bff51595 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 36fef0f5ed33e..315b6ccb8dd93 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index 916fd50bd6dcc..1e2f604a6658a 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-logging-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 2e9b6efde4e40..6c2e940096f8a 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-logging-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 69f605b770090..41a4a645ccbb6 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-logging-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 226cef67aac46..1b2f3c80de467 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-node-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 55bdfa7ae888f..5885b29b2c8c8 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-node-server-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index 0ab1f3154b7c6..9e667be321173 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-node-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 8ae587b311f54..b109431d1dbad 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-preboot-server plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 7cf1640f3a81e..ed3173fb57216 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index 2696e5095f1d9..09957ca3e6854 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-theme-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index a74da07fc7a1b..c3a60618f7845 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index df4a00590b746..3a7174fc1b2e3 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index f4ccbc6836131..7c0e6e7648ffa 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/crypto plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 88264483fc9a8..6017c04753893 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/crypto-browser plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index e023e9079e2bd..87f44ac0da128 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/datemath plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 9d1c3ffc9df7b..0889027b5ed49 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-cli-errors plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 81266da8d2371..759f8039981f8 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-cli-runner plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 46ef619d15bad..2d5e8095c3ffd 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-proc-runner plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index a303d0746a4b7..2a578260588bf 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_doc_links.devdocs.json b/api_docs/kbn_doc_links.devdocs.json index c50316d8d36b3..75ecd04cd953b 100644 --- a/api_docs/kbn_doc_links.devdocs.json +++ b/api_docs/kbn_doc_links.devdocs.json @@ -510,7 +510,7 @@ "label": "securitySolution", "description": [], "signature": [ - "{ readonly trustedApps: string; readonly eventFilters: string; readonly blocklist: string; readonly policyResponseTroubleshooting: { full_disk_access: string; }; }" + "{ readonly trustedApps: string; readonly eventFilters: string; readonly blocklist: string; readonly policyResponseTroubleshooting: { full_disk_access: string; macos_system_ext: string; }; }" ], "path": "packages/kbn-doc-links/src/types.ts", "deprecated": false diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index b14e9bc396e94..00ef15c27f6c6 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/doc-links plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index 795ed22797a5a..1745e95ece2ba 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/docs-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index fe26cd2e11499..59a8a0413c64c 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-archiver plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 48142c6196171..65d64b1d89a75 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-errors plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 2d8bae60b8638..9084761693e28 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-query plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 1cdf11398ec25..46381bd6e4ed9 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/eslint-plugin-imports plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 11fe0ce3bfe4c..851a8217b16ca 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/field-types plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index f575ed9e96acf..c1e107406b828 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/find-used-node-modules plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index 0774a78983edf..b77f7771f716b 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/generate plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index 1a82a8e4b4e05..c9dfd16d549fe 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/handlebars plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index 9883c92e94510..74193484aaa01 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/hapi-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_home_sample_data_cards.mdx b/api_docs/kbn_home_sample_data_cards.mdx index 03317518065c2..ff0d667da085f 100644 --- a/api_docs/kbn_home_sample_data_cards.mdx +++ b/api_docs/kbn_home_sample_data_cards.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-cards title: "@kbn/home-sample-data-cards" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/home-sample-data-cards plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-cards'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index c9e59b4d88f57..c8164c7778e15 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/i18n plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 8bf9d49d6575e..95f220bd9fb5b 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/import-resolver plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 96b22326b2c91..ea07bac765030 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/interpreter plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 39cdff5e68ec7..2b5ce56a5d60f 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/io-ts-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 893c265de79fb..a994586c8a74e 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/jest-serializers plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_kibana_json_schema.mdx b/api_docs/kbn_kibana_json_schema.mdx index 79d914b9c4185..e351775e76cee 100644 --- a/api_docs/kbn_kibana_json_schema.mdx +++ b/api_docs/kbn_kibana_json_schema.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-json-schema title: "@kbn/kibana-json-schema" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/kibana-json-schema plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-json-schema'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index a6d3a89102cab..d2b10fc180773 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/logging plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 1eb5f32f3d4e6..e6ebec63e1632 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/logging-mocks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index cb2f5e70cdbd0..28115f56adc24 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/mapbox-gl plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index 571327db19dae..d9073ce0d303d 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ml-agg-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index cb6bb04de04ac..a9e31ddb35448 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ml-is-populated-object plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index cbf44d612dba3..f9f2be975e065 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ml-string-hash plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 00c57bd021c12..c51c233e79489 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/monaco plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 362dc2c3a5978..26d65a3ead693 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/optimizer plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index af2b4599c64e9..401301b348c9e 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 0bfc7e8a1d076..f57e25cf322cb 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_discovery.mdx b/api_docs/kbn_plugin_discovery.mdx index cb9dc8fd3de57..55e9a6b95abc0 100644 --- a/api_docs/kbn_plugin_discovery.mdx +++ b/api_docs/kbn_plugin_discovery.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-discovery title: "@kbn/plugin-discovery" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-discovery plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-discovery'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index e342972b344dc..e4578b1f4a432 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-generator plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 2d2c6844989a3..4374d72505a63 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-helpers plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_pm.mdx b/api_docs/kbn_pm.mdx index 87b48361f3fda..da5a74d30c957 100644 --- a/api_docs/kbn_pm.mdx +++ b/api_docs/kbn_pm.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-pm title: "@kbn/pm" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/pm plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/pm'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 34861771b09ba..ca8e694697cd0 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/react-field plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 801fc84fe142a..5482e0bedb1a2 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/rule-data-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_scalability_simulation_generator.mdx b/api_docs/kbn_scalability_simulation_generator.mdx index c9819fefe3b25..e79d76f12349e 100644 --- a/api_docs/kbn_scalability_simulation_generator.mdx +++ b/api_docs/kbn_scalability_simulation_generator.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-scalability-simulation-generator title: "@kbn/scalability-simulation-generator" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/scalability-simulation-generator plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scalability-simulation-generator'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index d1729ee7ab846..e8ccd05d48c9a 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 6f3ce2b2f2a98..6c944bcd5e19e 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 39bad06541b21..6728b6ba14dee 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 5f574350fb617..347d01b914dbc 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 324b498fc24af..833b86fa341b0 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 83c2de04f5b8b..762606a0b72b1 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index ebd3da11ca2ef..71a19be9283bf 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 5c6f7b44f0bec..b85e37444435f 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index e31530908c658..fe27d37be1ed7 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index cb690f98e6b4e..36797c388c072 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index d923ad7f51457..192b8ec9d7554 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index c3de139828b82..26020f321d906 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-rules plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index 013e6d2f23c68..39c4712d09079 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index 6a69e5117bdc5..bb30474236d0c 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index a116923d595c8..2ae808a2f4544 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/server-http-tools plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index d3d8592d3a56c..a8d94e51fd268 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/server-route-repository plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index b970f9d128768..4fc6f96dc869a 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 940fe818df34d..3120a76d22182 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_components.devdocs.json b/api_docs/kbn_shared_ux_components.devdocs.json index 36b5a90b05801..52bb9bcd5d8b0 100644 --- a/api_docs/kbn_shared_ux_components.devdocs.json +++ b/api_docs/kbn_shared_ux_components.devdocs.json @@ -66,43 +66,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplateSolutionNav", - "type": "Function", - "tags": [], - "label": "KibanaPageTemplateSolutionNav", - "description": [ - "\nA wrapper around EuiSideNav but also creates the appropriate title with optional solution logo" - ], - "signature": [ - "({ children, headingProps, icon, isOpenOnDesktop, items, mobileBreakpoints, closeFlyoutButtonPosition, name, onCollapse, canBeCollapsed, ...rest }: React.PropsWithChildren<", - "KibanaPageTemplateSolutionNavProps", - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplateSolutionNav.$1", - "type": "CompoundType", - "tags": [], - "label": "{\n children,\n headingProps,\n icon,\n isOpenOnDesktop = false,\n items,\n mobileBreakpoints = ['xs', 's'],\n closeFlyoutButtonPosition = 'outside',\n name,\n onCollapse,\n canBeCollapsed = true,\n ...rest\n}", - "description": [], - "signature": [ - "React.PropsWithChildren<", - "KibanaPageTemplateSolutionNavProps", - ">" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/shared-ux-components", "id": "def-common.NoDataConfigPage", @@ -273,7 +236,7 @@ " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", "Property", ".MinHeight | undefined; } & { isEmptyState?: boolean | undefined; solutionNav?: ", - "KibanaPageTemplateSolutionNavProps", + "SolutionNavProps", " | undefined; noDataConfig?: ", { "pluginId": "@kbn/shared-ux-components", diff --git a/api_docs/kbn_shared_ux_components.mdx b/api_docs/kbn_shared_ux_components.mdx index f460e297eb49f..55b064588053a 100644 --- a/api_docs/kbn_shared_ux_components.mdx +++ b/api_docs/kbn_shared_ux_components.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-components title: "@kbn/shared-ux-components" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-components plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-components'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 7 | 1 | +| 11 | 0 | 6 | 0 | ## Common diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index d6fdca0a23148..b2c92e8913396 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 3328f0bcac453..d1c4b518a2b54 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_page_solution_nav.devdocs.json b/api_docs/kbn_shared_ux_page_solution_nav.devdocs.json new file mode 100644 index 0000000000000..7331e1f6ac1e0 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_solution_nav.devdocs.json @@ -0,0 +1,131 @@ +{ + "id": "@kbn/shared-ux-page-solution-nav", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-solution-nav", + "id": "def-common.SolutionNav", + "type": "Function", + "tags": [], + "label": "SolutionNav", + "description": [ + "\nA wrapper around `EuiSideNav` that includes the appropriate title with optional solution logo." + ], + "signature": [ + "({ children, headingProps, icon, isOpenOnDesktop, items, mobileBreakpoints, closeFlyoutButtonPosition, name, onCollapse, canBeCollapsed, ...rest }: React.PropsWithChildren<", + { + "pluginId": "@kbn/shared-ux-page-solution-nav", + "scope": "common", + "docId": "kibKbnSharedUxPageSolutionNavPluginApi", + "section": "def-common.SolutionNavProps", + "text": "SolutionNavProps" + }, + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/solution_nav/src/solution_nav.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-solution-nav", + "id": "def-common.SolutionNav.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n headingProps,\n icon,\n isOpenOnDesktop = false,\n items,\n mobileBreakpoints = ['xs', 's'],\n closeFlyoutButtonPosition = 'outside',\n name,\n onCollapse,\n canBeCollapsed = true,\n ...rest\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + { + "pluginId": "@kbn/shared-ux-page-solution-nav", + "scope": "common", + "docId": "kibKbnSharedUxPageSolutionNavPluginApi", + "section": "def-common.SolutionNavProps", + "text": "SolutionNavProps" + }, + ">" + ], + "path": "packages/shared-ux/page/solution_nav/src/solution_nav.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-solution-nav", + "id": "def-common.withSolutionNav", + "type": "Function", + "tags": [], + "label": "withSolutionNav", + "description": [], + "signature": [ + "

(WrappedComponent: React.ComponentType

) => { (props: Props

): JSX.Element; displayName: string; }" + ], + "path": "packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-solution-nav", + "id": "def-common.withSolutionNav.$1", + "type": "CompoundType", + "tags": [], + "label": "WrappedComponent", + "description": [], + "signature": [ + "React.ComponentType

" + ], + "path": "packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-solution-nav", + "id": "def-common.SolutionNavProps", + "type": "Type", + "tags": [], + "label": "SolutionNavProps", + "description": [ + "\nProps for the `SolutionNav` component." + ], + "signature": [ + "Omit<", + "EuiSideNavProps", + "<{}>, \"children\" | \"heading\" | \"items\"> & { name: string; icon?: ", + "IconType", + " | undefined; items?: ", + "EuiSideNavItemType", + "<{}>[] | undefined; children?: React.ReactNode; closeFlyoutButtonPosition?: \"outside\" | \"inside\" | undefined; isOpenOnDesktop?: boolean | undefined; onCollapse?: (() => void) | undefined; canBeCollapsed?: boolean | undefined; }" + ], + "path": "packages/shared-ux/page/solution_nav/src/solution_nav.tsx", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx new file mode 100644 index 0000000000000..ec5eb2ca715e7 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -0,0 +1,30 @@ +--- +id: kibKbnSharedUxPageSolutionNavPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav +title: "@kbn/shared-ux-page-solution-nav" +image: https://source.unsplash.com/400x175/?github +summary: API docs for the @kbn/shared-ux-page-solution-nav plugin +date: 2022-07-13 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- +import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 5 | 0 | 3 | 0 | + +## Common + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index 10146ed75c83d..3cd347e515853 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_services.mdx b/api_docs/kbn_shared_ux_services.mdx index 65e7140afe28c..0d2aefce71fdc 100644 --- a/api_docs/kbn_shared_ux_services.mdx +++ b/api_docs/kbn_shared_ux_services.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-services title: "@kbn/shared-ux-services" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-services plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-services'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_storybook.mdx b/api_docs/kbn_shared_ux_storybook.mdx index 3f1d95b263164..42b4f931b1d85 100644 --- a/api_docs/kbn_shared_ux_storybook.mdx +++ b/api_docs/kbn_shared_ux_storybook.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook title: "@kbn/shared-ux-storybook" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-storybook plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index d5c7f5e56b8e8..711fb0e0cd990 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/shared-ux-utility plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_sort_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index 8830a177ce2b6..5ae42cf4f2d29 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/sort-package-json plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index b472b5fbd8f4a..00e47f058bb0e 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/std plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 35ae6b8cef450..a3912ad4534f4 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/stdio-dev-helpers plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 1b12c02aec7e8..6bd0a35d7781a 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/storybook plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index b235a059a2d8b..01f7ecfa62fa7 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/telemetry-tools plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 651f4786f0156..e02a0e7631088 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/test plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 20835dd2e1608..e5a7fbdfff162 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/test-jest-helpers plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 349f171f5b3be..f5328706fcf4b 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/tooling-log plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index 3055d6d304109..f243d4dc40658 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/type-summarizer plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index 1aebf107aa27b..82bdca5e9d8b2 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/type-summarizer-core plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index 52e8ddec81689..3bb61421b625d 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/typed-react-router-config plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 062a5b9078aca..1b007f581dd8f 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ui-theme plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index f53d7e1be0ea1..6464c4216069e 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utility-types plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index 4d2355b63a94b..f1ca30178f685 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utility-types-jest plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 6eafcf2fc3a70..66520bf1db066 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 91aac1a61eb61..ca0fd397bc94c 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaOverview plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 687eae60179b7..3c4b6ed0309fc 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaReact plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 92603a4ebea38..e57d0e2d3b29e 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaUtils plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 60c14c122031d..736bf513869f4 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github summary: API docs for the kubernetesSecurity plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/lens.devdocs.json b/api_docs/lens.devdocs.json index 08678f653942c..990dbbafbda78 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -159,6 +159,21 @@ ], "returnComment": [] }, + { + "parentPluginId": "lens", + "id": "def-public.Embeddable.reportsEmbeddableLoad", + "type": "Function", + "tags": [], + "label": "reportsEmbeddableLoad", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "lens", "id": "def-public.Embeddable.supportedTriggers", @@ -1005,13 +1020,13 @@ }, { "parentPluginId": "lens", - "id": "def-public.DataLayerArgs.splitAccessor", - "type": "CompoundType", + "id": "def-public.DataLayerArgs.splitAccessors", + "type": "Array", "tags": [], - "label": "splitAccessor", + "label": "splitAccessors", "description": [], "signature": [ - "string | ", + "(string | ", { "pluginId": "visualizations", "scope": "common", @@ -1019,7 +1034,7 @@ "section": "def-common.ExpressionValueVisDimension", "text": "ExpressionValueVisDimension" }, - " | undefined" + ")[] | undefined" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index e0450f1abf271..1c49503e62394 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github summary: API docs for the lens plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 600 | 0 | 522 | 40 | +| 601 | 0 | 523 | 40 | ## Client diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 327ab57345a40..331b37523bb0b 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github summary: API docs for the licenseApiGuard plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 66839078a7b6a..7d70dd7118c5b 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the licenseManagement plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 82ff85966ce25..dce399078a361 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github summary: API docs for the licensing plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index bf69a3a893d20..c5bf01ce7e4e4 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github summary: API docs for the lists plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 16ecc45408de0..d0fe3a0d4d7c6 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github summary: API docs for the management plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/maps.devdocs.json b/api_docs/maps.devdocs.json index 8e94db12e16f0..f25dab745052a 100644 --- a/api_docs/maps.devdocs.json +++ b/api_docs/maps.devdocs.json @@ -314,6 +314,21 @@ ], "returnComment": [] }, + { + "parentPluginId": "maps", + "id": "def-public.MapEmbeddable.reportsEmbeddableLoad", + "type": "Function", + "tags": [], + "label": "reportsEmbeddableLoad", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "maps", "id": "def-public.MapEmbeddable.inputIsRefType", diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 72f42307dbf9c..c3af9f2b2b8ce 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github summary: API docs for the maps plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [GIS](https://github.com/orgs/elastic/teams/kibana-gis) for questions re | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 248 | 0 | 247 | 24 | +| 249 | 0 | 248 | 24 | ## Client diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 8ad30bc5269f3..8d4fa80184619 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github summary: API docs for the mapsEms plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 301159f8b1fde..7cf5e6f08934f 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github summary: API docs for the ml plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index c45fee1dc8e79..9a96f5fb71459 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github summary: API docs for the monitoring plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 743a4c1367da1..dd904b036cb13 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github summary: API docs for the monitoringCollection plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index d24a5dac3371e..c34729aae4333 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github summary: API docs for the navigation plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 04cda4bfcf52a..9fd49bf331ce3 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github summary: API docs for the newsfeed plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index cf452389bd2e9..b7ed67de04c43 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -2069,6 +2069,20 @@ "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.legendPosition", + "type": "CompoundType", + "tags": [], + "label": "legendPosition", + "description": [], + "signature": [ + "Position", + " | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, { "parentPluginId": "observability", "id": "def-public.ExploratoryEmbeddableProps.onBrushEnd", @@ -2204,6 +2218,19 @@ ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.align", + "type": "CompoundType", + "tags": [], + "label": "align", + "description": [], + "signature": [ + "\"left\" | \"right\" | \"center\" | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false } ], "initialIsOpen": false diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 25ab9bd4e98c2..71cfee396b9d1 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github summary: API docs for the observability plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 384 | 2 | 381 | 31 | +| 386 | 2 | 383 | 31 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index d6f51adf2a555..52aac69572b83 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github summary: API docs for the osquery plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index aab05ea9dbb1c..80e714e48ffa2 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -3,7 +3,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory summary: Directory of public APIs available through plugins or packages. -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,13 +12,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 334 | 275 | 36 | +| 335 | 276 | 36 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 27391 | 172 | 19498 | 1433 | +| 27414 | 172 | 19519 | 1433 | ## Plugin Directory @@ -52,10 +52,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 79 | 0 | 63 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 494 | 0 | 403 | 3 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 505 | 0 | 413 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 51 | 0 | 44 | 0 | -| | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 3 | 0 | 3 | 0 | +| | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 5 | 0 | 5 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 114 | 3 | 110 | 3 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 90 | 0 | 90 | 5 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 100 | 0 | 100 | 9 | @@ -76,7 +76,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 222 | 0 | 95 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 288 | 5 | 249 | 3 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 62 | 0 | 62 | 2 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1521 | 8 | 1389 | 10 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1522 | 8 | 1390 | 10 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | @@ -95,21 +95,21 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | kibanaUsageCollection | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 0 | 0 | 0 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 615 | 3 | 420 | 9 | | | [Security Team](https://github.com/orgs/elastic/teams/security-team) | - | 3 | 0 | 3 | 1 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 600 | 0 | 522 | 40 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 601 | 0 | 523 | 40 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 3 | 0 | 3 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | | | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 198 | 0 | 90 | 49 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 6 | -| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 248 | 0 | 247 | 24 | +| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 249 | 0 | 248 | 24 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 251 | 10 | 78 | 31 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 11 | 0 | 9 | 1 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 384 | 2 | 381 | 31 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 386 | 2 | 383 | 31 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 13 | 0 | 13 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 231 | 2 | 180 | 11 | @@ -134,7 +134,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 260 | 0 | 64 | 0 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 4 | 0 | 4 | 0 | | synthetics | [Uptime](https://github.com/orgs/elastic/teams/uptime) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 0 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 80 | 0 | 39 | 7 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 82 | 0 | 41 | 7 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 43 | 0 | 1 | 0 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 32 | 0 | 32 | 6 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 1 | 0 | 1 | 0 | @@ -301,9 +301,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 25 | 0 | 24 | 1 | | | [Owner missing] | - | 20 | 0 | 6 | 0 | | | [Owner missing] | - | 15 | 0 | 8 | 1 | -| | [Owner missing] | - | 13 | 0 | 7 | 1 | +| | [Owner missing] | - | 11 | 0 | 6 | 0 | | | [Owner missing] | - | 12 | 0 | 8 | 5 | | | [Owner missing] | - | 31 | 0 | 12 | 2 | +| | [Owner missing] | - | 5 | 0 | 3 | 0 | | | [Owner missing] | - | 22 | 0 | 13 | 2 | | | [Owner missing] | - | 80 | 0 | 51 | 1 | | | [Owner missing] | - | 16 | 0 | 7 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index fc208c81091bc..c7b08aab4bd73 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github summary: API docs for the presentationUtil plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 2d1fb67d26de5..59c7c219a1602 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github summary: API docs for the remoteClusters plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 80cf32fd0ed90..8d73fbaa1f36a 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github summary: API docs for the reporting plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index e9d9288cb3e7f..deb418b833fe3 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github summary: API docs for the rollup plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 307825975a7ca..db25b33fb89f9 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github summary: API docs for the ruleRegistry plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 51f7aa3f08761..e0a004928b4b2 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github summary: API docs for the runtimeFields plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 3f81ae82637ff..2792e2107d074 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjects plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index b5e91aa4161e8..4d25d3bf28f50 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsManagement plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index bdbd11196165d..5b61e650b0976 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsTagging plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index a33056823fe45..8f7e57b1e2718 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsTaggingOss plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 4ee75e67b0da4..7b042ea1f93c6 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github summary: API docs for the screenshotMode plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index b6d32d285b9b9..51a7e1a61919f 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github summary: API docs for the screenshotting plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 8b42b557c4116..434d136388f5e 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github summary: API docs for the security plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index ff130491b6ec5..d1d77eae3d5fc 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github summary: API docs for the securitySolution plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 6b8833becf436..da2c2cf09a878 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github summary: API docs for the sessionView plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 3721470c5f914..b6a02d17aecc4 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github summary: API docs for the share plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/shared_u_x.mdx b/api_docs/shared_u_x.mdx index d396395dcef19..de326e69e0fe2 100644 --- a/api_docs/shared_u_x.mdx +++ b/api_docs/shared_u_x.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/sharedUX title: "sharedUX" image: https://source.unsplash.com/400x175/?github summary: API docs for the sharedUX plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sharedUX'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 66174b12e48c4..2d533df972c65 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github summary: API docs for the snapshotRestore plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index aa56e7d9431f0..2082447ea3258 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github summary: API docs for the spaces plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index baea07d62e2cc..e5cce413d231b 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github summary: API docs for the stackAlerts plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/task_manager.devdocs.json b/api_docs/task_manager.devdocs.json index 9b015ce7264be..49c9fd818c3dd 100644 --- a/api_docs/task_manager.devdocs.json +++ b/api_docs/task_manager.devdocs.json @@ -239,6 +239,43 @@ } ], "functions": [ + { + "parentPluginId": "taskManager", + "id": "def-server.aggregateTaskOverduePercentilesForType", + "type": "Function", + "tags": [], + "label": "aggregateTaskOverduePercentilesForType", + "description": [], + "signature": [ + "(type: string) => { aggs: Record; query: ", + "QueryDslQueryContainer", + "; runtime_mappings: ", + "MappingRuntimeFields", + "; }" + ], + "path": "x-pack/plugins/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "taskManager", + "id": "def-server.aggregateTaskOverduePercentilesForType.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/task_manager/server/queries/aggregate_task_overdue_percentiles_for_type.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "taskManager", "id": "def-server.asInterval", @@ -1400,7 +1437,7 @@ "TaskScheduling", ", \"schedule\" | \"runSoon\" | \"ephemeralRunNow\" | \"ensureScheduled\" | \"bulkUpdateSchedules\"> & Pick<", "TaskStore", - ", \"fetch\" | \"get\" | \"remove\"> & { removeIfExists: (id: string) => Promise; } & { supportsEphemeralTasks: () => boolean; }" + ", \"aggregate\" | \"fetch\" | \"get\" | \"remove\"> & { removeIfExists: (id: string) => Promise; } & { supportsEphemeralTasks: () => boolean; }" ], "path": "x-pack/plugins/task_manager/server/plugin.ts", "deprecated": false, diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 8e15af839a4b5..2ca6c69bacca9 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github summary: API docs for the taskManager plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 80 | 0 | 39 | 7 | +| 82 | 0 | 41 | 7 | ## Server diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 8d4627b0a0e67..b0a927943f987 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetry plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index e3df7e229abfe..5ed1647e3fd4e 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryCollectionManager plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index 3e1f0c17b8241..421ef5b38c9a8 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryCollectionXpack plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 863ce108c48e1..3d33d343a8620 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryManagementSection plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/timelines.devdocs.json b/api_docs/timelines.devdocs.json index 38c0c9653f999..1ef3a094339f2 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -6968,9 +6968,7 @@ }, "; filterQuery: string | ", "ESQuery", - " | undefined; docValueFields?: ", - "QueryDslFieldAndFormat", - "[] | undefined; factoryQueryType?: ", + " | undefined; factoryQueryType?: ", "TimelineEventsQueries", " | undefined; entityType?: ", { diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 319ee00cff216..c384f9da142fc 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github summary: API docs for the timelines plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index a6c2fb6f90011..a8e0315881b2d 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github summary: API docs for the transform plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 0c679bdb8020c..c5522864a1c75 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github summary: API docs for the triggersActionsUi plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 0099e4cf7eaaf..49db9908f5e09 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github summary: API docs for the uiActions plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 3427b9f4a8ef3..176c8a902aa9c 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the uiActionsEnhanced plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 4db559f27d120..31a4820f9da14 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the unifiedSearch plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index b5df7764e5fc3..40f91935ccaeb 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github summary: API docs for the unifiedSearch.autocomplete plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 5bc965e0f2e1b..257045a1a7cd8 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github summary: API docs for the urlForwarding plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 407ae7fe20787..68a4cf6640fa6 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github summary: API docs for the usageCollection plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index d25bfb3aa53ab..c59920507b2c0 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github summary: API docs for the ux plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index a18709b0a133a..643412cbea7b5 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the visDefaultEditor plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index baaef94a15d1d..73b3fd805469b 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeGauge plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index 74f232b1fb3f6..8fced74534107 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeHeatmap plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index c409286bfda39..6f2df2634dae4 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypePie plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 0931024d8cd1e..399fdf3d04609 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTable plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index 6ed4ddce7daac..35ceba01e9d4c 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTimelion plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 766372be1f7ac..0e79bc87dad38 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTimeseries plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 38f97af77566f..9c7e5004768fd 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeVega plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 050a29ac598ff..63b6b57590f6d 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeVislib plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index de103e3f2b8d2..7ddcc5d5423f9 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeXy plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index e6d13ebfd5089..07a10571b64cb 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -5163,7 +5163,7 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - ">) => void; getInspectorAdapters: () => ", + ">) => void; reportsEmbeddableLoad: () => boolean; getInspectorAdapters: () => ", { "pluginId": "inspector", "scope": "common", @@ -5179,7 +5179,7 @@ "section": "def-public.OverlayRef", "text": "OverlayRef" }, - " | undefined; transferCustomizationsToUiState: () => void; hasInspector: () => boolean; onContainerLoading: () => void; onContainerRender: () => void; onContainerError: (error: ", + " | undefined; transferCustomizationsToUiState: () => void; hasInspector: () => boolean; onContainerLoading: () => void; onContainerData: () => void; onContainerRender: () => void; onContainerError: (error: ", { "pluginId": "expressions", "scope": "public", diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 427639052a2bd..13b8faa002999 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github summary: API docs for the visualizations plugin -date: 2022-07-12 +date: 2022-07-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/package.json b/package.json index b31198a809324..addd2cde108fb 100644 --- a/package.json +++ b/package.json @@ -180,7 +180,13 @@ "@kbn/core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal", "@kbn/core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks", "@kbn/core-http-common": "link:bazel-bin/packages/core/http/core-http-common", + "@kbn/core-http-context-server-internal": "link:bazel-bin/packages/core/http/core-http-context-server-internal", + "@kbn/core-http-context-server-mocks": "link:bazel-bin/packages/core/http/core-http-context-server-mocks", + "@kbn/core-http-router-server-internal": "link:bazel-bin/packages/core/http/core-http-router-server-internal", + "@kbn/core-http-router-server-mocks": "link:bazel-bin/packages/core/http/core-http-router-server-mocks", "@kbn/core-http-server": "link:bazel-bin/packages/core/http/core-http-server", + "@kbn/core-http-server-internal": "link:bazel-bin/packages/core/http/core-http-server-internal", + "@kbn/core-http-server-mocks": "link:bazel-bin/packages/core/http/core-http-server-mocks", "@kbn/core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser", "@kbn/core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal", "@kbn/core-i18n-browser-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-browser-mocks", @@ -251,6 +257,7 @@ "@kbn/shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app", "@kbn/shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data", "@kbn/shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data", + "@kbn/shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav", "@kbn/shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views", "@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services", "@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook", @@ -745,7 +752,13 @@ "@types/kbn__core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal/npm_module_types", "@types/kbn__core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks/npm_module_types", "@types/kbn__core-http-common": "link:bazel-bin/packages/core/http/core-http-common/npm_module_types", + "@types/kbn__core-http-context-server-internal": "link:bazel-bin/packages/core/http/core-http-context-server-internal/npm_module_types", + "@types/kbn__core-http-context-server-mocks": "link:bazel-bin/packages/core/http/core-http-context-server-mocks/npm_module_types", + "@types/kbn__core-http-router-server-internal": "link:bazel-bin/packages/core/http/core-http-router-server-internal/npm_module_types", + "@types/kbn__core-http-router-server-mocks": "link:bazel-bin/packages/core/http/core-http-router-server-mocks/npm_module_types", "@types/kbn__core-http-server": "link:bazel-bin/packages/core/http/core-http-server/npm_module_types", + "@types/kbn__core-http-server-internal": "link:bazel-bin/packages/core/http/core-http-server-internal/npm_module_types", + "@types/kbn__core-http-server-mocks": "link:bazel-bin/packages/core/http/core-http-server-mocks/npm_module_types", "@types/kbn__core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser/npm_module_types", "@types/kbn__core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal/npm_module_types", "@types/kbn__core-i18n-browser-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-browser-mocks/npm_module_types", @@ -834,6 +847,7 @@ "@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/npm_module_types", "@types/kbn__shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/npm_module_types", "@types/kbn__shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/npm_module_types", + "@types/kbn__shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/npm_module_types", "@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types", "@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types", @@ -1021,7 +1035,6 @@ "expose-loader": "^0.7.5", "faker": "^5.1.0", "fancy-log": "^1.3.2", - "fast-glob": "2.2.7", "fetch-mock": "^7.3.9", "file-loader": "^4.2.0", "form-data": "^4.0.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 588a8037dcb3d..8d39cf240970b 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -49,6 +49,12 @@ filegroup( "//packages/core/http/core-http-browser-mocks:build", "//packages/core/http/core-http-browser:build", "//packages/core/http/core-http-common:build", + "//packages/core/http/core-http-context-server-internal:build", + "//packages/core/http/core-http-context-server-mocks:build", + "//packages/core/http/core-http-router-server-internal:build", + "//packages/core/http/core-http-router-server-mocks:build", + "//packages/core/http/core-http-server-internal:build", + "//packages/core/http/core-http-server-mocks:build", "//packages/core/http/core-http-server:build", "//packages/core/i18n/core-i18n-browser-internal:build", "//packages/core/i18n/core-i18n-browser-mocks:build", @@ -186,6 +192,7 @@ filegroup( "//packages/shared-ux/link/redirect_app:build", "//packages/shared-ux/page/analytics_no_data:build", "//packages/shared-ux/page/kibana_no_data:build", + "//packages/shared-ux/page/solution_nav:build", "//packages/shared-ux/prompt/no_data_views:build", "//x-pack/packages/ml/agg_utils:build", "//x-pack/packages/ml/aiops_components:build", @@ -239,6 +246,12 @@ filegroup( "//packages/core/http/core-http-browser-mocks:build_types", "//packages/core/http/core-http-browser:build_types", "//packages/core/http/core-http-common:build_types", + "//packages/core/http/core-http-context-server-internal:build_types", + "//packages/core/http/core-http-context-server-mocks:build_types", + "//packages/core/http/core-http-router-server-internal:build_types", + "//packages/core/http/core-http-router-server-mocks:build_types", + "//packages/core/http/core-http-server-internal:build_types", + "//packages/core/http/core-http-server-mocks:build_types", "//packages/core/http/core-http-server:build_types", "//packages/core/i18n/core-i18n-browser-internal:build_types", "//packages/core/i18n/core-i18n-browser-mocks:build_types", @@ -361,6 +374,7 @@ filegroup( "//packages/shared-ux/link/redirect_app:build_types", "//packages/shared-ux/page/analytics_no_data:build_types", "//packages/shared-ux/page/kibana_no_data:build_types", + "//packages/shared-ux/page/solution_nav:build_types", "//packages/shared-ux/prompt/no_data_views:build_types", "//x-pack/packages/ml/agg_utils:build_types", "//x-pack/packages/ml/aiops_components:build_types", diff --git a/packages/core/http/core-http-context-server-internal/BUILD.bazel b/packages/core/http/core-http-context-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..f6d509a851f96 --- /dev/null +++ b/packages/core/http/core-http-context-server-internal/BUILD.bazel @@ -0,0 +1,104 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-http-context-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-http-context-server-internal" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//lodash", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//lodash", + "//packages/kbn-utility-types:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", + "//packages/core/base/core-base-common-internal:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/http/core-http-context-server-internal/README.md b/packages/core/http/core-http-context-server-internal/README.md new file mode 100644 index 0000000000000..8d1aced432ccd --- /dev/null +++ b/packages/core/http/core-http-context-server-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-http-context-server-internal + +This package contains the internal types and implementation for Core's internal `http` context service. diff --git a/packages/core/http/core-http-context-server-internal/jest.config.js b/packages/core/http/core-http-context-server-internal/jest.config.js new file mode 100644 index 0000000000000..e6e2b030dc3a9 --- /dev/null +++ b/packages/core/http/core-http-context-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/http/core-http-context-server-internal'], +}; diff --git a/packages/core/http/core-http-context-server-internal/package.json b/packages/core/http/core-http-context-server-internal/package.json new file mode 100644 index 0000000000000..1c2c18afb7da0 --- /dev/null +++ b/packages/core/http/core-http-context-server-internal/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-http-context-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/context/context_container.test.ts b/packages/core/http/core-http-context-server-internal/src/context_container.test.ts similarity index 92% rename from src/core/server/context/context_container.test.ts rename to packages/core/http/core-http-context-server-internal/src/context_container.test.ts index 2959533cec509..3b61cfea99fc9 100644 --- a/src/core/server/context/context_container.test.ts +++ b/packages/core/http/core-http-context-server-internal/src/context_container.test.ts @@ -7,9 +7,12 @@ */ import type { PluginOpaqueId } from '@kbn/core-base-common'; -import type { RequestHandlerContextBase } from '@kbn/core-http-server'; +import type { + RequestHandlerContextBase, + KibanaRequest, + KibanaResponseFactory, +} from '@kbn/core-http-server'; import { ContextContainer } from './context_container'; -import { httpServerMock } from '../http/http_server.mocks'; const pluginA = Symbol('pluginA'); const pluginB = Symbol('pluginB'); @@ -35,6 +38,13 @@ interface MyContext extends RequestHandlerContextBase { type TestContext = T & RequestHandlerContextBase; +const createKibanaRequest = (): KibanaRequest => { + return {} as unknown as KibanaRequest; +}; +const createKibanaResponseFactory = (): KibanaResponseFactory => { + return {} as unknown as KibanaResponseFactory; +}; + describe('ContextContainer', () => { describe('registerContext', () => { it('throws an error if the same context is registered twice', () => { @@ -145,8 +155,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(pluginC, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); expect(core1provider).not.toHaveBeenCalled(); @@ -188,8 +198,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(pluginC, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); expect(core1provider).not.toHaveBeenCalled(); @@ -229,8 +239,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(pluginC, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); expect(core1provider).not.toHaveBeenCalled(); @@ -271,8 +281,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(pluginC, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); expect(core1provider).not.toHaveBeenCalled(); @@ -356,8 +366,8 @@ describe('ContextContainer', () => { const handler2 = contextContainer.createHandler(pluginD, rawHandler2); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); await handler2(request, response); @@ -400,8 +410,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(pluginB, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); expect(await handler1(request, response)).toEqual('handler1'); expect(rawHandler1).toHaveBeenCalledWith(expect.any(Object), request, response); @@ -430,8 +440,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(pluginA, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); expect(await handler1(request, response)).toEqual('handler1'); // If no context is registered for pluginA, only core contexts should be exposed @@ -454,8 +464,8 @@ describe('ContextContainer', () => { }); const handler1 = contextContainer.createHandler(coreId, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); expect(await handler1(request, response)).toEqual('handler1'); expect(rawHandler1).toHaveBeenCalledWith(expect.any(Object), request, response); @@ -465,8 +475,8 @@ describe('ContextContainer', () => { expect.assertions(7); const contextContainer = new ContextContainer(plugins, coreId); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); contextContainer.registerContext(coreId, 'core1', (context, req, res) => { expect(req).toBe(request); expect(res).toBe(response); @@ -567,8 +577,8 @@ describe('ContextContainer', () => { const handler2 = contextContainer.createHandler(pluginD, rawHandler2); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); await handler2(request, response); @@ -597,8 +607,8 @@ describe('ContextContainer', () => { const rawHandler1 = jest.fn(() => 'handler1' as any); const handler1 = contextContainer.createHandler(pluginA, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); expect(await handler1(request, response)).toEqual('handler1'); }); @@ -608,8 +618,8 @@ describe('ContextContainer', () => { const rawHandler1 = jest.fn(() => 'handler1' as any); const handler1 = contextContainer.createHandler(pluginA, rawHandler1); - const request = httpServerMock.createKibanaRequest(); - const response = httpServerMock.createResponseFactory(); + const request = createKibanaRequest(); + const response = createKibanaResponseFactory(); await handler1(request, response); expect(rawHandler1).toHaveBeenCalledWith( { resolve: expect.any(Function) }, diff --git a/src/core/server/context/context_container.ts b/packages/core/http/core-http-context-server-internal/src/context_container.ts similarity index 100% rename from src/core/server/context/context_container.ts rename to packages/core/http/core-http-context-server-internal/src/context_container.ts diff --git a/packages/core/http/core-http-context-server-internal/src/context_service.test.mocks.ts b/packages/core/http/core-http-context-server-internal/src/context_service.test.mocks.ts new file mode 100644 index 0000000000000..49d48f3424f16 --- /dev/null +++ b/packages/core/http/core-http-context-server-internal/src/context_service.test.mocks.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { IContextContainer } from '@kbn/core-http-server'; + +const createContextMock = (mockContext: any = {}) => { + const contextMock: jest.Mocked = { + registerContext: jest.fn(), + createHandler: jest.fn(), + }; + contextMock.createHandler.mockImplementation( + (pluginId, handler) => + (...args) => + Promise.resolve(handler(mockContext, ...args)) + ); + return contextMock; +}; + +export const MockContextConstructor = jest.fn(createContextMock); +jest.doMock('./context_container', () => ({ + ContextContainer: MockContextConstructor, +})); diff --git a/src/core/server/context/context_service.test.ts b/packages/core/http/core-http-context-server-internal/src/context_service.test.ts similarity index 100% rename from src/core/server/context/context_service.test.ts rename to packages/core/http/core-http-context-server-internal/src/context_service.test.ts diff --git a/src/core/server/context/context_service.ts b/packages/core/http/core-http-context-server-internal/src/context_service.ts similarity index 100% rename from src/core/server/context/context_service.ts rename to packages/core/http/core-http-context-server-internal/src/context_service.ts diff --git a/src/core/server/context/index.ts b/packages/core/http/core-http-context-server-internal/src/index.ts similarity index 100% rename from src/core/server/context/index.ts rename to packages/core/http/core-http-context-server-internal/src/index.ts diff --git a/packages/core/http/core-http-context-server-internal/tsconfig.json b/packages/core/http/core-http-context-server-internal/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/http/core-http-context-server-internal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/http/core-http-context-server-mocks/BUILD.bazel b/packages/core/http/core-http-context-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..a53bae874f6d9 --- /dev/null +++ b/packages/core/http/core-http-context-server-mocks/BUILD.bazel @@ -0,0 +1,100 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-http-context-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-http-context-server-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/kbn-utility-types:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-context-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/http/core-http-context-server-mocks/README.md b/packages/core/http/core-http-context-server-mocks/README.md new file mode 100644 index 0000000000000..2be50f33660bc --- /dev/null +++ b/packages/core/http/core-http-context-server-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-http-context-server-mocks + +This package contains the mocks for Core's internal `http` context service. diff --git a/packages/core/http/core-http-context-server-mocks/jest.config.js b/packages/core/http/core-http-context-server-mocks/jest.config.js new file mode 100644 index 0000000000000..14c289e08adff --- /dev/null +++ b/packages/core/http/core-http-context-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/http/core-http-context-server-mocks'], +}; diff --git a/packages/core/http/core-http-context-server-mocks/package.json b/packages/core/http/core-http-context-server-mocks/package.json new file mode 100644 index 0000000000000..e98f7c35c3968 --- /dev/null +++ b/packages/core/http/core-http-context-server-mocks/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-http-context-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/context/context_container.mock.ts b/packages/core/http/core-http-context-server-mocks/src/context_container.mock.ts similarity index 100% rename from src/core/server/context/context_container.mock.ts rename to packages/core/http/core-http-context-server-mocks/src/context_container.mock.ts diff --git a/src/core/server/context/context_service.mock.ts b/packages/core/http/core-http-context-server-mocks/src/context_service.mock.ts similarity index 91% rename from src/core/server/context/context_service.mock.ts rename to packages/core/http/core-http-context-server-mocks/src/context_service.mock.ts index ca07e6c6923c2..6b56e43b35c76 100644 --- a/src/core/server/context/context_service.mock.ts +++ b/packages/core/http/core-http-context-server-mocks/src/context_service.mock.ts @@ -7,8 +7,11 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; - -import { ContextService, InternalContextSetup, InternalContextPreboot } from './context_service'; +import type { + ContextService, + InternalContextSetup, + InternalContextPreboot, +} from '@kbn/core-http-context-server-internal'; import { contextMock } from './context_container.mock'; const createPrebootContractMock = (mockContext = {}) => { diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/index.ts b/packages/core/http/core-http-context-server-mocks/src/index.ts similarity index 51% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/index.ts rename to packages/core/http/core-http-context-server-mocks/src/index.ts index 59ef2924b048d..b58cc5d877bd9 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/index.ts +++ b/packages/core/http/core-http-context-server-mocks/src/index.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -export type { KibanaPageTemplateSolutionNavProps } from './solution_nav'; -export { KibanaPageTemplateSolutionNav } from './solution_nav'; -export type { KibanaPageTemplateSolutionNavCollapseButtonProps } from './solution_nav_collapse_button'; -export { KibanaPageTemplateSolutionNavCollapseButton } from './solution_nav_collapse_button'; +export type { ContextContainerMock } from './context_container.mock'; +export { contextMock } from './context_container.mock'; +export { contextServiceMock } from './context_service.mock'; diff --git a/packages/core/http/core-http-context-server-mocks/tsconfig.json b/packages/core/http/core-http-context-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/http/core-http-context-server-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/http/core-http-router-server-internal/BUILD.bazel b/packages/core/http/core-http-router-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..016156539aaa2 --- /dev/null +++ b/packages/core/http/core-http-router-server-internal/BUILD.bazel @@ -0,0 +1,114 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-http-router-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-http-router-server-internal" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//@hapi/boom", + "@npm//uuid", + "@npm//rxjs", + "@npm//type-detect", + "//packages/kbn-config-schema", + "//packages/kbn-es-errors", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/uuid", + "@npm//type-detect", + "@npm//@hapi/hapi", + "@npm//@types/hapi__hapi", + "@npm//@hapi/boom", + "@npm//rxjs", + "//packages/kbn-std:npm_module_types", + "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/kbn-es-errors:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/http/core-http-router-server-internal/README.md b/packages/core/http/core-http-router-server-internal/README.md new file mode 100644 index 0000000000000..5b8926822d460 --- /dev/null +++ b/packages/core/http/core-http-router-server-internal/README.md @@ -0,0 +1,4 @@ +# @kbn/core-http-router-server-internal + +This package contains the internal types and implementation for Core's internal `http` router sub-domain. + diff --git a/packages/core/http/core-http-router-server-internal/jest.config.js b/packages/core/http/core-http-router-server-internal/jest.config.js new file mode 100644 index 0000000000000..c0b4fc1497eed --- /dev/null +++ b/packages/core/http/core-http-router-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/http/core-http-router-server-internal'], +}; diff --git a/packages/core/http/core-http-router-server-internal/package.json b/packages/core/http/core-http-router-server-internal/package.json new file mode 100644 index 0000000000000..45c10b39164b3 --- /dev/null +++ b/packages/core/http/core-http-router-server-internal/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-http-router-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/http/router/error_wrapper.test.ts b/packages/core/http/core-http-router-server-internal/src/error_wrapper.test.ts similarity index 100% rename from src/core/server/http/router/error_wrapper.test.ts rename to packages/core/http/core-http-router-server-internal/src/error_wrapper.test.ts diff --git a/src/core/server/http/router/error_wrapper.ts b/packages/core/http/core-http-router-server-internal/src/error_wrapper.ts similarity index 100% rename from src/core/server/http/router/error_wrapper.ts rename to packages/core/http/core-http-router-server-internal/src/error_wrapper.ts diff --git a/src/core/server/http/router/headers.ts b/packages/core/http/core-http-router-server-internal/src/headers.ts similarity index 100% rename from src/core/server/http/router/headers.ts rename to packages/core/http/core-http-router-server-internal/src/headers.ts diff --git a/src/core/server/http/router/index.ts b/packages/core/http/core-http-router-server-internal/src/index.ts similarity index 100% rename from src/core/server/http/router/index.ts rename to packages/core/http/core-http-router-server-internal/src/index.ts diff --git a/src/core/server/http/router/request.test.ts b/packages/core/http/core-http-router-server-internal/src/request.test.ts similarity index 100% rename from src/core/server/http/router/request.test.ts rename to packages/core/http/core-http-router-server-internal/src/request.test.ts diff --git a/src/core/server/http/router/request.ts b/packages/core/http/core-http-router-server-internal/src/request.ts similarity index 99% rename from src/core/server/http/router/request.ts rename to packages/core/http/core-http-router-server-internal/src/request.ts index 39bc87679b7cd..49e764a50cc00 100644 --- a/src/core/server/http/router/request.ts +++ b/packages/core/http/core-http-router-server-internal/src/request.ts @@ -8,7 +8,7 @@ import { URL } from 'url'; import uuid from 'uuid'; -import { Request, RouteOptions } from '@hapi/hapi'; +import type { Request, RouteOptions } from '@hapi/hapi'; import { fromEvent, NEVER } from 'rxjs'; import { shareReplay, first, filter } from 'rxjs/operators'; import { RecursiveReadonly } from '@kbn/utility-types'; diff --git a/src/core/server/http/router/response.ts b/packages/core/http/core-http-router-server-internal/src/response.ts similarity index 100% rename from src/core/server/http/router/response.ts rename to packages/core/http/core-http-router-server-internal/src/response.ts diff --git a/src/core/server/http/router/response_adapter.ts b/packages/core/http/core-http-router-server-internal/src/response_adapter.ts similarity index 100% rename from src/core/server/http/router/response_adapter.ts rename to packages/core/http/core-http-router-server-internal/src/response_adapter.ts diff --git a/src/core/server/http/router/route.ts b/packages/core/http/core-http-router-server-internal/src/route.ts similarity index 100% rename from src/core/server/http/router/route.ts rename to packages/core/http/core-http-router-server-internal/src/route.ts diff --git a/src/core/server/http/router/router.test.ts b/packages/core/http/core-http-router-server-internal/src/router.test.ts similarity index 100% rename from src/core/server/http/router/router.test.ts rename to packages/core/http/core-http-router-server-internal/src/router.test.ts diff --git a/src/core/server/http/router/router.ts b/packages/core/http/core-http-router-server-internal/src/router.ts similarity index 100% rename from src/core/server/http/router/router.ts rename to packages/core/http/core-http-router-server-internal/src/router.ts diff --git a/src/core/server/http/router/socket.test.ts b/packages/core/http/core-http-router-server-internal/src/socket.test.ts similarity index 100% rename from src/core/server/http/router/socket.test.ts rename to packages/core/http/core-http-router-server-internal/src/socket.test.ts diff --git a/src/core/server/http/router/socket.ts b/packages/core/http/core-http-router-server-internal/src/socket.ts similarity index 100% rename from src/core/server/http/router/socket.ts rename to packages/core/http/core-http-router-server-internal/src/socket.ts diff --git a/src/core/server/http/router/validator.test.ts b/packages/core/http/core-http-router-server-internal/src/validator.test.ts similarity index 100% rename from src/core/server/http/router/validator.test.ts rename to packages/core/http/core-http-router-server-internal/src/validator.test.ts diff --git a/src/core/server/http/router/validator.ts b/packages/core/http/core-http-router-server-internal/src/validator.ts similarity index 100% rename from src/core/server/http/router/validator.ts rename to packages/core/http/core-http-router-server-internal/src/validator.ts diff --git a/packages/core/http/core-http-router-server-internal/tsconfig.json b/packages/core/http/core-http-router-server-internal/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/http/core-http-router-server-internal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/http/core-http-router-server-mocks/BUILD.bazel b/packages/core/http/core-http-router-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..a377948e772ef --- /dev/null +++ b/packages/core/http/core-http-router-server-mocks/BUILD.bazel @@ -0,0 +1,106 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-http-router-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-http-router-server-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//query-string", + "//packages/kbn-hapi-mocks", + "//packages/kbn-config-schema", + "//packages/core/http/core-http-router-server-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//query-string", + "//packages/kbn-hapi-mocks:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-router-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/http/core-http-router-server-mocks/README.md b/packages/core/http/core-http-router-server-mocks/README.md new file mode 100644 index 0000000000000..87bb78da4dfdc --- /dev/null +++ b/packages/core/http/core-http-router-server-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-http-router-server-mocks + +This package contains the mocks for Core's internal `http` router sub-domain. diff --git a/packages/core/http/core-http-router-server-mocks/jest.config.js b/packages/core/http/core-http-router-server-mocks/jest.config.js new file mode 100644 index 0000000000000..7f154d49c62ea --- /dev/null +++ b/packages/core/http/core-http-router-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/http/core-http-router-server-mocks'], +}; diff --git a/packages/core/http/core-http-router-server-mocks/package.json b/packages/core/http/core-http-router-server-mocks/package.json new file mode 100644 index 0000000000000..59c910af29012 --- /dev/null +++ b/packages/core/http/core-http-router-server-mocks/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-http-router-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/core/http/core-http-router-server-mocks/src/index.ts b/packages/core/http/core-http-router-server-mocks/src/index.ts new file mode 100644 index 0000000000000..8f04fc362edfa --- /dev/null +++ b/packages/core/http/core-http-router-server-mocks/src/index.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 + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { mockRouter } from './router.mock'; +export type { RouterMock, RequestFixtureOptions } from './router.mock'; diff --git a/src/core/server/http/router/router.mock.ts b/packages/core/http/core-http-router-server-mocks/src/router.mock.ts similarity index 98% rename from src/core/server/http/router/router.mock.ts rename to packages/core/http/core-http-router-server-mocks/src/router.mock.ts index 573d43fea80d5..c6e2deb9b1473 100644 --- a/src/core/server/http/router/router.mock.ts +++ b/packages/core/http/core-http-router-server-mocks/src/router.mock.ts @@ -20,7 +20,7 @@ import type { KibanaRequestState, KibanaResponseFactory, } from '@kbn/core-http-server'; -import { CoreKibanaRequest } from './request'; +import { CoreKibanaRequest } from '@kbn/core-http-router-server-internal'; export type RouterMock = jest.Mocked>; diff --git a/packages/core/http/core-http-router-server-mocks/tsconfig.json b/packages/core/http/core-http-router-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/http/core-http-router-server-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/http/core-http-server-internal/BUILD.bazel b/packages/core/http/core-http-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..b61ca9d0493c9 --- /dev/null +++ b/packages/core/http/core-http-server-internal/BUILD.bazel @@ -0,0 +1,146 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-http-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-http-server-internal" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//rxjs", + "@npm//uuid", + "@npm//moment", + "@npm//@elastic/numeral", + "@npm//@hapi/boom", + "@npm//@hapi/cookie", + "@npm//@hapi/inert", + "@npm//elastic-apm-node", + "//packages/kbn-utils", + "//packages/kbn-std", + "//packages/kbn-config-schema", + "//packages/kbn-logging", + "//packages/kbn-crypto", + "//packages/kbn-server-http-tools", + "//packages/core/http/core-http-router-server-internal", + ### test dependencies + "@npm//supertest", + "@npm//chance", + "//packages/kbn-hapi-mocks", + "//packages/core/http/core-http-router-server-mocks", + "//packages/core/logging/core-logging-server-mocks", + "//packages/core/http/core-http-context-server-mocks", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/uuid", + "@npm//rxjs", + "@npm//moment", + "@npm//@elastic/numeral", + "@npm//lodash", + "@npm//@hapi/hapi", + "@npm//@hapi/boom", + "@npm//@hapi/cookie", + "@npm//@hapi/inert", + "@npm//@types/hapi__hapi", + "@npm//@types/hapi__cookie", + "@npm//@types/hapi__inert", + "@npm//elastic-apm-node", + "//packages/kbn-utils:npm_module_types", + "//packages/kbn-std:npm_module_types", + "//packages/kbn-server-http-tools:npm_module_types", + "//packages/kbn-logging:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/kbn-crypto:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", + "//packages/core/http/core-http-common:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-context-server-internal:npm_module_types", + "//packages/core/http/core-http-router-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/http/core-http-server-internal/README.md b/packages/core/http/core-http-server-internal/README.md new file mode 100644 index 0000000000000..e47cd5456ec28 --- /dev/null +++ b/packages/core/http/core-http-server-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-http-server-internal + +This package contains the internal types and implementation for core's server-side `http` service diff --git a/packages/core/http/core-http-server-internal/jest.config.js b/packages/core/http/core-http-server-internal/jest.config.js new file mode 100644 index 0000000000000..6938210c126ed --- /dev/null +++ b/packages/core/http/core-http-server-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/http/core-http-server-internal'], +}; diff --git a/packages/core/http/core-http-server-internal/package.json b/packages/core/http/core-http-server-internal/package.json new file mode 100644 index 0000000000000..af6db3d6b5106 --- /dev/null +++ b/packages/core/http/core-http-server-internal/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-http-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/core/http/core-http-server-internal/src/__fixtures/static/compression_available.json b/packages/core/http/core-http-server-internal/src/__fixtures/static/compression_available.json new file mode 100644 index 0000000000000..1f878fb465cff --- /dev/null +++ b/packages/core/http/core-http-server-internal/src/__fixtures/static/compression_available.json @@ -0,0 +1,3 @@ +{ + "hello": "dolly" +} diff --git a/packages/core/http/core-http-server-internal/src/__fixtures/static/compression_available.json.gz b/packages/core/http/core-http-server-internal/src/__fixtures/static/compression_available.json.gz new file mode 100644 index 0000000000000..e77819d2e8e59 Binary files /dev/null and b/packages/core/http/core-http-server-internal/src/__fixtures/static/compression_available.json.gz differ diff --git a/packages/core/http/core-http-server-internal/src/__fixtures/static/some_json.json b/packages/core/http/core-http-server-internal/src/__fixtures/static/some_json.json new file mode 100644 index 0000000000000..c8c4105eb57cd --- /dev/null +++ b/packages/core/http/core-http-server-internal/src/__fixtures/static/some_json.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/src/core/server/http/__snapshots__/http_config.test.ts.snap b/packages/core/http/core-http-server-internal/src/__snapshots__/http_config.test.ts.snap similarity index 100% rename from src/core/server/http/__snapshots__/http_config.test.ts.snap rename to packages/core/http/core-http-server-internal/src/__snapshots__/http_config.test.ts.snap diff --git a/src/core/server/http/__snapshots__/http_service.test.ts.snap b/packages/core/http/core-http-server-internal/src/__snapshots__/http_service.test.ts.snap similarity index 100% rename from src/core/server/http/__snapshots__/http_service.test.ts.snap rename to packages/core/http/core-http-server-internal/src/__snapshots__/http_service.test.ts.snap diff --git a/src/core/server/http/__snapshots__/https_redirect_server.test.ts.snap b/packages/core/http/core-http-server-internal/src/__snapshots__/https_redirect_server.test.ts.snap similarity index 100% rename from src/core/server/http/__snapshots__/https_redirect_server.test.ts.snap rename to packages/core/http/core-http-server-internal/src/__snapshots__/https_redirect_server.test.ts.snap diff --git a/src/core/server/http/auth_headers_storage.test.ts b/packages/core/http/core-http-server-internal/src/auth_headers_storage.test.ts similarity index 86% rename from src/core/server/http/auth_headers_storage.test.ts rename to packages/core/http/core-http-server-internal/src/auth_headers_storage.test.ts index b00fcaa0a1854..6d150f47b682d 100644 --- a/src/core/server/http/auth_headers_storage.test.ts +++ b/packages/core/http/core-http-server-internal/src/auth_headers_storage.test.ts @@ -7,14 +7,14 @@ */ import { AuthHeadersStorage } from './auth_headers_storage'; -import { httpServerMock } from './http_server.mocks'; +import { mockRouter } from '@kbn/core-http-router-server-mocks'; describe('AuthHeadersStorage', () => { describe('stores authorization headers', () => { it('retrieves a copy of headers associated with Kibana request', () => { const headers = { authorization: 'token' }; const storage = new AuthHeadersStorage(); - const request = httpServerMock.createKibanaRequest(); + const request = mockRouter.createKibanaRequest(); storage.set(request, headers); expect(storage.get(request)).toEqual(headers); }); diff --git a/src/core/server/http/auth_headers_storage.ts b/packages/core/http/core-http-server-internal/src/auth_headers_storage.ts similarity index 92% rename from src/core/server/http/auth_headers_storage.ts rename to packages/core/http/core-http-server-internal/src/auth_headers_storage.ts index 58f1086b7533f..1138187191309 100644 --- a/src/core/server/http/auth_headers_storage.ts +++ b/packages/core/http/core-http-server-internal/src/auth_headers_storage.ts @@ -13,7 +13,7 @@ import type { IAuthHeadersStorage, GetAuthHeaders, } from '@kbn/core-http-server'; -import { ensureRawRequest } from './router'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; /** @internal */ export class AuthHeadersStorage implements IAuthHeadersStorage { diff --git a/src/core/server/http/auth_state_storage.ts b/packages/core/http/core-http-server-internal/src/auth_state_storage.ts similarity index 94% rename from src/core/server/http/auth_state_storage.ts rename to packages/core/http/core-http-server-internal/src/auth_state_storage.ts index d305cf18ce60b..7bdb78db8ce54 100644 --- a/src/core/server/http/auth_state_storage.ts +++ b/packages/core/http/core-http-server-internal/src/auth_state_storage.ts @@ -5,10 +5,11 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import { Request } from '@hapi/hapi'; import type { KibanaRequest, IsAuthenticated } from '@kbn/core-http-server'; import { AuthStatus } from '@kbn/core-http-server'; -import { ensureRawRequest } from './router'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; /** @internal */ export class AuthStateStorage { diff --git a/src/core/server/http/base_path_service.test.ts b/packages/core/http/core-http-server-internal/src/base_path_service.test.ts similarity index 94% rename from src/core/server/http/base_path_service.test.ts rename to packages/core/http/core-http-server-internal/src/base_path_service.test.ts index 2d26000b4672b..efeb61b72c9ae 100644 --- a/src/core/server/http/base_path_service.test.ts +++ b/packages/core/http/core-http-server-internal/src/base_path_service.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ +import { mockRouter } from '@kbn/core-http-router-server-mocks'; import { BasePath } from './base_path_service'; -import { httpServerMock } from './http_server.mocks'; describe('BasePath', () => { describe('serverBasePath', () => { @@ -36,7 +36,7 @@ describe('BasePath', () => { describe('#get()', () => { it('returns base path associated with an incoming KibanaRequest', () => { - const request = httpServerMock.createKibanaRequest(); + const request = mockRouter.createKibanaRequest(); const basePath = new BasePath(); basePath.set(request, '/baz/'); @@ -44,7 +44,7 @@ describe('BasePath', () => { }); it('is based on server base path', () => { - const request = httpServerMock.createKibanaRequest(); + const request = mockRouter.createKibanaRequest(); const basePath = new BasePath('/foo/bar'); basePath.set(request, '/baz/'); @@ -54,7 +54,7 @@ describe('BasePath', () => { describe('#set()', () => { it('#set() cannot be set twice for one request', () => { - const request = httpServerMock.createKibanaRequest(); + const request = mockRouter.createKibanaRequest(); const basePath = new BasePath('/foo/bar'); const setPath = () => basePath.set(request, 'baz/'); diff --git a/src/core/server/http/base_path_service.ts b/packages/core/http/core-http-server-internal/src/base_path_service.ts similarity index 96% rename from src/core/server/http/base_path_service.ts rename to packages/core/http/core-http-server-internal/src/base_path_service.ts index e5d5e164a4c9d..cd40fc57399af 100644 --- a/src/core/server/http/base_path_service.ts +++ b/packages/core/http/core-http-server-internal/src/base_path_service.ts @@ -9,7 +9,7 @@ import { modifyUrl } from '@kbn/std'; import { Request } from '@hapi/hapi'; import type { KibanaRequest, IBasePath } from '@kbn/core-http-server'; -import { ensureRawRequest } from './router'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; /** * Core internal implementation of {@link IBasePath} diff --git a/src/core/server/http/cookie_session_storage.ts b/packages/core/http/core-http-server-internal/src/cookie_session_storage.ts similarity index 98% rename from src/core/server/http/cookie_session_storage.ts rename to packages/core/http/core-http-server-internal/src/cookie_session_storage.ts index 63975ab549b06..bba5a9742edb6 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/packages/core/http/core-http-server-internal/src/cookie_session_storage.ts @@ -16,7 +16,7 @@ import type { SessionStorage, SessionStorageCookieOptions, } from '@kbn/core-http-server'; -import { ensureRawRequest } from './router'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; class ScopedCookieSessionStorage> implements SessionStorage { constructor( diff --git a/src/core/server/http/csp/config.test.ts b/packages/core/http/core-http-server-internal/src/csp/config.test.ts similarity index 100% rename from src/core/server/http/csp/config.test.ts rename to packages/core/http/core-http-server-internal/src/csp/config.test.ts diff --git a/src/core/server/http/csp/config.ts b/packages/core/http/core-http-server-internal/src/csp/config.ts similarity index 100% rename from src/core/server/http/csp/config.ts rename to packages/core/http/core-http-server-internal/src/csp/config.ts diff --git a/src/core/server/http/csp/csp_config.test.mocks.ts b/packages/core/http/core-http-server-internal/src/csp/csp_config.test.mocks.ts similarity index 100% rename from src/core/server/http/csp/csp_config.test.mocks.ts rename to packages/core/http/core-http-server-internal/src/csp/csp_config.test.mocks.ts diff --git a/src/core/server/http/csp/csp_config.test.ts b/packages/core/http/core-http-server-internal/src/csp/csp_config.test.ts similarity index 100% rename from src/core/server/http/csp/csp_config.test.ts rename to packages/core/http/core-http-server-internal/src/csp/csp_config.test.ts diff --git a/src/core/server/http/csp/csp_config.ts b/packages/core/http/core-http-server-internal/src/csp/csp_config.ts similarity index 100% rename from src/core/server/http/csp/csp_config.ts rename to packages/core/http/core-http-server-internal/src/csp/csp_config.ts diff --git a/src/core/server/http/csp/csp_directives.test.ts b/packages/core/http/core-http-server-internal/src/csp/csp_directives.test.ts similarity index 100% rename from src/core/server/http/csp/csp_directives.test.ts rename to packages/core/http/core-http-server-internal/src/csp/csp_directives.test.ts diff --git a/src/core/server/http/csp/csp_directives.ts b/packages/core/http/core-http-server-internal/src/csp/csp_directives.ts similarity index 100% rename from src/core/server/http/csp/csp_directives.ts rename to packages/core/http/core-http-server-internal/src/csp/csp_directives.ts diff --git a/src/core/server/http/csp/index.ts b/packages/core/http/core-http-server-internal/src/csp/index.ts similarity index 100% rename from src/core/server/http/csp/index.ts rename to packages/core/http/core-http-server-internal/src/csp/index.ts diff --git a/src/core/server/http/external_url/config.test.ts b/packages/core/http/core-http-server-internal/src/external_url/config.test.ts similarity index 100% rename from src/core/server/http/external_url/config.test.ts rename to packages/core/http/core-http-server-internal/src/external_url/config.test.ts diff --git a/src/core/server/http/external_url/config.ts b/packages/core/http/core-http-server-internal/src/external_url/config.ts similarity index 100% rename from src/core/server/http/external_url/config.ts rename to packages/core/http/core-http-server-internal/src/external_url/config.ts diff --git a/src/core/server/http/external_url/external_url_config.ts b/packages/core/http/core-http-server-internal/src/external_url/external_url_config.ts similarity index 100% rename from src/core/server/http/external_url/external_url_config.ts rename to packages/core/http/core-http-server-internal/src/external_url/external_url_config.ts diff --git a/src/core/server/http/external_url/index.ts b/packages/core/http/core-http-server-internal/src/external_url/index.ts similarity index 100% rename from src/core/server/http/external_url/index.ts rename to packages/core/http/core-http-server-internal/src/external_url/index.ts diff --git a/src/core/server/http/http_config.test.ts b/packages/core/http/core-http-server-internal/src/http_config.test.ts similarity index 100% rename from src/core/server/http/http_config.test.ts rename to packages/core/http/core-http-server-internal/src/http_config.test.ts diff --git a/src/core/server/http/http_config.ts b/packages/core/http/core-http-server-internal/src/http_config.ts similarity index 100% rename from src/core/server/http/http_config.ts rename to packages/core/http/core-http-server-internal/src/http_config.ts diff --git a/src/core/server/http/http_server.test.ts b/packages/core/http/core-http-server-internal/src/http_server.test.ts similarity index 99% rename from src/core/server/http/http_server.test.ts rename to packages/core/http/core-http-server-internal/src/http_server.test.ts index 4d55e82cfcb14..82debfa44c2cb 100644 --- a/src/core/server/http/http_server.test.ts +++ b/packages/core/http/core-http-server-internal/src/http_server.test.ts @@ -22,8 +22,8 @@ import type { RouteValidationFunction, RequestHandlerContextBase, } from '@kbn/core-http-server'; +import { Router } from '@kbn/core-http-router-server-internal'; import { HttpConfig } from './http_config'; -import { Router } from './router'; import { HttpServer } from './http_server'; import { Readable } from 'stream'; import { KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils'; @@ -1410,7 +1410,7 @@ describe('setup contract', () => { }); describe('#registerStaticDir', () => { - const assetFolder = join(__dirname, 'integration_tests', 'fixtures', 'static'); + const assetFolder = join(__dirname, '__fixtures', 'static'); let tempDir: string; beforeAll(async () => { diff --git a/src/core/server/http/http_server.ts b/packages/core/http/core-http-server-internal/src/http_server.ts similarity index 99% rename from src/core/server/http/http_server.ts rename to packages/core/http/core-http-server-internal/src/http_server.ts index d5564e302c5af..766fa131349e1 100644 --- a/src/core/server/http/http_server.ts +++ b/packages/core/http/core-http-server-internal/src/http_server.ts @@ -16,7 +16,6 @@ import { getServerOptions, getRequestId, } from '@kbn/server-http-tools'; -import agent from 'elastic-apm-node'; import type { Duration } from 'moment'; import { firstValueFrom, Observable } from 'rxjs'; @@ -24,6 +23,7 @@ import { take } from 'rxjs/operators'; import apm from 'elastic-apm-node'; import type { Logger, LoggerFactory } from '@kbn/logging'; import type { InternalExecutionContextSetup } from '@kbn/core-execution-context-server-internal'; +import { isSafeMethod } from '@kbn/core-http-router-server-internal'; import type { IRouter, RouteConfigOptions, @@ -47,7 +47,6 @@ import { adoptToHapiOnPreAuth } from './lifecycle/on_pre_auth'; import { adoptToHapiOnPostAuthFormat } from './lifecycle/on_post_auth'; import { adoptToHapiOnRequest } from './lifecycle/on_pre_routing'; import { adoptToHapiOnPreResponseFormat } from './lifecycle/on_pre_response'; -import { isSafeMethod } from './router'; import { createCookieSessionStorageFactory } from './cookie_session_storage'; import { AuthStateStorage } from './auth_state_storage'; import { AuthHeadersStorage } from './auth_headers_storage'; @@ -359,7 +358,7 @@ export class HttpServer { requestUuid: uuid.v4(), // Kibana stores trace.id until https://github.com/elastic/apm-agent-nodejs/issues/2353 is resolved // The current implementation of the APM agent ends a request transaction before "response" log is emitted. - traceId: agent.currentTraceIds['trace.id'], + traceId: apm.currentTraceIds['trace.id'], } as KibanaRequestState; return responseToolkit.continue; }); diff --git a/src/core/server/http/http_service.test.mocks.ts b/packages/core/http/core-http-server-internal/src/http_service.test.mocks.ts similarity index 100% rename from src/core/server/http/http_service.test.mocks.ts rename to packages/core/http/core-http-server-internal/src/http_service.test.mocks.ts diff --git a/src/core/server/http/http_service.test.ts b/packages/core/http/core-http-server-internal/src/http_service.test.ts similarity index 98% rename from src/core/server/http/http_service.test.ts rename to packages/core/http/core-http-server-internal/src/http_service.test.ts index 2f4094edd4f82..8201560c935df 100644 --- a/src/core/server/http/http_service.test.ts +++ b/packages/core/http/core-http-server-internal/src/http_service.test.ts @@ -16,12 +16,12 @@ import { ConfigService, Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { HttpService } from '.'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { Router } from '@kbn/core-http-router-server-internal'; +import { HttpService } from './http_service'; import { HttpConfigType, config } from './http_config'; -import { contextServiceMock } from '../context/context_service.mock'; import { cspConfig } from './csp'; import { externalUrlConfig, ExternalUrlConfig } from './external_url'; -import { Router } from './router'; const logger = loggingSystemMock.create(); const env = Env.createDefault(REPO_ROOT, getEnvOptions()); diff --git a/src/core/server/http/http_service.ts b/packages/core/http/core-http-server-internal/src/http_service.ts similarity index 97% rename from src/core/server/http/http_service.ts rename to packages/core/http/core-http-server-internal/src/http_service.ts index 0ef2c9d91af67..607413dcfd546 100644 --- a/src/core/server/http/http_service.ts +++ b/packages/core/http/core-http-server-internal/src/http_service.ts @@ -21,21 +21,21 @@ import type { IContextContainer, IContextProvider, } from '@kbn/core-http-server'; +import type { + InternalContextSetup, + InternalContextPreboot, +} from '@kbn/core-http-context-server-internal'; +import { Router } from '@kbn/core-http-router-server-internal'; -import { InternalContextSetup, InternalContextPreboot } from '../context'; import { CspConfigType, cspConfig } from './csp'; - -import { Router } from './router'; import { HttpConfig, HttpConfigType, config as httpConfig } from './http_config'; import { HttpServer } from './http_server'; import { HttpsRedirectServer } from './https_redirect_server'; - import { InternalHttpServicePreboot, InternalHttpServiceSetup, InternalHttpServiceStart, } from './types'; - import { registerCoreHandlers } from './lifecycle_handlers'; import { ExternalUrlConfigType, externalUrlConfig, ExternalUrlConfig } from './external_url'; diff --git a/src/core/server/http/https_redirect_server.test.ts b/packages/core/http/core-http-server-internal/src/https_redirect_server.test.ts similarity index 100% rename from src/core/server/http/https_redirect_server.test.ts rename to packages/core/http/core-http-server-internal/src/https_redirect_server.test.ts diff --git a/src/core/server/http/https_redirect_server.ts b/packages/core/http/core-http-server-internal/src/https_redirect_server.ts similarity index 100% rename from src/core/server/http/https_redirect_server.ts rename to packages/core/http/core-http-server-internal/src/https_redirect_server.ts diff --git a/src/core/server/http/index.ts b/packages/core/http/core-http-server-internal/src/index.ts similarity index 80% rename from src/core/server/http/index.ts rename to packages/core/http/core-http-server-internal/src/index.ts index 4e4f7938c1211..0c0abe4c989e5 100644 --- a/src/core/server/http/index.ts +++ b/packages/core/http/core-http-server-internal/src/index.ts @@ -9,7 +9,8 @@ export { config, HttpConfig } from './http_config'; export type { HttpConfigType } from './http_config'; export { HttpService } from './http_service'; -export { isKibanaRequest, isRealRequest, CoreKibanaRequest, kibanaResponseFactory } from './router'; +export { HttpServer } from './http_server'; +export type { HttpServerSetup, LifecycleRegistrar } from './http_server'; export type { InternalHttpServicePreboot, InternalHttpServiceSetup, @@ -20,3 +21,5 @@ export { BasePath } from './base_path_service'; export { cspConfig, CspConfig } from './csp'; export { externalUrlConfig, ExternalUrlConfig } from './external_url'; + +export { createCookieSessionStorageFactory } from './cookie_session_storage'; diff --git a/src/core/server/http/lifecycle/auth.ts b/packages/core/http/core-http-server-internal/src/lifecycle/auth.ts similarity index 96% rename from src/core/server/http/lifecycle/auth.ts rename to packages/core/http/core-http-server-internal/src/lifecycle/auth.ts index 6e6e4958904e1..b31c1805604d1 100644 --- a/src/core/server/http/lifecycle/auth.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle/auth.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Lifecycle, Request, ResponseToolkit } from '@hapi/hapi'; +import type { Lifecycle, Request, ResponseToolkit } from '@hapi/hapi'; import type { Logger } from '@kbn/logging'; import type { AuthenticationHandler, @@ -24,7 +24,7 @@ import { CoreKibanaRequest, lifecycleResponseFactory, isKibanaResponse, -} from '../router'; +} from '@kbn/core-http-router-server-internal'; const authResult = { authenticated(data: AuthResultParams = {}): AuthResult { diff --git a/src/core/server/http/lifecycle/on_post_auth.ts b/packages/core/http/core-http-server-internal/src/lifecycle/on_post_auth.ts similarity index 97% rename from src/core/server/http/lifecycle/on_post_auth.ts rename to packages/core/http/core-http-server-internal/src/lifecycle/on_post_auth.ts index ff594aad9e827..22ef9db2bab08 100644 --- a/src/core/server/http/lifecycle/on_post_auth.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle/on_post_auth.ts @@ -20,7 +20,7 @@ import { CoreKibanaRequest, lifecycleResponseFactory, isKibanaResponse, -} from '../router'; +} from '@kbn/core-http-router-server-internal'; const postAuthResult = { next(): OnPostAuthResult { diff --git a/src/core/server/http/lifecycle/on_pre_auth.ts b/packages/core/http/core-http-server-internal/src/lifecycle/on_pre_auth.ts similarity index 97% rename from src/core/server/http/lifecycle/on_pre_auth.ts rename to packages/core/http/core-http-server-internal/src/lifecycle/on_pre_auth.ts index eda8034677192..67c12ca570191 100644 --- a/src/core/server/http/lifecycle/on_pre_auth.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle/on_pre_auth.ts @@ -20,7 +20,7 @@ import { CoreKibanaRequest, isKibanaResponse, lifecycleResponseFactory, -} from '../router'; +} from '@kbn/core-http-router-server-internal'; const preAuthResult = { next(): OnPreAuthResult { diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/packages/core/http/core-http-server-internal/src/lifecycle/on_pre_response.ts similarity index 98% rename from src/core/server/http/lifecycle/on_pre_response.ts rename to packages/core/http/core-http-server-internal/src/lifecycle/on_pre_response.ts index f5a473205284f..3a59d116a031d 100644 --- a/src/core/server/http/lifecycle/on_pre_response.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle/on_pre_response.ts @@ -25,7 +25,7 @@ import type { OnPreResponseHandler, } from '@kbn/core-http-server'; import { OnPreResponseResultType } from '@kbn/core-http-server'; -import { HapiResponseAdapter, CoreKibanaRequest } from '../router'; +import { HapiResponseAdapter, CoreKibanaRequest } from '@kbn/core-http-router-server-internal'; const preResponseResult = { render(responseRender: OnPreResponseRender): OnPreResponseResult { diff --git a/src/core/server/http/lifecycle/on_pre_routing.ts b/packages/core/http/core-http-server-internal/src/lifecycle/on_pre_routing.ts similarity index 98% rename from src/core/server/http/lifecycle/on_pre_routing.ts rename to packages/core/http/core-http-server-internal/src/lifecycle/on_pre_routing.ts index d5e16989cc833..36be4a61cc381 100644 --- a/src/core/server/http/lifecycle/on_pre_routing.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle/on_pre_routing.ts @@ -22,7 +22,7 @@ import { CoreKibanaRequest, isKibanaResponse, lifecycleResponseFactory, -} from '../router'; +} from '@kbn/core-http-router-server-internal'; const preRoutingResult = { next(): OnPreRoutingResult { diff --git a/src/core/server/http/lifecycle_handlers.test.ts b/packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts similarity index 90% rename from src/core/server/http/lifecycle_handlers.test.ts rename to packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts index 2f2cac972c57a..6fa2ef18353b6 100644 --- a/src/core/server/http/lifecycle_handlers.test.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts @@ -6,17 +6,34 @@ * Side Public License, v 1. */ -import type { KibanaRequest, RouteMethod, KibanaRouteOptions } from '@kbn/core-http-server'; +import type { + KibanaRequest, + RouteMethod, + KibanaRouteOptions, + OnPreResponseToolkit, + OnPostAuthToolkit, + OnPreRoutingToolkit, +} from '@kbn/core-http-server'; +import { mockRouter } from '@kbn/core-http-router-server-mocks'; import { createCustomHeadersPreResponseHandler, createVersionCheckPostAuthHandler, createXsrfPostAuthHandler, } from './lifecycle_handlers'; -import { httpServerMock } from './http_server.mocks'; import { HttpConfig } from './http_config'; +type ToolkitMock = jest.Mocked; + const createConfig = (partial: Partial): HttpConfig => partial as HttpConfig; +const createToolkit = (): ToolkitMock => { + return { + render: jest.fn(), + next: jest.fn(), + rewriteUrl: jest.fn(), + }; +}; + const forgeRequest = ({ headers = {}, path = '/', @@ -28,7 +45,7 @@ const forgeRequest = ({ method: RouteMethod; kibanaRouteOptions: KibanaRouteOptions; }>): KibanaRequest => { - return httpServerMock.createKibanaRequest({ + return mockRouter.createKibanaRequest({ headers, path, method, @@ -37,12 +54,12 @@ const forgeRequest = ({ }; describe('xsrf post-auth handler', () => { - let toolkit: ReturnType; - let responseFactory: ReturnType; + let toolkit: ToolkitMock; + let responseFactory: ReturnType; beforeEach(() => { - toolkit = httpServerMock.createToolkit(); - responseFactory = httpServerMock.createLifecycleResponseFactory(); + toolkit = createToolkit(); + responseFactory = mockRouter.createResponseFactory(); }); describe('non destructive methods', () => { @@ -165,12 +182,12 @@ describe('xsrf post-auth handler', () => { }); describe('versionCheck post-auth handler', () => { - let toolkit: ReturnType; - let responseFactory: ReturnType; + let toolkit: ToolkitMock; + let responseFactory: ReturnType; beforeEach(() => { - toolkit = httpServerMock.createToolkit(); - responseFactory = httpServerMock.createLifecycleResponseFactory(); + toolkit = createToolkit(); + responseFactory = mockRouter.createResponseFactory(); }); it('forward the request to the next interceptor if header matches', () => { @@ -225,10 +242,10 @@ describe('versionCheck post-auth handler', () => { }); describe('customHeaders pre-response handler', () => { - let toolkit: ReturnType; + let toolkit: ToolkitMock; beforeEach(() => { - toolkit = httpServerMock.createToolkit(); + toolkit = createToolkit(); }); it('adds the kbn-name header to the response', () => { diff --git a/src/core/server/http/lifecycle_handlers.ts b/packages/core/http/core-http-server-internal/src/lifecycle_handlers.ts similarity index 97% rename from src/core/server/http/lifecycle_handlers.ts rename to packages/core/http/core-http-server-internal/src/lifecycle_handlers.ts index b82914b9b985c..11e034a56914b 100644 --- a/src/core/server/http/lifecycle_handlers.ts +++ b/packages/core/http/core-http-server-internal/src/lifecycle_handlers.ts @@ -8,8 +8,8 @@ import { Env } from '@kbn/config'; import type { OnPostAuthHandler, OnPreResponseHandler } from '@kbn/core-http-server'; +import { isSafeMethod } from '@kbn/core-http-router-server-internal'; import { HttpConfig } from './http_config'; -import { isSafeMethod } from './router'; import { LifecycleRegistrar } from './http_server'; const VERSION_HEADER = 'kbn-version'; diff --git a/src/core/server/http/logging/get_payload_size.test.ts b/packages/core/http/core-http-server-internal/src/logging/get_payload_size.test.ts similarity index 100% rename from src/core/server/http/logging/get_payload_size.test.ts rename to packages/core/http/core-http-server-internal/src/logging/get_payload_size.test.ts diff --git a/src/core/server/http/logging/get_payload_size.ts b/packages/core/http/core-http-server-internal/src/logging/get_payload_size.ts similarity index 100% rename from src/core/server/http/logging/get_payload_size.ts rename to packages/core/http/core-http-server-internal/src/logging/get_payload_size.ts diff --git a/src/core/server/http/logging/get_response_log.test.ts b/packages/core/http/core-http-server-internal/src/logging/get_response_log.test.ts similarity index 92% rename from src/core/server/http/logging/get_response_log.test.ts rename to packages/core/http/core-http-server-internal/src/logging/get_response_log.test.ts index 386bf2a263934..a8f607c5c6865 100644 --- a/src/core/server/http/logging/get_response_log.test.ts +++ b/packages/core/http/core-http-server-internal/src/logging/get_response_log.test.ts @@ -189,6 +189,28 @@ describe('getEcsResponseLog', () => { `); }); + test('redacts x-elastic-app-auth headers by default', () => { + const req = createMockHapiRequest({ + headers: { 'x-elastic-app-auth': 'hello', 'user-agent': 'world' }, + response: { headers: { 'content-length': '123', 'x-elastic-app-auth': 'abc' } }, + }); + const result = getEcsResponseLog(req, logger); + // @ts-expect-error ECS custom field + expect(result.meta.http.request.headers).toMatchInlineSnapshot(` + Object { + "user-agent": "world", + "x-elastic-app-auth": "[REDACTED]", + } + `); + // @ts-expect-error ECS custom field + expect(result.meta.http.response.headers).toMatchInlineSnapshot(` + Object { + "content-length": "123", + "x-elastic-app-auth": "[REDACTED]", + } + `); + }); + test('does not mutate original headers', () => { const reqHeaders = { a: 'foo', b: ['hello', 'world'] }; const resHeaders = { headers: { c: 'bar' } }; diff --git a/src/core/server/http/logging/get_response_log.ts b/packages/core/http/core-http-server-internal/src/logging/get_response_log.ts similarity index 95% rename from src/core/server/http/logging/get_response_log.ts rename to packages/core/http/core-http-server-internal/src/logging/get_response_log.ts index 711c4bc1e58c9..f356bf077095a 100644 --- a/src/core/server/http/logging/get_response_log.ts +++ b/packages/core/http/core-http-server-internal/src/logging/get_response_log.ts @@ -14,7 +14,9 @@ import type { LogMeta, Logger } from '@kbn/logging'; import type { KibanaRequestState } from '@kbn/core-http-server'; import { getResponsePayloadBytes } from './get_payload_size'; -const FORBIDDEN_HEADERS = ['authorization', 'cookie', 'set-cookie']; +// If you are updating these, consider whether they should also be updated in the +// elasticsearch service `getEcsResponseLog` +const FORBIDDEN_HEADERS = ['authorization', 'cookie', 'set-cookie', 'x-elastic-app-auth']; const REDACTED_HEADER_TEXT = '[REDACTED]'; type HapiHeaders = Record; diff --git a/src/core/server/http/logging/index.ts b/packages/core/http/core-http-server-internal/src/logging/index.ts similarity index 100% rename from src/core/server/http/logging/index.ts rename to packages/core/http/core-http-server-internal/src/logging/index.ts diff --git a/src/core/server/http/security_response_headers_config.test.ts b/packages/core/http/core-http-server-internal/src/security_response_headers_config.test.ts similarity index 100% rename from src/core/server/http/security_response_headers_config.test.ts rename to packages/core/http/core-http-server-internal/src/security_response_headers_config.test.ts diff --git a/src/core/server/http/security_response_headers_config.ts b/packages/core/http/core-http-server-internal/src/security_response_headers_config.ts similarity index 100% rename from src/core/server/http/security_response_headers_config.ts rename to packages/core/http/core-http-server-internal/src/security_response_headers_config.ts diff --git a/src/core/server/http/types.ts b/packages/core/http/core-http-server-internal/src/types.ts similarity index 100% rename from src/core/server/http/types.ts rename to packages/core/http/core-http-server-internal/src/types.ts diff --git a/packages/core/http/core-http-server-internal/tsconfig.json b/packages/core/http/core-http-server-internal/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/http/core-http-server-internal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/http/core-http-server-mocks/BUILD.bazel b/packages/core/http/core-http-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..f3408be31eb1d --- /dev/null +++ b/packages/core/http/core-http-server-mocks/BUILD.bazel @@ -0,0 +1,119 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-http-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-http-server-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//rxjs", + "@npm//moment", + "//packages/kbn-hapi-mocks", + "//packages/kbn-config-schema", + "//packages/kbn-config-mocks", + "//packages/core/logging/core-logging-server-mocks", + "//packages/core/http/core-http-router-server-mocks", + "//packages/core/http/core-http-router-server-internal", + "//packages/core/http/core-http-server-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//rxjs", + "@npm//moment", + "@npm//@hapi/hapi", + "@npm//@types/hapi__hapi", + "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-config-mocks:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/kbn-hapi-mocks:npm_module_types", + "//packages/core/logging/core-logging-server-mocks:npm_module_types", + "//packages/core/http/core-http-server:npm_module_types", + "//packages/core/http/core-http-router-server-mocks:npm_module_types", + "//packages/core/http/core-http-router-server-internal:npm_module_types", + "//packages/core/http/core-http-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/http/core-http-server-mocks/README.md b/packages/core/http/core-http-server-mocks/README.md new file mode 100644 index 0000000000000..917bc9395db61 --- /dev/null +++ b/packages/core/http/core-http-server-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-http-server-mocks + +This package contains the mocks and test utils for core's server-side `http` service diff --git a/packages/core/http/core-http-server-mocks/jest.config.js b/packages/core/http/core-http-server-mocks/jest.config.js new file mode 100644 index 0000000000000..4f088fda9ea9a --- /dev/null +++ b/packages/core/http/core-http-server-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../..', + roots: ['/packages/core/http/core-http-server-mocks'], +}; diff --git a/packages/core/http/core-http-server-mocks/package.json b/packages/core/http/core-http-server-mocks/package.json new file mode 100644 index 0000000000000..d6757d779dfd6 --- /dev/null +++ b/packages/core/http/core-http-server-mocks/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-http-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/src/core/server/http/cookie_session_storage.mocks.ts b/packages/core/http/core-http-server-mocks/src/cookie_session_storage.mocks.ts similarity index 100% rename from src/core/server/http/cookie_session_storage.mocks.ts rename to packages/core/http/core-http-server-mocks/src/cookie_session_storage.mocks.ts diff --git a/src/core/server/http/http_server.mocks.ts b/packages/core/http/core-http-server-mocks/src/http_server.mocks.ts similarity index 95% rename from src/core/server/http/http_server.mocks.ts rename to packages/core/http/core-http-server-mocks/src/http_server.mocks.ts index e56535b94482c..8e7d5543e35eb 100644 --- a/src/core/server/http/http_server.mocks.ts +++ b/packages/core/http/core-http-server-mocks/src/http_server.mocks.ts @@ -13,7 +13,7 @@ import type { OnPostAuthToolkit, OnPreRoutingToolkit, } from '@kbn/core-http-server'; -import { mockRouter } from './router/router.mock'; +import { mockRouter } from '@kbn/core-http-router-server-mocks'; const createLifecycleResponseFactoryMock = (): jest.Mocked => ({ redirected: jest.fn(), diff --git a/src/core/server/http/http_service.mock.ts b/packages/core/http/core-http-server-mocks/src/http_service.mock.ts similarity index 97% rename from src/core/server/http/http_service.mock.ts rename to packages/core/http/core-http-server-mocks/src/http_service.mock.ts index 5ef94cff3110a..ec90929a0dc6f 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/packages/core/http/core-http-server-mocks/src/http_service.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Server } from '@hapi/hapi'; +import type { Server } from '@hapi/hapi'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { configMock } from '@kbn/config-mocks'; import type { @@ -22,17 +22,16 @@ import type { HttpServiceStart, } from '@kbn/core-http-server'; import { AuthStatus } from '@kbn/core-http-server'; +import { mockRouter, RouterMock } from '@kbn/core-http-router-server-mocks'; -import { CspConfig } from './csp'; -import { mockRouter, RouterMock } from './router/router.mock'; -import { +import { CspConfig, ExternalUrlConfig } from '@kbn/core-http-server-internal'; +import type { + HttpService, InternalHttpServicePreboot, InternalHttpServiceSetup, InternalHttpServiceStart, -} from './types'; -import { HttpService } from './http_service'; +} from '@kbn/core-http-server-internal'; import { sessionStorageMock } from './cookie_session_storage.mocks'; -import { ExternalUrlConfig } from './external_url'; type BasePathMocked = jest.Mocked; type AuthMocked = jest.Mocked; diff --git a/packages/core/http/core-http-server-mocks/src/index.ts b/packages/core/http/core-http-server-mocks/src/index.ts new file mode 100644 index 0000000000000..ca4e44d1c3e8d --- /dev/null +++ b/packages/core/http/core-http-server-mocks/src/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { sessionStorageMock } from './cookie_session_storage.mocks'; +export { httpServerMock } from './http_server.mocks'; +export { httpServiceMock } from './http_service.mock'; +export type { + HttpServicePrebootMock, + HttpServiceSetupMock, + HttpServiceStartMock, + InternalHttpServicePrebootMock, + InternalHttpServiceSetupMock, + InternalHttpServiceStartMock, +} from './http_service.mock'; +export { createCoreContext, createHttpServer } from './test_utils'; diff --git a/packages/core/http/core-http-server-mocks/src/test_utils.ts b/packages/core/http/core-http-server-mocks/src/test_utils.ts new file mode 100644 index 0000000000000..2b9658693dce7 --- /dev/null +++ b/packages/core/http/core-http-server-mocks/src/test_utils.ts @@ -0,0 +1,90 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { BehaviorSubject } from 'rxjs'; +import moment from 'moment'; +import { REPO_ROOT } from '@kbn/utils'; +import { ByteSizeValue } from '@kbn/config-schema'; +import { Env } from '@kbn/config'; +import { getEnvOptions, configServiceMock } from '@kbn/config-mocks'; +import type { CoreContext } from '@kbn/core-base-server-internal'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import { HttpService } from '@kbn/core-http-server-internal'; + +const coreId = Symbol('core'); +const env = Env.createDefault(REPO_ROOT, getEnvOptions()); + +const logger = loggingSystemMock.create(); + +const createConfigService = () => { + const configService = configServiceMock.create(); + configService.atPath.mockImplementation((path) => { + if (path === 'server') { + return new BehaviorSubject({ + hosts: ['localhost'], + maxPayload: new ByteSizeValue(1024), + autoListen: true, + ssl: { + enabled: false, + }, + cors: { + enabled: false, + }, + compression: { enabled: true }, + xsrf: { + disableProtection: true, + allowlist: [], + }, + securityResponseHeaders: {}, + customResponseHeaders: {}, + requestId: { + allowFromAnyIp: true, + ipAllowlist: [], + }, + shutdownTimeout: moment.duration(30, 'seconds'), + keepaliveTimeout: 120_000, + socketTimeout: 120_000, + } as any); + } + if (path === 'externalUrl') { + return new BehaviorSubject({ + policy: [], + } as any); + } + if (path === 'csp') { + return new BehaviorSubject({ + strict: false, + disableEmbedding: false, + warnLegacyBrowsers: true, + }); + } + throw new Error(`Unexpected config path: ${path}`); + }); + return configService; +}; + +const createDefaultContext = (): CoreContext => { + return { + coreId, + env, + logger, + configService: createConfigService(), + }; +}; + +export const createCoreContext = (overrides: Partial = {}): CoreContext => ({ + ...createDefaultContext(), + ...overrides, +}); + +/** + * Creates a concrete HttpServer with a mocked context. + */ +export const createHttpServer = (overrides: Partial = {}): HttpService => { + return new HttpService(createCoreContext(overrides)); +}; diff --git a/packages/core/http/core-http-server-mocks/tsconfig.json b/packages/core/http/core-http-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/http/core-http-server-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 87bc77e61bae5..ee2fb5143e92b 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -341,6 +341,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { blocklist: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/blocklist.html`, policyResponseTroubleshooting: { full_disk_access: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/deploy-elastic-endpoint.html#enable-fda-endpoint`, + macos_system_ext: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/deploy-elastic-endpoint.html#system-extension-endpoint`, }, }, query: { diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 3a0e57b43c169..8a7a0e788cbc3 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -247,6 +247,7 @@ export interface DocLinks { readonly blocklist: string; readonly policyResponseTroubleshooting: { full_disk_access: string; + macos_system_ext: string; }; }; readonly query: { diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 3b48937eb1098..647e8a8d4bbbe 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -23894,7209 +23894,6648 @@ module.exports = AggregateError; /***/ }), -/***/ "../../node_modules/del/node_modules/fast-glob/out/index.js": +/***/ "../../node_modules/del/node_modules/globby/gitignore.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const taskManager = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/managers/tasks.js"); -const async_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/async.js"); -const stream_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/stream.js"); -const sync_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/sync.js"); -const settings_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/settings.js"); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); -} -// https://github.com/typescript-eslint/typescript-eslint/issues/60 -// eslint-disable-next-line no-redeclare -(function (FastGlob) { - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - FastGlob.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - /** - * The stream returned by the provider cannot work with an asynchronous iterator. - * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. - * This affects performance (+25%). I don't see best solution right now. - */ - return utils.stream.merge(works); - } - FastGlob.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = [].concat(source); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - FastGlob.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - FastGlob.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - FastGlob.escapePath = escapePath; -})(FastGlob || (FastGlob = {})); -function getWorks(source, _Provider, options) { - const patterns = [].concat(source); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); -} -function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError('Patterns must be a string (non empty) or an array of strings'); - } -} -module.exports = FastGlob; +const {promisify} = __webpack_require__("util"); +const fs = __webpack_require__("fs"); +const path = __webpack_require__("path"); +const fastGlob = __webpack_require__("../../node_modules/fast-glob/out/index.js"); +const gitIgnore = __webpack_require__("../../node_modules/ignore/index.js"); +const slash = __webpack_require__("../../node_modules/slash/index.js"); +const DEFAULT_IGNORE = [ + '**/node_modules/**', + '**/flow-typed/**', + '**/coverage/**', + '**/.git' +]; -/***/ }), +const readFileP = promisify(fs.readFile); -/***/ "../../node_modules/del/node_modules/fast-glob/out/managers/tasks.js": -/***/ (function(module, exports, __webpack_require__) { +const mapGitIgnorePatternTo = base => ignore => { + if (ignore.startsWith('!')) { + return '!' + path.posix.join(base, ignore.slice(1)); + } -"use strict"; + return path.posix.join(base, ignore); +}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -function generate(patterns, settings) { - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); -} -exports.generate = generate; -/** - * Returns tasks grouped by basic pattern directories. - * - * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. - * This is necessary because directory traversal starts at the base directory and goes deeper. - */ -function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - /* - * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory - * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. - */ - if ('.' in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); - } - else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - return tasks; -} -exports.convertPatternsToTasks = convertPatternsToTasks; -function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); -} -exports.getPositivePatterns = getPositivePatterns; -function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; -} -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, group); -} -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; -} -exports.convertPatternGroupToTask = convertPatternGroupToTask; +const parseGitIgnore = (content, options) => { + const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); + return content + .split(/\r?\n/) + .filter(Boolean) + .filter(line => !line.startsWith('#')) + .map(mapGitIgnorePatternTo(base)); +}; -/***/ }), +const reduceIgnore = files => { + return files.reduce((ignores, file) => { + ignores.add(parseGitIgnore(file.content, { + cwd: file.cwd, + fileName: file.filePath + })); + return ignores; + }, gitIgnore()); +}; -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/async.js": -/***/ (function(module, exports, __webpack_require__) { +const ensureAbsolutePathForCwd = (cwd, p) => { + if (path.isAbsolute(p)) { + if (p.startsWith(cwd)) { + return p; + } -"use strict"; + throw new Error(`Path ${p} is not in cwd ${cwd}`); + } -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/readers/stream.js"); -const provider_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/provider.js"); -class ProviderAsync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = []; - return new Promise((resolve, reject) => { - const stream = this.api(root, task, options); - stream.once('error', reject); - stream.on('data', (entry) => entries.push(options.transform(entry))); - stream.once('end', () => resolve(entries)); - }); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderAsync; + return path.join(cwd, p); +}; +const getIsIgnoredPredecate = (ignores, cwd) => { + return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p)))); +}; -/***/ }), +const getFile = async (file, cwd) => { + const filePath = path.join(cwd, file); + const content = await readFileP(filePath, 'utf8'); -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/filters/deep.js": -/***/ (function(module, exports, __webpack_require__) { + return { + cwd, + filePath, + content + }; +}; -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -const partial_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/matchers/partial.js"); -class DeepFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - /** - * Avoid unnecessary depth calculations when it doesn't matter. - */ - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split('/').length; - if (basePath === '') { - return entryPathDepth; - } - const basePathDepth = basePath.split('/').length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } -} -exports.default = DeepFilter; +const getFileSync = (file, cwd) => { + const filePath = path.join(cwd, file); + const content = fs.readFileSync(filePath, 'utf8'); + return { + cwd, + filePath, + content + }; +}; -/***/ }), +const normalizeOptions = ({ + ignore = [], + cwd = slash(process.cwd()) +} = {}) => { + return {ignore, cwd}; +}; -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/filters/entry.js": -/***/ (function(module, exports, __webpack_require__) { +module.exports = async options => { + options = normalizeOptions(options); -"use strict"; + const paths = await fastGlob('**/.gitignore', { + ignore: DEFAULT_IGNORE.concat(options.ignore), + cwd: options.cwd + }); -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -class EntryFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = new Map(); - } - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); - return (entry) => this._filter(entry, positiveRe, negativeRe); - } - _filter(entry, positiveRe, negativeRe) { - if (this._settings.unique && this._isDuplicateEntry(entry)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { - return false; - } - const filepath = this._settings.baseNameMatch ? entry.name : entry.path; - const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); - if (this._settings.unique && isMatched) { - this._createIndexRecord(entry); - } - return isMatched; - } - _isDuplicateEntry(entry) { - return this.index.has(entry.path); - } - _createIndexRecord(entry) { - this.index.set(entry.path, undefined); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - _isMatchToPatterns(entryPath, patternsRe) { - const filepath = utils.path.removeLeadingDotSegment(entryPath); - return utils.pattern.matchAny(filepath, patternsRe); - } -} -exports.default = EntryFilter; + const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); + const ignores = reduceIgnore(files); + return getIsIgnoredPredecate(ignores, options.cwd); +}; -/***/ }), +module.exports.sync = options => { + options = normalizeOptions(options); -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/filters/error.js": -/***/ (function(module, exports, __webpack_require__) { + const paths = fastGlob.sync('**/.gitignore', { + ignore: DEFAULT_IGNORE.concat(options.ignore), + cwd: options.cwd + }); -"use strict"; + const files = paths.map(file => getFileSync(file, options.cwd)); + const ignores = reduceIgnore(files); -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -class ErrorFilter { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error) => this._isNonFatalError(error); - } - _isNonFatalError(error) { - return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; - } -} -exports.default = ErrorFilter; + return getIsIgnoredPredecate(ignores, options.cwd); +}; /***/ }), -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/matchers/matcher.js": +/***/ "../../node_modules/del/node_modules/globby/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -class Matcher { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - /** - * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). - * So, before expand patterns with brace expansion into separated patterns. - */ - const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); - for (const pattern of patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } -} -exports.default = Matcher; - - -/***/ }), +const fs = __webpack_require__("fs"); +const arrayUnion = __webpack_require__("../../node_modules/array-union/index.js"); +const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); +const glob = __webpack_require__("../../node_modules/glob/glob.js"); +const fastGlob = __webpack_require__("../../node_modules/fast-glob/out/index.js"); +const dirGlob = __webpack_require__("../../node_modules/dir-glob/index.js"); +const gitignore = __webpack_require__("../../node_modules/del/node_modules/globby/gitignore.js"); +const {FilterStream, UniqueStream} = __webpack_require__("../../node_modules/del/node_modules/globby/stream-utils.js"); -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/matchers/partial.js": -/***/ (function(module, exports, __webpack_require__) { +const DEFAULT_FILTER = () => false; -"use strict"; +const isNegative = pattern => pattern[0] === '!'; -Object.defineProperty(exports, "__esModule", { value: true }); -const matcher_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/matchers/matcher.js"); -class PartialMatcher extends matcher_1.default { - match(filepath) { - const parts = filepath.split('/'); - const levels = parts.length; - const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - /** - * In this case, the pattern has a globstar and we must read all directories unconditionally, - * but only if the level has reached the end of the first group. - * - * fixtures/{a,b}/** - * ^ true/false ^ always true - */ - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; - } -} -exports.default = PartialMatcher; +const assertPatternsInput = patterns => { + if (!patterns.every(pattern => typeof pattern === 'string')) { + throw new TypeError('Patterns must be a string or an array of strings'); + } +}; +const checkCwdOption = (options = {}) => { + if (!options.cwd) { + return; + } -/***/ }), + let stat; + try { + stat = fs.statSync(options.cwd); + } catch (_) { + return; + } -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/provider.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + if (!stat.isDirectory()) { + throw new Error('The `cwd` option must be a path to a directory'); + } +}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = __webpack_require__("path"); -const deep_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/filters/deep.js"); -const entry_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/filters/entry.js"); -const error_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/filters/error.js"); -const entry_2 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/transformers/entry.js"); -class Provider { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === '.' ? '' : task.base; - return { - basePath, - pathSegmentSeparator: '/', - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } -} -exports.default = Provider; +const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; +const generateGlobTasks = (patterns, taskOptions) => { + patterns = arrayUnion([].concat(patterns)); + assertPatternsInput(patterns); + checkCwdOption(taskOptions); -/***/ }), + const globTasks = []; -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/stream.js": -/***/ (function(module, exports, __webpack_require__) { + taskOptions = { + ignore: [], + expandDirectories: true, + ...taskOptions + }; -"use strict"; + for (const [index, pattern] of patterns.entries()) { + if (isNegative(pattern)) { + continue; + } -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__("stream"); -const stream_2 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/readers/stream.js"); -const provider_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/provider.js"); -class ProviderStream extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); - source - .once('error', (error) => destination.emit('error', error)) - .on('data', (entry) => destination.emit('data', options.transform(entry))) - .once('end', () => destination.emit('end')); - destination - .once('close', () => source.destroy()); - return destination; - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderStream; + const ignore = patterns + .slice(index) + .filter(isNegative) + .map(pattern => pattern.slice(1)); + const options = { + ...taskOptions, + ignore: taskOptions.ignore.concat(ignore) + }; -/***/ }), + globTasks.push({pattern, options}); + } -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/sync.js": -/***/ (function(module, exports, __webpack_require__) { + return globTasks; +}; -"use strict"; +const globDirs = (task, fn) => { + let options = {}; + if (task.options.cwd) { + options.cwd = task.options.cwd; + } -Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/readers/sync.js"); -const provider_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/providers/provider.js"); -class ProviderSync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderSync; + if (Array.isArray(task.options.expandDirectories)) { + options = { + ...options, + files: task.options.expandDirectories + }; + } else if (typeof task.options.expandDirectories === 'object') { + options = { + ...options, + ...task.options.expandDirectories + }; + } + return fn(task.pattern, options); +}; -/***/ }), +const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern]; -/***/ "../../node_modules/del/node_modules/fast-glob/out/providers/transformers/entry.js": -/***/ (function(module, exports, __webpack_require__) { +const getFilterSync = options => { + return options && options.gitignore ? + gitignore.sync({cwd: options.cwd, ignore: options.ignore}) : + DEFAULT_FILTER; +}; -"use strict"; +const globToTask = task => glob => { + const {options} = task; + if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { + options.ignore = dirGlob.sync(options.ignore); + } -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -class EntryTransformer { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += '/'; - } - if (!this._settings.objectMode) { - return filepath; - } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } -} -exports.default = EntryTransformer; + return { + pattern: glob, + options + }; +}; +module.exports = async (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); -/***/ }), + const getFilter = async () => { + return options && options.gitignore ? + gitignore({cwd: options.cwd, ignore: options.ignore}) : + DEFAULT_FILTER; + }; -/***/ "../../node_modules/del/node_modules/fast-glob/out/readers/reader.js": -/***/ (function(module, exports, __webpack_require__) { + const getTasks = async () => { + const tasks = await Promise.all(globTasks.map(async task => { + const globs = await getPattern(task, dirGlob); + return Promise.all(globs.map(globToTask(task))); + })); -"use strict"; + return arrayUnion(...tasks); + }; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = __webpack_require__("path"); -const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); -const utils = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/index.js"); -class Reader { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error) { - return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; - } -} -exports.default = Reader; + const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); + const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); + return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); +}; -/***/ }), +module.exports.sync = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); -/***/ "../../node_modules/del/node_modules/fast-glob/out/readers/stream.js": -/***/ (function(module, exports, __webpack_require__) { + const tasks = globTasks.reduce((tasks, task) => { + const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); + return tasks.concat(newTask); + }, []); -"use strict"; + const filter = getFilterSync(options); -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__("stream"); -const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); -const fsWalk = __webpack_require__("../../node_modules/@nodelib/fs.walk/out/index.js"); -const reader_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/readers/reader.js"); -class ReaderStream extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options) - .then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }) - .catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath) - .then((stats) => this._makeEntry(stats, pattern)) - .catch((error) => { - if (options.errorFilter(error)) { - return null; - } - throw error; - }); - } - _getStat(filepath) { - return new Promise((resolve, reject) => { - this._stat(filepath, this._fsStatSettings, (error, stats) => { - return error === null ? resolve(stats) : reject(error); - }); - }); - } -} -exports.default = ReaderStream; + return tasks.reduce( + (matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.options)), + [] + ).filter(path_ => !filter(path_)); +}; +module.exports.stream = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); -/***/ }), + const tasks = globTasks.reduce((tasks, task) => { + const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); + return tasks.concat(newTask); + }, []); -/***/ "../../node_modules/del/node_modules/fast-glob/out/readers/sync.js": -/***/ (function(module, exports, __webpack_require__) { + const filter = getFilterSync(options); + const filterStream = new FilterStream(p => !filter(p)); + const uniqueStream = new UniqueStream(); -"use strict"; + return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))) + .pipe(filterStream) + .pipe(uniqueStream); +}; -Object.defineProperty(exports, "__esModule", { value: true }); -const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); -const fsWalk = __webpack_require__("../../node_modules/@nodelib/fs.walk/out/index.js"); -const reader_1 = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/readers/reader.js"); -class ReaderSync extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } - catch (error) { - if (options.errorFilter(error)) { - return null; - } - throw error; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } -} -exports.default = ReaderSync; +module.exports.generateGlobTasks = generateGlobTasks; + +module.exports.hasMagic = (patterns, options) => [] + .concat(patterns) + .some(pattern => glob.hasMagic(pattern, options)); + +module.exports.gitignore = gitignore; /***/ }), -/***/ "../../node_modules/del/node_modules/fast-glob/out/settings.js": +/***/ "../../node_modules/del/node_modules/globby/stream-utils.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; -const fs = __webpack_require__("fs"); -const os = __webpack_require__("os"); -/** - * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. - * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 - */ -const CPU_COUNT = Math.max(os.cpus().length, 1); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - lstatSync: fs.lstatSync, - stat: fs.stat, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -class Settings { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - } - _getValue(option, value) { - return option === undefined ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } +const {Transform} = __webpack_require__("stream"); + +class ObjectTransform extends Transform { + constructor() { + super({ + objectMode: true + }); + } } -exports.default = Settings; +class FilterStream extends ObjectTransform { + constructor(filter) { + super(); + this._filter = filter; + } -/***/ }), + _transform(data, encoding, callback) { + if (this._filter(data)) { + this.push(data); + } -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/array.js": -/***/ (function(module, exports, __webpack_require__) { + callback(); + } +} -"use strict"; +class UniqueStream extends ObjectTransform { + constructor() { + super(); + this._pushed = new Set(); + } -Object.defineProperty(exports, "__esModule", { value: true }); -exports.splitWhen = exports.flatten = void 0; -function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); -} -exports.flatten = flatten; -function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } - else { - result[groupIndex].push(item); - } - } - return result; + _transform(data, encoding, callback) { + if (!this._pushed.has(data)) { + this.push(data); + this._pushed.add(data); + } + + callback(); + } } -exports.splitWhen = splitWhen; + +module.exports = { + FilterStream, + UniqueStream +}; /***/ }), -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/errno.js": +/***/ "../../node_modules/del/node_modules/indent-string/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEnoentCodeError = void 0; -function isEnoentCodeError(error) { - return error.code === 'ENOENT'; -} -exports.isEnoentCodeError = isEnoentCodeError; +module.exports = (string, count = 1, options) => { + options = { + indent: ' ', + includeEmptyLines: false, + ...options + }; -/***/ }), + if (typeof string !== 'string') { + throw new TypeError( + `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` + ); + } -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/fs.js": -/***/ (function(module, exports, __webpack_require__) { + if (typeof count !== 'number') { + throw new TypeError( + `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` + ); + } -"use strict"; + if (typeof options.indent !== 'string') { + throw new TypeError( + `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` + ); + } -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; + if (count === 0) { + return string; + } + + const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + + return string.replace(regex, options.indent.repeat(count)); +}; /***/ }), -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/index.js": +/***/ "../../node_modules/del/node_modules/p-map/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; -const array = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/array.js"); -exports.array = array; -const errno = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/errno.js"); -exports.errno = errno; -const fs = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/fs.js"); -exports.fs = fs; -const path = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/path.js"); -exports.path = path; -const pattern = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/pattern.js"); -exports.pattern = pattern; -const stream = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/stream.js"); -exports.stream = stream; -const string = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/utils/string.js"); -exports.string = string; +const AggregateError = __webpack_require__("../../node_modules/del/node_modules/aggregate-error/index.js"); +module.exports = async ( + iterable, + mapper, + { + concurrency = Infinity, + stopOnError = true + } = {} +) => { + return new Promise((resolve, reject) => { + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } -/***/ }), + if (!(typeof concurrency === 'number' && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); + } -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/path.js": -/***/ (function(module, exports, __webpack_require__) { + const ret = []; + const errors = []; + const iterator = iterable[Symbol.iterator](); + let isRejected = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; -"use strict"; + const next = () => { + if (isRejected) { + return; + } -Object.defineProperty(exports, "__esModule", { value: true }); -exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; -const path = __webpack_require__("path"); -const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ -const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; -/** - * Designed to work only with simple paths: `dir\\file`. - */ -function unixify(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.unixify = unixify; -function makeAbsolute(cwd, filepath) { - return path.resolve(cwd, filepath); -} -exports.makeAbsolute = makeAbsolute; -function escape(pattern) { - return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} -exports.escape = escape; -function removeLeadingDotSegment(entry) { - // We do not use `startsWith` because this is 10x slower than current implementation for some cases. - // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - if (entry.charAt(0) === '.') { - const secondCharactery = entry.charAt(1); - if (secondCharactery === '/' || secondCharactery === '\\') { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } - } - return entry; -} -exports.removeLeadingDotSegment = removeLeadingDotSegment; + const nextItem = iterator.next(); + const i = currentIndex; + currentIndex++; + + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0) { + if (!stopOnError && errors.length !== 0) { + reject(new AggregateError(errors)); + } else { + resolve(ret); + } + } + + return; + } + + resolvingCount++; + + (async () => { + try { + const element = await nextItem.value; + ret[i] = await mapper(element, i); + resolvingCount--; + next(); + } catch (error) { + if (stopOnError) { + isRejected = true; + reject(error); + } else { + errors.push(error); + resolvingCount--; + next(); + } + } + })(); + }; + + for (let i = 0; i < concurrency; i++) { + next(); + + if (isIterableDone) { + break; + } + } + }); +}; /***/ }), -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/pattern.js": +/***/ "../../node_modules/delayed-stream/lib/delayed_stream.js": /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var Stream = __webpack_require__("stream").Stream; +var util = __webpack_require__("util"); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; -const path = __webpack_require__("path"); -const globParent = __webpack_require__("../../node_modules/glob-parent/index.js"); -const micromatch = __webpack_require__("../../node_modules/del/node_modules/micromatch/index.js"); -const GLOBSTAR = '**'; -const ESCAPE_SYMBOL = '\\'; -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/; -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/; -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/; -const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/; -function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); -} -exports.isStaticPattern = isStaticPattern; -function isDynamicPattern(pattern, options = {}) { - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false; - } - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) { - return true; - } - return false; -} -exports.isDynamicPattern = isDynamicPattern; -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Returns patterns that can be applied inside the current directory. - * - * @example - * // ['./*', '*', 'a/*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; } -exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; -/** - * Returns patterns to be expanded relative to (outside) the current directory. - * - * @example - * // ['../*', './../*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); -} -exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; -function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith('..') || pattern.startsWith('./..'); -} -exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; -function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); -} -exports.getBaseDirectory = getBaseDirectory; -function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); -} -exports.hasGlobStar = hasGlobStar; -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -function isAffectDepthOfReadingPattern(pattern) { - const basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); -} -exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; -function expandBraceExpansion(pattern) { - return micromatch.braces(pattern, { - expand: true, - nodupes: true - }); -} -exports.expandBraceExpansion = expandBraceExpansion; -function getPatternParts(pattern, options) { - let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - /** - * The scan method returns an empty array in some cases. - * See micromatch/picomatch#58 for more details. - */ - if (parts.length === 0) { - parts = [pattern]; - } - /** - * The scan method does not return an empty part for the pattern with a forward slash. - * This is another part of micromatch/picomatch#58. - */ - if (parts[0].startsWith('/')) { - parts[0] = parts[0].slice(1); - parts.unshift(''); - } - return parts; -} -exports.getPatternParts = getPatternParts; -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); -} -exports.convertPatternsToRe = convertPatternsToRe; -function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); -} -exports.matchAny = matchAny; - - -/***/ }), - -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/stream.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.merge = void 0; -const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); -function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once('error', (error) => mergedStream.emit('error', error)); - }); - mergedStream.once('close', () => propagateCloseEventToSources(streams)); - mergedStream.once('end', () => propagateCloseEventToSources(streams)); - return mergedStream; -} -exports.merge = merge; -function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit('close')); -} - - -/***/ }), - -/***/ "../../node_modules/del/node_modules/fast-glob/out/utils/string.js": -/***/ (function(module, exports, __webpack_require__) { +util.inherits(DelayedStream, Stream); -"use strict"; +DelayedStream.create = function(source, options) { + var delayedStream = new this(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEmpty = exports.isString = void 0; -function isString(input) { - return typeof input === 'string'; -} -exports.isString = isString; -function isEmpty(input) { - return input === ''; -} -exports.isEmpty = isEmpty; + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + delayedStream.source = source; -/***/ }), + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; -/***/ "../../node_modules/del/node_modules/globby/gitignore.js": -/***/ (function(module, exports, __webpack_require__) { + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } -"use strict"; + return delayedStream; +}; -const {promisify} = __webpack_require__("util"); -const fs = __webpack_require__("fs"); -const path = __webpack_require__("path"); -const fastGlob = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/index.js"); -const gitIgnore = __webpack_require__("../../node_modules/ignore/index.js"); -const slash = __webpack_require__("../../node_modules/slash/index.js"); +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); -const DEFAULT_IGNORE = [ - '**/node_modules/**', - '**/flow-typed/**', - '**/coverage/**', - '**/.git' -]; +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; -const readFileP = promisify(fs.readFile); +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } -const mapGitIgnorePatternTo = base => ignore => { - if (ignore.startsWith('!')) { - return '!' + path.posix.join(base, ignore.slice(1)); - } + this.source.resume(); +}; - return path.posix.join(base, ignore); +DelayedStream.prototype.pause = function() { + this.source.pause(); }; -const parseGitIgnore = (content, options) => { - const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); +DelayedStream.prototype.release = function() { + this._released = true; - return content - .split(/\r?\n/) - .filter(Boolean) - .filter(line => !line.startsWith('#')) - .map(mapGitIgnorePatternTo(base)); + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; }; -const reduceIgnore = files => { - return files.reduce((ignores, file) => { - ignores.add(parseGitIgnore(file.content, { - cwd: file.cwd, - fileName: file.filePath - })); - return ignores; - }, gitIgnore()); +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; }; -const ensureAbsolutePathForCwd = (cwd, p) => { - if (path.isAbsolute(p)) { - if (p.startsWith(cwd)) { - return p; - } +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } - throw new Error(`Path ${p} is not in cwd ${cwd}`); - } + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } - return path.join(cwd, p); + this._bufferedEvents.push(args); }; -const getIsIgnoredPredecate = (ignores, cwd) => { - return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p)))); -}; +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } -const getFile = async (file, cwd) => { - const filePath = path.join(cwd, file); - const content = await readFileP(filePath, 'utf8'); + if (this.dataSize <= this.maxDataSize) { + return; + } - return { - cwd, - filePath, - content - }; + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); }; -const getFileSync = (file, cwd) => { - const filePath = path.join(cwd, file); - const content = fs.readFileSync(filePath, 'utf8'); - return { - cwd, - filePath, - content - }; -}; +/***/ }), -const normalizeOptions = ({ - ignore = [], - cwd = slash(process.cwd()) -} = {}) => { - return {ignore, cwd}; -}; +/***/ "../../node_modules/detect-indent/index.js": +/***/ (function(module, exports, __webpack_require__) { -module.exports = async options => { - options = normalizeOptions(options); +"use strict"; - const paths = await fastGlob('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), - cwd: options.cwd - }); - const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); - const ignores = reduceIgnore(files); +// Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment +const INDENT_REGEX = /^(?:( )+|\t+)/; - return getIsIgnoredPredecate(ignores, options.cwd); -}; +const INDENT_TYPE_SPACE = 'space'; +const INDENT_TYPE_TAB = 'tab'; -module.exports.sync = options => { - options = normalizeOptions(options); +// Make a Map that counts how many indents/unindents have occurred for a given size and how many lines follow a given indentation. +// The key is a concatenation of the indentation type (s = space and t = tab) and the size of the indents/unindents. +// +// indents = { +// t3: [1, 0], +// t4: [1, 5], +// s5: [1, 0], +// s12: [1, 0], +// } +function makeIndentsMap(string, ignoreSingleSpaces) { + const indents = new Map(); - const paths = fastGlob.sync('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), - cwd: options.cwd - }); + // Remember the size of previous line's indentation + let previousSize = 0; + let previousIndentType; - const files = paths.map(file => getFileSync(file, options.cwd)); - const ignores = reduceIgnore(files); + // Indents key (ident type + size of the indents/unindents) + let key; - return getIsIgnoredPredecate(ignores, options.cwd); -}; + for (const line of string.split(/\n/g)) { + if (!line) { + // Ignore empty lines + continue; + } + let indent; + let indentType; + let weight; + let entry; + const matches = line.match(INDENT_REGEX); -/***/ }), + if (matches === null) { + previousSize = 0; + previousIndentType = ''; + } else { + indent = matches[0].length; -/***/ "../../node_modules/del/node_modules/globby/index.js": -/***/ (function(module, exports, __webpack_require__) { + if (matches[1]) { + indentType = INDENT_TYPE_SPACE; + } else { + indentType = INDENT_TYPE_TAB; + } -"use strict"; + // Ignore single space unless it's the only indent detected to prevent common false positives + if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) { + continue; + } -const fs = __webpack_require__("fs"); -const arrayUnion = __webpack_require__("../../node_modules/array-union/index.js"); -const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); -const glob = __webpack_require__("../../node_modules/glob/glob.js"); -const fastGlob = __webpack_require__("../../node_modules/del/node_modules/fast-glob/out/index.js"); -const dirGlob = __webpack_require__("../../node_modules/dir-glob/index.js"); -const gitignore = __webpack_require__("../../node_modules/del/node_modules/globby/gitignore.js"); -const {FilterStream, UniqueStream} = __webpack_require__("../../node_modules/del/node_modules/globby/stream-utils.js"); + if (indentType !== previousIndentType) { + previousSize = 0; + } -const DEFAULT_FILTER = () => false; + previousIndentType = indentType; -const isNegative = pattern => pattern[0] === '!'; + weight = 0; -const assertPatternsInput = patterns => { - if (!patterns.every(pattern => typeof pattern === 'string')) { - throw new TypeError('Patterns must be a string or an array of strings'); - } -}; + const indentDifference = indent - previousSize; + previousSize = indent; -const checkCwdOption = (options = {}) => { - if (!options.cwd) { - return; - } + // Previous line have same indent? + if (indentDifference === 0) { + weight++; + // We use the key from previous loop + } else { + const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference; + key = encodeIndentsKey(indentType, absoluteIndentDifference); + } - let stat; - try { - stat = fs.statSync(options.cwd); - } catch (_) { - return; - } + // Update the stats + entry = indents.get(key); - if (!stat.isDirectory()) { - throw new Error('The `cwd` option must be a path to a directory'); - } -}; + if (entry === undefined) { + entry = [1, 0]; // Init + } else { + entry = [++entry[0], entry[1] + weight]; + } -const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; + indents.set(key, entry); + } + } -const generateGlobTasks = (patterns, taskOptions) => { - patterns = arrayUnion([].concat(patterns)); - assertPatternsInput(patterns); - checkCwdOption(taskOptions); + return indents; +} - const globTasks = []; +// Encode the indent type and amount as a string (e.g. 's4') for use as a compound key in the indents Map. +function encodeIndentsKey(indentType, indentAmount) { + const typeCharacter = indentType === INDENT_TYPE_SPACE ? 's' : 't'; + return typeCharacter + String(indentAmount); +} - taskOptions = { - ignore: [], - expandDirectories: true, - ...taskOptions - }; +// Extract the indent type and amount from a key of the indents Map. +function decodeIndentsKey(indentsKey) { + const keyHasTypeSpace = indentsKey[0] === 's'; + const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB; - for (const [index, pattern] of patterns.entries()) { - if (isNegative(pattern)) { - continue; - } + const amount = Number(indentsKey.slice(1)); - const ignore = patterns - .slice(index) - .filter(isNegative) - .map(pattern => pattern.slice(1)); + return {type, amount}; +} - const options = { - ...taskOptions, - ignore: taskOptions.ignore.concat(ignore) - }; +// Return the key (e.g. 's4') from the indents Map that represents the most common indent, +// or return undefined if there are no indents. +function getMostUsedKey(indents) { + let result; + let maxUsed = 0; + let maxWeight = 0; - globTasks.push({pattern, options}); + for (const [key, [usedCount, weight]] of indents) { + if (usedCount > maxUsed || (usedCount === maxUsed && weight > maxWeight)) { + maxUsed = usedCount; + maxWeight = weight; + result = key; + } } - return globTasks; -}; + return result; +} -const globDirs = (task, fn) => { - let options = {}; - if (task.options.cwd) { - options.cwd = task.options.cwd; - } +function makeIndentString(type, amount) { + const indentCharacter = type === INDENT_TYPE_SPACE ? ' ' : '\t'; + return indentCharacter.repeat(amount); +} - if (Array.isArray(task.options.expandDirectories)) { - options = { - ...options, - files: task.options.expandDirectories - }; - } else if (typeof task.options.expandDirectories === 'object') { - options = { - ...options, - ...task.options.expandDirectories - }; +module.exports = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); } - return fn(task.pattern, options); -}; + // Identify indents while skipping single space indents to avoid common edge cases (e.g. code comments) + // If no indents are identified, run again and include all indents for comprehensive detection + let indents = makeIndentsMap(string, true); + if (indents.size === 0) { + indents = makeIndentsMap(string, false); + } -const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern]; + const keyOfMostUsedIndent = getMostUsedKey(indents); -const getFilterSync = options => { - return options && options.gitignore ? - gitignore.sync({cwd: options.cwd, ignore: options.ignore}) : - DEFAULT_FILTER; -}; + let type; + let amount = 0; + let indent = ''; -const globToTask = task => glob => { - const {options} = task; - if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { - options.ignore = dirGlob.sync(options.ignore); + if (keyOfMostUsedIndent !== undefined) { + ({type, amount} = decodeIndentsKey(keyOfMostUsedIndent)); + indent = makeIndentString(type, amount); } return { - pattern: glob, - options + amount, + type, + indent }; }; -module.exports = async (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); - const getFilter = async () => { - return options && options.gitignore ? - gitignore({cwd: options.cwd, ignore: options.ignore}) : - DEFAULT_FILTER; - }; +/***/ }), - const getTasks = async () => { - const tasks = await Promise.all(globTasks.map(async task => { - const globs = await getPattern(task, dirGlob); - return Promise.all(globs.map(globToTask(task))); - })); +/***/ "../../node_modules/detect-newline/index.js": +/***/ (function(module, exports, __webpack_require__) { - return arrayUnion(...tasks); - }; +"use strict"; - const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); - const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); - return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); -}; +const detectNewline = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } -module.exports.sync = (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); + const newlines = string.match(/(?:\r?\n)/g) || []; - const tasks = globTasks.reduce((tasks, task) => { - const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - return tasks.concat(newTask); - }, []); - - const filter = getFilterSync(options); - - return tasks.reduce( - (matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.options)), - [] - ).filter(path_ => !filter(path_)); -}; - -module.exports.stream = (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); - - const tasks = globTasks.reduce((tasks, task) => { - const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - return tasks.concat(newTask); - }, []); + if (newlines.length === 0) { + return; + } - const filter = getFilterSync(options); - const filterStream = new FilterStream(p => !filter(p)); - const uniqueStream = new UniqueStream(); + const crlf = newlines.filter(newline => newline === '\r\n').length; + const lf = newlines.length - crlf; - return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))) - .pipe(filterStream) - .pipe(uniqueStream); + return crlf > lf ? '\r\n' : '\n'; }; -module.exports.generateGlobTasks = generateGlobTasks; - -module.exports.hasMagic = (patterns, options) => [] - .concat(patterns) - .some(pattern => glob.hasMagic(pattern, options)); - -module.exports.gitignore = gitignore; +module.exports = detectNewline; +module.exports.graceful = string => (typeof string === 'string' && detectNewline(string)) || '\n'; /***/ }), -/***/ "../../node_modules/del/node_modules/globby/stream-utils.js": +/***/ "../../node_modules/dir-glob/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const {Transform} = __webpack_require__("stream"); +const path = __webpack_require__("path"); +const pathType = __webpack_require__("../../node_modules/path-type/index.js"); -class ObjectTransform extends Transform { - constructor() { - super({ - objectMode: true - }); - } -} +const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; -class FilterStream extends ObjectTransform { - constructor(filter) { - super(); - this._filter = filter; +const getPath = (filepath, cwd) => { + const pth = filepath[0] === '!' ? filepath.slice(1) : filepath; + return path.isAbsolute(pth) ? pth : path.join(cwd, pth); +}; + +const addExtensions = (file, extensions) => { + if (path.extname(file)) { + return `**/${file}`; } - _transform(data, encoding, callback) { - if (this._filter(data)) { - this.push(data); - } + return `**/${file}.${getExtensions(extensions)}`; +}; - callback(); +const getGlob = (directory, options) => { + if (options.files && !Array.isArray(options.files)) { + throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``); } -} -class UniqueStream extends ObjectTransform { - constructor() { - super(); - this._pushed = new Set(); + if (options.extensions && !Array.isArray(options.extensions)) { + throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``); } - _transform(data, encoding, callback) { - if (!this._pushed.has(data)) { - this.push(data); - this._pushed.add(data); - } - - callback(); + if (options.files && options.extensions) { + return options.files.map(x => path.posix.join(directory, addExtensions(x, options.extensions))); } -} - -module.exports = { - FilterStream, - UniqueStream -}; - - -/***/ }), -/***/ "../../node_modules/del/node_modules/indent-string/index.js": -/***/ (function(module, exports, __webpack_require__) { + if (options.files) { + return options.files.map(x => path.posix.join(directory, `**/${x}`)); + } -"use strict"; + if (options.extensions) { + return [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)]; + } + return [path.posix.join(directory, '**')]; +}; -module.exports = (string, count = 1, options) => { +module.exports = async (input, options) => { options = { - indent: ' ', - includeEmptyLines: false, + cwd: process.cwd(), ...options }; - if (typeof string !== 'string') { - throw new TypeError( - `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` - ); + if (typeof options.cwd !== 'string') { + throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); } - if (typeof count !== 'number') { - throw new TypeError( - `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` - ); - } + const globs = await Promise.all([].concat(input).map(async x => { + const isDirectory = await pathType.isDirectory(getPath(x, options.cwd)); + return isDirectory ? getGlob(x, options) : x; + })); - if (typeof options.indent !== 'string') { - throw new TypeError( - `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` - ); - } + return [].concat.apply([], globs); // eslint-disable-line prefer-spread +}; - if (count === 0) { - return string; +module.exports.sync = (input, options) => { + options = { + cwd: process.cwd(), + ...options + }; + + if (typeof options.cwd !== 'string') { + throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); } - const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + const globs = [].concat(input).map(x => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x); - return string.replace(regex, options.indent.repeat(count)); + return [].concat.apply([], globs); // eslint-disable-line prefer-spread }; /***/ }), -/***/ "../../node_modules/del/node_modules/micromatch/index.js": +/***/ "../../node_modules/duplexer/index.js": /***/ (function(module, exports, __webpack_require__) { -"use strict"; - +var Stream = __webpack_require__("stream") +var writeMethods = ["write", "end", "destroy"] +var readMethods = ["resume", "pause"] +var readEvents = ["data", "close"] +var slice = Array.prototype.slice -const util = __webpack_require__("util"); -const braces = __webpack_require__("../../node_modules/braces/index.js"); -const picomatch = __webpack_require__("../../node_modules/picomatch/index.js"); -const utils = __webpack_require__("../../node_modules/picomatch/lib/utils.js"); -const isEmptyString = val => val === '' || val === './'; +module.exports = duplex -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} `list` List of strings to match. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ +function forEach (arr, fn) { + if (arr.forEach) { + return arr.forEach(fn) + } -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); + for (var i = 0; i < arr.length; i++) { + fn(arr[i], i) + } +} - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; +function duplex(writer, reader) { + var stream = new Stream() + var ended = false - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); - } - }; + forEach(writeMethods, proxyWriter) - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; + forEach(readMethods, proxyReader) - for (let item of list) { - let matched = isMatch(item, true); + forEach(readEvents, proxyStream) - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; + reader.on("end", handleEnd) - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } + writer.on("drain", function() { + stream.emit("drain") + }) - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); + writer.on("error", reemit) + reader.on("error", reemit) - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } + stream.writable = writer.writable + stream.readable = reader.readable - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } + return stream - return matches; -}; + function proxyWriter(methodName) { + stream[methodName] = method -/** - * Backwards compatibility - */ + function method() { + return writer[methodName].apply(writer, arguments) + } + } -micromatch.match = micromatch; + function proxyReader(methodName) { + stream[methodName] = method -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ + function method() { + stream.emit(methodName) + var func = reader[methodName] + if (func) { + return func.apply(reader, arguments) + } + reader.emit(methodName) + } + } -micromatch.matcher = (pattern, options) => picomatch(pattern, options); + function proxyStream(methodName) { + reader.on(methodName, reemit) -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `[options]` See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ + function reemit() { + var args = slice.call(arguments) + args.unshift(methodName) + stream.emit.apply(stream, args) + } + } -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + function handleEnd() { + if (ended) { + return + } + ended = true + var args = slice.call(arguments) + args.unshift("end") + stream.emit.apply(stream, args) + } -/** - * Backwards compatibility - */ + function reemit(err) { + stream.emit("error", err) + } +} -micromatch.any = micromatch.isMatch; -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ +/***/ }), -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; +/***/ "../../node_modules/end-of-stream/index.js": +/***/ (function(module, exports, __webpack_require__) { - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; +var once = __webpack_require__("../../node_modules/once/once.js"); - let matches = micromatch(list, patterns, { ...options, onResult }); +var noop = function() {}; - for (let item of items) { - if (!matches.includes(item)) { - result.add(item); - } - } - return [...result]; +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; }; -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any of the patterns matches any part of `str`. - * @api public - */ +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } + callback = once(callback || noop); - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; - } - } + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; - return micromatch.isMatch(str, pattern, { ...options, contains: true }); -}; + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; -}; + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` - * @api public - */ + var onerror = function(err) { + callback.call(stream, err); + }; -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); + var onclose = function() { + process.nextTick(onclosenexttick); + }; - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; - } - } - return false; -}; + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` - * @api public - */ - -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); + var onrequest = function() { + stream.req.on('finish', onfinish); + }; - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; - } - } - return true; -}; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ + if (isChildProcess(stream)) stream.on('exit', onexit); -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); - return [].concat(patterns).every(p => picomatch(p, options)(str)); + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; }; -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ +module.exports = eos; -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; +/***/ }), -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ +/***/ "../../node_modules/error-ex/index.js": +/***/ (function(module, exports, __webpack_require__) { -micromatch.makeRe = (...args) => picomatch.makeRe(...args); +"use strict"; -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ -micromatch.scan = (...args) => picomatch.scan(...args); +var util = __webpack_require__("util"); +var isArrayish = __webpack_require__("../../node_modules/is-arrayish/index.js"); -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ +var errorEx = function errorEx(name, properties) { + if (!name || name.constructor !== String) { + properties = name || {}; + name = Error.name; + } -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); - } - } - return res; -}; + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); + } -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ + message = message instanceof Error + ? message.message + : (message || this.message); -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - return braces(pattern, options); -}; + Error.call(this, message); + Error.captureStackTrace(this, errorExError); -/** - * Expand braces - */ + this.name = name; -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); -}; + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: false, + get: function () { + var newMessage = message.split(/\r?\n/g); -/** - * Expose micromatch - */ + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } -module.exports = micromatch; + var modifier = properties[key]; + if ('message' in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } -/***/ }), + return newMessage.join('\n'); + }, + set: function (v) { + message = v; + } + }); -/***/ "../../node_modules/del/node_modules/p-map/index.js": -/***/ (function(module, exports, __webpack_require__) { + var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; -"use strict"; + stackDescriptor.get = function () { + var stack = (stackGetter) + ? stackGetter.call(this).split(/\r?\n+/g) + : stackValue.split(/\r?\n+/g); -const AggregateError = __webpack_require__("../../node_modules/del/node_modules/aggregate-error/index.js"); + // starting in Node 7, the stack builder caches the message. + // just replace it. + stack[0] = this.name + ': ' + this.message; -module.exports = async ( - iterable, - mapper, - { - concurrency = Infinity, - stopOnError = true - } = {} -) => { - return new Promise((resolve, reject) => { - if (typeof mapper !== 'function') { - throw new TypeError('Mapper function is required'); - } + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - if (!(typeof concurrency === 'number' && concurrency >= 1)) { - throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); - } + var modifier = properties[key]; - const ret = []; - const errors = []; - const iterator = iterable[Symbol.iterator](); - let isRejected = false; - let isIterableDone = false; - let resolvingCount = 0; - let currentIndex = 0; + if ('line' in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, ' ' + line); + } + } - const next = () => { - if (isRejected) { - return; + if ('stack' in modifier) { + modifier.stack(this[key], stack); + } } - const nextItem = iterator.next(); - const i = currentIndex; - currentIndex++; + return stack.join('\n'); + }; - if (nextItem.done) { - isIterableDone = true; + Object.defineProperty(this, 'stack', stackDescriptor); + }; - if (resolvingCount === 0) { - if (!stopOnError && errors.length !== 0) { - reject(new AggregateError(errors)); - } else { - resolve(ret); - } - } + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util.inherits(errorExError, Error); + } - return; - } + return errorExError; +}; - resolvingCount++; +errorEx.append = function (str, def) { + return { + message: function (v, message) { + v = v || def; - (async () => { - try { - const element = await nextItem.value; - ret[i] = await mapper(element, i); - resolvingCount--; - next(); - } catch (error) { - if (stopOnError) { - isRejected = true; - reject(error); - } else { - errors.push(error); - resolvingCount--; - next(); - } - } - })(); - }; + if (v) { + message[0] += ' ' + str.replace('%s', v.toString()); + } - for (let i = 0; i < concurrency; i++) { - next(); + return message; + } + }; +}; - if (isIterableDone) { - break; +errorEx.line = function (str, def) { + return { + line: function (v) { + v = v || def; + + if (v) { + return str.replace('%s', v.toString()); } + + return null; } - }); + }; }; +module.exports = errorEx; + /***/ }), -/***/ "../../node_modules/delayed-stream/lib/delayed_stream.js": +/***/ "../../node_modules/escape-string-regexp/index.js": /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__("stream").Stream; -var util = __webpack_require__("util"); +"use strict"; -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; -DelayedStream.create = function(source, options) { - var delayedStream = new this(); +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } + return str.replace(matchOperatorsRe, '\\$&'); +}; - delayedStream.source = source; - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; +/***/ }), - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } +/***/ "../../node_modules/execa/index.js": +/***/ (function(module, exports, __webpack_require__) { - return delayedStream; -}; +"use strict"; -Object.defineProperty(DelayedStream.prototype, 'readable', { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } -}); +const path = __webpack_require__("path"); +const childProcess = __webpack_require__("child_process"); +const crossSpawn = __webpack_require__("../../node_modules/cross-spawn/index.js"); +const stripFinalNewline = __webpack_require__("../../node_modules/strip-final-newline/index.js"); +const npmRunPath = __webpack_require__("../../node_modules/npm-run-path/index.js"); +const onetime = __webpack_require__("../../node_modules/onetime/index.js"); +const makeError = __webpack_require__("../../node_modules/execa/lib/error.js"); +const normalizeStdio = __webpack_require__("../../node_modules/execa/lib/stdio.js"); +const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__("../../node_modules/execa/lib/kill.js"); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__("../../node_modules/execa/lib/stream.js"); +const {mergePromise, getSpawnedPromise} = __webpack_require__("../../node_modules/execa/lib/promise.js"); +const {joinCommand, parseCommand} = __webpack_require__("../../node_modules/execa/lib/command.js"); -DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); -}; +const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } +const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { + const env = extendEnv ? {...process.env, ...envOption} : envOption; - this.source.resume(); -}; + if (preferLocal) { + return npmRunPath.env({env, cwd: localDir, execPath}); + } -DelayedStream.prototype.pause = function() { - this.source.pause(); + return env; }; -DelayedStream.prototype.release = function() { - this._released = true; +const handleArguments = (file, args, options = {}) => { + const parsed = crossSpawn._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || process.cwd(), + execPath: process.execPath, + encoding: 'utf8', + reject: true, + cleanup: true, + all: false, + windowsHide: true, + ...options + }; -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; + options.env = getEnv(options); -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } + options.stdio = normalizeStdio(options); - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } + if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { + // #116 + args.unshift('/q'); + } - this._bufferedEvents.push(args); + return {file, args, options, parsed}; }; -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } +const handleOutput = (options, value, error) => { + if (typeof value !== 'string' && !Buffer.isBuffer(value)) { + // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` + return error === undefined ? undefined : ''; + } - if (this.dataSize <= this.maxDataSize) { - return; - } + if (options.stripFinalNewline) { + return stripFinalNewline(value); + } - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); + return value; }; +const execa = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); -/***/ }), - -/***/ "../../node_modules/detect-indent/index.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + let spawned; + try { + spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); + } catch (error) { + // Ensure the returned error is always both a promise and a child process + const dummySpawned = new childProcess.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + return mergePromise(dummySpawned, errorPromise); + } + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); -// Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment -const INDENT_REGEX = /^(?:( )+|\t+)/; + const context = {isCanceled: false}; -const INDENT_TYPE_SPACE = 'space'; -const INDENT_TYPE_TAB = 'tab'; + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context); -// Make a Map that counts how many indents/unindents have occurred for a given size and how many lines follow a given indentation. -// The key is a concatenation of the indentation type (s = space and t = tab) and the size of the indents/unindents. -// -// indents = { -// t3: [1, 0], -// t4: [1, 5], -// s5: [1, 0], -// s12: [1, 0], -// } -function makeIndentsMap(string, ignoreSingleSpaces) { - const indents = new Map(); + const handlePromise = async () => { + const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr = handleOutput(parsed.options, stderrResult); + const all = handleOutput(parsed.options, allResult); - // Remember the size of previous line's indentation - let previousSize = 0; - let previousIndentType; + if (error || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error, + exitCode, + signal, + stdout, + stderr, + all, + command, + parsed, + timedOut, + isCanceled: context.isCanceled, + killed: spawned.killed + }); - // Indents key (ident type + size of the indents/unindents) - let key; + if (!parsed.options.reject) { + return returnedError; + } - for (const line of string.split(/\n/g)) { - if (!line) { - // Ignore empty lines - continue; + throw returnedError; } - let indent; - let indentType; - let weight; - let entry; - const matches = line.match(INDENT_REGEX); + return { + command, + exitCode: 0, + stdout, + stderr, + all, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; - if (matches === null) { - previousSize = 0; - previousIndentType = ''; - } else { - indent = matches[0].length; + const handlePromiseOnce = onetime(handlePromise); - if (matches[1]) { - indentType = INDENT_TYPE_SPACE; - } else { - indentType = INDENT_TYPE_TAB; - } + crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - // Ignore single space unless it's the only indent detected to prevent common false positives - if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) { - continue; - } + handleInput(spawned, parsed.options.input); - if (indentType !== previousIndentType) { - previousSize = 0; - } + spawned.all = makeAllStream(spawned, parsed.options); - previousIndentType = indentType; + return mergePromise(spawned, handlePromiseOnce); +}; - weight = 0; +module.exports = execa; - const indentDifference = indent - previousSize; - previousSize = indent; +module.exports.sync = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); - // Previous line have same indent? - if (indentDifference === 0) { - weight++; - // We use the key from previous loop - } else { - const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference; - key = encodeIndentsKey(indentType, absoluteIndentDifference); - } + validateInputSync(parsed.options); - // Update the stats - entry = indents.get(key); + let result; + try { + result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); + } catch (error) { + throw makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + parsed, + timedOut: false, + isCanceled: false, + killed: false + }); + } - if (entry === undefined) { - entry = [1, 0]; // Init - } else { - entry = [++entry[0], entry[1] + weight]; - } + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr = handleOutput(parsed.options, result.stderr, result.error); - indents.set(key, entry); + if (result.error || result.status !== 0 || result.signal !== null) { + const error = makeError({ + stdout, + stderr, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + parsed, + timedOut: result.error && result.error.code === 'ETIMEDOUT', + isCanceled: false, + killed: result.signal !== null + }); + + if (!parsed.options.reject) { + return error; } + + throw error; } - return indents; -} + return { + command, + exitCode: 0, + stdout, + stderr, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; +}; -// Encode the indent type and amount as a string (e.g. 's4') for use as a compound key in the indents Map. -function encodeIndentsKey(indentType, indentAmount) { - const typeCharacter = indentType === INDENT_TYPE_SPACE ? 's' : 't'; - return typeCharacter + String(indentAmount); -} +module.exports.command = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa(file, args, options); +}; -// Extract the indent type and amount from a key of the indents Map. -function decodeIndentsKey(indentsKey) { - const keyHasTypeSpace = indentsKey[0] === 's'; - const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB; +module.exports.commandSync = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa.sync(file, args, options); +}; - const amount = Number(indentsKey.slice(1)); +module.exports.node = (scriptPath, args, options = {}) => { + if (args && !Array.isArray(args) && typeof args === 'object') { + options = args; + args = []; + } - return {type, amount}; -} + const stdio = normalizeStdio.node(options); -// Return the key (e.g. 's4') from the indents Map that represents the most common indent, -// or return undefined if there are no indents. -function getMostUsedKey(indents) { - let result; - let maxUsed = 0; - let maxWeight = 0; + const {nodePath = process.execPath, nodeOptions = process.execArgv} = options; - for (const [key, [usedCount, weight]] of indents) { - if (usedCount > maxUsed || (usedCount === maxUsed && weight > maxWeight)) { - maxUsed = usedCount; - maxWeight = weight; - result = key; + return execa( + nodePath, + [ + ...nodeOptions, + scriptPath, + ...(Array.isArray(args) ? args : []) + ], + { + ...options, + stdin: undefined, + stdout: undefined, + stderr: undefined, + stdio, + shell: false } - } + ); +}; - return result; -} -function makeIndentString(type, amount) { - const indentCharacter = type === INDENT_TYPE_SPACE ? ' ' : '\t'; - return indentCharacter.repeat(amount); -} - -module.exports = string => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } +/***/ }), - // Identify indents while skipping single space indents to avoid common edge cases (e.g. code comments) - // If no indents are identified, run again and include all indents for comprehensive detection - let indents = makeIndentsMap(string, true); - if (indents.size === 0) { - indents = makeIndentsMap(string, false); - } +/***/ "../../node_modules/execa/lib/command.js": +/***/ (function(module, exports, __webpack_require__) { - const keyOfMostUsedIndent = getMostUsedKey(indents); +"use strict"; - let type; - let amount = 0; - let indent = ''; +const SPACES_REGEXP = / +/g; - if (keyOfMostUsedIndent !== undefined) { - ({type, amount} = decodeIndentsKey(keyOfMostUsedIndent)); - indent = makeIndentString(type, amount); +const joinCommand = (file, args = []) => { + if (!Array.isArray(args)) { + return file; } - return { - amount, - type, - indent - }; + return [file, ...args].join(' '); }; - -/***/ }), - -/***/ "../../node_modules/detect-newline/index.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -const detectNewline = string => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); +// Allow spaces to be escaped by a backslash if not meant as a delimiter +const handleEscaping = (tokens, token, index) => { + if (index === 0) { + return [token]; } - const newlines = string.match(/(?:\r?\n)/g) || []; + const previousToken = tokens[tokens.length - 1]; - if (newlines.length === 0) { - return; + if (previousToken.endsWith('\\')) { + return [...tokens.slice(0, -1), `${previousToken.slice(0, -1)} ${token}`]; } - const crlf = newlines.filter(newline => newline === '\r\n').length; - const lf = newlines.length - crlf; + return [...tokens, token]; +}; - return crlf > lf ? '\r\n' : '\n'; +// Handle `execa.command()` +const parseCommand = command => { + return command + .trim() + .split(SPACES_REGEXP) + .reduce(handleEscaping, []); }; -module.exports = detectNewline; -module.exports.graceful = string => (typeof string === 'string' && detectNewline(string)) || '\n'; +module.exports = { + joinCommand, + parseCommand +}; /***/ }), -/***/ "../../node_modules/dir-glob/index.js": +/***/ "../../node_modules/execa/lib/error.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const path = __webpack_require__("path"); -const pathType = __webpack_require__("../../node_modules/path-type/index.js"); - -const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; - -const getPath = (filepath, cwd) => { - const pth = filepath[0] === '!' ? filepath.slice(1) : filepath; - return path.isAbsolute(pth) ? pth : path.join(cwd, pth); -}; - -const addExtensions = (file, extensions) => { - if (path.extname(file)) { - return `**/${file}`; - } - - return `**/${file}.${getExtensions(extensions)}`; -}; +const {signalsByName} = __webpack_require__("../../node_modules/human-signals/build/src/main.js"); -const getGlob = (directory, options) => { - if (options.files && !Array.isArray(options.files)) { - throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``); +const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; } - if (options.extensions && !Array.isArray(options.extensions)) { - throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``); + if (isCanceled) { + return 'was canceled'; } - if (options.files && options.extensions) { - return options.files.map(x => path.posix.join(directory, addExtensions(x, options.extensions))); + if (errorCode !== undefined) { + return `failed with ${errorCode}`; } - if (options.files) { - return options.files.map(x => path.posix.join(directory, `**/${x}`)); + if (signal !== undefined) { + return `was killed with ${signal} (${signalDescription})`; } - if (options.extensions) { - return [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)]; + if (exitCode !== undefined) { + return `failed with exit code ${exitCode}`; } - return [path.posix.join(directory, '**')]; + return 'failed'; }; -module.exports = async (input, options) => { - options = { - cwd: process.cwd(), - ...options - }; +const makeError = ({ + stdout, + stderr, + all, + error, + signal, + exitCode, + command, + timedOut, + isCanceled, + killed, + parsed: {options: {timeout}} +}) => { + // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. + // We normalize them to `undefined` + exitCode = exitCode === null ? undefined : exitCode; + signal = signal === null ? undefined : signal; + const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; - if (typeof options.cwd !== 'string') { - throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); - } + const errorCode = error && error.code; - const globs = await Promise.all([].concat(input).map(async x => { - const isDirectory = await pathType.isDirectory(getPath(x, options.cwd)); - return isDirectory ? getGlob(x, options) : x; - })); + const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); + const execaMessage = `Command ${prefix}: ${command}`; + const isError = Object.prototype.toString.call(error) === '[object Error]'; + const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; + const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); - return [].concat.apply([], globs); // eslint-disable-line prefer-spread -}; + if (isError) { + error.originalMessage = error.message; + error.message = message; + } else { + error = new Error(message); + } -module.exports.sync = (input, options) => { - options = { - cwd: process.cwd(), - ...options - }; + error.shortMessage = shortMessage; + error.command = command; + error.exitCode = exitCode; + error.signal = signal; + error.signalDescription = signalDescription; + error.stdout = stdout; + error.stderr = stderr; - if (typeof options.cwd !== 'string') { - throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); + if (all !== undefined) { + error.all = all; } - const globs = [].concat(input).map(x => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x); + if ('bufferedData' in error) { + delete error.bufferedData; + } - return [].concat.apply([], globs); // eslint-disable-line prefer-spread + error.failed = true; + error.timedOut = Boolean(timedOut); + error.isCanceled = isCanceled; + error.killed = killed && !timedOut; + + return error; }; +module.exports = makeError; + /***/ }), -/***/ "../../node_modules/duplexer/index.js": +/***/ "../../node_modules/execa/lib/kill.js": /***/ (function(module, exports, __webpack_require__) { -var Stream = __webpack_require__("stream") -var writeMethods = ["write", "end", "destroy"] -var readMethods = ["resume", "pause"] -var readEvents = ["data", "close"] -var slice = Array.prototype.slice +"use strict"; -module.exports = duplex +const os = __webpack_require__("os"); +const onExit = __webpack_require__("../../node_modules/signal-exit/index.js"); -function forEach (arr, fn) { - if (arr.forEach) { - return arr.forEach(fn) - } +const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - for (var i = 0; i < arr.length; i++) { - fn(arr[i], i) - } -} +// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior +const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; +}; -function duplex(writer, reader) { - var stream = new Stream() - var ended = false +const setKillTimeout = (kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } - forEach(writeMethods, proxyWriter) + const timeout = getForceKillAfterTimeout(options); + const t = setTimeout(() => { + kill('SIGKILL'); + }, timeout); - forEach(readMethods, proxyReader) + // Guarded because there's no `.unref()` when `execa` is used in the renderer + // process in Electron. This cannot be tested since we don't run tests in + // Electron. + // istanbul ignore else + if (t.unref) { + t.unref(); + } +}; - forEach(readEvents, proxyStream) +const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { + return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; +}; - reader.on("end", handleEnd) +const isSigterm = signal => { + return signal === os.constants.signals.SIGTERM || + (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); +}; - writer.on("drain", function() { - stream.emit("drain") - }) +const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } - writer.on("error", reemit) - reader.on("error", reemit) - - stream.writable = writer.writable - stream.readable = reader.readable - - return stream - - function proxyWriter(methodName) { - stream[methodName] = method - - function method() { - return writer[methodName].apply(writer, arguments) - } - } + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); + } - function proxyReader(methodName) { - stream[methodName] = method + return forceKillAfterTimeout; +}; - function method() { - stream.emit(methodName) - var func = reader[methodName] - if (func) { - return func.apply(reader, arguments) - } - reader.emit(methodName) - } - } +// `childProcess.cancel()` +const spawnedCancel = (spawned, context) => { + const killResult = spawned.kill(); - function proxyStream(methodName) { - reader.on(methodName, reemit) + if (killResult) { + context.isCanceled = true; + } +}; - function reemit() { - var args = slice.call(arguments) - args.unshift(methodName) - stream.emit.apply(stream, args) - } - } +const timeoutKill = (spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); +}; - function handleEnd() { - if (ended) { - return - } - ended = true - var args = slice.call(arguments) - args.unshift("end") - stream.emit.apply(stream, args) - } +// `timeout` option handling +const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { + if (timeout === 0 || timeout === undefined) { + return spawnedPromise; + } - function reemit(err) { - stream.emit("error", err) - } -} + if (!Number.isFinite(timeout) || timeout < 0) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); + } + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); + }); -/***/ }), + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); + }); -/***/ "../../node_modules/end-of-stream/index.js": -/***/ (function(module, exports, __webpack_require__) { + return Promise.race([timeoutPromise, safeSpawnedPromise]); +}; -var once = __webpack_require__("../../node_modules/once/once.js"); +// `cleanup` option handling +const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; + } -var noop = function() {}; + const removeExitHandler = onExit(() => { + spawned.kill(); + }); -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; + return timedPromise.finally(() => { + removeExitHandler(); + }); }; -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +module.exports = { + spawnedKill, + spawnedCancel, + setupTimeout, + setExitHandler }; -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; +/***/ }), - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; +/***/ "../../node_modules/execa/lib/promise.js": +/***/ (function(module, exports, __webpack_require__) { - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; +"use strict"; - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - var onerror = function(err) { - callback.call(stream, err); - }; +const nativePromisePrototype = (async () => {})().constructor.prototype; +const descriptors = ['then', 'catch', 'finally'].map(property => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) +]); - var onclose = function() { - process.nextTick(onclosenexttick); - }; +// The return value is a mixin of `childProcess` and `Promise` +const mergePromise = (spawned, promise) => { + for (const [property, descriptor] of descriptors) { + // Starting the main `promise` is deferred to avoid consuming streams + const value = typeof promise === 'function' ? + (...args) => Reflect.apply(descriptor.value, promise(), args) : + descriptor.value.bind(promise); - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; + Reflect.defineProperty(spawned, property, {...descriptor, value}); + } - var onrequest = function() { - stream.req.on('finish', onfinish); - }; + return spawned; +}; - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } +// Use promises instead of `child_process` events +const getSpawnedPromise = spawned => { + return new Promise((resolve, reject) => { + spawned.on('exit', (exitCode, signal) => { + resolve({exitCode, signal}); + }); - if (isChildProcess(stream)) stream.on('exit', onexit); + spawned.on('error', error => { + reject(error); + }); - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); + if (spawned.stdin) { + spawned.stdin.on('error', error => { + reject(error); + }); + } + }); +}; - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; +module.exports = { + mergePromise, + getSpawnedPromise }; -module.exports = eos; /***/ }), -/***/ "../../node_modules/error-ex/index.js": +/***/ "../../node_modules/execa/lib/stdio.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; +const aliases = ['stdin', 'stdout', 'stderr']; -var util = __webpack_require__("util"); -var isArrayish = __webpack_require__("../../node_modules/is-arrayish/index.js"); +const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined); -var errorEx = function errorEx(name, properties) { - if (!name || name.constructor !== String) { - properties = name || {}; - name = Error.name; +const normalizeStdio = opts => { + if (!opts) { + return; } - var errorExError = function ErrorEXError(message) { - if (!this) { - return new ErrorEXError(message); - } + const {stdio} = opts; - message = message instanceof Error - ? message.message - : (message || this.message); + if (stdio === undefined) { + return aliases.map(alias => opts[alias]); + } - Error.call(this, message); - Error.captureStackTrace(this, errorExError); + if (hasAlias(opts)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); + } - this.name = name; + if (typeof stdio === 'string') { + return stdio; + } - Object.defineProperty(this, 'message', { - configurable: true, - enumerable: false, - get: function () { - var newMessage = message.split(/\r?\n/g); + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } + const length = Math.max(stdio.length, aliases.length); + return Array.from({length}, (value, index) => stdio[index]); +}; - var modifier = properties[key]; +module.exports = normalizeStdio; - if ('message' in modifier) { - newMessage = modifier.message(this[key], newMessage) || newMessage; - if (!isArrayish(newMessage)) { - newMessage = [newMessage]; - } - } - } +// `ipc` is pushed unless it is already present +module.exports.node = opts => { + const stdio = normalizeStdio(opts); - return newMessage.join('\n'); - }, - set: function (v) { - message = v; - } - }); + if (stdio === 'ipc') { + return 'ipc'; + } - var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); - var stackGetter = stackDescriptor.get; - var stackValue = stackDescriptor.value; - delete stackDescriptor.value; - delete stackDescriptor.writable; + if (stdio === undefined || typeof stdio === 'string') { + return [stdio, stdio, stdio, 'ipc']; + } - stackDescriptor.get = function () { - var stack = (stackGetter) - ? stackGetter.call(this).split(/\r?\n+/g) - : stackValue.split(/\r?\n+/g); + if (stdio.includes('ipc')) { + return stdio; + } - // starting in Node 7, the stack builder caches the message. - // just replace it. - stack[0] = this.name + ': ' + this.message; + return [...stdio, 'ipc']; +}; - var lineCount = 1; - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - var modifier = properties[key]; +/***/ }), - if ('line' in modifier) { - var line = modifier.line(this[key]); - if (line) { - stack.splice(lineCount++, 0, ' ' + line); - } - } +/***/ "../../node_modules/execa/lib/stream.js": +/***/ (function(module, exports, __webpack_require__) { - if ('stack' in modifier) { - modifier.stack(this[key], stack); - } - } +"use strict"; - return stack.join('\n'); - }; +const isStream = __webpack_require__("../../node_modules/is-stream/index.js"); +const getStream = __webpack_require__("../../node_modules/get-stream/index.js"); +const mergeStream = __webpack_require__("../../node_modules/merge-stream/index.js"); - Object.defineProperty(this, 'stack', stackDescriptor); - }; +// `input` option +const handleInput = (spawned, input) => { + // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 + // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 + if (input === undefined || spawned.stdin === undefined) { + return; + } - if (Object.setPrototypeOf) { - Object.setPrototypeOf(errorExError.prototype, Error.prototype); - Object.setPrototypeOf(errorExError, Error); + if (isStream(input)) { + input.pipe(spawned.stdin); } else { - util.inherits(errorExError, Error); + spawned.stdin.end(input); } - - return errorExError; }; -errorEx.append = function (str, def) { - return { - message: function (v, message) { - v = v || def; - - if (v) { - message[0] += ' ' + str.replace('%s', v.toString()); - } +// `all` interleaves `stdout` and `stderr` +const makeAllStream = (spawned, {all}) => { + if (!all || (!spawned.stdout && !spawned.stderr)) { + return; + } - return message; - } - }; -}; + const mixed = mergeStream(); -errorEx.line = function (str, def) { - return { - line: function (v) { - v = v || def; + if (spawned.stdout) { + mixed.add(spawned.stdout); + } - if (v) { - return str.replace('%s', v.toString()); - } + if (spawned.stderr) { + mixed.add(spawned.stderr); + } - return null; - } - }; + return mixed; }; -module.exports = errorEx; +// On failure, `result.stdout|stderr|all` should contain the currently buffered stream +const getBufferedData = async (stream, streamPromise) => { + if (!stream) { + return; + } + stream.destroy(); -/***/ }), + try { + return await streamPromise; + } catch (error) { + return error.bufferedData; + } +}; -/***/ "../../node_modules/escape-string-regexp/index.js": -/***/ (function(module, exports, __webpack_require__) { +const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { + if (!stream || !buffer) { + return; + } -"use strict"; + if (encoding) { + return getStream(stream, {encoding, maxBuffer}); + } + return getStream.buffer(stream, {maxBuffer}); +}; -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; +// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) +const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { + const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); + const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); + const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error) { + return Promise.all([ + {error, signal: error.signal, timedOut: error.timedOut}, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr, stderrPromise), + getBufferedData(all, allPromise) + ]); + } +}; + +const validateInputSync = ({input}) => { + if (isStream(input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); } +}; - return str.replace(matchOperatorsRe, '\\$&'); +module.exports = { + handleInput, + makeAllStream, + getSpawnedResult, + validateInputSync }; + /***/ }), -/***/ "../../node_modules/execa/index.js": +/***/ "../../node_modules/fast-glob/node_modules/micromatch/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const path = __webpack_require__("path"); -const childProcess = __webpack_require__("child_process"); -const crossSpawn = __webpack_require__("../../node_modules/cross-spawn/index.js"); -const stripFinalNewline = __webpack_require__("../../node_modules/strip-final-newline/index.js"); -const npmRunPath = __webpack_require__("../../node_modules/npm-run-path/index.js"); -const onetime = __webpack_require__("../../node_modules/onetime/index.js"); -const makeError = __webpack_require__("../../node_modules/execa/lib/error.js"); -const normalizeStdio = __webpack_require__("../../node_modules/execa/lib/stdio.js"); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__("../../node_modules/execa/lib/kill.js"); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__("../../node_modules/execa/lib/stream.js"); -const {mergePromise, getSpawnedPromise} = __webpack_require__("../../node_modules/execa/lib/promise.js"); -const {joinCommand, parseCommand} = __webpack_require__("../../node_modules/execa/lib/command.js"); -const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; +const util = __webpack_require__("util"); +const braces = __webpack_require__("../../node_modules/braces/index.js"); +const picomatch = __webpack_require__("../../node_modules/picomatch/index.js"); +const utils = __webpack_require__("../../node_modules/picomatch/lib/utils.js"); +const isEmptyString = val => val === '' || val === './'; -const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { - const env = extendEnv ? {...process.env, ...envOption} : envOption; +/** + * Returns an array of strings that match one or more glob patterns. + * + * ```js + * const mm = require('micromatch'); + * // mm(list, patterns[, options]); + * + * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {String|Array} `list` List of strings to match. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ - if (preferLocal) { - return npmRunPath.env({env, cwd: localDir, execPath}); - } +const micromatch = (list, patterns, options) => { + patterns = [].concat(patterns); + list = [].concat(list); - return env; -}; + let omit = new Set(); + let keep = new Set(); + let items = new Set(); + let negatives = 0; -const handleArguments = (file, args, options = {}) => { - const parsed = crossSpawn._parse(file, args, options); - file = parsed.command; - args = parsed.args; - options = parsed.options; + let onResult = state => { + items.add(state.output); + if (options && options.onResult) { + options.onResult(state); + } + }; - options = { - maxBuffer: DEFAULT_MAX_BUFFER, - buffer: true, - stripFinalNewline: true, - extendEnv: true, - preferLocal: false, - localDir: options.cwd || process.cwd(), - execPath: process.execPath, - encoding: 'utf8', - reject: true, - cleanup: true, - all: false, - windowsHide: true, - ...options - }; + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; - options.env = getEnv(options); + for (let item of list) { + let matched = isMatch(item, true); - options.stdio = normalizeStdio(options); + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; - if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { - // #116 - args.unshift('/q'); - } + if (negated) { + omit.add(matched.output); + } else { + omit.delete(matched.output); + keep.add(matched.output); + } + } + } - return {file, args, options, parsed}; -}; + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter(item => !omit.has(item)); -const handleOutput = (options, value, error) => { - if (typeof value !== 'string' && !Buffer.isBuffer(value)) { - // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` - return error === undefined ? undefined : ''; - } + if (options && matches.length === 0) { + if (options.failglob === true) { + throw new Error(`No matches found for "${patterns.join(', ')}"`); + } - if (options.stripFinalNewline) { - return stripFinalNewline(value); - } + if (options.nonull === true || options.nullglob === true) { + return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; + } + } - return value; + return matches; }; -const execa = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); - } catch (error) { - // Ensure the returned error is always both a promise and a child process - const dummySpawned = new childProcess.ChildProcess(); - const errorPromise = Promise.reject(makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - })); - return mergePromise(dummySpawned, errorPromise); - } - - const spawnedPromise = getSpawnedPromise(spawned); - const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); - const processDone = setExitHandler(spawned, parsed.options, timedPromise); +/** + * Backwards compatibility + */ - const context = {isCanceled: false}; +micromatch.match = micromatch; - spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); - spawned.cancel = spawnedCancel.bind(null, spawned, context); +/** + * Returns a matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. + * + * ```js + * const mm = require('micromatch'); + * // mm.matcher(pattern[, options]); + * + * const isMatch = mm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` + * @return {Function} Returns a matcher function. + * @api public + */ - const handlePromise = async () => { - const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); - const stdout = handleOutput(parsed.options, stdoutResult); - const stderr = handleOutput(parsed.options, stderrResult); - const all = handleOutput(parsed.options, allResult); +micromatch.matcher = (pattern, options) => picomatch(pattern, options); - if (error || exitCode !== 0 || signal !== null) { - const returnedError = makeError({ - error, - exitCode, - signal, - stdout, - stderr, - all, - command, - parsed, - timedOut, - isCanceled: context.isCanceled, - killed: spawned.killed - }); +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const mm = require('micromatch'); + * // mm.isMatch(string, patterns[, options]); + * + * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(mm.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `[options]` See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ - if (!parsed.options.reject) { - return returnedError; - } +micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); - throw returnedError; - } +/** + * Backwards compatibility + */ - return { - command, - exitCode: 0, - stdout, - stderr, - all, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; - }; +micromatch.any = micromatch.isMatch; - const handlePromiseOnce = onetime(handlePromise); +/** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.not(list, patterns[, options]); + * + * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public + */ - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); +micromatch.not = (list, patterns, options = {}) => { + patterns = [].concat(patterns).map(String); + let result = new Set(); + let items = []; - handleInput(spawned, parsed.options.input); + let onResult = state => { + if (options.onResult) options.onResult(state); + items.push(state.output); + }; - spawned.all = makeAllStream(spawned, parsed.options); + let matches = micromatch(list, patterns, { ...options, onResult }); - return mergePromise(spawned, handlePromiseOnce); + for (let item of items) { + if (!matches.includes(item)) { + result.add(item); + } + } + return [...result]; }; -module.exports = execa; +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var mm = require('micromatch'); + * // mm.contains(string, pattern[, options]); + * + * console.log(mm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(mm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any of the patterns matches any part of `str`. + * @api public + */ -module.exports.sync = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); +micromatch.contains = (str, pattern, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } - validateInputSync(parsed.options); + if (Array.isArray(pattern)) { + return pattern.some(p => micromatch.contains(str, p, options)); + } - let result; - try { - result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); - } catch (error) { - throw makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - }); - } + if (typeof pattern === 'string') { + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } - const stdout = handleOutput(parsed.options, result.stdout, result.error); - const stderr = handleOutput(parsed.options, result.stderr, result.error); + if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { + return true; + } + } - if (result.error || result.status !== 0 || result.signal !== null) { - const error = makeError({ - stdout, - stderr, - error: result.error, - signal: result.signal, - exitCode: result.status, - command, - parsed, - timedOut: result.error && result.error.code === 'ETIMEDOUT', - isCanceled: false, - killed: result.signal !== null - }); - - if (!parsed.options.reject) { - return error; - } - - throw error; - } - - return { - command, - exitCode: 0, - stdout, - stderr, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; + return micromatch.isMatch(str, pattern, { ...options, contains: true }); }; -module.exports.command = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa(file, args, options); -}; +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * const mm = require('micromatch'); + * // mm.matchKeys(object, patterns[, options]); + * + * const obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(mm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ -module.exports.commandSync = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa.sync(file, args, options); +micromatch.matchKeys = (obj, patterns, options) => { + if (!utils.isObject(obj)) { + throw new TypeError('Expected the first argument to be an object'); + } + let keys = micromatch(Object.keys(obj), patterns, options); + let res = {}; + for (let key of keys) res[key] = obj[key]; + return res; }; -module.exports.node = (scriptPath, args, options = {}) => { - if (args && !Array.isArray(args) && typeof args === 'object') { - options = args; - args = []; - } - - const stdio = normalizeStdio.node(options); +/** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.some(list, patterns[, options]); + * + * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` + * @api public + */ - const {nodePath = process.execPath, nodeOptions = process.execArgv} = options; +micromatch.some = (list, patterns, options) => { + let items = [].concat(list); - return execa( - nodePath, - [ - ...nodeOptions, - scriptPath, - ...(Array.isArray(args) ? args : []) - ], - { - ...options, - stdin: undefined, - stdout: undefined, - stderr: undefined, - stdio, - shell: false - } - ); + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (items.some(item => isMatch(item))) { + return true; + } + } + return false; }; +/** + * Returns true if every string in the given `list` matches + * any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.every(list, patterns[, options]); + * + * console.log(mm.every('foo.js', ['foo.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` + * @api public + */ -/***/ }), - -/***/ "../../node_modules/execa/lib/command.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const SPACES_REGEXP = / +/g; - -const joinCommand = (file, args = []) => { - if (!Array.isArray(args)) { - return file; - } +micromatch.every = (list, patterns, options) => { + let items = [].concat(list); - return [file, ...args].join(' '); + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (!items.every(item => isMatch(item))) { + return false; + } + } + return true; }; -// Allow spaces to be escaped by a backslash if not meant as a delimiter -const handleEscaping = (tokens, token, index) => { - if (index === 0) { - return [token]; - } - - const previousToken = tokens[tokens.length - 1]; - - if (previousToken.endsWith('\\')) { - return [...tokens.slice(0, -1), `${previousToken.slice(0, -1)} ${token}`]; - } +/** + * Returns true if **all** of the given `patterns` match + * the specified string. + * + * ```js + * const mm = require('micromatch'); + * // mm.all(string, patterns[, options]); + * + * console.log(mm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ - return [...tokens, token]; -}; +micromatch.all = (str, patterns, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } -// Handle `execa.command()` -const parseCommand = command => { - return command - .trim() - .split(SPACES_REGEXP) - .reduce(handleEscaping, []); + return [].concat(patterns).every(p => picomatch(p, options)(str)); }; -module.exports = { - joinCommand, - parseCommand -}; +/** + * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * + * ```js + * const mm = require('micromatch'); + * // mm.capture(pattern, string[, options]); + * + * console.log(mm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `glob` Glob pattern to use for matching. + * @param {String} `input` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. + * @api public + */ +micromatch.capture = (glob, input, options) => { + let posix = utils.isWindows(options); + let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); + let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); -/***/ }), + if (match) { + return match.slice(1).map(v => v === void 0 ? '' : v); + } +}; -/***/ "../../node_modules/execa/lib/error.js": -/***/ (function(module, exports, __webpack_require__) { +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * const mm = require('micromatch'); + * // mm.makeRe(pattern[, options]); + * + * console.log(mm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ -"use strict"; +micromatch.makeRe = (...args) => picomatch.makeRe(...args); -const {signalsByName} = __webpack_require__("../../node_modules/human-signals/build/src/main.js"); - -const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { - if (timedOut) { - return `timed out after ${timeout} milliseconds`; - } - - if (isCanceled) { - return 'was canceled'; - } - - if (errorCode !== undefined) { - return `failed with ${errorCode}`; - } +/** + * Scan a glob pattern to separate the pattern into segments. Used + * by the [split](#split) method. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.scan(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ - if (signal !== undefined) { - return `was killed with ${signal} (${signalDescription})`; - } +micromatch.scan = (...args) => picomatch.scan(...args); - if (exitCode !== undefined) { - return `failed with exit code ${exitCode}`; - } +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const mm = require('micromatch'); + * const state = mm(pattern[, options]); + * ``` + * @param {String} `glob` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as regex source string. + * @api public + */ - return 'failed'; +micromatch.parse = (patterns, options) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str of braces(String(pattern), options)) { + res.push(picomatch.parse(str, options)); + } + } + return res; }; -const makeError = ({ - stdout, - stderr, - all, - error, - signal, - exitCode, - command, - timedOut, - isCanceled, - killed, - parsed: {options: {timeout}} -}) => { - // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. - // We normalize them to `undefined` - exitCode = exitCode === null ? undefined : exitCode; - signal = signal === null ? undefined : signal; - const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; - - const errorCode = error && error.code; - - const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); - const execaMessage = `Command ${prefix}: ${command}`; - const isError = Object.prototype.toString.call(error) === '[object Error]'; - const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; - const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); - - if (isError) { - error.originalMessage = error.message; - error.message = message; - } else { - error = new Error(message); - } - - error.shortMessage = shortMessage; - error.command = command; - error.exitCode = exitCode; - error.signal = signal; - error.signalDescription = signalDescription; - error.stdout = stdout; - error.stderr = stderr; - - if (all !== undefined) { - error.all = all; - } +/** + * Process the given brace `pattern`. + * + * ```js + * const { braces } = require('micromatch'); + * console.log(braces('foo/{a,b,c}/bar')); + * //=> [ 'foo/(a|b|c)/bar' ] + * + * console.log(braces('foo/{a,b,c}/bar', { expand: true })); + * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] + * ``` + * @param {String} `pattern` String with brace pattern to process. + * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. + * @return {Array} + * @api public + */ - if ('bufferedData' in error) { - delete error.bufferedData; - } +micromatch.braces = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { + return [pattern]; + } + return braces(pattern, options); +}; - error.failed = true; - error.timedOut = Boolean(timedOut); - error.isCanceled = isCanceled; - error.killed = killed && !timedOut; +/** + * Expand braces + */ - return error; +micromatch.braceExpand = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + return micromatch.braces(pattern, { ...options, expand: true }); }; -module.exports = makeError; +/** + * Expose micromatch + */ + +module.exports = micromatch; /***/ }), -/***/ "../../node_modules/execa/lib/kill.js": +/***/ "../../node_modules/fast-glob/out/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const os = __webpack_require__("os"); -const onExit = __webpack_require__("../../node_modules/signal-exit/index.js"); - -const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - -// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior -const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { - const killResult = kill(signal); - setKillTimeout(kill, signal, options, killResult); - return killResult; -}; - -const setKillTimeout = (kill, signal, options, killResult) => { - if (!shouldForceKill(signal, options, killResult)) { - return; - } - - const timeout = getForceKillAfterTimeout(options); - const t = setTimeout(() => { - kill('SIGKILL'); - }, timeout); - - // Guarded because there's no `.unref()` when `execa` is used in the renderer - // process in Electron. This cannot be tested since we don't run tests in - // Electron. - // istanbul ignore else - if (t.unref) { - t.unref(); - } -}; - -const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { - return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; -}; +const taskManager = __webpack_require__("../../node_modules/fast-glob/out/managers/tasks.js"); +const async_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/async.js"); +const stream_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/stream.js"); +const sync_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/sync.js"); +const settings_1 = __webpack_require__("../../node_modules/fast-glob/out/settings.js"); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); +} +// https://github.com/typescript-eslint/typescript-eslint/issues/60 +// eslint-disable-next-line no-redeclare +(function (FastGlob) { + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); + } + FastGlob.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + /** + * The stream returned by the provider cannot work with an asynchronous iterator. + * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. + * This affects performance (+25%). I don't see best solution right now. + */ + return utils.stream.merge(works); + } + FastGlob.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = [].concat(source); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); + } + FastGlob.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); + } + FastGlob.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); + } + FastGlob.escapePath = escapePath; +})(FastGlob || (FastGlob = {})); +function getWorks(source, _Provider, options) { + const patterns = [].concat(source); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); +} +function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError('Patterns must be a string (non empty) or an array of strings'); + } +} +module.exports = FastGlob; -const isSigterm = signal => { - return signal === os.constants.signals.SIGTERM || - (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); -}; -const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { - if (forceKillAfterTimeout === true) { - return DEFAULT_FORCE_KILL_TIMEOUT; - } +/***/ }), - if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { - throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); - } +/***/ "../../node_modules/fast-glob/out/managers/tasks.js": +/***/ (function(module, exports, __webpack_require__) { - return forceKillAfterTimeout; -}; +"use strict"; -// `childProcess.cancel()` -const spawnedCancel = (spawned, context) => { - const killResult = spawned.kill(); - - if (killResult) { - context.isCanceled = true; - } -}; - -const timeoutKill = (spawned, signal, reject) => { - spawned.kill(signal); - reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); -}; - -// `timeout` option handling -const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { - if (timeout === 0 || timeout === undefined) { - return spawnedPromise; - } - - if (!Number.isFinite(timeout) || timeout < 0) { - throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); - } - - let timeoutId; - const timeoutPromise = new Promise((resolve, reject) => { - timeoutId = setTimeout(() => { - timeoutKill(spawned, killSignal, reject); - }, timeout); - }); - - const safeSpawnedPromise = spawnedPromise.finally(() => { - clearTimeout(timeoutId); - }); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +function generate(patterns, settings) { + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +exports.generate = generate; +/** + * Returns tasks grouped by basic pattern directories. + * + * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. + * This is necessary because directory traversal starts at the base directory and goes deeper. + */ +function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + /* + * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory + * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. + */ + if ('.' in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); + } + else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; +} +exports.convertPatternsToTasks = convertPatternsToTasks; +function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); +} +exports.getPositivePatterns = getPositivePatterns; +function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; +} +exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, group); +} +exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; +} +exports.convertPatternGroupToTask = convertPatternGroupToTask; - return Promise.race([timeoutPromise, safeSpawnedPromise]); -}; -// `cleanup` option handling -const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { - if (!cleanup || detached) { - return timedPromise; - } +/***/ }), - const removeExitHandler = onExit(() => { - spawned.kill(); - }); +/***/ "../../node_modules/fast-glob/out/providers/async.js": +/***/ (function(module, exports, __webpack_require__) { - return timedPromise.finally(() => { - removeExitHandler(); - }); -}; +"use strict"; -module.exports = { - spawnedKill, - spawnedCancel, - setupTimeout, - setExitHandler -}; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = __webpack_require__("../../node_modules/fast-glob/out/readers/stream.js"); +const provider_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/provider.js"); +class ProviderAsync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_1.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = []; + return new Promise((resolve, reject) => { + const stream = this.api(root, task, options); + stream.once('error', reject); + stream.on('data', (entry) => entries.push(options.transform(entry))); + stream.once('end', () => resolve(entries)); + }); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports.default = ProviderAsync; /***/ }), -/***/ "../../node_modules/execa/lib/promise.js": +/***/ "../../node_modules/fast-glob/out/providers/filters/deep.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +const partial_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/matchers/partial.js"); +class DeepFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + /** + * Avoid unnecessary depth calculations when it doesn't matter. + */ + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split('/').length; + if (basePath === '') { + return entryPathDepth; + } + const basePathDepth = basePath.split('/').length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } +} +exports.default = DeepFilter; -const nativePromisePrototype = (async () => {})().constructor.prototype; -const descriptors = ['then', 'catch', 'finally'].map(property => [ - property, - Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) -]); - -// The return value is a mixin of `childProcess` and `Promise` -const mergePromise = (spawned, promise) => { - for (const [property, descriptor] of descriptors) { - // Starting the main `promise` is deferred to avoid consuming streams - const value = typeof promise === 'function' ? - (...args) => Reflect.apply(descriptor.value, promise(), args) : - descriptor.value.bind(promise); - - Reflect.defineProperty(spawned, property, {...descriptor, value}); - } - - return spawned; -}; -// Use promises instead of `child_process` events -const getSpawnedPromise = spawned => { - return new Promise((resolve, reject) => { - spawned.on('exit', (exitCode, signal) => { - resolve({exitCode, signal}); - }); +/***/ }), - spawned.on('error', error => { - reject(error); - }); +/***/ "../../node_modules/fast-glob/out/providers/filters/entry.js": +/***/ (function(module, exports, __webpack_require__) { - if (spawned.stdin) { - spawned.stdin.on('error', error => { - reject(error); - }); - } - }); -}; - -module.exports = { - mergePromise, - getSpawnedPromise -}; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +class EntryFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = new Map(); + } + getFilter(positive, negative) { + const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); + return (entry) => this._filter(entry, positiveRe, negativeRe); + } + _filter(entry, positiveRe, negativeRe) { + if (this._settings.unique && this._isDuplicateEntry(entry)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { + return false; + } + const filepath = this._settings.baseNameMatch ? entry.name : entry.path; + const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); + if (this._settings.unique && isMatched) { + this._createIndexRecord(entry); + } + return isMatched; + } + _isDuplicateEntry(entry) { + return this.index.has(entry.path); + } + _createIndexRecord(entry) { + this.index.set(entry.path, undefined); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); + } + _isMatchToPatterns(entryPath, patternsRe) { + const filepath = utils.path.removeLeadingDotSegment(entryPath); + return utils.pattern.matchAny(filepath, patternsRe); + } +} +exports.default = EntryFilter; /***/ }), -/***/ "../../node_modules/execa/lib/stdio.js": +/***/ "../../node_modules/fast-glob/out/providers/filters/error.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const aliases = ['stdin', 'stdout', 'stderr']; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +class ErrorFilter { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } +} +exports.default = ErrorFilter; -const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined); -const normalizeStdio = opts => { - if (!opts) { - return; - } +/***/ }), - const {stdio} = opts; +/***/ "../../node_modules/fast-glob/out/providers/matchers/matcher.js": +/***/ (function(module, exports, __webpack_require__) { - if (stdio === undefined) { - return aliases.map(alias => opts[alias]); - } +"use strict"; - if (hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); - } +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +class Matcher { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + /** + * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). + * So, before expand patterns with brace expansion into separated patterns. + */ + const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); + for (const pattern of patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } +} +exports.default = Matcher; - if (typeof stdio === 'string') { - return stdio; - } - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } +/***/ }), - const length = Math.max(stdio.length, aliases.length); - return Array.from({length}, (value, index) => stdio[index]); -}; +/***/ "../../node_modules/fast-glob/out/providers/matchers/partial.js": +/***/ (function(module, exports, __webpack_require__) { -module.exports = normalizeStdio; +"use strict"; -// `ipc` is pushed unless it is already present -module.exports.node = opts => { - const stdio = normalizeStdio(opts); +Object.defineProperty(exports, "__esModule", { value: true }); +const matcher_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/matchers/matcher.js"); +class PartialMatcher extends matcher_1.default { + match(filepath) { + const parts = filepath.split('/'); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + /** + * In this case, the pattern has a globstar and we must read all directories unconditionally, + * but only if the level has reached the end of the first group. + * + * fixtures/{a,b}/** + * ^ true/false ^ always true + */ + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; + } +} +exports.default = PartialMatcher; - if (stdio === 'ipc') { - return 'ipc'; - } - if (stdio === undefined || typeof stdio === 'string') { - return [stdio, stdio, stdio, 'ipc']; - } +/***/ }), - if (stdio.includes('ipc')) { - return stdio; - } +/***/ "../../node_modules/fast-glob/out/providers/provider.js": +/***/ (function(module, exports, __webpack_require__) { - return [...stdio, 'ipc']; -}; +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const path = __webpack_require__("path"); +const deep_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/filters/deep.js"); +const entry_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/filters/entry.js"); +const error_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/filters/error.js"); +const entry_2 = __webpack_require__("../../node_modules/fast-glob/out/providers/transformers/entry.js"); +class Provider { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); + } + _getRootDirectory(task) { + return path.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === '.' ? '' : task.base; + return { + basePath, + pathSegmentSeparator: '/', + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } +} +exports.default = Provider; /***/ }), -/***/ "../../node_modules/execa/lib/stream.js": +/***/ "../../node_modules/fast-glob/out/providers/stream.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -const isStream = __webpack_require__("../../node_modules/is-stream/index.js"); -const getStream = __webpack_require__("../../node_modules/get-stream/index.js"); -const mergeStream = __webpack_require__("../../node_modules/merge-stream/index.js"); - -// `input` option -const handleInput = (spawned, input) => { - // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 - // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 - if (input === undefined || spawned.stdin === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -}; - -// `all` interleaves `stdout` and `stderr` -const makeAllStream = (spawned, {all}) => { - if (!all || (!spawned.stdout && !spawned.stderr)) { - return; - } +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = __webpack_require__("stream"); +const stream_2 = __webpack_require__("../../node_modules/fast-glob/out/readers/stream.js"); +const provider_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/provider.js"); +class ProviderStream extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); + source + .once('error', (error) => destination.emit('error', error)) + .on('data', (entry) => destination.emit('data', options.transform(entry))) + .once('end', () => destination.emit('end')); + destination + .once('close', () => source.destroy()); + return destination; + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports.default = ProviderStream; - const mixed = mergeStream(); - if (spawned.stdout) { - mixed.add(spawned.stdout); - } +/***/ }), - if (spawned.stderr) { - mixed.add(spawned.stderr); - } +/***/ "../../node_modules/fast-glob/out/providers/sync.js": +/***/ (function(module, exports, __webpack_require__) { - return mixed; -}; +"use strict"; -// On failure, `result.stdout|stderr|all` should contain the currently buffered stream -const getBufferedData = async (stream, streamPromise) => { - if (!stream) { - return; - } +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = __webpack_require__("../../node_modules/fast-glob/out/readers/sync.js"); +const provider_1 = __webpack_require__("../../node_modules/fast-glob/out/providers/provider.js"); +class ProviderSync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports.default = ProviderSync; - stream.destroy(); - try { - return await streamPromise; - } catch (error) { - return error.bufferedData; - } -}; +/***/ }), -const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { - if (!stream || !buffer) { - return; - } +/***/ "../../node_modules/fast-glob/out/providers/transformers/entry.js": +/***/ (function(module, exports, __webpack_require__) { - if (encoding) { - return getStream(stream, {encoding, maxBuffer}); - } +"use strict"; - return getStream.buffer(stream, {maxBuffer}); -}; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +class EntryTransformer { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += '/'; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } +} +exports.default = EntryTransformer; -// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) -const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { - const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); - const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); - const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); - try { - return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); - } catch (error) { - return Promise.all([ - {error, signal: error.signal, timedOut: error.timedOut}, - getBufferedData(stdout, stdoutPromise), - getBufferedData(stderr, stderrPromise), - getBufferedData(all, allPromise) - ]); - } -}; +/***/ }), -const validateInputSync = ({input}) => { - if (isStream(input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } -}; +/***/ "../../node_modules/fast-glob/out/readers/reader.js": +/***/ (function(module, exports, __webpack_require__) { -module.exports = { - handleInput, - makeAllStream, - getSpawnedResult, - validateInputSync -}; +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = __webpack_require__("path"); +const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); +const utils = __webpack_require__("../../node_modules/fast-glob/out/utils/index.js"); +class Reader { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } +} +exports.default = Reader; /***/ }), -/***/ "../../node_modules/fastq/queue.js": +/***/ "../../node_modules/fast-glob/out/readers/stream.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = __webpack_require__("stream"); +const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); +const fsWalk = __webpack_require__("../../node_modules/@nodelib/fs.walk/out/index.js"); +const reader_1 = __webpack_require__("../../node_modules/fast-glob/out/readers/reader.js"); +class ReaderStream extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; + } + dynamic(root, options) { + return this._walkStream(root, options); + } + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options) + .then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }) + .catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options) { + return this._getStat(filepath) + .then((stats) => this._makeEntry(stats, pattern)) + .catch((error) => { + if (options.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve(stats) : reject(error); + }); + }); + } +} +exports.default = ReaderStream; -var reusify = __webpack_require__("../../node_modules/reusify/reusify.js") -function fastqueue (context, worker, concurrency) { - if (typeof context === 'function') { - concurrency = worker - worker = context - context = null - } +/***/ }), - var cache = reusify(Task) - var queueHead = null - var queueTail = null - var _running = 0 +/***/ "../../node_modules/fast-glob/out/readers/sync.js": +/***/ (function(module, exports, __webpack_require__) { - var self = { - push: push, - drain: noop, - saturated: noop, - pause: pause, - paused: false, - concurrency: concurrency, - running: running, - resume: resume, - idle: idle, - length: length, - unshift: unshift, - empty: noop, - kill: kill, - killAndDrain: killAndDrain - } - - return self - - function running () { - return _running - } - - function pause () { - self.paused = true - } - - function length () { - var current = queueHead - var counter = 0 +"use strict"; - while (current) { - current = current.next - counter++ +Object.defineProperty(exports, "__esModule", { value: true }); +const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); +const fsWalk = __webpack_require__("../../node_modules/@nodelib/fs.walk/out/index.js"); +const reader_1 = __webpack_require__("../../node_modules/fast-glob/out/readers/reader.js"); +class ReaderSync extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; } - - return counter - } - - function resume () { - if (!self.paused) return - self.paused = false - for (var i = 0; i < self.concurrency; i++) { - _running++ - release() + dynamic(root, options) { + return this._walkSync(root, options); } - } - - function idle () { - return _running === 0 && self.length() === 0 - } - - function push (value, done) { - var current = cache.get() - - current.context = context - current.release = release - current.value = value - current.callback = done || noop - - if (_running === self.concurrency || self.paused) { - if (queueTail) { - queueTail.next = current - queueTail = current - } else { - queueHead = current - queueTail = current - self.saturated() - } - } else { - _running++ - worker.call(context, current.value, current.worked) + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; } - } + _getEntry(filepath, pattern, options) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } + catch (error) { + if (options.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } +} +exports.default = ReaderSync; - function unshift (value, done) { - var current = cache.get() - current.context = context - current.release = release - current.value = value - current.callback = done || noop +/***/ }), - if (_running === self.concurrency || self.paused) { - if (queueHead) { - current.next = queueHead - queueHead = current - } else { - queueHead = current - queueTail = current - self.saturated() - } - } else { - _running++ - worker.call(context, current.value, current.worked) - } - } +/***/ "../../node_modules/fast-glob/out/settings.js": +/***/ (function(module, exports, __webpack_require__) { - function release (holder) { - if (holder) { - cache.release(holder) - } - var next = queueHead - if (next) { - if (!self.paused) { - if (queueTail === queueHead) { - queueTail = null +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; +const fs = __webpack_require__("fs"); +const os = __webpack_require__("os"); +/** + * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. + * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 + */ +const CPU_COUNT = Math.max(os.cpus().length, 1); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + lstatSync: fs.lstatSync, + stat: fs.stat, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +class Settings { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; } - queueHead = next.next - next.next = null - worker.call(context, next.value, next.worked) - if (queueTail === null) { - self.empty() + if (this.stats) { + this.objectMode = true; } - } else { - _running-- - } - } else if (--_running === 0) { - self.drain() } - } - - function kill () { - queueHead = null - queueTail = null - self.drain = noop - } - - function killAndDrain () { - queueHead = null - queueTail = null - self.drain() - self.drain = noop - } + _getValue(option, value) { + return option === undefined ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } } +exports.default = Settings; -function noop () {} -function Task () { - this.value = null - this.callback = noop - this.next = null - this.release = noop - this.context = null +/***/ }), - var self = this +/***/ "../../node_modules/fast-glob/out/utils/array.js": +/***/ (function(module, exports, __webpack_require__) { - this.worked = function worked (err, result) { - var callback = self.callback - self.value = null - self.callback = noop - callback.call(self.context, err, result) - self.release(self) - } -} +"use strict"; -module.exports = fastqueue +Object.defineProperty(exports, "__esModule", { value: true }); +exports.splitWhen = exports.flatten = void 0; +function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); +} +exports.flatten = flatten; +function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } + else { + result[groupIndex].push(item); + } + } + return result; +} +exports.splitWhen = splitWhen; /***/ }), -/***/ "../../node_modules/fill-range/index.js": +/***/ "../../node_modules/fast-glob/out/utils/errno.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -const util = __webpack_require__("util"); -const toRegexRange = __webpack_require__("../../node_modules/to-regex-range/index.js"); - -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); - -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); -}; - -const isValidValue = value => { - return typeof value === 'number' || (typeof value === 'string' && value !== ''); -}; - -const isNumber = num => Number.isInteger(+num); - -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - while (value[++index] === '0'); - return index > 0; -}; - -const stringify = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; - } - return options.stringify === true; -}; - -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); - } - if (toNumber === false) { - return String(input); - } - return input; -}; - -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - if (negative) { - input = input.slice(1); - maxLength--; - } - while (input.length < maxLength) input = '0' + input; - return negative ? ('-' + input) : input; -}; - -const toSequence = (parts, options) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; - - if (parts.positives.length) { - positives = parts.positives.join('|'); - } - - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.join('|')})`; - } - - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; - } - - if (options.wrap) { - return `(${prefix}${result})`; - } - return result; -}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEnoentCodeError = void 0; +function isEnoentCodeError(error) { + return error.code === 'ENOENT'; +} +exports.isEnoentCodeError = isEnoentCodeError; -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange(a, b, { wrap: false, ...options }); - } - let start = String.fromCharCode(a); - if (a === b) return start; +/***/ }), - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; +/***/ "../../node_modules/fast-glob/out/utils/fs.js": +/***/ (function(module, exports, __webpack_require__) { -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - return toRegexRange(start, end, options); -}; +"use strict"; -const rangeError = (...args) => { - return new RangeError('Invalid range arguments: ' + util.inspect(...args)); -}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); - } - return []; -}; +/***/ }), -const fillNumbers = (start, end, step = 1, options = {}) => { - let a = Number(start); - let b = Number(end); +/***/ "../../node_modules/fast-glob/out/utils/index.js": +/***/ (function(module, exports, __webpack_require__) { - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; - } +"use strict"; - // fix negative zero - if (a === 0) a = 0; - if (b === 0) b = 0; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; +const array = __webpack_require__("../../node_modules/fast-glob/out/utils/array.js"); +exports.array = array; +const errno = __webpack_require__("../../node_modules/fast-glob/out/utils/errno.js"); +exports.errno = errno; +const fs = __webpack_require__("../../node_modules/fast-glob/out/utils/fs.js"); +exports.fs = fs; +const path = __webpack_require__("../../node_modules/fast-glob/out/utils/path.js"); +exports.path = path; +const pattern = __webpack_require__("../../node_modules/fast-glob/out/utils/pattern.js"); +exports.pattern = pattern; +const stream = __webpack_require__("../../node_modules/fast-glob/out/utils/stream.js"); +exports.stream = stream; +const string = __webpack_require__("../../node_modules/fast-glob/out/utils/string.js"); +exports.string = string; - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify(start, end, options) === false; - let format = options.transform || transform(toNumber); +/***/ }), - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); - } +/***/ "../../node_modules/fast-glob/out/utils/path.js": +/***/ (function(module, exports, __webpack_require__) { - let parts = { negatives: [], positives: [] }; - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - let range = []; - let index = 0; +"use strict"; - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; +const path = __webpack_require__("path"); +const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ +const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; +/** + * Designed to work only with simple paths: `dir\\file`. + */ +function unixify(filepath) { + return filepath.replace(/\\/g, '/'); +} +exports.unixify = unixify; +function makeAbsolute(cwd, filepath) { + return path.resolve(cwd, filepath); +} +exports.makeAbsolute = makeAbsolute; +function escape(pattern) { + return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +exports.escape = escape; +function removeLeadingDotSegment(entry) { + // We do not use `startsWith` because this is 10x slower than current implementation for some cases. + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with + if (entry.charAt(0) === '.') { + const secondCharactery = entry.charAt(1); + if (secondCharactery === '/' || secondCharactery === '\\') { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } } - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return step > 1 - ? toSequence(parts, options) - : toRegex(range, null, { wrap: false, ...options }); - } - - return range; -}; - -const fillLetters = (start, end, step = 1, options = {}) => { - if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { - return invalidRange(start, end, options); - } - + return entry; +} +exports.removeLeadingDotSegment = removeLeadingDotSegment; - let format = options.transform || (val => String.fromCharCode(val)); - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); +/***/ }), - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); - } +/***/ "../../node_modules/fast-glob/out/utils/pattern.js": +/***/ (function(module, exports, __webpack_require__) { - let range = []; - let index = 0; +"use strict"; - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); - } +Object.defineProperty(exports, "__esModule", { value: true }); +exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; +const path = __webpack_require__("path"); +const globParent = __webpack_require__("../../node_modules/glob-parent/index.js"); +const micromatch = __webpack_require__("../../node_modules/fast-glob/node_modules/micromatch/index.js"); +const GLOBSTAR = '**'; +const ESCAPE_SYMBOL = '\\'; +const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; +const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/; +const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/; +const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/; +const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/; +function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); +} +exports.isStaticPattern = isStaticPattern; +function isDynamicPattern(pattern, options = {}) { + /** + * A special case with an empty string is necessary for matching patterns that start with a forward slash. + * An empty string cannot be a dynamic pattern. + * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. + */ + if (pattern === '') { + return false; + } + /** + * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check + * filepath directly (without read directory). + */ + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; + } + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) { + return true; + } + return false; +} +exports.isDynamicPattern = isDynamicPattern; +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; +} +exports.convertToPositivePattern = convertToPositivePattern; +function convertToNegativePattern(pattern) { + return '!' + pattern; +} +exports.convertToNegativePattern = convertToNegativePattern; +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +exports.isNegativePattern = isNegativePattern; +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +exports.isPositivePattern = isPositivePattern; +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +exports.getNegativePatterns = getNegativePatterns; +function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Returns patterns that can be applied inside the current directory. + * + * @example + * // ['./*', '*', 'a/*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); +} +exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; +/** + * Returns patterns to be expanded relative to (outside) the current directory. + * + * @example + * // ['../*', './../*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); +} +exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; +function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith('..') || pattern.startsWith('./..'); +} +exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; +function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); +} +exports.getBaseDirectory = getBaseDirectory; +function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); +} +exports.hasGlobStar = hasGlobStar; +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR); +} +exports.endsWithSlashGlobStar = endsWithSlashGlobStar; +function isAffectDepthOfReadingPattern(pattern) { + const basename = path.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); +} +exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; +function expandBraceExpansion(pattern) { + return micromatch.braces(pattern, { + expand: true, + nodupes: true + }); +} +exports.expandBraceExpansion = expandBraceExpansion; +function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + /** + * The scan method returns an empty array in some cases. + * See micromatch/picomatch#58 for more details. + */ + if (parts.length === 0) { + parts = [pattern]; + } + /** + * The scan method does not return an empty part for the pattern with a forward slash. + * This is another part of micromatch/picomatch#58. + */ + if (parts[0].startsWith('/')) { + parts[0] = parts[0].slice(1); + parts.unshift(''); + } + return parts; +} +exports.getPatternParts = getPatternParts; +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +exports.makeRe = makeRe; +function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); +} +exports.convertPatternsToRe = convertPatternsToRe; +function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); +} +exports.matchAny = matchAny; - return range; -}; -const fill = (start, end, step, options = {}) => { - if (end == null && isValidValue(start)) { - return [start]; - } +/***/ }), - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } +/***/ "../../node_modules/fast-glob/out/utils/stream.js": +/***/ (function(module, exports, __webpack_require__) { - if (typeof step === 'function') { - return fill(start, end, 1, { transform: step }); - } +"use strict"; - if (isObject(step)) { - return fill(start, end, 0, step); - } +Object.defineProperty(exports, "__esModule", { value: true }); +exports.merge = void 0; +const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); +function merge(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once('error', (error) => mergedStream.emit('error', error)); + }); + mergedStream.once('close', () => propagateCloseEventToSources(streams)); + mergedStream.once('end', () => propagateCloseEventToSources(streams)); + return mergedStream; +} +exports.merge = merge; +function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit('close')); +} - let opts = { ...options }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; - if (!isNumber(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); - } +/***/ }), - if (isNumber(start) && isNumber(end)) { - return fillNumbers(start, end, step, opts); - } +/***/ "../../node_modules/fast-glob/out/utils/string.js": +/***/ (function(module, exports, __webpack_require__) { - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; +"use strict"; -module.exports = fill; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEmpty = exports.isString = void 0; +function isString(input) { + return typeof input === 'string'; +} +exports.isString = isString; +function isEmpty(input) { + return input === ''; +} +exports.isEmpty = isEmpty; /***/ }), -/***/ "../../node_modules/follow-redirects/debug.js": +/***/ "../../node_modules/fastq/queue.js": /***/ (function(module, exports, __webpack_require__) { -var debug; +"use strict"; -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = __webpack_require__("../../node_modules/debug/src/index.js")("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; +var reusify = __webpack_require__("../../node_modules/reusify/reusify.js") -/***/ }), +function fastqueue (context, worker, concurrency) { + if (typeof context === 'function') { + concurrency = worker + worker = context + context = null + } -/***/ "../../node_modules/follow-redirects/index.js": -/***/ (function(module, exports, __webpack_require__) { + var cache = reusify(Task) + var queueHead = null + var queueTail = null + var _running = 0 -var url = __webpack_require__("url"); -var URL = url.URL; -var http = __webpack_require__("http"); -var https = __webpack_require__("https"); -var Writable = __webpack_require__("stream").Writable; -var assert = __webpack_require__("assert"); -var debug = __webpack_require__("../../node_modules/follow-redirects/debug.js"); - -// Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; -var eventHandlers = Object.create(null); -events.forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); - -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); + var self = { + push: push, + drain: noop, + saturated: noop, + pause: pause, + paused: false, + concurrency: concurrency, + running: running, + resume: resume, + idle: idle, + length: length, + unshift: unshift, + empty: noop, + kill: kill, + killAndDrain: killAndDrain + } -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; + return self - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); + function running () { + return _running } - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; - - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); + function pause () { + self.paused = true + } -RedirectableRequest.prototype.abort = function () { - abortRequest(this._currentRequest); - this.emit("abort"); -}; + function length () { + var current = queueHead + var counter = 0 -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } + while (current) { + current = current.next + counter++ + } - // Validate input and shift parameters if necessary - if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (typeof encoding === "function") { - callback = encoding; - encoding = null; + return counter } - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); + function resume () { + if (!self.paused) return + self.paused = false + for (var i = 0; i < self.concurrency; i++) { + _running++ + release() } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); } -}; -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (typeof data === "function") { - callback = data; - data = encoding = null; - } - else if (typeof encoding === "function") { - callback = encoding; - encoding = null; + function idle () { + return _running === 0 && self.length() === 0 } - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; + function push (value, done) { + var current = cache.get() -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; + current.context = context + current.release = release + current.value = value + current.callback = done || noop -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; + if (_running === self.concurrency || self.paused) { + if (queueTail) { + queueTail.next = current + queueTail = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) + } + } -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; + function unshift (value, done) { + var current = cache.get() - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } + current.context = context + current.release = release + current.value = value + current.callback = done || noop - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); + if (_running === self.concurrency || self.paused) { + if (queueHead) { + current.next = queueHead + queueHead = current + } else { + queueHead = current + queueTail = current + self.saturated() + } + } else { + _running++ + worker.call(context, current.value, current.worked) } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); } - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; + function release (holder) { + if (holder) { + cache.release(holder) } - - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); + var next = queueHead + if (next) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null + } + queueHead = next.next + next.next = null + worker.call(context, next.value, next.worked) + if (queueTail === null) { + self.empty() + } + } else { + _running-- + } + } else if (--_running === 0) { + self.drain() } } - // Attach callback if passed - if (callback) { - this.on("timeout", callback); + function kill () { + queueHead = null + queueTail = null + self.drain = noop } - // Start the timer if or when the socket is opened - if (this.socket) { - startTimer(this.socket); + function killAndDrain () { + queueHead = null + queueTail = null + self.drain() + self.drain = noop } - else { - this._currentRequest.once("socket", startTimer); +} + +function noop () {} + +function Task () { + this.value = null + this.callback = noop + this.next = null + this.release = noop + this.context = null + + var self = this + + this.worked = function worked (err, result) { + var callback = self.callback + self.value = null + self.callback = noop + callback.call(self.context, err, result) + self.release(self) } +} - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); +module.exports = fastqueue - return this; + +/***/ }), + +/***/ "../../node_modules/fill-range/index.js": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +const util = __webpack_require__("util"); +const toRegexRange = __webpack_require__("../../node_modules/to-regex-range/index.js"); + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); }; -// Proxy all other public ClientRequest methods -[ - "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); +const isNumber = num => Number.isInteger(+num); -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; + +const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; } + return options.stringify === true; +}; - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); } + if (toNumber === false) { + return String(input); + } + return input; +}; - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; }; +const toSequence = (parts, options) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; + if (parts.positives.length) { + positives = parts.positives.join('|'); } - // Create the native request - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - this._currentUrl = url.format(this._options); + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.join('|')})`; + } - // Set up event handlers - request._redirectable = this; - for (var e = 0; e < events.length; e++) { - request.on(events[e], eventHandlers[events[e]]); + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; } - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end. - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); + if (options.wrap) { + return `(${prefix}${result})`; } + + return result; }; -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); } - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. + let start = String.fromCharCode(a); + if (a === b) return start; - // If the response is not a redirect; return it as-is - var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; - // Clean up - this._requestBodyBuffers = []; - return; +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); } + return toRegexRange(start, end, options); +}; - // The response is a redirect, so abort the current request - abortRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); } + return []; +}; - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError(cause)); - return; - } + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); - // Create the redirected request - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); } - // Evaluate the beforeRedirect callback - if (typeof beforeRedirect === "function") { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } - catch (err) { - this.emit("error", err); - return; + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); } - this._sanitizeOptions(this._options); + a = descending ? a - step : a + step; + index++; } - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError(cause)); + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options) + : toRegex(range, null, { wrap: false, ...options }); } + + return range; }; -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (typeof input === "string") { - var urlStr = input; - try { - input = urlToOptions(new URL(urlStr)); - } - catch (err) { - /* istanbul ignore next */ - input = url.parse(urlStr); - } - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (typeof options === "function") { - callback = options; - options = null; - } + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } + let range = []; + let index = 0; - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } -/* istanbul ignore next */ -function noop() { /* empty */ } + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); + return range; +}; + +const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; } - return options; -} -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); -} -function createErrorType(code, defaultMessage) { - function CustomError(cause) { - Error.captureStackTrace(this, this.constructor); - if (!cause) { - this.message = defaultMessage; - } - else { - this.message = defaultMessage + ": " + cause.message; - this.cause = cause; - } + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); } - CustomError.prototype = new Error(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - CustomError.prototype.code = code; - return CustomError; -} -function abortRequest(request) { - for (var e = 0; e < events.length; e++) { - request.removeListener(events[e], eventHandlers[events[e]]); + if (isObject(step)) { + return fill(start, end, 0, step); } - request.on("error", noop); - request.abort(); -} - -function isSubdomain(subdomain, domain) { - const dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} - -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; -/***/ }), + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } -/***/ "../../node_modules/form-data/lib/form_data.js": -/***/ (function(module, exports, __webpack_require__) { + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } -var CombinedStream = __webpack_require__("../../node_modules/combined-stream/lib/combined_stream.js"); -var util = __webpack_require__("util"); -var path = __webpack_require__("path"); -var http = __webpack_require__("http"); -var https = __webpack_require__("https"); -var parseUrl = __webpack_require__("url").parse; -var fs = __webpack_require__("fs"); -var Stream = __webpack_require__("stream").Stream; -var mime = __webpack_require__("../../node_modules/mime-types/index.js"); -var asynckit = __webpack_require__("../../node_modules/asynckit/index.js"); -var populate = __webpack_require__("../../node_modules/form-data/lib/populate.js"); + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; -// Public API -module.exports = FormData; +module.exports = fill; -// make it a Stream -util.inherits(FormData, CombinedStream); -/** - * Create readable "multipart/form-data" streams. - * Can be used to submit forms - * and file uploads to other web applications. - * - * @constructor - * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream - */ -function FormData(options) { - if (!(this instanceof FormData)) { - return new FormData(options); - } +/***/ }), - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; +/***/ "../../node_modules/follow-redirects/debug.js": +/***/ (function(module, exports, __webpack_require__) { - CombinedStream.call(this); +var debug; - options = options || {}; - for (var option in options) { - this[option] = options[option]; +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = __webpack_require__("../../node_modules/debug/src/index.js")("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } } -} + debug.apply(null, arguments); +}; -FormData.LINE_BREAK = '\r\n'; -FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; -FormData.prototype.append = function(field, value, options) { +/***/ }), - options = options || {}; +/***/ "../../node_modules/follow-redirects/index.js": +/***/ (function(module, exports, __webpack_require__) { - // allow filename as single option - if (typeof options == 'string') { - options = {filename: options}; - } +var url = __webpack_require__("url"); +var URL = url.URL; +var http = __webpack_require__("http"); +var https = __webpack_require__("https"); +var Writable = __webpack_require__("stream").Writable; +var assert = __webpack_require__("assert"); +var debug = __webpack_require__("../../node_modules/follow-redirects/debug.js"); - var append = CombinedStream.prototype.append.bind(this); +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); - // all that streamy business can't handle numbers - if (typeof value == 'number') { - value = '' + value; - } +// Error types with codes +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded" +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; + + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + self._processResponse(response); + }; - append(header); - append(value); - append(footer); + // Perform the first request + this._performRequest(); +} +RedirectableRequest.prototype = Object.create(Writable.prototype); - // pass along options.knownLength - this._trackLength(header, value, options); +RedirectableRequest.prototype.abort = function () { + abortRequest(this._currentRequest); + this.emit("abort"); }; -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); } - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - FormData.LINE_BREAK.length; + // Validate input and shift parameters if necessary + if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (typeof encoding === "function") { + callback = encoding; + encoding = null; + } - // empty or either doesn't have path or not an http response or not a stream - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); + } return; } - - // no need to bother with the length - if (!options.knownLength) { - this._valuesToMeasure.push(value); + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); } }; -FormData.prototype._lengthRetriever = function(value, callback) { - - if (value.hasOwnProperty('fd')) { - - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { - - // when end specified - // no need to calculate range - // inclusive, starts with 0 - callback(null, value.end + 1 - (value.start ? value.start : 0)); - - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function(err, stat) { - - var fileSize; - - if (err) { - callback(err); - return; - } - - // update final size based on the range options - fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - callback(null, +value.headers['content-length']); +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (typeof data === "function") { + callback = data; + data = encoding = null; + } + else if (typeof encoding === "function") { + callback = encoding; + encoding = null; + } - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - callback(null, +response.headers['content-length']); + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); }); - value.resume(); - - // something else - } else { - callback('Unknown stream'); + this._ending = true; } }; -FormData.prototype._multiPartHeader = function(field, value, options) { - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (typeof options.header == 'string') { - return options.header; - } +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; - var contents = ''; - var headers = { - // add custom disposition as third element or keep it two elements if not - 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - 'Content-Type': [].concat(contentType || []) - }; +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; - // allow custom headers. - if (typeof options.header == 'object') { - populate(headers, options.header); + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); } - var header; - for (var prop in headers) { - if (!headers.hasOwnProperty(prop)) continue; - header = headers[prop]; - - // skip nullish headers. - if (header == null) { - continue; + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } - // convert all headers to arrays. - if (!Array.isArray(header)) { - header = [header]; + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; } - // add non-empty headers. - if (header.length) { - contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); } } - return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; -}; - -FormData.prototype._getContentDisposition = function(value, options) { - - var filename - , contentDisposition - ; - - if (typeof options.filepath === 'string') { - // custom filepath for relative paths - filename = path.normalize(options.filepath).replace(/\\/g, '/'); - } else if (options.filename || value.name || value.path) { - // custom filename take precedence - // formidable and the browser add a name property - // fs- and request- streams have path property - filename = path.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - // or try http response - filename = path.basename(value.client._httpMessage.path || ''); + // Attach callback if passed + if (callback) { + this.on("timeout", callback); } - if (filename) { - contentDisposition = 'filename="' + filename + '"'; + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); } - return contentDisposition; + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + + return this; }; -FormData.prototype._getContentType = function(value, options) { +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); - // use custom content-type above all - var contentType = options.contentType; +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); - // or try `name` from formidable, browser - if (!contentType && value.name) { - contentType = mime.lookup(value.name); +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; } - // or try `path` from fs-, request- streams - if (!contentType && value.path) { - contentType = mime.lookup(value.path); + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; } - // or if it's http-reponse - if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { - contentType = value.headers['content-type']; + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } } +}; - // or guess it from the filepath or filename - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - // fallback to the default content type if `value` is not simple value - if (!contentType && typeof value == 'object') { - contentType = FormData.DEFAULT_CONTENT_TYPE; +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + this.emit("error", new TypeError("Unsupported protocol " + protocol)); + return; } - return contentType; -}; + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } -FormData.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; + // Create the native request + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + this._currentUrl = url.format(this._options); - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } + // Set up event handlers + request._redirectable = this; + for (var e = 0; e < events.length; e++) { + request.on(events[e], eventHandlers[events[e]]); } - return formHeaders; -}; - -FormData.prototype.setBoundary = function(boundary) { - this._boundary = boundary; -}; - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end. + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + /* istanbul ignore else */ + if (request === self._currentRequest) { + // Report any write errors + /* istanbul ignore if */ + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + /* istanbul ignore else */ + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); } - - return this._boundary; }; -FormData.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc( 0 ); - var boundary = this.getBoundary(); +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } - // Create the form content. Add Line breaks to the end of data. - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== 'function') { + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. - // Add content to the buffer. - if(Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); - }else { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); - } + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); - // Add break after content. - if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); - } - } + // Clean up + this._requestBodyBuffers = []; + return; } - // Add the footer and return the Buffer object. - return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); -}; + // The response is a redirect, so abort the current request + abortRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + this.emit("error", new TooManyRedirectsError()); + return; } - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); } - // https://github.com/form-data/form-data/issues/40 - if (!this.hasKnownLength()) { - // Some async length retrievers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); } - return knownLength; -}; + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); -// Public API to check if length of added values is known -// https://github.com/form-data/form-data/issues/196 -// https://github.com/form-data/form-data/issues/262 -FormData.prototype.hasKnownLength = function() { - var hasKnownLength = true; + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = url.parse(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); - if (this._valuesToMeasure.length) { - hasKnownLength = false; + // Determine the URL of the redirection + var redirectUrl; + try { + redirectUrl = url.resolve(currentUrl, location); } - - return hasKnownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; + catch (cause) { + this.emit("error", new RedirectionError(cause)); + return; } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; + // Create the redirected request + debug("redirecting to", redirectUrl); + this._isRedirect = true; + var redirectUrlParts = url.parse(redirectUrl); + Object.assign(this._options, redirectUrlParts); + + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrlParts.protocol !== currentUrlParts.protocol && + redirectUrlParts.protocol !== "https:" || + redirectUrlParts.host !== currentHost && + !isSubdomain(redirectUrlParts.host, currentHost)) { + removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); + // Evaluate the beforeRedirect callback + if (typeof beforeRedirect === "function") { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + try { + beforeRedirect(this._options, responseDetails, requestDetails); + } + catch (err) { + this.emit("error", err); return; } + this._sanitizeOptions(this._options); + } - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - var request - , options - , defaults = {method: 'post'} - ; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); + // Perform the redirected request + try { + this._performRequest(); + } + catch (cause) { + this.emit("error", new RedirectionError(cause)); + } +}; - // use custom params - } else { +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters + if (typeof input === "string") { + var urlStr = input; + try { + input = urlToOptions(new URL(urlStr)); + } + catch (err) { + /* istanbul ignore next */ + input = url.parse(urlStr); + } + } + else if (URL && (input instanceof URL)) { + input = urlToOptions(input); + } + else { + callback = options; + options = input; + input = { protocol: protocol }; + } + if (typeof options === "function") { + callback = options; + options = null; + } - // https if specified, fallback to http in any other case - if (options.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; - // get content length and fire away - this.getLength(function(err, length) { - if (err && err !== 'Unknown stream') { - this._error(err); - return; + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); } - // add content length - if (length) { - request.setHeader('Content-Length', length); + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; } - this.pipe(request); - if (cb) { - var onResponse; - - var callback = function (error, responce) { - request.removeListener('error', callback); - request.removeListener('response', onResponse); + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; +} - return cb.call(this, error, responce); - }; +/* istanbul ignore next */ +function noop() { /* empty */ } - onResponse = callback.bind(this, null); +// from https://github.com/nodejs/node/blob/master/lib/internal/url.js +function urlToOptions(urlObject) { + var options = { + protocol: urlObject.protocol, + hostname: urlObject.hostname.startsWith("[") ? + /* istanbul ignore next */ + urlObject.hostname.slice(1, -1) : + urlObject.hostname, + hash: urlObject.hash, + search: urlObject.search, + pathname: urlObject.pathname, + path: urlObject.pathname + urlObject.search, + href: urlObject.href, + }; + if (urlObject.port !== "") { + options.port = Number(urlObject.port); + } + return options; +} - request.on('error', callback); - request.on('response', onResponse); +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; } - }.bind(this)); + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} - return request; -}; +function createErrorType(code, defaultMessage) { + function CustomError(cause) { + Error.captureStackTrace(this, this.constructor); + if (!cause) { + this.message = defaultMessage; + } + else { + this.message = defaultMessage + ": " + cause.message; + this.cause = cause; + } + } + CustomError.prototype = new Error(); + CustomError.prototype.constructor = CustomError; + CustomError.prototype.name = "Error [" + code + "]"; + CustomError.prototype.code = code; + return CustomError; +} -FormData.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit('error', err); +function abortRequest(request) { + for (var e = 0; e < events.length; e++) { + request.removeListener(events[e], eventHandlers[events[e]]); } -}; + request.on("error", noop); + request.abort(); +} -FormData.prototype.toString = function () { - return '[object FormData]'; -}; +function isSubdomain(subdomain, domain) { + const dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} + +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; /***/ }), -/***/ "../../node_modules/form-data/lib/populate.js": -/***/ (function(module, exports) { +/***/ "../../node_modules/form-data/lib/form_data.js": +/***/ (function(module, exports, __webpack_require__) { -// populates missing values -module.exports = function(dst, src) { +var CombinedStream = __webpack_require__("../../node_modules/combined-stream/lib/combined_stream.js"); +var util = __webpack_require__("util"); +var path = __webpack_require__("path"); +var http = __webpack_require__("http"); +var https = __webpack_require__("https"); +var parseUrl = __webpack_require__("url").parse; +var fs = __webpack_require__("fs"); +var Stream = __webpack_require__("stream").Stream; +var mime = __webpack_require__("../../node_modules/mime-types/index.js"); +var asynckit = __webpack_require__("../../node_modules/asynckit/index.js"); +var populate = __webpack_require__("../../node_modules/form-data/lib/populate.js"); - Object.keys(src).forEach(function(prop) - { - dst[prop] = dst[prop] || src[prop]; - }); +// Public API +module.exports = FormData; - return dst; -}; +// make it a Stream +util.inherits(FormData, CombinedStream); +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); + } -/***/ }), + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; -/***/ "../../node_modules/fs.realpath/index.js": -/***/ (function(module, exports, __webpack_require__) { + CombinedStream.call(this); -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } +} -var fs = __webpack_require__("fs") -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__("../../node_modules/fs.realpath/old.js") +FormData.prototype.append = function(field, value, options) { -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} + options = options || {}; -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; } - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} + var append = CombinedStream.prototype.append.bind(this); -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; } - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} - - -/***/ }), -/***/ "../../node_modules/fs.realpath/old.js": -/***/ (function(module, exports, __webpack_require__) { + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + append(header); + append(value); + append(footer); -var pathModule = __webpack_require__("path"); -var isWindows = process.platform === 'win32'; -var fs = __webpack_require__("fs"); + // pass along options.knownLength + this._trackLength(header, value, options); +}; -// JavaScript implementation of realpath, ported from node pre-v6 +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; + this._valueLength += valueLength; - return callback; + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } + // empty or either doesn't have path or not an http response or not a stream + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + return; } - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); } -} +}; -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} +FormData.prototype._lengthRetriever = function(value, callback) { -var normalize = pathModule.normalize; + if (value.hasOwnProperty('fd')) { -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } + var fileSize; - var original = p, - seenLinks = {}, - knownHard = {}; + if (err) { + callback(err); + return; + } - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } - start(); + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + callback(null, +value.headers['content-length']); - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + callback(null, +response.headers['content-length']); + }); + value.resume(); - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } + // something else + } else { + callback('Unknown stream'); } +}; - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (typeof options.header == 'string') { + return options.header; + } - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); + // allow custom headers. + if (typeof options.header == 'object') { + populate(headers, options.header); } - if (cache) cache[original] = p; + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; + header = headers[prop]; - return p; -}; + // skip nullish headers. + if (header == null) { + continue; + } + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } } - // make p is absolute - p = pathModule.resolve(p); + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); +FormData.prototype._getContentDisposition = function(value, options) { + + var filename + , contentDisposition + ; + + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); } - var original = p, - seenLinks = {}, - knownHard = {}; + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; + return contentDisposition; +}; - start(); +FormData.prototype._getContentType = function(value, options) { - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; + // use custom content-type above all + var contentType = options.contentType; - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mime.lookup(value.name); } - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } - return fs.lstat(base, gotStat); + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; } - function gotStat(err, stat) { - if (err) return cb(err); + return contentType; +}; - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); } - fs.stat(base, function(err) { - if (err) return cb(err); - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } + next(footer); + }.bind(this); +}; - function gotTarget(err, target, base) { - if (err) return cb(err); +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } } + + return formHeaders; }; +FormData.prototype.setBoundary = function(boundary) { + this._boundary = boundary; +}; -/***/ }), +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } -/***/ "../../node_modules/function-bind/implementation.js": -/***/ (function(module, exports, __webpack_require__) { + return this._boundary; +}; -"use strict"; +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } } - var args = slice.call(arguments, 1); + } - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + this._boundary = boundary; +}; - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; - return bound; + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; }; +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; -/***/ }), + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } -/***/ "../../node_modules/function-bind/index.js": -/***/ (function(module, exports, __webpack_require__) { + return hasKnownLength; +}; -"use strict"; +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } -var implementation = __webpack_require__("../../node_modules/function-bind/implementation.js"); + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } -module.exports = Function.prototype.bind || implementation; + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + values.forEach(function(length) { + knownLength += length; + }); -/***/ }), + cb(null, knownLength); + }); +}; -/***/ "../../node_modules/get-stream/buffer-stream.js": -/***/ (function(module, exports, __webpack_require__) { +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; -"use strict"; + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { -const {PassThrough: PassThroughStream} = __webpack_require__("stream"); + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); -module.exports = options => { - options = {...options}; + // use custom params + } else { - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); - if (isBuffer) { - encoding = null; - } + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } - const stream = new PassThroughStream({objectMode}); + // get content length and fire away + this.getLength(function(err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; + } - if (encoding) { - stream.setEncoding(encoding); - } + // add content length + if (length) { + request.setHeader('Content-Length', length); + } - let length = 0; - const chunks = []; + this.pipe(request); + if (cb) { + var onResponse; - stream.on('data', chunk => { - chunks.push(chunk); + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); + return cb.call(this, error, responce); + }; - stream.getBufferedValue = () => { - if (array) { - return chunks; - } + onResponse = callback.bind(this, null); - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); - stream.getBufferedLength = () => length; + return request; +}; - return stream; +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; + +FormData.prototype.toString = function () { + return '[object FormData]'; }; /***/ }), -/***/ "../../node_modules/get-stream/index.js": -/***/ (function(module, exports, __webpack_require__) { +/***/ "../../node_modules/form-data/lib/populate.js": +/***/ (function(module, exports) { -"use strict"; +// populates missing values +module.exports = function(dst, src) { -const pump = __webpack_require__("../../node_modules/pump/index.js"); -const bufferStream = __webpack_require__("../../node_modules/get-stream/buffer-stream.js"); + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} + return dst; +}; -async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - options = { - maxBuffer: Infinity, - ...options - }; +/***/ }), - const {maxBuffer} = options; +/***/ "../../node_modules/fs.realpath/index.js": +/***/ (function(module, exports, __webpack_require__) { - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = error => { - if (error) { // A null check - error.bufferedData = stream.getBufferedValue(); - } +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch - reject(error); - }; +var fs = __webpack_require__("fs") +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = __webpack_require__("../../node_modules/fs.realpath/old.js") - resolve(); - }); +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } - return stream.getBufferedValue(); + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) } -module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} /***/ }), -/***/ "../../node_modules/getopts/index.js": +/***/ "../../node_modules/fs.realpath/old.js": /***/ (function(module, exports, __webpack_require__) { -"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +var pathModule = __webpack_require__("path"); +var isWindows = process.platform === 'win32'; +var fs = __webpack_require__("fs"); -const EMPTYARR = [] -const SHORTSPLIT = /$|[!-@[-`{-~][\s\S]*/g -const isArray = Array.isArray +// JavaScript implementation of realpath, ported from node pre-v6 -const parseValue = function(any) { - if (any === "") return "" - if (any === "false") return false - const maybe = Number(any) - return maybe * 0 === 0 ? maybe : any -} +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); -const parseAlias = function(aliases) { - let out = {}, - key, - alias, - prev, - len, - any, - i, - k +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; - for (key in aliases) { - any = aliases[key] - alias = out[key] = isArray(any) ? any : [any] + return callback; - for (i = 0, len = alias.length; i < len; i++) { - prev = out[alias[i]] = [key] + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } - for (k = 0; k < len; k++) { - if (i !== k) prev.push(alias[k]) + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); } } } - - return out } -const parseDefault = function(aliases, defaults) { - let out = {}, - key, - alias, - value, - len, - i - - for (key in defaults) { - value = defaults[key] - alias = aliases[key] +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} - out[key] = value +var normalize = pathModule.normalize; - if (alias === undefined) { - aliases[key] = EMPTYARR - } else { - for (i = 0, len = alias.length; i < len; i++) { - out[alias[i]] = value - } - } - } +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} - return out +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; } -const parseOptions = function(aliases, options, value) { - let out = {}, - key, - alias, - len, - end, - i, - k +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); - if (options !== undefined) { - for (i = 0, len = options.length; i < len; i++) { - key = options[i] - alias = aliases[key] + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } - out[key] = value + var original = p, + seenLinks = {}, + knownHard = {}; - if (alias === undefined) { - aliases[key] = EMPTYARR - } else { - for (k = 0, end = alias.length; k < end; k++) { - out[alias[k]] = value - } - } - } - } + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; - return out -} + start(); -const write = function(out, key, value, aliases, unknown) { - let i, - prev, - alias = aliases[key], - len = alias === undefined ? -1 : alias.length - - if (len >= 0 || unknown === undefined || unknown(key)) { - prev = out[key] - - if (prev === undefined) { - out[key] = value - } else { - if (isArray(prev)) { - prev.push(value) - } else { - out[key] = [prev, value] - } - } + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; - for (i = 0; i < len; i++) { - out[alias[i]] = out[key] + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; } } -} -const getopts = function(argv, opts) { - let unknown = (opts = opts || {}).unknown, - aliases = parseAlias(opts.alias), - strings = parseOptions(aliases, opts.string, ""), - values = parseDefault(aliases, opts.default), - bools = parseOptions(aliases, opts.boolean, false), - stopEarly = opts.stopEarly, - _ = [], - out = { _ }, - i = 0, - k = 0, - len = argv.length, - key, - arg, - end, - match, - value + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; - for (; i < len; i++) { - arg = argv[i] + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } - if (arg[0] !== "-" || arg === "-") { - if (stopEarly) while (i < len) _.push(argv[i++]) - else _.push(arg) - } else if (arg === "--") { - while (++i < len) _.push(argv[i]) - } else if (arg[1] === "-") { - end = arg.indexOf("=", 2) - if (arg[2] === "n" && arg[3] === "o" && arg[4] === "-") { - key = arg.slice(5, end >= 0 ? end : undefined) - value = false - } else if (end >= 0) { - key = arg.slice(2, end) - value = - bools[key] !== undefined || - (strings[key] === undefined - ? parseValue(arg.slice(end + 1)) - : arg.slice(end + 1)) - } else { - key = arg.slice(2) - value = - bools[key] !== undefined || - (len === i + 1 || argv[i + 1][0] === "-" - ? strings[key] === undefined - ? true - : "" - : strings[key] === undefined - ? parseValue(argv[++i]) - : argv[++i]) - } - write(out, key, value, aliases, unknown) + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; } else { - SHORTSPLIT.lastIndex = 2 - match = SHORTSPLIT.exec(arg) - end = match.index - value = match[0] + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } - for (k = 1; k < end; k++) { - write( - out, - (key = arg[k]), - k + 1 < end - ? strings[key] === undefined || - arg.substring(k + 1, (k = end)) + value - : value === "" - ? len === i + 1 || argv[i + 1][0] === "-" - ? strings[key] === undefined || "" - : bools[key] !== undefined || - (strings[key] === undefined ? parseValue(argv[++i]) : argv[++i]) - : bools[key] !== undefined || - (strings[key] === undefined ? parseValue(value) : value), - aliases, - unknown - ) + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } - for (key in values) if (out[key] === undefined) out[key] = values[key] - for (key in bools) if (out[key] === undefined) out[key] = false - for (key in strings) if (out[key] === undefined) out[key] = "" + if (cache) cache[original] = p; - return out -} + return p; +}; -module.exports = getopts +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } -/***/ }), + // make p is absolute + p = pathModule.resolve(p); -/***/ "../../node_modules/git-hooks-list/index.json": -/***/ (function(module) { + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } -module.exports = JSON.parse("[\"applypatch-msg\",\"pre-applypatch\",\"post-applypatch\",\"pre-commit\",\"pre-merge-commit\",\"prepare-commit-msg\",\"commit-msg\",\"post-commit\",\"pre-rebase\",\"post-checkout\",\"post-merge\",\"pre-push\",\"pre-receive\",\"update\",\"post-receive\",\"post-update\",\"push-to-checkout\",\"pre-auto-gc\",\"post-rewrite\",\"sendemail-validate\",\"fsmonitor-watchman\",\"p4-pre-submit\",\"post-index-change\"]"); + var original = p, + seenLinks = {}, + knownHard = {}; -/***/ }), + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; -/***/ "../../node_modules/glob-parent/index.js": -/***/ (function(module, exports, __webpack_require__) { + start(); -"use strict"; + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } -var isGlob = __webpack_require__("../../node_modules/is-glob/index.js"); -var pathPosixDirname = __webpack_require__("path").posix.dirname; -var isWin32 = __webpack_require__("os").platform() === 'win32'; + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } -var slash = '/'; -var backslash = /\\/g; -var enclosure = /[\{\[].*[\}\]]$/; -var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; -var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; -/** - * @param {string} str - * @param {Object} opts - * @param {boolean} [opts.flipBackslashes=true] - * @returns {string} - */ -module.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } - // flip windows path separators - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } - // special case for strings ending in enclosure containing path separator - if (enclosure.test(str)) { - str += slash; + return fs.lstat(base, gotStat); } - // preserves full path in case of trailing path separator - str += 'a'; + function gotStat(err, stat) { + if (err) return cb(err); - // remove path parts that are globby - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } - // remove escape chars and return result - return str.replace(escaped, '$1'); + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } }; /***/ }), -/***/ "../../node_modules/glob/common.js": +/***/ "../../node_modules/function-bind/implementation.js": /***/ (function(module, exports, __webpack_require__) { -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var fs = __webpack_require__("fs") -var path = __webpack_require__("path") -var minimatch = __webpack_require__("../../node_modules/minimatch/minimatch.js") -var isAbsolute = __webpack_require__("../../node_modules/path-is-absolute/index.js") -var Minimatch = minimatch.Minimatch +"use strict"; -function alphasort (a, b) { - return a.localeCompare(b, 'en') -} -function setupIgnores (self, options) { - self.ignore = options.ignore || [] +/* eslint no-invalid-this: 1 */ - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } -function setopts (self, pattern, options) { - if (!options) - options = {} + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; } - pattern = "**/" + pattern - } - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs + return bound; +}; - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - setupIgnores(self, options) +/***/ }), - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } +/***/ "../../node_modules/function-bind/index.js": +/***/ (function(module, exports, __webpack_require__) { - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") +"use strict"; - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true +var implementation = __webpack_require__("../../node_modules/function-bind/implementation.js"); - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} +module.exports = Function.prototype.bind || implementation; -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } +/***/ }), - if (!nou) - all = Object.keys(all) +/***/ "../../node_modules/get-stream/buffer-stream.js": +/***/ (function(module, exports, __webpack_require__) { - if (!self.nosort) - all = all.sort(alphasort) +"use strict"; - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } +const {PassThrough: PassThroughStream} = __webpack_require__("stream"); - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) +module.exports = options => { + options = {...options}; - self.found = all -} + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } + if (isBuffer) { + encoding = null; + } - return m -} + const stream = new PassThroughStream({objectMode}); -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } + if (encoding) { + stream.setEncoding(encoding); + } - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') + let length = 0; + const chunks = []; - return abs -} + stream.on('data', chunk => { + chunks.push(chunk); + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false + stream.getBufferedValue = () => { + if (array) { + return chunks; + } - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false + stream.getBufferedLength = () => length; - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} + return stream; +}; /***/ }), -/***/ "../../node_modules/glob/glob.js": +/***/ "../../node_modules/get-stream/index.js": /***/ (function(module, exports, __webpack_require__) { -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = __webpack_require__("../../node_modules/fs.realpath/index.js") -var minimatch = __webpack_require__("../../node_modules/minimatch/minimatch.js") -var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__("../../node_modules/inherits/inherits.js") -var EE = __webpack_require__("events").EventEmitter -var path = __webpack_require__("path") -var assert = __webpack_require__("assert") -var isAbsolute = __webpack_require__("../../node_modules/path-is-absolute/index.js") -var globSync = __webpack_require__("../../node_modules/glob/sync.js") -var common = __webpack_require__("../../node_modules/glob/common.js") -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __webpack_require__("../../node_modules/inflight/inflight.js") -var util = __webpack_require__("util") -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = __webpack_require__("../../node_modules/once/once.js") - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} +"use strict"; - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } +const pump = __webpack_require__("../../node_modules/pump/index.js"); +const bufferStream = __webpack_require__("../../node_modules/get-stream/buffer-stream.js"); - return new Glob(pattern, options, cb) +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } } -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob +async function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } + options = { + maxBuffer: Infinity, + ...options + }; - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} + const {maxBuffer} = options; -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true + let stream; + await new Promise((resolve, reject) => { + const rejectPromise = error => { + if (error) { // A null check + error.bufferedData = stream.getBufferedValue(); + } - var g = new Glob(pattern, options) - var set = g.minimatch.set + reject(error); + }; - if (!pattern) - return false + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } - if (set.length > 1) - return true + resolve(); + }); - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); - return false + return stream.getBufferedValue(); } -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } +module.exports = getStream; +// TODO: Remove this for the next major release +module.exports.default = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) +/***/ }), - setopts(this, pattern, options) - this._didRealPath = false +/***/ "../../node_modules/getopts/index.js": +/***/ (function(module, exports, __webpack_require__) { - // process each pattern in the minimatch set - var n = this.minimatch.set.length +"use strict"; - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 +const EMPTYARR = [] +const SHORTSPLIT = /$|[!-@[-`{-~][\s\S]*/g +const isArray = Array.isArray - this._emitQueue = [] - this._processQueue = [] - this.paused = false +const parseValue = function(any) { + if (any === "") return "" + if (any === "false") return false + const maybe = Number(any) + return maybe * 0 === 0 ? maybe : any +} - if (this.noprocess) - return this +const parseAlias = function(aliases) { + let out = {}, + key, + alias, + prev, + len, + any, + i, + k - if (n === 0) - return done() + for (key in aliases) { + any = aliases[key] + alias = out[key] = isArray(any) ? any : [any] - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false + for (i = 0, len = alias.length; i < len; i++) { + prev = out[alias[i]] = [key] - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() + for (k = 0; k < len; k++) { + if (i !== k) prev.push(alias[k]) } } } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - common.finish(this) - this.emit('end', this.found) + return out } -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true +const parseDefault = function(aliases, defaults) { + let out = {}, + key, + alias, + value, + len, + i - var n = this.matches.length - if (n === 0) - return this._finish() + for (key in defaults) { + value = defaults[key] + alias = aliases[key] - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) + out[key] = value - function next () { - if (--n === 0) - self._finish() + if (alias === undefined) { + aliases[key] = EMPTYARR + } else { + for (i = 0, len = alias.length; i < len; i++) { + out[alias[i]] = value + } + } } -} -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() + return out +} - var found = Object.keys(matchset) - var self = this - var n = found.length +const parseOptions = function(aliases, options, value) { + let out = {}, + key, + alias, + len, + end, + i, + k - if (n === 0) - return cb() + if (options !== undefined) { + for (i = 0, len = options.length; i < len; i++) { + key = options[i] + alias = aliases[key] - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here + out[key] = value - if (--n === 0) { - self.matches[index] = set - cb() + if (alias === undefined) { + aliases[key] = EMPTYARR + } else { + for (k = 0, end = alias.length; k < end; k++) { + out[alias[k]] = value + } } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} + } + } -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) + return out } -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} +const write = function(out, key, value, aliases, unknown) { + let i, + prev, + alias = aliases[key], + len = alias === undefined ? -1 : alias.length -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} + if (len >= 0 || unknown === undefined || unknown(key)) { + prev = out[key] -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) + if (prev === undefined) { + out[key] = value + } else { + if (isArray(prev)) { + prev.push(value) + } else { + out[key] = [prev, value] } } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } + + for (i = 0; i < len; i++) { + out[alias[i]] = out[key] } } } -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return +const getopts = function(argv, opts) { + let unknown = (opts = opts || {}).unknown, + aliases = parseAlias(opts.alias), + strings = parseOptions(aliases, opts.string, ""), + values = parseDefault(aliases, opts.default), + bools = parseOptions(aliases, opts.boolean, false), + stopEarly = opts.stopEarly, + _ = [], + out = { _ }, + i = 0, + k = 0, + len = argv.length, + key, + arg, + end, + match, + value - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break + for (; i < len; i++) { + arg = argv[i] - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } + if (arg[0] !== "-" || arg === "-") { + if (stopEarly) while (i < len) _.push(argv[i++]) + else _.push(arg) + } else if (arg === "--") { + while (++i < len) _.push(argv[i]) + } else if (arg[1] === "-") { + end = arg.indexOf("=", 2) + if (arg[2] === "n" && arg[3] === "o" && arg[4] === "-") { + key = arg.slice(5, end >= 0 ? end : undefined) + value = false + } else if (end >= 0) { + key = arg.slice(2, end) + value = + bools[key] !== undefined || + (strings[key] === undefined + ? parseValue(arg.slice(end + 1)) + : arg.slice(end + 1)) + } else { + key = arg.slice(2) + value = + bools[key] !== undefined || + (len === i + 1 || argv[i + 1][0] === "-" + ? strings[key] === undefined + ? true + : "" + : strings[key] === undefined + ? parseValue(argv[++i]) + : argv[++i]) + } + write(out, key, value, aliases, unknown) + } else { + SHORTSPLIT.lastIndex = 2 + match = SHORTSPLIT.exec(arg) + end = match.index + value = match[0] - var remain = pattern.slice(n) + for (k = 1; k < end; k++) { + write( + out, + (key = arg[k]), + k + 1 < end + ? strings[key] === undefined || + arg.substring(k + 1, (k = end)) + value + : value === "" + ? len === i + 1 || argv[i + 1][0] === "-" + ? strings[key] === undefined || "" + : bools[key] !== undefined || + (strings[key] === undefined ? parseValue(argv[++i]) : argv[++i]) + : bools[key] !== undefined || + (strings[key] === undefined ? parseValue(value) : value), + aliases, + unknown + ) + } + } + } - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix + for (key in values) if (out[key] === undefined) out[key] = values[key] + for (key in bools) if (out[key] === undefined) out[key] = false + for (key in strings) if (out[key] === undefined) out[key] = "" - var abs = this._makeAbs(read) + return out +} - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() +module.exports = getopts - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} +/***/ }), -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { +/***/ "../../node_modules/git-hooks-list/index.json": +/***/ (function(module) { - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() +module.exports = JSON.parse("[\"applypatch-msg\",\"pre-applypatch\",\"post-applypatch\",\"pre-commit\",\"pre-merge-commit\",\"prepare-commit-msg\",\"commit-msg\",\"post-commit\",\"pre-rebase\",\"post-checkout\",\"post-merge\",\"pre-push\",\"pre-receive\",\"update\",\"post-receive\",\"post-update\",\"push-to-checkout\",\"pre-auto-gc\",\"post-rewrite\",\"sendemail-validate\",\"fsmonitor-watchman\",\"p4-pre-submit\",\"post-index-change\"]"); - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' +/***/ }), - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } +/***/ "../../node_modules/glob-parent/index.js": +/***/ (function(module, exports, __webpack_require__) { - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) +"use strict"; - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. +var isGlob = __webpack_require__("../../node_modules/is-glob/index.js"); +var pathPosixDirname = __webpack_require__("path").posix.dirname; +var isWin32 = __webpack_require__("os").platform() === 'win32'; - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); } - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - if (isIgnored(this, e)) - return + // preserves full path in case of trailing path separator + str += 'a'; - if (this.paused) { - this._emitQueue.push([index, e]) - return - } + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); - var abs = isAbsolute(e) ? e : this._makeAbs(e) + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; - if (this.mark) - e = this._mark(e) - if (this.absolute) - e = abs +/***/ }), - if (this.matches[index][e]) - return +/***/ "../../node_modules/glob/common.js": +/***/ (function(module, exports, __webpack_require__) { - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored - this.matches[index][e] = true +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) +var fs = __webpack_require__("fs") +var path = __webpack_require__("path") +var minimatch = __webpack_require__("../../node_modules/minimatch/minimatch.js") +var isAbsolute = __webpack_require__("../../node_modules/path-is-absolute/index.js") +var Minimatch = minimatch.Minimatch - this.emit('match', e) +function alphasort (a, b) { + return a.localeCompare(b, 'en') } -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return +function setupIgnores (self, options) { + self.ignore = options.ignore || [] - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - self.fs.lstat(abs, lstatcb) + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher } } -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return +function setopts (self, pattern, options) { + if (!options) + options = {} - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) - if (Array.isArray(c)) - return cb(null, c) + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd } - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options } -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) else - e = abs + '/' + e - this.cache[e] = true + m.forEach(function (m) { + all[m] = true + }) } } - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break + if (!nou) + all = Object.keys(all) - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break + if (!self.nosort) + all = all.sort(alphasort) - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } } - return cb() -} + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) + self.found = all } +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) + return m +} - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) } if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + abs = abs.replace(/\\/g, '/') - // Mark this as a match - this._emitMatch(index, prefix) - cb() + return abs } -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) } -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false - return cb(null, c, stat) + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) } /***/ }), -/***/ "../../node_modules/glob/sync.js": +/***/ "../../node_modules/glob/glob.js": /***/ (function(module, exports, __webpack_require__) { -module.exports = globSync -globSync.GlobSync = GlobSync +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob var rp = __webpack_require__("../../node_modules/fs.realpath/index.js") var minimatch = __webpack_require__("../../node_modules/minimatch/minimatch.js") var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__("../../node_modules/glob/glob.js").Glob -var util = __webpack_require__("util") +var inherits = __webpack_require__("../../node_modules/inherits/inherits.js") +var EE = __webpack_require__("events").EventEmitter var path = __webpack_require__("path") var assert = __webpack_require__("assert") var isAbsolute = __webpack_require__("../../node_modules/path-is-absolute/index.js") +var globSync = __webpack_require__("../../node_modules/glob/sync.js") var common = __webpack_require__("../../node_modules/glob/common.js") var setopts = common.setopts var ownProp = common.ownProp +var inflight = __webpack_require__("../../node_modules/inflight/inflight.js") +var util = __webpack_require__("util") var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} +var once = __webpack_require__("../../node_modules/once/once.js") -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) + return new Glob(pattern, options, cb) +} - setopts(this, pattern, options) +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync - if (this.noprocess) - return this +// old api surface +glob.glob = glob - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin } - this._finish() -} -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) }) } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + common.finish(this) + this.emit('end', this.found) } +Glob.prototype._realpath = function () { + if (this._didRealpath) + return -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 @@ -31105,12 +30544,12 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { } // now n is the index of the first one that is *not* a string. - // See if there's anything else + // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: - this._processSimple(pattern.join('/'), index) + this._processSimple(pattern.join('/'), index, cb) return case 0: @@ -31142,24 +30581,29 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { var abs = this._makeAbs(read) - //if ignored, skip processing + //if ignored, skip _processing if (childrenIgnored(this, read)) - return + return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) - return + return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. @@ -31183,10 +30627,12 @@ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, } } + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) - return + return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or @@ -31200,7 +30646,7 @@ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { - if (prefix.slice(-1) !== '/') + if (prefix !== '/') e = prefix + '/' + e else e = prefix + e @@ -31212,7 +30658,7 @@ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, this._emitMatch(index, e) } // This was the last one, and no stats were needed - return + return cb() } // now test all matched entries as stand-ins for that part @@ -31221,27 +30667,36 @@ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) } + cb() } +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return -GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return - var abs = this._makeAbs(e) + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) - if (this.absolute) { + if (this.absolute) e = abs - } if (this.matches[index][e]) return @@ -31254,66 +30709,84 @@ GlobSync.prototype._emitMatch = function (index, e) { this.matches[index][e] = true - if (this.stat) - this._stat(e) + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) } +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return -GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) - return this._readdir(abs, false) + return this._readdir(abs, false, cb) - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym + if (lstatcb) + self.fs.lstat(abs, lstatcb) - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() - return entries + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } } -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) + return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') - return null + return cb() if (Array.isArray(c)) - return c + return cb(null, c) } - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) } } -GlobSync.prototype._readdirEntries = function (abs, entries) { +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. @@ -31329,12 +30802,13 @@ GlobSync.prototype._readdirEntries = function (abs, entries) { } this.cache[abs] = entries - - // mark and cache dir-ness - return entries + return cb(null, entries) } -GlobSync.prototype._readdirError = function (f, er) { +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 @@ -31345,7 +30819,8 @@ GlobSync.prototype._readdirError = function (f, er) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code - throw error + this.emit('error', error) + this.abort() } break @@ -31358,22 +30833,35 @@ GlobSync.prototype._readdirError = function (f, er) { default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } if (!this.silent) console.error('glob error', er) break } + + return cb() } -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} - var entries = this._readdir(abs, inGlobStar) + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) - return + return cb() // test without the globstar, and with every child both below // and replacing the globstar. @@ -31382,14 +30870,14 @@ GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) + this._process(noGlobStar, index, false, cb) - var len = entries.length var isSym = this.symlinks[abs] + var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) - return + return cb() for (var i = 0; i < len; i++) { var e = entries[i] @@ -31398,24 +30886,33 @@ GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) + this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) - this._process(below, index, true) + this._process(below, index, true, cb) } + + cb() } -GlobSync.prototype._processSimple = function (prefix, index) { +Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? - var exists = this._stat(prefix) + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) - return + return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) @@ -31433,15 +30930,16 @@ GlobSync.prototype._processSimple = function (prefix, index) { // Mark this as a match this._emitMatch(index, prefix) + cb() } // Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { +Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) - return false + return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] @@ -31451,10 +30949,10 @@ GlobSync.prototype._stat = function (f) { // It exists, but maybe not how we need it if (!needDir || c === 'DIR') - return c + return cb(null, c) if (needDir && c === 'FILE') - return false + return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. @@ -31462,2028 +30960,868 @@ GlobSync.prototype._stat = function (f) { var exists var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat - } + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) } else { - stat = lstat + self._stat2(f, abs, er, lstat, cb) } } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + var needDir = f.slice(-1) === '/' this.statCache[abs] = stat + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') - return false + return cb() - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) + return cb(null, c, stat) } /***/ }), -/***/ "../../node_modules/globby/gitignore.js": +/***/ "../../node_modules/glob/sync.js": /***/ (function(module, exports, __webpack_require__) { -"use strict"; +module.exports = globSync +globSync.GlobSync = GlobSync -const {promisify} = __webpack_require__("util"); -const fs = __webpack_require__("fs"); -const path = __webpack_require__("path"); -const fastGlob = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/index.js"); -const gitIgnore = __webpack_require__("../../node_modules/ignore/index.js"); -const slash = __webpack_require__("../../node_modules/slash/index.js"); +var rp = __webpack_require__("../../node_modules/fs.realpath/index.js") +var minimatch = __webpack_require__("../../node_modules/minimatch/minimatch.js") +var Minimatch = minimatch.Minimatch +var Glob = __webpack_require__("../../node_modules/glob/glob.js").Glob +var util = __webpack_require__("util") +var path = __webpack_require__("path") +var assert = __webpack_require__("assert") +var isAbsolute = __webpack_require__("../../node_modules/path-is-absolute/index.js") +var common = __webpack_require__("../../node_modules/glob/common.js") +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored -const DEFAULT_IGNORE = [ - '**/node_modules/**', - '**/flow-typed/**', - '**/coverage/**', - '**/.git' -]; +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') -const readFileP = promisify(fs.readFile); + return new GlobSync(pattern, options).found +} -const mapGitIgnorePatternTo = base => ignore => { - if (ignore.startsWith('!')) { - return '!' + path.posix.join(base, ignore.slice(1)); - } +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') - return path.posix.join(base, ignore); -}; + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') -const parseGitIgnore = (content, options) => { - const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) - return content - .split(/\r?\n/) - .filter(Boolean) - .filter(line => !line.startsWith('#')) - .map(mapGitIgnorePatternTo(base)); -}; + setopts(this, pattern, options) -const reduceIgnore = files => { - const ignores = gitIgnore(); - for (const file of files) { - ignores.add(parseGitIgnore(file.content, { - cwd: file.cwd, - fileName: file.filePath - })); - } + if (this.noprocess) + return this - return ignores; -}; + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} -const ensureAbsolutePathForCwd = (cwd, p) => { - cwd = slash(cwd); - if (path.isAbsolute(p)) { - if (slash(p).startsWith(cwd)) { - return p; - } +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} - throw new Error(`Path ${p} is not in cwd ${cwd}`); - } - return path.join(cwd, p); -}; +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) -const getIsIgnoredPredecate = (ignores, cwd) => { - return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p)))); -}; + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. -const getFile = async (file, cwd) => { - const filePath = path.join(cwd, file); - const content = await readFileP(filePath, 'utf8'); + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return - return { - cwd, - filePath, - content - }; -}; + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break -const getFileSync = (file, cwd) => { - const filePath = path.join(cwd, file); - const content = fs.readFileSync(filePath, 'utf8'); + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } - return { - cwd, - filePath, - content - }; -}; + var remain = pattern.slice(n) -const normalizeOptions = ({ - ignore = [], - cwd = slash(process.cwd()) -} = {}) => { - return {ignore, cwd}; -}; + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix -module.exports = async options => { - options = normalizeOptions(options); + var abs = this._makeAbs(read) - const paths = await fastGlob('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), - cwd: options.cwd - }); + //if ignored, skip processing + if (childrenIgnored(this, read)) + return - const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); - const ignores = reduceIgnore(files); + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} - return getIsIgnoredPredecate(ignores, options.cwd); -}; -module.exports.sync = options => { - options = normalizeOptions(options); +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) - const paths = fastGlob.sync('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), - cwd: options.cwd - }); + // if the abs isn't a dir, then nothing can match! + if (!entries) + return - const files = paths.map(file => getFileSync(file, options.cwd)); - const ignores = reduceIgnore(files); + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' - return getIsIgnoredPredecate(ignores, options.cwd); -}; + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return -/***/ }), + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. -/***/ "../../node_modules/globby/index.js": -/***/ (function(module, exports, __webpack_require__) { + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) -"use strict"; + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } -const fs = __webpack_require__("fs"); -const arrayUnion = __webpack_require__("../../node_modules/array-union/index.js"); -const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); -const fastGlob = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/index.js"); -const dirGlob = __webpack_require__("../../node_modules/dir-glob/index.js"); -const gitignore = __webpack_require__("../../node_modules/globby/gitignore.js"); -const {FilterStream, UniqueStream} = __webpack_require__("../../node_modules/globby/stream-utils.js"); + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } -const DEFAULT_FILTER = () => false; + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} -const isNegative = pattern => pattern[0] === '!'; -const assertPatternsInput = patterns => { - if (!patterns.every(pattern => typeof pattern === 'string')) { - throw new TypeError('Patterns must be a string or an array of strings'); - } -}; +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return -const checkCwdOption = (options = {}) => { - if (!options.cwd) { - return; - } + var abs = this._makeAbs(e) - let stat; - try { - stat = fs.statSync(options.cwd); - } catch { - return; - } + if (this.mark) + e = this._mark(e) - if (!stat.isDirectory()) { - throw new Error('The `cwd` option must be a path to a directory'); - } -}; + if (this.absolute) { + e = abs + } -const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; + if (this.matches[index][e]) + return -const generateGlobTasks = (patterns, taskOptions) => { - patterns = arrayUnion([].concat(patterns)); - assertPatternsInput(patterns); - checkCwdOption(taskOptions); + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } - const globTasks = []; + this.matches[index][e] = true - taskOptions = { - ignore: [], - expandDirectories: true, - ...taskOptions - }; + if (this.stat) + this._stat(e) +} - for (const [index, pattern] of patterns.entries()) { - if (isNegative(pattern)) { - continue; - } - const ignore = patterns - .slice(index) - .filter(pattern => isNegative(pattern)) - .map(pattern => pattern.slice(1)); +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) - const options = { - ...taskOptions, - ignore: taskOptions.ignore.concat(ignore) - }; + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } - globTasks.push({pattern, options}); - } + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym - return globTasks; -}; + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) -const globDirs = (task, fn) => { - let options = {}; - if (task.options.cwd) { - options.cwd = task.options.cwd; - } + return entries +} - if (Array.isArray(task.options.expandDirectories)) { - options = { - ...options, - files: task.options.expandDirectories - }; - } else if (typeof task.options.expandDirectories === 'object') { - options = { - ...options, - ...task.options.expandDirectories - }; - } +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries - return fn(task.pattern, options); -}; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) -const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern]; + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null -const getFilterSync = options => { - return options && options.gitignore ? - gitignore.sync({cwd: options.cwd, ignore: options.ignore}) : - DEFAULT_FILTER; -}; + if (Array.isArray(c)) + return c + } -const globToTask = task => glob => { - const {options} = task; - if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { - options.ignore = dirGlob.sync(options.ignore); - } + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} - return { - pattern: glob, - options - }; -}; +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } -module.exports = async (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); + this.cache[abs] = entries - const getFilter = async () => { - return options && options.gitignore ? - gitignore({cwd: options.cwd, ignore: options.ignore}) : - DEFAULT_FILTER; - }; + // mark and cache dir-ness + return entries +} - const getTasks = async () => { - const tasks = await Promise.all(globTasks.map(async task => { - const globs = await getPattern(task, dirGlob); - return Promise.all(globs.map(globToTask(task))); - })); +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break - return arrayUnion(...tasks); - }; + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break - const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); - const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} - return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); -}; +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { -module.exports.sync = (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); + var entries = this._readdir(abs, inGlobStar) - const tasks = []; - for (const task of globTasks) { - const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - tasks.push(...newTask); - } + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return - const filter = getFilterSync(options); + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) - let matches = []; - for (const task of tasks) { - matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options)); - } - - return matches.filter(path_ => !filter(path_)); -}; - -module.exports.stream = (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); - - const tasks = []; - for (const task of globTasks) { - const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - tasks.push(...newTask); - } - - const filter = getFilterSync(options); - const filterStream = new FilterStream(p => !filter(p)); - const uniqueStream = new UniqueStream(); - - return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))) - .pipe(filterStream) - .pipe(uniqueStream); -}; - -module.exports.generateGlobTasks = generateGlobTasks; - -module.exports.hasMagic = (patterns, options) => [] - .concat(patterns) - .some(pattern => fastGlob.isDynamicPattern(pattern, options)); - -module.exports.gitignore = gitignore; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/index.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const taskManager = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/managers/tasks.js"); -const async_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/async.js"); -const stream_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/stream.js"); -const sync_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/sync.js"); -const settings_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/settings.js"); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); -} -// https://github.com/typescript-eslint/typescript-eslint/issues/60 -// eslint-disable-next-line no-redeclare -(function (FastGlob) { - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - FastGlob.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - /** - * The stream returned by the provider cannot work with an asynchronous iterator. - * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. - * This affects performance (+25%). I don't see best solution right now. - */ - return utils.stream.merge(works); - } - FastGlob.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = [].concat(source); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - FastGlob.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - FastGlob.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - FastGlob.escapePath = escapePath; -})(FastGlob || (FastGlob = {})); -function getWorks(source, _Provider, options) { - const patterns = [].concat(source); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); -} -function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError('Patterns must be a string (non empty) or an array of strings'); - } -} -module.exports = FastGlob; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/managers/tasks.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -function generate(patterns, settings) { - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); -} -exports.generate = generate; -/** - * Returns tasks grouped by basic pattern directories. - * - * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. - * This is necessary because directory traversal starts at the base directory and goes deeper. - */ -function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - /* - * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory - * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. - */ - if ('.' in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); - } - else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - return tasks; -} -exports.convertPatternsToTasks = convertPatternsToTasks; -function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); -} -exports.getPositivePatterns = getPositivePatterns; -function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; -} -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, group); -} -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; -} -exports.convertPatternGroupToTask = convertPatternGroupToTask; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/async.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/readers/stream.js"); -const provider_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/provider.js"); -class ProviderAsync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = []; - return new Promise((resolve, reject) => { - const stream = this.api(root, task, options); - stream.once('error', reject); - stream.on('data', (entry) => entries.push(options.transform(entry))); - stream.once('end', () => resolve(entries)); - }); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderAsync; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/filters/deep.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -const partial_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/matchers/partial.js"); -class DeepFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - /** - * Avoid unnecessary depth calculations when it doesn't matter. - */ - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split('/').length; - if (basePath === '') { - return entryPathDepth; - } - const basePathDepth = basePath.split('/').length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } -} -exports.default = DeepFilter; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/filters/entry.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -class EntryFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = new Map(); - } - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); - return (entry) => this._filter(entry, positiveRe, negativeRe); - } - _filter(entry, positiveRe, negativeRe) { - if (this._settings.unique && this._isDuplicateEntry(entry)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { - return false; - } - const filepath = this._settings.baseNameMatch ? entry.name : entry.path; - const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); - if (this._settings.unique && isMatched) { - this._createIndexRecord(entry); - } - return isMatched; - } - _isDuplicateEntry(entry) { - return this.index.has(entry.path); - } - _createIndexRecord(entry) { - this.index.set(entry.path, undefined); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - _isMatchToPatterns(entryPath, patternsRe) { - const filepath = utils.path.removeLeadingDotSegment(entryPath); - return utils.pattern.matchAny(filepath, patternsRe); - } -} -exports.default = EntryFilter; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/filters/error.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -class ErrorFilter { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error) => this._isNonFatalError(error); - } - _isNonFatalError(error) { - return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; - } -} -exports.default = ErrorFilter; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/matchers/matcher.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -class Matcher { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - /** - * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). - * So, before expand patterns with brace expansion into separated patterns. - */ - const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); - for (const pattern of patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } -} -exports.default = Matcher; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/matchers/partial.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const matcher_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/matchers/matcher.js"); -class PartialMatcher extends matcher_1.default { - match(filepath) { - const parts = filepath.split('/'); - const levels = parts.length; - const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - /** - * In this case, the pattern has a globstar and we must read all directories unconditionally, - * but only if the level has reached the end of the first group. - * - * fixtures/{a,b}/** - * ^ true/false ^ always true - */ - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; - } -} -exports.default = PartialMatcher; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/provider.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const path = __webpack_require__("path"); -const deep_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/filters/deep.js"); -const entry_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/filters/entry.js"); -const error_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/filters/error.js"); -const entry_2 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/transformers/entry.js"); -class Provider { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === '.' ? '' : task.base; - return { - basePath, - pathSegmentSeparator: '/', - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } -} -exports.default = Provider; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/stream.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__("stream"); -const stream_2 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/readers/stream.js"); -const provider_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/provider.js"); -class ProviderStream extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); - source - .once('error', (error) => destination.emit('error', error)) - .on('data', (entry) => destination.emit('data', options.transform(entry))) - .once('end', () => destination.emit('end')); - destination - .once('close', () => source.destroy()); - return destination; - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderStream; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/sync.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/readers/sync.js"); -const provider_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/providers/provider.js"); -class ProviderSync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderSync; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/providers/transformers/entry.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -class EntryTransformer { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += '/'; - } - if (!this._settings.objectMode) { - return filepath; - } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } -} -exports.default = EntryTransformer; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/readers/reader.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const path = __webpack_require__("path"); -const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); -const utils = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/index.js"); -class Reader { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error) { - return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; - } -} -exports.default = Reader; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/readers/stream.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = __webpack_require__("stream"); -const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); -const fsWalk = __webpack_require__("../../node_modules/@nodelib/fs.walk/out/index.js"); -const reader_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/readers/reader.js"); -class ReaderStream extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options) - .then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }) - .catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath) - .then((stats) => this._makeEntry(stats, pattern)) - .catch((error) => { - if (options.errorFilter(error)) { - return null; - } - throw error; - }); - } - _getStat(filepath) { - return new Promise((resolve, reject) => { - this._stat(filepath, this._fsStatSettings, (error, stats) => { - return error === null ? resolve(stats) : reject(error); - }); - }); - } -} -exports.default = ReaderStream; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/readers/sync.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -const fsStat = __webpack_require__("../../node_modules/@nodelib/fs.stat/out/index.js"); -const fsWalk = __webpack_require__("../../node_modules/@nodelib/fs.walk/out/index.js"); -const reader_1 = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/readers/reader.js"); -class ReaderSync extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } - catch (error) { - if (options.errorFilter(error)) { - return null; - } - throw error; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } -} -exports.default = ReaderSync; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/settings.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; -const fs = __webpack_require__("fs"); -const os = __webpack_require__("os"); -/** - * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. - * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 - */ -const CPU_COUNT = Math.max(os.cpus().length, 1); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - lstatSync: fs.lstatSync, - stat: fs.stat, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -class Settings { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - } - _getValue(option, value) { - return option === undefined ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } -} -exports.default = Settings; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/array.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.splitWhen = exports.flatten = void 0; -function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); -} -exports.flatten = flatten; -function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } - else { - result[groupIndex].push(item); - } - } - return result; -} -exports.splitWhen = splitWhen; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/errno.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEnoentCodeError = void 0; -function isEnoentCodeError(error) { - return error.code === 'ENOENT'; -} -exports.isEnoentCodeError = isEnoentCodeError; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/fs.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/index.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; -const array = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/array.js"); -exports.array = array; -const errno = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/errno.js"); -exports.errno = errno; -const fs = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/fs.js"); -exports.fs = fs; -const path = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/path.js"); -exports.path = path; -const pattern = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/pattern.js"); -exports.pattern = pattern; -const stream = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/stream.js"); -exports.stream = stream; -const string = __webpack_require__("../../node_modules/globby/node_modules/fast-glob/out/utils/string.js"); -exports.string = string; - - -/***/ }), - -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/path.js": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; -const path = __webpack_require__("path"); -const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ -const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; -/** - * Designed to work only with simple paths: `dir\\file`. - */ -function unixify(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.unixify = unixify; -function makeAbsolute(cwd, filepath) { - return path.resolve(cwd, filepath); -} -exports.makeAbsolute = makeAbsolute; -function escape(pattern) { - return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} -exports.escape = escape; -function removeLeadingDotSegment(entry) { - // We do not use `startsWith` because this is 10x slower than current implementation for some cases. - // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - if (entry.charAt(0) === '.') { - const secondCharactery = entry.charAt(1); - if (secondCharactery === '/' || secondCharactery === '\\') { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } - } - return entry; -} -exports.removeLeadingDotSegment = removeLeadingDotSegment; - - -/***/ }), + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/pattern.js": -/***/ (function(module, exports, __webpack_require__) { + var len = entries.length + var isSym = this.symlinks[abs] -"use strict"; + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return -Object.defineProperty(exports, "__esModule", { value: true }); -exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; -const path = __webpack_require__("path"); -const globParent = __webpack_require__("../../node_modules/glob-parent/index.js"); -const micromatch = __webpack_require__("../../node_modules/globby/node_modules/micromatch/index.js"); -const GLOBSTAR = '**'; -const ESCAPE_SYMBOL = '\\'; -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/; -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/; -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/; -const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/; -function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); -} -exports.isStaticPattern = isStaticPattern; -function isDynamicPattern(pattern, options = {}) { - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false; - } - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) { - return true; - } - return false; -} -exports.isDynamicPattern = isDynamicPattern; -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Returns patterns that can be applied inside the current directory. - * - * @example - * // ['./*', '*', 'a/*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); -} -exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; -/** - * Returns patterns to be expanded relative to (outside) the current directory. - * - * @example - * // ['../*', './../*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); -} -exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; -function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith('..') || pattern.startsWith('./..'); -} -exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; -function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); -} -exports.getBaseDirectory = getBaseDirectory; -function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); -} -exports.hasGlobStar = hasGlobStar; -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -function isAffectDepthOfReadingPattern(pattern) { - const basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); -} -exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; -function expandBraceExpansion(pattern) { - return micromatch.braces(pattern, { - expand: true, - nodupes: true - }); -} -exports.expandBraceExpansion = expandBraceExpansion; -function getPatternParts(pattern, options) { - let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - /** - * The scan method returns an empty array in some cases. - * See micromatch/picomatch#58 for more details. - */ - if (parts.length === 0) { - parts = [pattern]; - } - /** - * The scan method does not return an empty part for the pattern with a forward slash. - * This is another part of micromatch/picomatch#58. - */ - if (parts[0].startsWith('/')) { - parts[0] = parts[0].slice(1); - parts.unshift(''); - } - return parts; -} -exports.getPatternParts = getPatternParts; -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); -} -exports.convertPatternsToRe = convertPatternsToRe; -function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } } -exports.matchAny = matchAny; +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) -/***/ }), + if (!this.matches[index]) + this.matches[index] = Object.create(null) -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/stream.js": -/***/ (function(module, exports, __webpack_require__) { + // If it doesn't exist, then just mark the lack of results + if (!exists) + return -"use strict"; + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } -Object.defineProperty(exports, "__esModule", { value: true }); -exports.merge = void 0; -const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); -function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once('error', (error) => mergedStream.emit('error', error)); - }); - mergedStream.once('close', () => propagateCloseEventToSources(streams)); - mergedStream.once('end', () => propagateCloseEventToSources(streams)); - return mergedStream; -} -exports.merge = merge; -function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit('close')); + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) } +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' -/***/ }), + if (f.length > this.maxLength) + return false -/***/ "../../node_modules/globby/node_modules/fast-glob/out/utils/string.js": -/***/ (function(module, exports, __webpack_require__) { + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] -"use strict"; + if (Array.isArray(c)) + c = 'DIR' -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEmpty = exports.isString = void 0; -function isString(input) { - return typeof input === 'string'; + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c } -exports.isString = isString; -function isEmpty(input) { - return input === ''; + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) } -exports.isEmpty = isEmpty; /***/ }), -/***/ "../../node_modules/globby/node_modules/micromatch/index.js": +/***/ "../../node_modules/globby/gitignore.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; +const {promisify} = __webpack_require__("util"); +const fs = __webpack_require__("fs"); +const path = __webpack_require__("path"); +const fastGlob = __webpack_require__("../../node_modules/fast-glob/out/index.js"); +const gitIgnore = __webpack_require__("../../node_modules/ignore/index.js"); +const slash = __webpack_require__("../../node_modules/slash/index.js"); -const util = __webpack_require__("util"); -const braces = __webpack_require__("../../node_modules/braces/index.js"); -const picomatch = __webpack_require__("../../node_modules/picomatch/index.js"); -const utils = __webpack_require__("../../node_modules/picomatch/lib/utils.js"); -const isEmptyString = val => val === '' || val === './'; +const DEFAULT_IGNORE = [ + '**/node_modules/**', + '**/flow-typed/**', + '**/coverage/**', + '**/.git' +]; -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} `list` List of strings to match. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ +const readFileP = promisify(fs.readFile); -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); +const mapGitIgnorePatternTo = base => ignore => { + if (ignore.startsWith('!')) { + return '!' + path.posix.join(base, ignore.slice(1)); + } - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; + return path.posix.join(base, ignore); +}; - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); - } - }; +const parseGitIgnore = (content, options) => { + const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; + return content + .split(/\r?\n/) + .filter(Boolean) + .filter(line => !line.startsWith('#')) + .map(mapGitIgnorePatternTo(base)); +}; - for (let item of list) { - let matched = isMatch(item, true); +const reduceIgnore = files => { + const ignores = gitIgnore(); + for (const file of files) { + ignores.add(parseGitIgnore(file.content, { + cwd: file.cwd, + fileName: file.filePath + })); + } - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; + return ignores; +}; - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } +const ensureAbsolutePathForCwd = (cwd, p) => { + cwd = slash(cwd); + if (path.isAbsolute(p)) { + if (slash(p).startsWith(cwd)) { + return p; + } - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); + throw new Error(`Path ${p} is not in cwd ${cwd}`); + } - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } + return path.join(cwd, p); +}; - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } +const getIsIgnoredPredecate = (ignores, cwd) => { + return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p)))); +}; - return matches; +const getFile = async (file, cwd) => { + const filePath = path.join(cwd, file); + const content = await readFileP(filePath, 'utf8'); + + return { + cwd, + filePath, + content + }; }; -/** - * Backwards compatibility - */ +const getFileSync = (file, cwd) => { + const filePath = path.join(cwd, file); + const content = fs.readFileSync(filePath, 'utf8'); -micromatch.match = micromatch; + return { + cwd, + filePath, + content + }; +}; -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ +const normalizeOptions = ({ + ignore = [], + cwd = slash(process.cwd()) +} = {}) => { + return {ignore, cwd}; +}; -micromatch.matcher = (pattern, options) => picomatch(pattern, options); +module.exports = async options => { + options = normalizeOptions(options); -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `[options]` See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ + const paths = await fastGlob('**/.gitignore', { + ignore: DEFAULT_IGNORE.concat(options.ignore), + cwd: options.cwd + }); -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); + const ignores = reduceIgnore(files); -/** - * Backwards compatibility - */ + return getIsIgnoredPredecate(ignores, options.cwd); +}; -micromatch.any = micromatch.isMatch; +module.exports.sync = options => { + options = normalizeOptions(options); -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ + const paths = fastGlob.sync('**/.gitignore', { + ignore: DEFAULT_IGNORE.concat(options.ignore), + cwd: options.cwd + }); -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; + const files = paths.map(file => getFileSync(file, options.cwd)); + const ignores = reduceIgnore(files); - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; + return getIsIgnoredPredecate(ignores, options.cwd); +}; - let matches = micromatch(list, patterns, { ...options, onResult }); - for (let item of items) { - if (!matches.includes(item)) { - result.add(item); - } - } - return [...result]; -}; +/***/ }), -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any of the patterns matches any part of `str`. - * @api public - */ +/***/ "../../node_modules/globby/index.js": +/***/ (function(module, exports, __webpack_require__) { -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } +"use strict"; - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } +const fs = __webpack_require__("fs"); +const arrayUnion = __webpack_require__("../../node_modules/array-union/index.js"); +const merge2 = __webpack_require__("../../node_modules/merge2/index.js"); +const fastGlob = __webpack_require__("../../node_modules/fast-glob/out/index.js"); +const dirGlob = __webpack_require__("../../node_modules/dir-glob/index.js"); +const gitignore = __webpack_require__("../../node_modules/globby/gitignore.js"); +const {FilterStream, UniqueStream} = __webpack_require__("../../node_modules/globby/stream-utils.js"); - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } +const DEFAULT_FILTER = () => false; - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; - } - } +const isNegative = pattern => pattern[0] === '!'; - return micromatch.isMatch(str, pattern, { ...options, contains: true }); +const assertPatternsInput = patterns => { + if (!patterns.every(pattern => typeof pattern === 'string')) { + throw new TypeError('Patterns must be a string or an array of strings'); + } }; -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ +const checkCwdOption = (options = {}) => { + if (!options.cwd) { + return; + } -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; + let stat; + try { + stat = fs.statSync(options.cwd); + } catch { + return; + } + + if (!stat.isDirectory()) { + throw new Error('The `cwd` option must be a path to a directory'); + } }; -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` - * @api public - */ +const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); +const generateGlobTasks = (patterns, taskOptions) => { + patterns = arrayUnion([].concat(patterns)); + assertPatternsInput(patterns); + checkCwdOption(taskOptions); - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; - } - } - return false; -}; + const globTasks = []; -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` - * @api public - */ + taskOptions = { + ignore: [], + expandDirectories: true, + ...taskOptions + }; -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); + for (const [index, pattern] of patterns.entries()) { + if (isNegative(pattern)) { + continue; + } - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; - } - } - return true; + const ignore = patterns + .slice(index) + .filter(pattern => isNegative(pattern)) + .map(pattern => pattern.slice(1)); + + const options = { + ...taskOptions, + ignore: taskOptions.ignore.concat(ignore) + }; + + globTasks.push({pattern, options}); + } + + return globTasks; }; -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +const globDirs = (task, fn) => { + let options = {}; + if (task.options.cwd) { + options.cwd = task.options.cwd; + } -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } + if (Array.isArray(task.options.expandDirectories)) { + options = { + ...options, + files: task.options.expandDirectories + }; + } else if (typeof task.options.expandDirectories === 'object') { + options = { + ...options, + ...task.options.expandDirectories + }; + } - return [].concat(patterns).every(p => picomatch(p, options)(str)); + return fn(task.pattern, options); }; -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ +const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern]; -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); +const getFilterSync = options => { + return options && options.gitignore ? + gitignore.sync({cwd: options.cwd, ignore: options.ignore}) : + DEFAULT_FILTER; +}; - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } +const globToTask = task => glob => { + const {options} = task; + if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { + options.ignore = dirGlob.sync(options.ignore); + } + + return { + pattern: glob, + options + }; }; -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ +module.exports = async (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); -micromatch.makeRe = (...args) => picomatch.makeRe(...args); + const getFilter = async () => { + return options && options.gitignore ? + gitignore({cwd: options.cwd, ignore: options.ignore}) : + DEFAULT_FILTER; + }; -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ + const getTasks = async () => { + const tasks = await Promise.all(globTasks.map(async task => { + const globs = await getPattern(task, dirGlob); + return Promise.all(globs.map(globToTask(task))); + })); -micromatch.scan = (...args) => picomatch.scan(...args); + return arrayUnion(...tasks); + }; -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ + const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); + const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); - } - } - return res; + return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); }; -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ +module.exports.sync = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - return braces(pattern, options); + const tasks = []; + for (const task of globTasks) { + const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); + tasks.push(...newTask); + } + + const filter = getFilterSync(options); + + let matches = []; + for (const task of tasks) { + matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options)); + } + + return matches.filter(path_ => !filter(path_)); }; -/** - * Expand braces - */ +module.exports.stream = (patterns, options) => { + const globTasks = generateGlobTasks(patterns, options); -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); + const tasks = []; + for (const task of globTasks) { + const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); + tasks.push(...newTask); + } + + const filter = getFilterSync(options); + const filterStream = new FilterStream(p => !filter(p)); + const uniqueStream = new UniqueStream(); + + return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))) + .pipe(filterStream) + .pipe(uniqueStream); }; -/** - * Expose micromatch - */ +module.exports.generateGlobTasks = generateGlobTasks; -module.exports = micromatch; +module.exports.hasMagic = (patterns, options) => [] + .concat(patterns) + .some(pattern => fastGlob.isDynamicPattern(pattern, options)); + +module.exports.gitignore = gitignore; /***/ }), diff --git a/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts b/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts index 93e3cd2a4ce02..8f756842e4b5b 100644 --- a/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts +++ b/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts @@ -292,37 +292,17 @@ export const eventDetailsFormattedFields = [ }, { category: 'threat', - field: 'threat.enrichments.lazer.great.field', - values: ['grrrrr', 'grrrrr_2'], - originalValue: ['grrrrr', 'grrrrr_2'], - isObjectArray: false, - }, - { - category: 'threat', - field: 'threat.enrichments.lazer.great.field.wowoe.fooooo', - values: ['grrrrr'], - originalValue: ['grrrrr'], - isObjectArray: false, - }, - { - category: 'threat', - field: 'threat.enrichments.lazer.great.field.astring', - values: ['cool'], - originalValue: ['cool'], - isObjectArray: false, - }, - { - category: 'threat', - field: 'threat.enrichments.lazer.great.field.aNumber', - values: ['1'], - originalValue: ['1'], - isObjectArray: false, - }, - { - category: 'threat', - field: 'threat.enrichments.lazer.great.field.neat', - values: ['true'], - originalValue: ['true'], - isObjectArray: false, + field: 'threat.enrichments.lazer', + values: [ + '{"great.field":["grrrrr"]}', + '{"great.field":["grrrrr_2"]}', + '{"great.field":[{"wowoe":[{"fooooo":["grrrrr"]}],"astring":"cool","aNumber":1,"neat":true}]}', + ], + originalValue: [ + '{"great.field":["grrrrr"]}', + '{"great.field":["grrrrr_2"]}', + '{"great.field":[{"wowoe":[{"fooooo":["grrrrr"]}],"astring":"cool","aNumber":1,"neat":true}]}', + ], + isObjectArray: true, }, ]; diff --git a/packages/kbn-shared-ux-components/BUILD.bazel b/packages/kbn-shared-ux-components/BUILD.bazel index 03468daf75fb8..5739076517f0b 100644 --- a/packages/kbn-shared-ux-components/BUILD.bazel +++ b/packages/kbn-shared-ux-components/BUILD.bazel @@ -40,23 +40,24 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/shared-ux/avatar/solution", - "//packages/shared-ux/link/redirect_app", - "//packages/shared-ux/prompt/no_data_views", - "//packages/shared-ux/card/no_data", - "//packages/kbn-shared-ux-services", - "//packages/kbn-shared-ux-storybook", - "//packages/kbn-shared-ux-utility", "@npm//@elastic/eui", - "@npm//@emotion/react", "@npm//@emotion/css", + "@npm//@emotion/react", "@npm//classnames", "@npm//react-use", "@npm//react", "@npm//rxjs", "@npm//url-loader", + "//packages/kbn-i18n-react", + "//packages/kbn-i18n", + "//packages/kbn-shared-ux-services", + "//packages/kbn-shared-ux-storybook", + "//packages/kbn-shared-ux-utility", + "//packages/shared-ux/avatar/solution", + "//packages/shared-ux/card/no_data", + "//packages/shared-ux/link/redirect_app", + "//packages/shared-ux/page/solution_nav", + "//packages/shared-ux/prompt/no_data_views", ] # In this array place dependencies necessary to build the types, which will include the @@ -69,25 +70,26 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ + "@npm//@elastic/eui", + "@npm//@emotion/css", + "@npm//@emotion/react", + "@npm//@types/classnames", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "@npm//react-use", + "@npm//rxjs", "//packages/kbn-ambient-ui-types", "//packages/kbn-i18n-react:npm_module_types", "//packages/kbn-i18n:npm_module_types", - "//packages/shared-ux/avatar/solution:npm_module_types", - "//packages/shared-ux/link/redirect_app:npm_module_types", - "//packages/shared-ux/prompt/no_data_views:npm_module_types", - "//packages/shared-ux/card/no_data:npm_module_types", "//packages/kbn-shared-ux-services:npm_module_types", "//packages/kbn-shared-ux-storybook:npm_module_types", "//packages/kbn-shared-ux-utility:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/classnames", - "@npm//@emotion/react", - "@npm//@emotion/css", - "@npm//@elastic/eui", - "@npm//react-use", - "@npm//rxjs", + "//packages/shared-ux/avatar/solution:npm_module_types", + "//packages/shared-ux/card/no_data:npm_module_types", + "//packages/shared-ux/link/redirect_app:npm_module_types", + "//packages/shared-ux/page/solution_nav:npm_module_types", + "//packages/shared-ux/prompt/no_data_views:npm_module_types", ] jsts_transpiler( diff --git a/packages/kbn-shared-ux-components/src/index.ts b/packages/kbn-shared-ux-components/src/index.ts index 970e584d95782..9e11d9341fe59 100644 --- a/packages/kbn-shared-ux-components/src/index.ts +++ b/packages/kbn-shared-ux-components/src/index.ts @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -export { KibanaPageTemplateSolutionNav } from './page_template/solution_nav'; - // TODO: clintandrewhall - NoDataPageProps is a temporary addition until it is split into its own package export type { KibanaPageTemplateProps, NoDataPageProps } from './page_template'; diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx index 77c2d659b56ef..c21431a8107fe 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx +++ b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx @@ -5,10 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { EuiPageTemplate } from '@elastic/eui'; + import React from 'react'; +import { EuiPageTemplate } from '@elastic/eui'; +import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; + import { NoDataPage } from '../no_data_page'; -import { withSolutionNav } from '../../with_solution_nav'; import { KibanaPageTemplateProps } from '../../types'; import { getClasses, NO_DATA_PAGE_TEMPLATE_PROPS } from '../../util'; diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx b/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx index 6e0cf9fdb2e52..ae6be1297f018 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx +++ b/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx @@ -8,9 +8,10 @@ import React from 'react'; import { EuiButton, EuiText } from '@elastic/eui'; +import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; + import { KibanaPageTemplate } from './page_template'; import mdx from './page_template.mdx'; -import { KibanaPageTemplateSolutionNavProps } from './solution_nav'; import { KibanaPageTemplateProps } from './types'; export default { @@ -36,7 +37,7 @@ const noDataConfig = { docsLink: 'http://wwww.docs.elastic.co', }; -const items: KibanaPageTemplateSolutionNavProps['items'] = [ +const items: SolutionNavProps['items'] = [ { name: 'Ingest', id: '1', diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx b/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx index 8d073e14f7776..1324b60b92870 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx +++ b/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx @@ -8,11 +8,12 @@ import React from 'react'; import { shallow, render } from 'enzyme'; +import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; + import { KibanaPageTemplate } from './page_template'; -import { KibanaPageTemplateSolutionNavProps } from './solution_nav'; import { NoDataPageProps } from './no_data_page'; -const items: KibanaPageTemplateSolutionNavProps['items'] = [ +const items: SolutionNavProps['items'] = [ { name: 'Ingest', id: '1', diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.tsx b/packages/kbn-shared-ux-components/src/page_template/page_template.tsx index 6d63d54e9b9dd..467f02224b0de 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.tsx +++ b/packages/kbn-shared-ux-components/src/page_template/page_template.tsx @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -import './page_template.scss'; - import React, { FunctionComponent } from 'react'; import { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_page'; diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx b/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx index cef22f2713efc..46424348f2ff3 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx +++ b/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx @@ -9,8 +9,8 @@ import React, { FunctionComponent } from 'react'; import { EuiEmptyPrompt, EuiPageTemplate } from '@elastic/eui'; +import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; -import { withSolutionNav } from './with_solution_nav'; import { KibanaPageTemplateProps } from './types'; import { getClasses } from './util'; diff --git a/packages/kbn-shared-ux-components/src/page_template/types.ts b/packages/kbn-shared-ux-components/src/page_template/types.ts index cd4764a976db8..6a8b0d583ed18 100644 --- a/packages/kbn-shared-ux-components/src/page_template/types.ts +++ b/packages/kbn-shared-ux-components/src/page_template/types.ts @@ -7,7 +7,8 @@ */ import { EuiPageTemplateProps } from '@elastic/eui'; -import { KibanaPageTemplateSolutionNavProps } from './solution_nav'; +import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; + import { NoDataPageProps } from './no_data_page'; export type KibanaPageTemplateProps = EuiPageTemplateProps & { @@ -21,7 +22,7 @@ export type KibanaPageTemplateProps = EuiPageTemplateProps & { /** * Quick creation of EuiSideNav. Hooks up mobile instance too */ - solutionNav?: KibanaPageTemplateSolutionNavProps; + solutionNav?: SolutionNavProps; /** * Accepts a configuration object, that when provided, ignores pageHeader and children and instead * displays Agent, Beats, and custom cards to direct users to the right ingest location diff --git a/packages/shared-ux/page/solution_nav/BUILD.bazel b/packages/shared-ux/page/solution_nav/BUILD.bazel new file mode 100644 index 0000000000000..ef939dfdbbc5b --- /dev/null +++ b/packages/shared-ux/page/solution_nav/BUILD.bazel @@ -0,0 +1,144 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "solution_nav" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-solution-nav" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.scss", + "src/**/*.mdx", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//@elastic/eui", + "@npm//classnames", + "@npm//enzyme", + "@npm//react",\ + "//packages/kbn-i18n-react", + "//packages/kbn-i18n", + "//packages/shared-ux/avatar/solution", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@elastic/eui", + "@npm//@types/classnames", + "@npm//@types/enzyme", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "//packages/kbn-ambient-ui-types", + "//packages/kbn-i18n-react:npm_module_types", + "//packages/kbn-i18n:npm_module_types", + "//packages/shared-ux/avatar/solution:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, + additional_args = [ + "--copy-files", + "--quiet" + ], +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/solution_nav/README.mdx b/packages/shared-ux/page/solution_nav/README.mdx new file mode 100644 index 0000000000000..abad92c1e4108 --- /dev/null +++ b/packages/shared-ux/page/solution_nav/README.mdx @@ -0,0 +1,17 @@ +--- +id: sharedUX/Page/SolutionNav +slug: /shared-ux/page/solution-nav +title: Solution Page Navigation +summary: A customized `EuiSideNav` for pages within Solutions in Kibana. +tags: ['shared-ux', 'component'] +date: 2022-06-30 +--- + +This is a customized `EuiSideNav` for pages within Solutions in Kibana. It also includes a Higher-order Component (HOC) to supply Side Navigation to an existing component. It is currently used in the Kibana Page Template for solutions that provide side navigation, (e.g. Observability). It does not currently depend on any Kibana services. + +## API + +| Export | Description | +|---|---| +| `SolutionNav` | The `SolutionNav` component | +| `withSolutionNav` | The HOC which can provide the navigation to any component aligning with `KibanaPageTemplate` and its props. | \ No newline at end of file diff --git a/packages/shared-ux/page/solution_nav/jest.config.js b/packages/shared-ux/page/solution_nav/jest.config.js new file mode 100644 index 0000000000000..243409e35b2e4 --- /dev/null +++ b/packages/shared-ux/page/solution_nav/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/shared-ux/page/solution_nav'], +}; diff --git a/packages/shared-ux/page/solution_nav/package.json b/packages/shared-ux/page/solution_nav/package.json new file mode 100644 index 0000000000000..f57abed80f231 --- /dev/null +++ b/packages/shared-ux/page/solution_nav/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-solution-nav", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/__snapshots__/solution_nav_collapse_button.test.tsx.snap b/packages/shared-ux/page/solution_nav/src/__snapshots__/collapse_button.test.tsx.snap similarity index 51% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/__snapshots__/solution_nav_collapse_button.test.tsx.snap rename to packages/shared-ux/page/solution_nav/src/__snapshots__/collapse_button.test.tsx.snap index d2548b3e8df43..04fb0dfc2a965 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/__snapshots__/solution_nav_collapse_button.test.tsx.snap +++ b/packages/shared-ux/page/solution_nav/src/__snapshots__/collapse_button.test.tsx.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`KibanaPageTemplateSolutionNavCollapseButton isCollapsed 1`] = ` +exports[`SolutionNavCollapseButton isCollapsed 1`] = ` `; -exports[`KibanaPageTemplateSolutionNavCollapseButton renders 1`] = ` +exports[`SolutionNavCollapseButton renders 1`] = `

`; -exports[`KibanaPageTemplateSolutionNav accepts canBeCollapsed prop 1`] = ` +exports[`SolutionNav accepts canBeCollapsed prop 1`] = `

`; -exports[`KibanaPageTemplateSolutionNav heading accepts more headingProps 1`] = ` +exports[`SolutionNav accepts canBeCollapsed prop 2`] = ` +

+ + + +

+ + } + titleElement="span" + > + + + +
+
+`; + +exports[`SolutionNav heading accepts more headingProps 1`] = ` + + `; -exports[`KibanaPageTemplateSolutionNav renders 1`] = ` +exports[`SolutionNav renders 1`] = `

`; -exports[`KibanaPageTemplateSolutionNav renders with icon 1`] = ` +exports[`SolutionNav renders with icon 1`] = `

{ +describe('SolutionNavCollapseButton', () => { test('renders', () => { - const component = shallow(); + const component = shallow(); expect(component).toMatchSnapshot(); - expect(component.find('.kbnPageTemplateSolutionNavCollapseButton').prop('title')).toBe( + expect(component.find('.kbnSolutionNavCollapseButton').prop('title')).toBe( 'Collapse side navigation' ); }); test('isCollapsed', () => { - const component = shallow(); + const component = shallow(); expect(component).toMatchSnapshot(); - expect(component.find('.kbnPageTemplateSolutionNavCollapseButton').prop('title')).toBe( + expect(component.find('.kbnSolutionNavCollapseButton').prop('title')).toBe( 'Open side navigation' ); }); diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav_collapse_button.tsx b/packages/shared-ux/page/solution_nav/src/collapse_button.tsx similarity index 62% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav_collapse_button.tsx rename to packages/shared-ux/page/solution_nav/src/collapse_button.tsx index 35890b935ad3e..2cfc2b61a2b46 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav_collapse_button.tsx +++ b/packages/shared-ux/page/solution_nav/src/collapse_button.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import './solution_nav_collapse_button.scss'; +import './collapse_button.scss'; import React from 'react'; import classNames from 'classnames'; @@ -13,34 +13,33 @@ import classNames from 'classnames'; import { EuiButtonIcon, EuiButtonIconPropsForButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -export type KibanaPageTemplateSolutionNavCollapseButtonProps = - Partial & { - /** - * Boolean state of current collapsed status - */ - isCollapsed: boolean; - }; +export type SolutionNavCollapseButtonProps = Partial & { + /** + * Boolean state of current collapsed status + */ + isCollapsed: boolean; +}; -const collapseLabel = i18n.translate('sharedUXComponents.solutionNav.collapsibleLabel', { +const collapseLabel = i18n.translate('sharedUXPackages.solutionNav.collapsibleLabel', { defaultMessage: 'Collapse side navigation', }); -const openLabel = i18n.translate('sharedUXComponents.solutionNav.openLabel', { +const openLabel = i18n.translate('sharedUXPackages.solutionNav.openLabel', { defaultMessage: 'Open side navigation', }); /** * Creates the styled icon button for showing/hiding solution nav */ -export const KibanaPageTemplateSolutionNavCollapseButton = ({ +export const SolutionNavCollapseButton = ({ className, isCollapsed, ...rest -}: KibanaPageTemplateSolutionNavCollapseButtonProps) => { +}: SolutionNavCollapseButtonProps) => { const classes = classNames( - 'kbnPageTemplateSolutionNavCollapseButton', + 'kbnSolutionNavCollapseButton', { - 'kbnPageTemplateSolutionNavCollapseButton-isCollapsed': isCollapsed, + 'kbnSolutionNavCollapseButton-isCollapsed': isCollapsed, }, className ); diff --git a/src/core/server/context/context_service.test.mocks.ts b/packages/shared-ux/page/solution_nav/src/index.ts similarity index 62% rename from src/core/server/context/context_service.test.mocks.ts rename to packages/shared-ux/page/solution_nav/src/index.ts index dcd6eebe6e9c8..d116afa7accaa 100644 --- a/src/core/server/context/context_service.test.mocks.ts +++ b/packages/shared-ux/page/solution_nav/src/index.ts @@ -6,9 +6,7 @@ * Side Public License, v 1. */ -import { contextMock } from './context_container.mock'; +export { SolutionNav } from './solution_nav'; +export type { SolutionNavProps } from './solution_nav'; -export const MockContextConstructor = jest.fn(contextMock.create); -jest.doMock('./context_container', () => ({ - ContextContainer: MockContextConstructor, -})); +export { withSolutionNav } from './with_solution_nav'; diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.scss b/packages/shared-ux/page/solution_nav/src/solution_nav.scss similarity index 74% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.scss rename to packages/shared-ux/page/solution_nav/src/solution_nav.scss index c21f5e1bbab99..06fb58cf3de03 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.scss +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.scss @@ -2,28 +2,28 @@ $euiSideNavEmphasizedBackgroundColor: transparentize($euiColorLightShade, .7); @import '@elastic/eui/src/components/side_nav/mixins'; // Put the page background color in the flyout version too -.kbnPageTemplateSolutionNav__flyout { +.kbnSolutionNav__flyout { background-color: $euiPageBackgroundColor; } -.kbnPageTemplateSolutionNav { +.kbnSolutionNav { @include euiSideNavEmbellish; @include euiYScroll; display: flex; flex-direction: column; - @include euiBreakpoint('m' ,'l', 'xl') { + @include euiBreakpoint('m', 'l', 'xl') { width: 248px; padding: $euiSizeL; } - .kbnPageTemplateSolutionNav__avatar { + .kbnSolutionNav__avatar { margin-right: $euiSize; } } -.kbnPageTemplateSolutionNav--hidden { +.kbnSolutionNav--hidden { pointer-events: none; opacity: 0; diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.stories.tsx b/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx similarity index 74% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.stories.tsx rename to packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx index 03bf76da8b285..9613fbac42f6e 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.stories.tsx +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx @@ -7,16 +7,17 @@ */ import React from 'react'; -import { KibanaPageTemplateSolutionNav, KibanaPageTemplateSolutionNavProps } from './solution_nav'; +import { action } from '@storybook/addon-actions'; +import { SolutionNav as Component, SolutionNavProps } from './solution_nav'; export default { - title: 'Page Template/Solution Nav/Solution Nav', + title: 'Page Template', description: 'Solution-specific navigation for the sidebar', }; -type Params = Pick; +type Params = Pick; -const items: KibanaPageTemplateSolutionNavProps['items'] = [ +const items: SolutionNavProps['items'] = [ { name:
Ingest
, id: '1', @@ -55,11 +56,13 @@ const items: KibanaPageTemplateSolutionNavProps['items'] = [ }, ]; -export const PureComponent = (params: Params) => { - return ; +export const SolutionNav = (params: Params) => { + return ( + + ); }; -PureComponent.argTypes = { +SolutionNav.argTypes = { name: { control: 'text', defaultValue: 'Kibana', @@ -79,6 +82,6 @@ PureComponent.argTypes = { }, }; -PureComponent.parameters = { +SolutionNav.parameters = { layout: 'fullscreen', }; diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.test.tsx b/packages/shared-ux/page/solution_nav/src/solution_nav.test.tsx similarity index 66% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.test.tsx rename to packages/shared-ux/page/solution_nav/src/solution_nav.test.tsx index 459d186e04d2c..7be2fc7c397f7 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.test.tsx +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { KibanaPageTemplateSolutionNav, KibanaPageTemplateSolutionNavProps } from './solution_nav'; +import { SolutionNav, SolutionNavProps } from './solution_nav'; jest.mock('@elastic/eui', () => { const original = jest.requireActual('@elastic/eui'); @@ -20,7 +20,7 @@ jest.mock('@elastic/eui', () => { }; }); -const items: KibanaPageTemplateSolutionNavProps['items'] = [ +const items: SolutionNavProps['items'] = [ { name: 'Ingest', id: '1', @@ -59,14 +59,11 @@ const items: KibanaPageTemplateSolutionNavProps['items'] = [ }, ]; -describe('KibanaPageTemplateSolutionNav', () => { +describe('SolutionNav', () => { describe('heading', () => { test('accepts more headingProps', () => { const component = shallow( - + ); expect(component).toMatchSnapshot(); @@ -74,37 +71,37 @@ describe('KibanaPageTemplateSolutionNav', () => { }); test('renders', () => { - const component = shallow(); + const component = shallow(); expect(component).toMatchSnapshot(); }); test('renders with icon', () => { - const component = shallow( - - ); + const component = shallow(); expect(component).toMatchSnapshot(); }); test('renders with children', () => { const component = shallow( - + - + ); expect(component.find('#dummy_component').length > 0).toBeTruthy(); }); test('accepts EuiSideNavProps', () => { - const component = shallow( - - ); + const component = shallow(); expect(component).toMatchSnapshot(); }); test('accepts canBeCollapsed prop', () => { - const component = shallow( - + const canBeCollapsed = shallow( + ); - expect(component).toMatchSnapshot(); + expect(canBeCollapsed).toMatchSnapshot(); + const noCollapse = shallow( + + ); + expect(noCollapse).toMatchSnapshot(); }); }); diff --git a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.tsx b/packages/shared-ux/page/solution_nav/src/solution_nav.tsx similarity index 78% rename from packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.tsx rename to packages/shared-ux/page/solution_nav/src/solution_nav.tsx index 9ba6438bf94f8..31950f716c225 100644 --- a/packages/kbn-shared-ux-components/src/page_template/solution_nav/solution_nav.tsx +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.tsx @@ -7,7 +7,7 @@ */ import './solution_nav.scss'; -import React, { FunctionComponent, useState, useMemo } from 'react'; +import React, { FC, useState, useMemo } from 'react'; import classNames from 'classnames'; import { EuiAvatarProps, @@ -27,12 +27,12 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; -import { KibanaPageTemplateSolutionNavCollapseButton } from './solution_nav_collapse_button'; +import { SolutionNavCollapseButton } from './collapse_button'; -export type KibanaPageTemplateSolutionNavProps = Omit< - EuiSideNavProps<{}>, - 'children' | 'items' | 'heading' -> & { +/** + * Props for the `SolutionNav` component. + */ +export type SolutionNavProps = Omit, 'children' | 'items' | 'heading'> & { /** * Name of the solution, i.e. "Observability" */ @@ -58,6 +58,9 @@ export type KibanaPageTemplateSolutionNavProps = Omit< * Control the collapsed state */ isOpenOnDesktop?: boolean; + /** + * Handler for when the navigation flyout is collapsed. + */ onCollapse?: () => void; /** * Allows hiding of the navigation by the user. @@ -77,14 +80,12 @@ const setTabIndex = (items: Array>, isHidden: boolean) => }); }; -const generateId = htmlIdGenerator('KibanaPageTemplateSolutionNav'); +const generateId = htmlIdGenerator('SolutionNav'); /** - * A wrapper around EuiSideNav but also creates the appropriate title with optional solution logo + * A wrapper around `EuiSideNav` that includes the appropriate title with optional solution logo. */ -export const KibanaPageTemplateSolutionNav: FunctionComponent< - KibanaPageTemplateSolutionNavProps -> = ({ +export const SolutionNav: FC = ({ children, headingProps, icon, @@ -101,7 +102,7 @@ export const KibanaPageTemplateSolutionNav: FunctionComponent< const isMediumBreakpoint = useIsWithinBreakpoints(['m']); const isLargerBreakpoint = useIsWithinBreakpoints(['l', 'xl']); - // This is used for both the EuiSideNav and EuiFlyout toggling + // This is used for both the `EuiSideNav` and `EuiFlyout` toggling const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState(false); const toggleOpenOnMobile = () => { setIsSideNavOpenOnMobile(!isSideNavOpenOnMobile); @@ -110,33 +111,28 @@ export const KibanaPageTemplateSolutionNav: FunctionComponent< const isHidden = isLargerBreakpoint && !isOpenOnDesktop && canBeCollapsed; const isCustomSideNav = !!children; - const sideNavClasses = classNames('kbnPageTemplateSolutionNav', { - 'kbnPageTemplateSolutionNav--hidden': isHidden, + const sideNavClasses = classNames('kbnSolutionNav', { + 'kbnSolutionNav--hidden': isHidden, }); - /** - * Create the avatar and titles - */ + // Create the avatar and titles. const headingID = headingProps?.id || generateId('heading'); const HeadingElement = headingProps?.element || 'h2'; + const titleText = ( {icon && ( - + )} ); - /** - * Create the side nav content - */ + // Create the side nav content const sideNavContent = useMemo(() => { if (isCustomSideNav) { return children; } + if (!items) { return null; } + return (
@@ -207,10 +203,7 @@ export const KibanaPageTemplateSolutionNav: FunctionComponent< )} {canBeCollapsed && ( - + )} )} @@ -222,10 +215,7 @@ export const KibanaPageTemplateSolutionNav: FunctionComponent< {sideNavContent}
{canBeCollapsed && ( - + )} )} diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.scss b/packages/shared-ux/page/solution_nav/src/with_solution_nav.scss similarity index 63% rename from packages/kbn-shared-ux-components/src/page_template/page_template.scss rename to packages/shared-ux/page/solution_nav/src/with_solution_nav.scss index aec93da6217ee..1e4dfba82d13c 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.scss +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.scss @@ -1,4 +1,4 @@ -.kbnPageTemplate__pageSideBar { +.kbnSolutionNav__sidebar { overflow: hidden; // Temporary hack till the sizing is changed directly in EUI min-width: 248px; @@ -7,13 +7,11 @@ transition: min-width $euiAnimSpeedFast $euiAnimSlightResistance; } - &.kbnPageTemplate__pageSideBar--shrink { + &.kbnSolutionNav__sidebar--shrink { min-width: $euiSizeXXL; } .kbnPageTemplate--centeredBody & { - @include euiBreakpoint('m', 'l', 'xl') { - border-right: $euiBorderThin; - } + border-right: $euiBorderThin; } } diff --git a/packages/kbn-shared-ux-components/src/page_template/with_solution_nav.test.tsx b/packages/shared-ux/page/solution_nav/src/with_solution_nav.test.tsx similarity index 93% rename from packages/kbn-shared-ux-components/src/page_template/with_solution_nav.test.tsx rename to packages/shared-ux/page/solution_nav/src/with_solution_nav.test.tsx index 0d0ac4cf71bfc..b179eb6f3fab9 100644 --- a/packages/kbn-shared-ux-components/src/page_template/with_solution_nav.test.tsx +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.test.tsx @@ -6,16 +6,17 @@ * Side Public License, v 1. */ -import { shallow } from 'enzyme'; import React from 'react'; +import { shallow } from 'enzyme'; + +import { SolutionNavProps } from './solution_nav'; import { withSolutionNav } from './with_solution_nav'; -import { KibanaPageTemplateSolutionNavProps } from './solution_nav'; const TestComponent = () => { return
This is a wrapped component
; }; -const items: KibanaPageTemplateSolutionNavProps['items'] = [ +const items: SolutionNavProps['items'] = [ { name: 'Ingest', id: '1', diff --git a/packages/kbn-shared-ux-components/src/page_template/with_solution_nav.tsx b/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx similarity index 71% rename from packages/kbn-shared-ux-components/src/page_template/with_solution_nav.tsx rename to packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx index 8d804030f9199..5b6fc9e083dbe 100644 --- a/packages/kbn-shared-ux-components/src/page_template/with_solution_nav.tsx +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx @@ -8,24 +8,34 @@ import React, { ComponentType, useState } from 'react'; import classNames from 'classnames'; -import { useIsWithinBreakpoints } from '@elastic/eui'; -import { EuiPageSideBarProps } from '@elastic/eui/src/components/page/page_side_bar'; -import { KibanaPageTemplateSolutionNav, KibanaPageTemplateSolutionNavProps } from './solution_nav'; -import { KibanaPageTemplateProps } from './types'; +import { useIsWithinBreakpoints, EuiPageTemplateProps } from '@elastic/eui'; +import { SolutionNav, SolutionNavProps } from './solution_nav'; + +import './with_solution_nav.scss'; // https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging function getDisplayName(Component: ComponentType) { return Component.displayName || Component.name || 'UnnamedComponent'; } -type SolutionNavProps = KibanaPageTemplateProps & { - solutionNav: KibanaPageTemplateSolutionNavProps; +type TemplateProps = Pick< + EuiPageTemplateProps, + 'pageSideBar' | 'pageSideBarProps' | 'template' | 'children' +>; + +type ComponentProps = TemplateProps & { + isEmptyState?: boolean; }; +type Props

= P & + ComponentProps & { + solutionNav: SolutionNavProps; + }; + const SOLUTION_NAV_COLLAPSED_KEY = 'solutionNavIsCollapsed'; -export const withSolutionNav = (WrappedComponent: ComponentType) => { - const WithSolutionNav = (props: SolutionNavProps) => { +export const withSolutionNav =

(WrappedComponent: ComponentType

) => { + const WithSolutionNav = (props: Props

) => { const isMediumBreakpoint = useIsWithinBreakpoints(['m']); const isLargerBreakpoint = useIsWithinBreakpoints(['l', 'xl']); const [isSideNavOpenOnDesktop, setisSideNavOpenOnDesktop] = useState( @@ -33,6 +43,7 @@ export const withSolutionNav = (WrappedComponent: ComponentType { setisSideNavOpenOnDesktop(!isSideNavOpenOnDesktop); // Have to store it as the opposite of the default we want @@ -42,9 +53,9 @@ export const withSolutionNav = (WrappedComponent: ComponentType ); + const pageSideBarProps = { - paddingSize: 'none', + paddingSize: 'none' as 'none', ...props.pageSideBarProps, className: sideBarClasses, - } as EuiPageSideBarProps; // needed because for some reason 'none' is not recognized as a valid value for paddingSize + }; + return ( {children} diff --git a/packages/shared-ux/page/solution_nav/tsconfig.json b/packages/shared-ux/page/solution_nav/tsconfig.json new file mode 100644 index 0000000000000..93076efae5d7c --- /dev/null +++ b/packages/shared-ux/page/solution_nav/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react", + "@kbn/ambient-ui-types" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/scripts/archive_migration_functions.sh b/scripts/archive_migration_functions.sh new file mode 100644 index 0000000000000..e924f5db13315 --- /dev/null +++ b/scripts/archive_migration_functions.sh @@ -0,0 +1,486 @@ +#!/bin/bash + +standard_list="url,index-pattern,query,graph-workspace,tag,visualization,canvas-element,canvas-workpad,dashboard,search,lens,map,cases,uptime-dynamic-settings,osquery-saved-query,osquery-pack,infrastructure-ui-source,metrics-explorer-view,inventory-view,infrastructure-monitoring-log-view,apm-indices" + +orig_archive="x-pack/test/functional/es_archives/banners/multispace" +new_archive="x-pack/test/functional/fixtures/kbn_archiver/banners/multispace" +test_config="x-pack/test/functional/apps/spaces/config.ts" + +arrayify_csv() { + local xs=${1} + echo "$xs" | tr ',' '\n' | uniq | sort +} + +intersection() { + local containedTypesArr=("$@") + local standardListArr + standardListArr=($(arrayify_csv "$standard_list")) + + intersections=() + + for a in "${containedTypesArr[@]}"; do + for b in "${standardListArr[@]}"; do + if [[ "$a" == "$b" ]]; then + intersections+=("$a") + fi + done + done + + echo "${intersections[@]}" +} + +is_zipped() { + local archive=$1 + + local zip + zip=$(find "$archive" -maxdepth 1 -type f -name '*.gz' 2>/dev/null) + if [[ "$zip" == "" ]]; then + echo "" + else + echo "$zip" + fi +} + +unzip_and_keep() { + local archive=$1 + + local zip + zip=$(find "$archive" -maxdepth 1 -type f -name '*.gz') + gunzip --keep "$zip" +} + +_guard() { + local archive=$1 + local failures=() + local archiveJson="${archive}/data.json" + + if [[ ! -d "$archive" ]]; then + failures+=("Archive does not exist") + fi + + if [ "${#failures[@]}" -eq 0 ]; then + local zipped + zipped=$(is_zipped "$archive") + if [[ "$zipped" != "" && ! -f "$archiveJson" ]]; then + unzip_and_keep "$archive" + fi + + local containsDotKibanaRefs + containsDotKibanaRefs=$(grep -is '"index": ".kibana' "$archiveJson") + if [[ "$containsDotKibanaRefs" == "" ]]; then + failures+=(".kibana is not mentioned within the archive") + fi + fi + + echo "${failures[@]}" +} + +_types() { + local archive=${1:-$orig_archive} + local archiveJson="${archive}/data.json" + + if [[ -f "${archive}/data.json" ]]; then + local typesList + typesList=$(jq 'select(.value.source.type | length > 0) | .value.source.type' "$archiveJson") + echo "$typesList" | sed 's/^.//;s/.$//' | sort | uniq # The sed command drops the first and last characters. + fi +} + +_find_config() { + local test_file=${1} + + local current + local parent + local grandParent + local greatGrand + current=$(dirname "$test_file") + parent=$(dirname "$current") + grandParent=$(dirname "$parent") + greatGrand=$(dirname "$grandParent") + + local dirs=("$current" "$parent" "$grandParent" "$greatGrand") + + local configs=() + for x in "${dirs[@]}"; do + local config=$(find "$x" -maxdepth 1 -type f -name '*config.js' -or -name '*config.ts') + if [ -n "$config" ]; then + configs+=("$config") + fi + done + + echo "${configs[@]}" +} + +uniqueify() { + local xs=("$@") + local xss=() + for x in $(printf "%s\n" "${xs[@]}" | sort -u); do + if [[ -n "$x" ]]; then + xss+=("$x") + fi + done + echo "${xss[@]}" +} + +find_configs() { + local testFiles=("$@") + local configs=() + local uniqConfigs=() + + for testFile in "${testFiles[@]}"; do + configs+=($(_find_config "$testFile")) + done + + uniqConfigs=($(uniqueify "${configs[@]}")) + echo "${uniqConfigs[@]}" +} + +usages_list() { + local archive=${1:-$orig_archive} + + grep -q "x-pack" <<<"$archive" + isInXpack=$? + + local found_usages=() + + if [[ $isInXpack = 0 ]]; then + found_usages+=($(find x-pack/test -type f -print0 | xargs -0 grep -n "$archive" | cut -d ':' -f 1 | uniq)) + else + found_usages+=($(find test -type f -print0 | xargs -0 grep -n "$archive" | cut -d ':' -f 1 | uniq)) + fi + + echo "${found_usages[@]}" +} + +are_enabled() { + local testConfigs=("$@") + local enabledList=($(node scripts/enabled_ftr_configs.js)) + local needsMigration=() + + for enabled in "${enabledList[@]}"; do + for config in "${testConfigs[@]}"; do + if [[ "$enabled" == "$config" ]]; then + needsMigration+=("$config") + fi + done + done + echo "${needsMigration[@]}" +} + +print_list() { + local xs=("$@") + for x in "${xs[@]}"; do + echo " ${x}" + done +} + +clean_up() { + local xs + xs=$(git status -s | grep "??" | grep "data.json" | tr '??' ' ' | xargs) + for x in "${xs[@]}"; do + rm -f "$x" + done +} + +should_migrate() { + local archive=${1:-$orig_archive} + local archiveJson="${archive}/data.json" + printf "\n??? Should we migrate \n %s\n" "$archive" + + local guardResults=($(_guard "$archive")) + + if [ "${#guardResults[@]}" -eq 0 ]; then + local containedTypes=($(_types "$archive")) + local intersections=($(intersection "${containedTypes[@]}")) + local intersectionsLength="${#intersections[@]}" + if [ "${intersectionsLength}" -gt 0 ]; then + local foundTestFiles=($(usages_list "$archive")) + local configs=($(find_configs "${foundTestFiles[@]}")) + local needsMigration=($(are_enabled "${configs[@]}")) + if [ "${#needsMigration[@]}" -gt 0 ]; then + echo "### Yes, it needs migration" + echo " ### Saved Object type(s) that we care about:" + print_list "${intersections[@]}" + echo " ### Test file(s) that use it:" + print_list "${foundTestFiles[@]}" + echo " ### Config(s) that govern the test file(s):" + print_list "${configs[@]}" + else + echo "!!! No, do not migrate, it's config(s) is / are not enabled." + echo "!!! It contains the following saved object(s)" + print_list "${containedTypes[@]}" + echo " !!! For these files:" + print_list "${foundTestFiles[@]}" + echo " !!! Config(s) that govern the test file(s):" + print_list "${configs[@]}" + fi + else + echo "!!! No, we've found $intersectionsLength saved objects that are listed in the standard_list" + echo "!!! It contains the following saved object(s)" + print_list "${containedTypes[@]}" + fi + else + echo "!!! No, it failed the guard(s):" + echo "${guardResults[@]}" + fi + + trap clean_up EXIT +} + +migrate() { + set -x + node scripts/es_archiver.js load "$orig_archive" --config "$test_config" + node scripts/kbn_archiver.js save "$new_archive" --config "$test_config" --type "$standard_list" + node scripts/es_archiver.js unload "$orig_archive" + set +x +} + +load_logstash() { + set -x + node scripts/es_archiver.js load x-pack/test/functional/es_archives/logstash_functional --config "$test_config" + set +x +} + +load_es() { + set -x + node scripts/es_archiver.js load "$orig_archive" --config "$test_config" + set +x +} + +unload_es() { + set -x + node scripts/es_archiver.js unload "$orig_archive" + set +x +} + +save_es_archive_without_kibana_objects() { + local indexName=${1:?"You must pass the name of the index!"} + set -x + node scripts/es_archiver.js save "$orig_archive" --config "$test_config" "$indexName" + set +x +} + +save_kbn() { + local space=${1:-default} + + set -x + node scripts/kbn_archiver.js --config "$test_config" save "$new_archive" --type $standard_list --space "$space" + set +x + # node scripts/kbn_archiver.js --config x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts save x-pack/test/functional/fixtures/kbn_archiver/saved_objects/default_space --type search,index-pattern,visualization,dashboard,lens,map,graph-workspace,query,tag,url,canvas-workpad +} + +load_kbn() { + local space=${1:-default} + + set -x + node scripts/kbn_archiver.js --config "$test_config" load "$new_archive" --space "$space" + set +x +} + +load_created_kbn_archive() { + set -x + node scripts/kbn_archiver.js --config "$test_config" load "$new_archive" + set +x +} + +unload_kbn() { + set -x + node scripts/kbn_archiver.js --config "$test_config" unload "$new_archive" + set +x +} + +ping_server() { + set -x + server_addr="http://elastic:changeme@localhost:9220" + curl -k "${server_addr}/_cat/health?v=true" + set +x +} + +server() { + local config=${1:-$test_config} + + set -x + node scripts/functional_tests_server.js --config "$config" + set +x +} + +run_test() { + local config=${1:-$test_config} + + set -x + node scripts/functional_test_runner --config "$config" + set +x +} + +run_test_extra() { + set -x + node scripts/functional_test_runner --config "$test_config" \ + --grep="CSV Generation from SearchSource" \ + --include-tag "ciGroup2" \ + --updateSnapshots + set +x +} + +allowed_types='{ + "types": [ + { + "name": "config", + "namespaceType": "single", + "hidden": false, + "displayName": "config" + }, + { + "name": "url", + "namespaceType": "single", + "hidden": false, + "displayName": "url" + }, + { + "name": "index-pattern", + "namespaceType": "multiple", + "hidden": false, + "displayName": "data view" + }, + { + "name": "action", + "namespaceType": "multiple-isolated", + "hidden": true, + "displayName": "connector" + }, + { + "name": "query", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "query" + }, + { + "name": "alert", + "namespaceType": "multiple-isolated", + "hidden": true, + "displayName": "rule" + }, + { + "name": "graph-workspace", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "graph-workspace" + }, + { + "name": "tag", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "tag" + }, + { + "name": "visualization", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "visualization" + }, + { + "name": "canvas-element", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "canvas-element" + }, + { + "name": "canvas-workpad", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "canvas-workpad" + }, + { + "name": "dashboard", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "dashboard" + }, + { + "name": "search", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "search" + }, + { + "name": "lens", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "lens" + }, + { + "name": "map", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "map" + }, + { + "name": "cases", + "namespaceType": "multiple-isolated", + "hidden": true, + "displayName": "cases" + }, + { + "name": "uptime-dynamic-settings", + "namespaceType": "single", + "hidden": false, + "displayName": "uptime-dynamic-settings" + }, + { + "name": "osquery-saved-query", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "osquery-saved-query" + }, + { + "name": "osquery-pack", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "osquery-pack" + }, + { + "name": "infrastructure-ui-source", + "namespaceType": "single", + "hidden": false, + "displayName": "infrastructure-ui-source" + }, + { + "name": "metrics-explorer-view", + "namespaceType": "single", + "hidden": false, + "displayName": "metrics-explorer-view" + }, + { + "name": "inventory-view", + "namespaceType": "single", + "hidden": false, + "displayName": "inventory-view" + }, + { + "name": "infrastructure-monitoring-log-view", + "namespaceType": "multiple-isolated", + "hidden": false, + "displayName": "log view" + }, + { + "name": "apm-indices", + "namespaceType": "single", + "hidden": false, + "displayName": "apm-indices" + }, + { + "name": "csp_rule", + "namespaceType": "agnostic", + "hidden": false, + "displayName": "csp_rule" + }, + { + "name": "csp-rule-template", + "namespaceType": "agnostic", + "hidden": false, + "displayName": "csp-rule-template" + } + ] +}' +_allowed_types() { + echo "$allowed_types" | jq '.types | .[].name' | sort +} diff --git a/scripts/enabled_ftr_configs.js b/scripts/enabled_ftr_configs.js new file mode 100644 index 0000000000000..41ad21a464fec --- /dev/null +++ b/scripts/enabled_ftr_configs.js @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +require('../src/setup_node_env'); + +var yaml = require('js-yaml'); +var fs = require('fs'); + +try { + yaml.load(fs.readFileSync('.buildkite/ftr_configs.yml', 'utf8')).enabled.forEach(function (x) { + console.log(x); + }); +} catch (e) { + console.log(e); +} diff --git a/src/core/server/capabilities/capabilities_service.test.ts b/src/core/server/capabilities/capabilities_service.test.ts index b637fe493033e..4627c22be92f1 100644 --- a/src/core/server/capabilities/capabilities_service.test.ts +++ b/src/core/server/capabilities/capabilities_service.test.ts @@ -7,12 +7,12 @@ */ import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { mockRouter, RouterMock } from '@kbn/core-http-router-server-mocks'; import { httpServiceMock, InternalHttpServicePrebootMock, InternalHttpServiceSetupMock, -} from '../http/http_service.mock'; -import { mockRouter, RouterMock } from '../http/router/router.mock'; +} from '@kbn/core-http-server-mocks'; import { CapabilitiesService, CapabilitiesSetup } from './capabilities_service'; describe('CapabilitiesService', () => { diff --git a/src/core/server/capabilities/capabilities_service.ts b/src/core/server/capabilities/capabilities_service.ts index 059bd4027b980..c4de3ea5e6f8d 100644 --- a/src/core/server/capabilities/capabilities_service.ts +++ b/src/core/server/capabilities/capabilities_service.ts @@ -9,8 +9,11 @@ import type { CoreContext } from '@kbn/core-base-server-internal'; import type { Logger } from '@kbn/logging'; import type { KibanaRequest } from '@kbn/core-http-server'; +import type { + InternalHttpServicePreboot, + InternalHttpServiceSetup, +} from '@kbn/core-http-server-internal'; import { Capabilities, CapabilitiesProvider, CapabilitiesSwitcher } from './types'; -import { InternalHttpServicePreboot, InternalHttpServiceSetup } from '../http'; import { mergeCapabilities } from './merge_capabilities'; import { getCapabilitiesResolver, CapabilitiesResolver } from './resolve_capabilities'; import { registerRoutes } from './routes'; diff --git a/src/core/server/capabilities/integration_tests/capabilities_service.test.ts b/src/core/server/capabilities/integration_tests/capabilities_service.test.ts index f721c3ca76e89..fd5310a8bf444 100644 --- a/src/core/server/capabilities/integration_tests/capabilities_service.test.ts +++ b/src/core/server/capabilities/integration_tests/capabilities_service.test.ts @@ -12,10 +12,14 @@ import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { HttpService, InternalHttpServicePreboot, InternalHttpServiceSetup } from '../../http'; -import { contextServiceMock } from '../../context/context_service.mock'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { + HttpService, + InternalHttpServicePreboot, + InternalHttpServiceSetup, +} from '@kbn/core-http-server-internal'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; import { CapabilitiesService, CapabilitiesSetup } from '..'; -import { createHttpServer } from '../../http/test_utils'; const coreId = Symbol('core'); diff --git a/src/core/server/capabilities/resolve_capabilities.test.ts b/src/core/server/capabilities/resolve_capabilities.test.ts index 382e217b7011f..f2a8e7b404918 100644 --- a/src/core/server/capabilities/resolve_capabilities.test.ts +++ b/src/core/server/capabilities/resolve_capabilities.test.ts @@ -7,9 +7,9 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { Capabilities } from './types'; import { resolveCapabilities } from './resolve_capabilities'; -import { httpServerMock } from '../http/http_server.mocks'; describe('resolveCapabilities', () => { let defaultCaps: Capabilities; diff --git a/src/core/server/core_app/bundle_routes/bundle_route.test.ts b/src/core/server/core_app/bundle_routes/bundle_route.test.ts index 377d8432ae9a9..ee43bea44ef05 100644 --- a/src/core/server/core_app/bundle_routes/bundle_route.test.ts +++ b/src/core/server/core_app/bundle_routes/bundle_route.test.ts @@ -8,7 +8,7 @@ import { createDynamicAssetHandlerMock } from './bundle_route.test.mocks'; -import { httpServiceMock } from '../../http/http_service.mock'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { FileHashCache } from './file_hash_cache'; import { registerRouteForBundle } from './bundles_route'; diff --git a/src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts b/src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts index d3cf20592befd..12f3041ec53fb 100644 --- a/src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts +++ b/src/core/server/core_app/bundle_routes/register_bundle_routes.test.ts @@ -9,7 +9,7 @@ import { registerRouteForBundleMock } from './register_bundle_routes.test.mocks'; import { PackageInfo } from '@kbn/config'; -import { httpServiceMock } from '../../http/http_service.mock'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { InternalPluginInfo, UiPlugins } from '../../plugins'; import { registerBundleRoutes } from './register_bundle_routes'; import { FileHashCache } from './file_hash_cache'; diff --git a/src/core/server/core_app/core_app.test.ts b/src/core/server/core_app/core_app.test.ts index 327969891a292..913ac2aa9ef67 100644 --- a/src/core/server/core_app/core_app.test.ts +++ b/src/core/server/core_app/core_app.test.ts @@ -9,12 +9,12 @@ import { registerBundleRoutesMock } from './core_app.test.mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { mockRouter } from '@kbn/core-http-router-server-mocks'; import { coreMock, httpServerMock } from '../mocks'; import { httpResourcesMock } from '../http_resources/http_resources_service.mock'; import type { UiPlugins } from '../plugins'; import { PluginType } from '../plugins'; import { CoreApp } from './core_app'; -import { mockRouter } from '../http/router/router.mock'; import { RequestHandlerContext } from '..'; const emptyPlugins = (): UiPlugins => ({ diff --git a/src/core/server/core_app/integration_tests/bundle_routes.test.ts b/src/core/server/core_app/integration_tests/bundle_routes.test.ts index 4a34b5b42cf4e..30ff025ac2a14 100644 --- a/src/core/server/core_app/integration_tests/bundle_routes.test.ts +++ b/src/core/server/core_app/integration_tests/bundle_routes.test.ts @@ -11,10 +11,10 @@ import { readFile } from 'fs/promises'; import supertest from 'supertest'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; import type { IRouter } from '@kbn/core-http-server'; -import { contextServiceMock } from '../../context/context_service.mock'; -import { HttpService } from '../../http'; -import { createHttpServer } from '../../http/test_utils'; +import { HttpService } from '@kbn/core-http-server-internal'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; import { registerRouteForBundle } from '../bundle_routes/bundles_route'; import { FileHashCache } from '../bundle_routes/file_hash_cache'; diff --git a/src/core/server/core_usage_data/core_usage_data_service.test.ts b/src/core/server/core_usage_data/core_usage_data_service.test.ts index 50b78a6bed899..c22f1d3667365 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.test.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.test.ts @@ -17,9 +17,9 @@ import { configServiceMock } from '@kbn/config-mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { config as RawLoggingConfig } from '@kbn/core-logging-server-internal'; import { config as RawElasticsearchConfig } from '../elasticsearch/elasticsearch_config'; -import { config as RawHttpConfig } from '../http/http_config'; +import { config as RawHttpConfig } from '@kbn/core-http-server-internal'; import { savedObjectsConfig as RawSavedObjectsConfig } from '../saved_objects/saved_objects_config'; -import { httpServiceMock } from '../http/http_service.mock'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { metricsServiceMock } from '../metrics/metrics_service.mock'; import { savedObjectsServiceMock } from '../saved_objects/saved_objects_service.mock'; diff --git a/src/core/server/core_usage_data/core_usage_data_service.ts b/src/core/server/core_usage_data/core_usage_data_service.ts index cc1fce0069847..f18dfe0dcd624 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.ts @@ -19,9 +19,9 @@ import type { import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import type { LoggingConfigType } from '@kbn/core-logging-server-internal'; import type { Logger } from '@kbn/logging'; +import type { HttpConfigType, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { SavedObjectsServiceStart, SavedObjectTypeRegistry } from '..'; import { ElasticsearchConfigType } from '../elasticsearch/elasticsearch_config'; -import { HttpConfigType, InternalHttpServiceSetup } from '../http'; import { SavedObjectsConfigType } from '../saved_objects/saved_objects_config'; import type { diff --git a/src/core/server/deprecations/deprecations_service.test.ts b/src/core/server/deprecations/deprecations_service.test.ts index 9fd512f325d48..cedb524b29095 100644 --- a/src/core/server/deprecations/deprecations_service.test.ts +++ b/src/core/server/deprecations/deprecations_service.test.ts @@ -9,9 +9,9 @@ import { DeprecationsFactoryMock } from './deprecations_service.test.mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; /* eslint-disable dot-notation */ import { DeprecationsService, DeprecationsSetupDeps } from './deprecations_service'; -import { httpServiceMock } from '../http/http_service.mock'; import { savedObjectsClientMock, elasticsearchServiceMock, configServiceMock } from '../mocks'; import { mockDeprecationsFactory } from './deprecations_factory.mock'; import { mockDeprecationsRegistry } from './deprecations_registry.mock'; diff --git a/src/core/server/deprecations/deprecations_service.ts b/src/core/server/deprecations/deprecations_service.ts index 9f1a119d546ec..6d8aef2ef84e8 100644 --- a/src/core/server/deprecations/deprecations_service.ts +++ b/src/core/server/deprecations/deprecations_service.ts @@ -11,11 +11,11 @@ import { firstValueFrom } from 'rxjs'; import type { Logger } from '@kbn/logging'; import type { IConfigService } from '@kbn/config'; import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { DeprecationsFactory } from './deprecations_factory'; import { DomainDeprecationDetails, RegisterDeprecationsConfig } from './types'; import { registerRoutes } from './routes'; import { config as deprecationConfig, DeprecationConfigType } from './deprecation_config'; -import { InternalHttpServiceSetup } from '../http'; import { IScopedClusterClient } from '../elasticsearch/client'; import { SavedObjectsClientContract } from '../saved_objects/types'; diff --git a/src/core/server/deprecations/routes/index.ts b/src/core/server/deprecations/routes/index.ts index 5c73af882085c..8869697eebeb3 100644 --- a/src/core/server/deprecations/routes/index.ts +++ b/src/core/server/deprecations/routes/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { InternalHttpServiceSetup } from '../../http'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import type { InternalDeprecationRequestHandlerContext } from '../internal_types'; import { registerGetRoute } from './get'; diff --git a/src/core/server/elasticsearch/client/cluster_client.test.ts b/src/core/server/elasticsearch/client/cluster_client.test.ts index e6d9060981cd4..78fc0494951a7 100644 --- a/src/core/server/elasticsearch/client/cluster_client.test.ts +++ b/src/core/server/elasticsearch/client/cluster_client.test.ts @@ -12,8 +12,7 @@ import { createInternalErrorHandlerMock, } from './cluster_client.test.mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { httpServerMock } from '../../http/http_server.mocks'; -import { httpServiceMock } from '../../http/http_service.mock'; +import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks'; import { elasticsearchClientMock } from './mocks'; import { ClusterClient } from './cluster_client'; import { ElasticsearchClientConfig } from './client_config'; diff --git a/src/core/server/elasticsearch/client/cluster_client.ts b/src/core/server/elasticsearch/client/cluster_client.ts index 2412bf825d685..2eaaa0d6efca4 100644 --- a/src/core/server/elasticsearch/client/cluster_client.ts +++ b/src/core/server/elasticsearch/client/cluster_client.ts @@ -9,8 +9,12 @@ import type { Client } from '@elastic/elasticsearch'; import type { Logger } from '@kbn/logging'; import type { Headers, IAuthHeadersStorage } from '@kbn/core-http-server'; -import { isKibanaRequest, isRealRequest } from '../../http'; -import { ensureRawRequest, filterHeaders } from '../../http/router'; +import { + ensureRawRequest, + filterHeaders, + isKibanaRequest, + isRealRequest, +} from '@kbn/core-http-router-server-internal'; import { ScopeableRequest } from '../types'; import { ElasticsearchClient } from './types'; import { configureClient } from './configure_client'; diff --git a/src/core/server/elasticsearch/client/get_ecs_response_log.test.ts b/src/core/server/elasticsearch/client/get_ecs_response_log.test.ts index 547aae3224756..ec00badbcdf28 100644 --- a/src/core/server/elasticsearch/client/get_ecs_response_log.test.ts +++ b/src/core/server/elasticsearch/client/get_ecs_response_log.test.ts @@ -68,6 +68,28 @@ describe('getEcsResponseLog', () => { `); }); + test('redacts x-elastic-app-auth headers by default', () => { + const event = createResponseEvent({ + requestParams: { headers: { 'x-elastic-app-auth': 'hello', 'user-agent': 'world' } }, + response: { headers: { 'content-length': '123', 'x-elastic-app-auth': 'abc' } }, + }); + const log = getEcsResponseLog(event); + // @ts-expect-error ECS custom field + expect(log.http.request.headers).toMatchInlineSnapshot(` + Object { + "user-agent": "world", + "x-elastic-app-auth": "[REDACTED]", + } + `); + // @ts-expect-error ECS custom field + expect(log.http.response.headers).toMatchInlineSnapshot(` + Object { + "content-length": "123", + "x-elastic-app-auth": "[REDACTED]", + } + `); + }); + test('does not mutate original headers', () => { const reqHeaders = { a: 'foo', b: ['hello', 'world'] }; const resHeaders = { c: 'bar' }; diff --git a/src/core/server/elasticsearch/client/get_ecs_response_log.ts b/src/core/server/elasticsearch/client/get_ecs_response_log.ts index 1a75967cf66d7..b977f03a9a062 100644 --- a/src/core/server/elasticsearch/client/get_ecs_response_log.ts +++ b/src/core/server/elasticsearch/client/get_ecs_response_log.ts @@ -9,7 +9,9 @@ import { type IncomingHttpHeaders } from 'http'; import { type DiagnosticResult } from '@elastic/elasticsearch'; import { type LogMeta } from '@kbn/logging'; -const FORBIDDEN_HEADERS = ['authorization', 'cookie', 'set-cookie']; +// If you are updating these, consider whether they should also be updated in the +// http service `getResponseLog` +const FORBIDDEN_HEADERS = ['authorization', 'cookie', 'set-cookie', 'x-elastic-app-auth']; const REDACTED_HEADER_TEXT = '[REDACTED]'; // We are excluding sensitive headers by default, until we have a log filtering mechanism. diff --git a/src/core/server/elasticsearch/client/retry_unauthorized.test.ts b/src/core/server/elasticsearch/client/retry_unauthorized.test.ts index 16b30a25ea417..8b8ee4e7b2f46 100644 --- a/src/core/server/elasticsearch/client/retry_unauthorized.test.ts +++ b/src/core/server/elasticsearch/client/retry_unauthorized.test.ts @@ -8,7 +8,7 @@ import type { UnauthorizedError } from '@kbn/es-errors'; import type { SetAuthHeaders } from '@kbn/core-http-server'; -import { httpServerMock } from '../../http/http_server.mocks'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { createInternalErrorHandler, isRetryResult, diff --git a/src/core/server/elasticsearch/client/retry_unauthorized.ts b/src/core/server/elasticsearch/client/retry_unauthorized.ts index a6ef50491e1dd..568bc530e2fe8 100644 --- a/src/core/server/elasticsearch/client/retry_unauthorized.ts +++ b/src/core/server/elasticsearch/client/retry_unauthorized.ts @@ -9,7 +9,7 @@ import { MaybePromise } from '@kbn/utility-types'; import { UnauthorizedError } from '@kbn/es-errors'; import type { AuthHeaders, KibanaRequest, SetAuthHeaders } from '@kbn/core-http-server'; -import { isRealRequest } from '../../http'; +import { isRealRequest } from '@kbn/core-http-router-server-internal'; import { ScopeableRequest } from '../types'; /** diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.ts b/src/core/server/elasticsearch/elasticsearch_service.test.ts index 61f9cb92fb643..b40a157a4ca2f 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.test.ts @@ -31,7 +31,7 @@ import type { CoreContext } from '@kbn/core-base-server-internal'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { analyticsServiceMock } from '@kbn/core-analytics-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { httpServiceMock } from '../http/http_service.mock'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { configSchema, ElasticsearchConfig } from './elasticsearch_config'; import { ElasticsearchService, SetupDeps } from './elasticsearch_service'; import { elasticsearchClientMock } from './client/mocks'; diff --git a/src/core/server/elasticsearch/elasticsearch_service.ts b/src/core/server/elasticsearch/elasticsearch_service.ts index 318a2a47d16b9..a60069d644ca2 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.ts @@ -17,11 +17,11 @@ import type { IExecutionContext, } from '@kbn/core-execution-context-server-internal'; import type { IAuthHeadersStorage } from '@kbn/core-http-server'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { registerAnalyticsContextProvider } from './register_analytics_context_provider'; import { ClusterClient, ElasticsearchClientConfig } from './client'; import { ElasticsearchConfig, ElasticsearchConfigType } from './elasticsearch_config'; -import type { InternalHttpServiceSetup } from '../http'; import { InternalElasticsearchServicePreboot, InternalElasticsearchServiceSetup, diff --git a/src/core/server/http/integration_tests/cookie_session_storage.test.ts b/src/core/server/http/integration_tests/cookie_session_storage.test.ts index 7eb522d5de388..713ed2dc9edfd 100644 --- a/src/core/server/http/integration_tests/cookie_session_storage.test.ts +++ b/src/core/server/http/integration_tests/cookie_session_storage.test.ts @@ -16,15 +16,11 @@ import { Env } from '@kbn/config'; import { getEnvOptions, configServiceMock } from '@kbn/config-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; - import type { CoreContext } from '@kbn/core-base-server-internal'; -import { HttpService } from '../http_service'; - -import { contextServiceMock } from '../../context/context_service.mock'; -import { httpServerMock } from '../http_server.mocks'; - -import { createCookieSessionStorageFactory } from '../cookie_session_storage'; -import { ensureRawRequest } from '../router'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; +import { HttpService, createCookieSessionStorageFactory } from '@kbn/core-http-server-internal'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; let server: HttpService; diff --git a/src/core/server/http/integration_tests/http_server.test.ts b/src/core/server/http/integration_tests/http_server.test.ts index c77f17880cdba..1b9da1f0fddde 100644 --- a/src/core/server/http/integration_tests/http_server.test.ts +++ b/src/core/server/http/integration_tests/http_server.test.ts @@ -12,9 +12,8 @@ import moment from 'moment'; import { of } from 'rxjs'; import { ByteSizeValue } from '@kbn/config-schema'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { HttpConfig } from '../http_config'; -import { Router } from '../router'; -import { HttpServer } from '../http_server'; +import { Router } from '@kbn/core-http-router-server-internal'; +import { HttpServer, HttpConfig } from '@kbn/core-http-server-internal'; describe('Http server', () => { let server: HttpServer; diff --git a/src/core/server/http/integration_tests/lifecycle.test.ts b/src/core/server/http/integration_tests/lifecycle.test.ts index 15ae184ba5e74..2833d9f0bad13 100644 --- a/src/core/server/http/integration_tests/lifecycle.test.ts +++ b/src/core/server/http/integration_tests/lifecycle.test.ts @@ -11,12 +11,10 @@ import { parse as parseCookie } from 'tough-cookie'; import { schema } from '@kbn/config-schema'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; - -import { ensureRawRequest } from '../router'; -import { HttpService } from '../http_service'; - -import { contextServiceMock } from '../../context/context_service.mock'; -import { createHttpServer } from '../test_utils'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; +import { HttpService } from '@kbn/core-http-server-internal'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; let server: HttpService; diff --git a/src/core/server/http/integration_tests/lifecycle_handlers.test.ts b/src/core/server/http/integration_tests/lifecycle_handlers.test.ts index bdb67776e3da9..6ba3f971d3db7 100644 --- a/src/core/server/http/integration_tests/lifecycle_handlers.test.ts +++ b/src/core/server/http/integration_tests/lifecycle_handlers.test.ts @@ -12,12 +12,9 @@ import { BehaviorSubject } from 'rxjs'; import { ByteSizeValue } from '@kbn/config-schema'; import { configServiceMock } from '@kbn/config-mocks'; import type { IRouter, RouteRegistrar } from '@kbn/core-http-server'; - -import { createHttpServer } from '../test_utils'; -import { HttpService } from '../http_service'; -import { HttpServerSetup } from '../http_server'; - -import { contextServiceMock } from '../../context/context_service.mock'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; +import { HttpService, HttpServerSetup } from '@kbn/core-http-server-internal'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; // eslint-disable-next-line @typescript-eslint/no-var-requires diff --git a/src/core/server/http/integration_tests/preboot.test.ts b/src/core/server/http/integration_tests/preboot.test.ts index d92ca5913f253..d6ba19d066a7c 100644 --- a/src/core/server/http/integration_tests/preboot.test.ts +++ b/src/core/server/http/integration_tests/preboot.test.ts @@ -10,9 +10,9 @@ import supertest from 'supertest'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { contextServiceMock } from '../../context/context_service.mock'; -import { createHttpServer } from '../test_utils'; -import { HttpService } from '../http_service'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; +import { HttpService } from '@kbn/core-http-server-internal'; let server: HttpService; const prebootDeps = { diff --git a/src/core/server/http/integration_tests/request.test.ts b/src/core/server/http/integration_tests/request.test.ts index 3bdf2e38a5447..3e09de6e7749d 100644 --- a/src/core/server/http/integration_tests/request.test.ts +++ b/src/core/server/http/integration_tests/request.test.ts @@ -13,11 +13,9 @@ jest.mock('uuid', () => ({ import supertest from 'supertest'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; - -import { HttpService } from '../http_service'; - -import { contextServiceMock } from '../../context/context_service.mock'; -import { createHttpServer } from '../test_utils'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import type { HttpService } from '@kbn/core-http-server-internal'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; import { schema } from '@kbn/config-schema'; let server: HttpService; diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/http/integration_tests/router.test.ts index de3f45350d90e..6e0740973d0c2 100644 --- a/src/core/server/http/integration_tests/router.test.ts +++ b/src/core/server/http/integration_tests/router.test.ts @@ -13,10 +13,10 @@ import { schema } from '@kbn/config-schema'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { contextServiceMock } from '../../context/context_service.mock'; -import { createHttpServer } from '../test_utils'; -import { HttpService } from '../http_service'; -import { Router } from '../router'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { Router } from '@kbn/core-http-router-server-internal'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; +import type { HttpService } from '@kbn/core-http-server-internal'; import { loggerMock } from '@kbn/logging-mocks'; let server: HttpService; diff --git a/src/core/server/http/test_utils.ts b/src/core/server/http/test_utils.ts deleted file mode 100644 index f7d43a39287c9..0000000000000 --- a/src/core/server/http/test_utils.ts +++ /dev/null @@ -1,85 +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 - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { BehaviorSubject } from 'rxjs'; -import moment from 'moment'; -import { REPO_ROOT } from '@kbn/utils'; -import { ByteSizeValue } from '@kbn/config-schema'; -import { Env } from '@kbn/config'; -import { getEnvOptions, configServiceMock } from '@kbn/config-mocks'; -import type { CoreContext } from '@kbn/core-base-server-internal'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { HttpService } from './http_service'; - -const coreId = Symbol('core'); -const env = Env.createDefault(REPO_ROOT, getEnvOptions()); - -const logger = loggingSystemMock.create(); - -const configService = configServiceMock.create(); -configService.atPath.mockImplementation((path) => { - if (path === 'server') { - return new BehaviorSubject({ - hosts: ['localhost'], - maxPayload: new ByteSizeValue(1024), - autoListen: true, - ssl: { - enabled: false, - }, - cors: { - enabled: false, - }, - compression: { enabled: true }, - xsrf: { - disableProtection: true, - allowlist: [], - }, - securityResponseHeaders: {}, - customResponseHeaders: {}, - requestId: { - allowFromAnyIp: true, - ipAllowlist: [], - }, - shutdownTimeout: moment.duration(30, 'seconds'), - keepaliveTimeout: 120_000, - socketTimeout: 120_000, - } as any); - } - if (path === 'externalUrl') { - return new BehaviorSubject({ - policy: [], - } as any); - } - if (path === 'csp') { - return new BehaviorSubject({ - strict: false, - disableEmbedding: false, - warnLegacyBrowsers: true, - }); - } - throw new Error(`Unexpected config path: ${path}`); -}); - -const defaultContext: CoreContext = { - coreId, - env, - logger, - configService, -}; - -export const createCoreContext = (overrides: Partial = {}): CoreContext => ({ - ...defaultContext, - ...overrides, -}); - -/** - * Creates a concrete HttpServer with a mocked context. - */ -export const createHttpServer = (overrides: Partial = {}): HttpService => { - return new HttpService(createCoreContext(overrides)); -}; diff --git a/src/core/server/http_resources/http_resources_service.mock.ts b/src/core/server/http_resources/http_resources_service.mock.ts index a2ca0aa246582..6c50d720ceab2 100644 --- a/src/core/server/http_resources/http_resources_service.mock.ts +++ b/src/core/server/http_resources/http_resources_service.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { httpServerMock } from '../http/http_server.mocks'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { HttpResources, HttpResourcesServiceToolkit } from './types'; const createHttpResourcesMock = (): jest.Mocked => ({ diff --git a/src/core/server/http_resources/http_resources_service.test.ts b/src/core/server/http_resources/http_resources_service.test.ts index d2488c618b7b3..47b0ef049485b 100644 --- a/src/core/server/http_resources/http_resources_service.test.ts +++ b/src/core/server/http_resources/http_resources_service.test.ts @@ -11,9 +11,8 @@ import { getApmConfigMock } from './http_resources_service.test.mocks'; import type { RouteConfig } from '@kbn/core-http-server'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { httpServiceMock, httpServerMock } from '@kbn/core-http-server-mocks'; import { coreMock } from '../mocks'; -import { httpServiceMock } from '../http/http_service.mock'; -import { httpServerMock } from '../http/http_server.mocks'; import { renderingMock } from '../rendering/rendering_service.mock'; import { HttpResourcesService, PrebootDeps, SetupDeps } from './http_resources_service'; import { httpResourcesMock } from './http_resources_service.mock'; diff --git a/src/core/server/http_resources/http_resources_service.ts b/src/core/server/http_resources/http_resources_service.ts index fa48fc33394a1..7e95dc9e302d9 100644 --- a/src/core/server/http_resources/http_resources_service.ts +++ b/src/core/server/http_resources/http_resources_service.ts @@ -14,8 +14,11 @@ import type { KibanaRequest, KibanaResponseFactory, } from '@kbn/core-http-server'; +import type { + InternalHttpServiceSetup, + InternalHttpServicePreboot, +} from '@kbn/core-http-server-internal'; import { RequestHandlerContext } from '..'; -import { InternalHttpServiceSetup, InternalHttpServicePreboot } from '../http'; import { InternalRenderingServicePreboot, InternalRenderingServiceSetup } from '../rendering'; import { InternalHttpResourcesSetup, diff --git a/src/core/server/i18n/i18n_service.ts b/src/core/server/i18n/i18n_service.ts index 1accf75f252d6..5d64095cc229a 100644 --- a/src/core/server/i18n/i18n_service.ts +++ b/src/core/server/i18n/i18n_service.ts @@ -10,7 +10,10 @@ import { firstValueFrom } from 'rxjs'; import type { Logger } from '@kbn/logging'; import type { IConfigService } from '@kbn/config'; import type { CoreContext } from '@kbn/core-base-server-internal'; -import { InternalHttpServicePreboot, InternalHttpServiceSetup } from '../http'; +import type { + InternalHttpServicePreboot, + InternalHttpServiceSetup, +} from '@kbn/core-http-server-internal'; import { config as i18nConfigDef, I18nConfigType } from './i18n_config'; import { getKibanaTranslationFiles } from './get_kibana_translation_files'; import { initTranslations } from './init_translations'; diff --git a/src/core/server/index.ts b/src/core/server/index.ts index e87c814dca851..9dc6a88bacca5 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -141,7 +141,8 @@ export type { ElasticsearchRequestHandlerContext, } from './elasticsearch'; -export { kibanaResponseFactory, CoreKibanaRequest, CspConfig } from './http'; +export { CspConfig } from '@kbn/core-http-server-internal'; +export { CoreKibanaRequest, kibanaResponseFactory } from '@kbn/core-http-router-server-internal'; export type { AuthenticationHandler, diff --git a/src/core/server/internal_types.ts b/src/core/server/internal_types.ts index 298fa83e0b2d7..ca02ad45eacf4 100644 --- a/src/core/server/internal_types.ts +++ b/src/core/server/internal_types.ts @@ -21,19 +21,22 @@ import type { InternalExecutionContextSetup, InternalExecutionContextStart, } from '@kbn/core-execution-context-server-internal'; -import { InternalPrebootServicePreboot } from '@kbn/core-preboot-server-internal'; +import type { InternalPrebootServicePreboot } from '@kbn/core-preboot-server-internal'; +import type { + InternalContextPreboot, + InternalContextSetup, +} from '@kbn/core-http-context-server-internal'; +import type { + InternalHttpServicePreboot, + InternalHttpServiceSetup, + InternalHttpServiceStart, +} from '@kbn/core-http-server-internal'; import { CapabilitiesSetup, CapabilitiesStart } from './capabilities'; -import { InternalContextPreboot, InternalContextSetup } from './context'; import { InternalElasticsearchServicePreboot, InternalElasticsearchServiceSetup, InternalElasticsearchServiceStart, } from './elasticsearch'; -import { - InternalHttpServicePreboot, - InternalHttpServiceSetup, - InternalHttpServiceStart, -} from './http'; import { InternalSavedObjectsServiceSetup, InternalSavedObjectsServiceStart, diff --git a/src/core/server/metrics/integration_tests/server_collector.test.ts b/src/core/server/metrics/integration_tests/server_collector.test.ts index 26f524b751df2..73be33c868cf5 100644 --- a/src/core/server/metrics/integration_tests/server_collector.test.ts +++ b/src/core/server/metrics/integration_tests/server_collector.test.ts @@ -10,10 +10,10 @@ import { BehaviorSubject, Subject } from 'rxjs'; import { take, filter } from 'rxjs/operators'; import supertest from 'supertest'; import { Server as HapiServer } from '@hapi/hapi'; -import { createHttpServer } from '../../http/test_utils'; +import { createHttpServer } from '@kbn/core-http-server-mocks'; import type { IRouter } from '@kbn/core-http-server'; -import { HttpService } from '../../http'; -import { contextServiceMock } from '../../context/context_service.mock'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import type { HttpService } from '@kbn/core-http-server-internal'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { ServerMetricsCollector } from '../collectors/server'; import { setTimeout as setTimeoutPromise } from 'timers/promises'; diff --git a/src/core/server/metrics/metrics_service.test.ts b/src/core/server/metrics/metrics_service.test.ts index f2e1a278e9bc1..de78b534b2dc7 100644 --- a/src/core/server/metrics/metrics_service.test.ts +++ b/src/core/server/metrics/metrics_service.test.ts @@ -11,9 +11,9 @@ import moment from 'moment'; import { configServiceMock } from '@kbn/config-mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { mockOpsCollector } from './metrics_service.test.mocks'; import { MetricsService } from './metrics_service'; -import { httpServiceMock } from '../http/http_service.mock'; import { take } from 'rxjs/operators'; const testInterval = 100; diff --git a/src/core/server/metrics/metrics_service.ts b/src/core/server/metrics/metrics_service.ts index f2515b29e2744..60229bde6c0ee 100644 --- a/src/core/server/metrics/metrics_service.ts +++ b/src/core/server/metrics/metrics_service.ts @@ -9,7 +9,7 @@ import { firstValueFrom, ReplaySubject } from 'rxjs'; import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import { Logger } from '@kbn/logging'; -import { InternalHttpServiceSetup } from '../http'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { InternalMetricsServiceSetup, InternalMetricsServiceStart, OpsMetrics } from './types'; import { OpsMetricsCollector } from './ops_metrics_collector'; import { opsConfig, OpsConfigType } from './ops_config'; diff --git a/src/core/server/metrics/ops_metrics_collector.test.ts b/src/core/server/metrics/ops_metrics_collector.test.ts index 78160729f7bdc..cd80c35b37f86 100644 --- a/src/core/server/metrics/ops_metrics_collector.test.ts +++ b/src/core/server/metrics/ops_metrics_collector.test.ts @@ -7,12 +7,12 @@ */ import { loggerMock } from '@kbn/logging-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { mockOsCollector, mockProcessCollector, mockServerCollector, } from './ops_metrics_collector.test.mocks'; -import { httpServiceMock } from '../http/http_service.mock'; import { OpsMetricsCollector } from './ops_metrics_collector'; describe('OpsMetricsCollector', () => { diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index 2d8d34be93e5c..9e693ac7600e8 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -18,6 +18,8 @@ import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; import { nodeServiceMock } from '@kbn/core-node-server-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { prebootServiceMock } from '@kbn/core-preboot-server-mocks'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import type { PluginInitializerContext, CoreSetup, @@ -27,9 +29,7 @@ import type { RequestHandlerContext, } from '.'; import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; -import { httpServiceMock } from './http/http_service.mock'; import { httpResourcesMock } from './http_resources/http_resources_service.mock'; -import { contextServiceMock } from './context/context_service.mock'; import { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; import { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; import { typeRegistryMock as savedObjectsTypeRegistryMock } from './saved_objects/saved_objects_type_registry.mock'; @@ -42,13 +42,12 @@ import { statusServiceMock } from './status/status_service.mock'; import { coreUsageDataServiceMock } from './core_usage_data/core_usage_data_service.mock'; import { i18nServiceMock } from './i18n/i18n_service.mock'; import { deprecationsServiceMock } from './deprecations/deprecations_service.mock'; + export { configServiceMock, configDeprecationsMock } from '@kbn/config-mocks'; export { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -export { httpServerMock } from './http/http_server.mocks'; +export { httpServerMock, sessionStorageMock, httpServiceMock } from '@kbn/core-http-server-mocks'; export { httpResourcesMock } from './http_resources/http_resources_service.mock'; -export { sessionStorageMock } from './http/cookie_session_storage.mocks'; export { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; -export { httpServiceMock } from './http/http_service.mock'; export { savedObjectsRepositoryMock } from './saved_objects/service/lib/repository.mock'; export { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; export { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; @@ -58,7 +57,7 @@ export { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; export { metricsServiceMock } from './metrics/metrics_service.mock'; export { renderingMock } from './rendering/rendering_service.mock'; export { statusServiceMock } from './status/status_service.mock'; -export { contextServiceMock } from './context/context_service.mock'; +export { contextServiceMock } from '@kbn/core-http-context-server-mocks'; export { capabilitiesServiceMock } from './capabilities/capabilities_service.mock'; export { coreUsageDataServiceMock } from './core_usage_data/core_usage_data_service.mock'; export { i18nServiceMock } from './i18n/i18n_service.mock'; diff --git a/src/core/server/rendering/__mocks__/params.ts b/src/core/server/rendering/__mocks__/params.ts index 7da44d717723f..47c5612555e48 100644 --- a/src/core/server/rendering/__mocks__/params.ts +++ b/src/core/server/rendering/__mocks__/params.ts @@ -7,8 +7,8 @@ */ import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { elasticsearchServiceMock } from '../../elasticsearch/elasticsearch_service.mock'; -import { httpServiceMock } from '../../http/http_service.mock'; import { pluginServiceMock } from '../../plugins/plugins_service.mock'; import { statusServiceMock } from '../../status/status_service.mock'; diff --git a/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts b/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts index 7df28449fd39d..54b5b539bbd68 100644 --- a/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts +++ b/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts @@ -16,8 +16,7 @@ import { import { PackageInfo } from '@kbn/config'; import { AuthStatus } from '@kbn/core-http-server'; import { UiPlugins } from '../../plugins'; -import { httpServiceMock } from '../../http/http_service.mock'; -import { httpServerMock } from '../../http/http_server.mocks'; +import { httpServiceMock, httpServerMock } from '@kbn/core-http-server-mocks'; import { uiSettingsServiceMock } from '../../ui_settings/ui_settings_service.mock'; import { bootstrapRendererFactory, BootstrapRenderer } from './bootstrap_renderer'; diff --git a/src/core/server/rendering/rendering_service.test.ts b/src/core/server/rendering/rendering_service.test.ts index eb5614d540754..477e169b3328f 100644 --- a/src/core/server/rendering/rendering_service.test.ts +++ b/src/core/server/rendering/rendering_service.test.ts @@ -15,8 +15,8 @@ import { import { load } from 'cheerio'; -import { httpServerMock } from '../http/http_server.mocks'; -import { mockRouter } from '../http/router/router.mock'; +import { mockRouter } from '@kbn/core-http-router-server-mocks'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { uiSettingsServiceMock } from '../ui_settings/ui_settings_service.mock'; import { mockRenderingServiceParams, diff --git a/src/core/server/rendering/types.ts b/src/core/server/rendering/types.ts index 8a2bfa01f7a84..d6c660f3b5ec1 100644 --- a/src/core/server/rendering/types.ts +++ b/src/core/server/rendering/types.ts @@ -10,8 +10,11 @@ import { i18n } from '@kbn/i18n'; import type { ThemeVersion } from '@kbn/ui-shared-deps-npm'; import type { InjectedMetadata } from '@kbn/core-injected-metadata-common-internal'; import type { KibanaRequest, ICspConfig } from '@kbn/core-http-server'; +import type { + InternalHttpServicePreboot, + InternalHttpServiceSetup, +} from '@kbn/core-http-server-internal'; import { InternalElasticsearchServiceSetup } from '../elasticsearch'; -import { InternalHttpServicePreboot, InternalHttpServiceSetup } from '../http'; import { UiPlugins } from '../plugins'; import { IUiSettingsClient } from '../ui_settings'; import type { InternalStatusServiceSetup } from '../status'; diff --git a/src/core/server/saved_objects/export/apply_export_transforms.test.ts b/src/core/server/saved_objects/export/apply_export_transforms.test.ts index 47bdf337c2b58..561c1ee1aed8b 100644 --- a/src/core/server/saved_objects/export/apply_export_transforms.test.ts +++ b/src/core/server/saved_objects/export/apply_export_transforms.test.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ +import { CoreKibanaRequest } from '@kbn/core-http-router-server-internal'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { SavedObject } from '../../../types'; -import { CoreKibanaRequest } from '../../http'; -import { httpServerMock } from '../../http/http_server.mocks'; import { applyExportTransforms } from './apply_export_transforms'; import { SavedObjectsExportTransform } from './types'; diff --git a/src/core/server/saved_objects/export/collect_exported_objects.test.ts b/src/core/server/saved_objects/export/collect_exported_objects.test.ts index fbb6c1a9f786e..7a483d3a9af20 100644 --- a/src/core/server/saved_objects/export/collect_exported_objects.test.ts +++ b/src/core/server/saved_objects/export/collect_exported_objects.test.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { applyExportTransformsMock } from './collect_exported_objects.test.mocks'; import { savedObjectsClientMock } from '../../mocks'; -import { httpServerMock } from '../../http/http_server.mocks'; import { loggerMock } from '@kbn/logging-mocks'; import { SavedObject, SavedObjectError } from '../../../types'; import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; diff --git a/src/core/server/saved_objects/export/saved_objects_exporter.test.ts b/src/core/server/saved_objects/export/saved_objects_exporter.test.ts index 21c7eaa08090b..6b0e0e3b277d9 100644 --- a/src/core/server/saved_objects/export/saved_objects_exporter.test.ts +++ b/src/core/server/saved_objects/export/saved_objects_exporter.test.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ +import { httpServerMock } from '@kbn/core-http-server-mocks'; import type { SavedObject } from '../../../types'; import { SavedObjectsExporter } from './saved_objects_exporter'; import { savedObjectsClientMock } from '../service/saved_objects_client.mock'; import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; -import { httpServerMock } from '../../http/http_server.mocks'; import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; import { Readable } from 'stream'; import { createPromiseFromStreams, createConcatStream } from '@kbn/utils'; diff --git a/src/core/server/saved_objects/routes/index.ts b/src/core/server/saved_objects/routes/index.ts index 34083e0d6ddf8..edc52efdeaef8 100644 --- a/src/core/server/saved_objects/routes/index.ts +++ b/src/core/server/saved_objects/routes/index.ts @@ -7,7 +7,7 @@ */ import type { Logger } from '@kbn/logging'; -import { InternalHttpServiceSetup } from '../../http'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { SavedObjectConfig } from '../saved_objects_config'; import { IKibanaMigrator } from '../migrations'; diff --git a/src/core/server/saved_objects/routes/integration_tests/get.test.ts b/src/core/server/saved_objects/routes/integration_tests/get.test.ts index 8b34c9f2ef958..6f0cb25934ef5 100644 --- a/src/core/server/saved_objects/routes/integration_tests/get.test.ts +++ b/src/core/server/saved_objects/routes/integration_tests/get.test.ts @@ -8,14 +8,14 @@ import supertest from 'supertest'; import { registerGetRoute } from '../get'; -import { ContextService } from '../../../context'; +import { ContextService } from '@kbn/core-http-context-server-internal'; +import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks'; import { savedObjectsClientMock } from '../../service/saved_objects_client.mock'; -import { CoreUsageStatsClient } from '../../../core_usage_data'; +import type { CoreUsageStatsClient } from '../../../core_usage_data'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { HttpService, InternalHttpServiceSetup } from '../../../http'; -import { createHttpServer, createCoreContext } from '../../../http/test_utils'; import { contextServiceMock, coreMock } from '../../../mocks'; import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; diff --git a/src/core/server/saved_objects/routes/integration_tests/resolve.test.ts b/src/core/server/saved_objects/routes/integration_tests/resolve.test.ts index 78397ca00cb60..9ee1b0f1200e6 100644 --- a/src/core/server/saved_objects/routes/integration_tests/resolve.test.ts +++ b/src/core/server/saved_objects/routes/integration_tests/resolve.test.ts @@ -7,15 +7,15 @@ */ import supertest from 'supertest'; +import { ContextService } from '@kbn/core-http-context-server-internal'; +import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks'; import { registerResolveRoute } from '../resolve'; -import { ContextService } from '../../../context'; import { savedObjectsClientMock } from '../../service/saved_objects_client.mock'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { HttpService, InternalHttpServiceSetup } from '../../../http'; -import { createHttpServer, createCoreContext } from '../../../http/test_utils'; import { contextServiceMock, coreMock } from '../../../mocks'; import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types'; diff --git a/src/core/server/saved_objects/routes/test_utils.ts b/src/core/server/saved_objects/routes/test_utils.ts index 5783ecb9e5e27..74d813ab68793 100644 --- a/src/core/server/saved_objects/routes/test_utils.ts +++ b/src/core/server/saved_objects/routes/test_utils.ts @@ -7,8 +7,8 @@ */ import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { ContextService } from '../../context'; -import { createHttpServer, createCoreContext } from '../../http/test_utils'; +import { ContextService } from '@kbn/core-http-context-server-internal'; +import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks'; import { contextServiceMock, coreMock } from '../../mocks'; import { SavedObjectsType } from '../types'; import { InternalSavedObjectsRequestHandlerContext } from '../internal_types'; diff --git a/src/core/server/saved_objects/routes/utils.test.ts b/src/core/server/saved_objects/routes/utils.test.ts index 9c245e58b5947..ddeff043f2bba 100644 --- a/src/core/server/saved_objects/routes/utils.test.ts +++ b/src/core/server/saved_objects/routes/utils.test.ts @@ -11,13 +11,13 @@ import { Readable } from 'stream'; import { createPromiseFromStreams, createConcatStream } from '@kbn/utils'; import { catchAndReturnBoomErrors } from './utils'; import Boom from '@hapi/boom'; -import { +import type { KibanaRequest, RequestHandler, - RequestHandlerContext, + RequestHandlerContextBase, KibanaResponseFactory, - kibanaResponseFactory, -} from '../..'; +} from '@kbn/core-http-server'; +import { kibanaResponseFactory } from '@kbn/core-http-router-server-internal'; async function readStreamToCompletion(stream: Readable) { return createPromiseFromStreams([stream, createConcatStream([])]); @@ -170,7 +170,7 @@ describe('validateObjects', () => { }); describe('catchAndReturnBoomErrors', () => { - let context: RequestHandlerContext; + let context: RequestHandlerContextBase; let request: KibanaRequest; let response: KibanaResponseFactory; diff --git a/src/core/server/saved_objects/saved_objects_service.test.ts b/src/core/server/saved_objects/saved_objects_service.test.ts index a177d7b0c3527..e2b7cdb92c46b 100644 --- a/src/core/server/saved_objects/saved_objects_service.test.ts +++ b/src/core/server/saved_objects/saved_objects_service.test.ts @@ -24,14 +24,13 @@ import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '@kbn/config-mocks'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { httpServiceMock, httpServerMock } from '@kbn/core-http-server-mocks'; import { SavedObjectsService } from './saved_objects_service'; import { configServiceMock } from '../mocks'; import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service.mock'; import { coreUsageDataServiceMock } from '../core_usage_data/core_usage_data_service.mock'; import { deprecationsServiceMock } from '../deprecations/deprecations_service.mock'; -import { httpServiceMock } from '../http/http_service.mock'; -import { httpServerMock } from '../http/http_server.mocks'; import { SavedObjectsClientFactoryProvider } from './service/lib'; import { NodesVersionCompatibility } from '../elasticsearch/version_check/ensure_es_version'; import { SavedObjectsRepository } from './service/lib/repository'; diff --git a/src/core/server/saved_objects/saved_objects_service.ts b/src/core/server/saved_objects/saved_objects_service.ts index 8559ab2d16a6d..83f906f0d14c9 100644 --- a/src/core/server/saved_objects/saved_objects_service.ts +++ b/src/core/server/saved_objects/saved_objects_service.ts @@ -12,6 +12,7 @@ import type { Logger } from '@kbn/logging'; import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; import type { KibanaRequest } from '@kbn/core-http-server'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { SavedObjectsClient, SavedObjectsClientProvider, @@ -30,7 +31,6 @@ import { SavedObjectsMigrationConfigType, SavedObjectConfig, } from './saved_objects_config'; -import { InternalHttpServiceSetup } from '../http'; import { SavedObjectsClientContract, SavedObjectsType, diff --git a/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts b/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts index f8a81e48bbbc3..efc04f69e6ecf 100644 --- a/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts +++ b/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ +import { httpServerMock } from '@kbn/core-http-server-mocks'; import { SavedObjectsClientProvider } from './scoped_client_provider'; -import { httpServerMock } from '../../../http/http_server.mocks'; import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; test(`uses default client factory when one isn't set`, () => { diff --git a/src/core/server/server.test.mocks.ts b/src/core/server/server.test.mocks.ts index 16f2fb3d2e1df..e1b294fb6778a 100644 --- a/src/core/server/server.test.mocks.ts +++ b/src/core/server/server.test.mocks.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { httpServiceMock } from './http/http_service.mock'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; export const mockHttpService = httpServiceMock.create(); -jest.doMock('./http/http_service', () => ({ +jest.doMock('@kbn/core-http-server-internal', () => ({ HttpService: jest.fn(() => mockHttpService), })); @@ -44,10 +44,10 @@ jest.doMock('./saved_objects/saved_objects_service', () => ({ SavedObjectsService: jest.fn(() => mockSavedObjectsService), })); -import { contextServiceMock } from './context/context_service.mock'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; export const mockContextService = contextServiceMock.create(); -jest.doMock('./context/context_service', () => ({ +jest.doMock('@kbn/core-http-context-server-internal', () => ({ ContextService: jest.fn(() => mockContextService), })); diff --git a/src/core/server/server.ts b/src/core/server/server.ts index b8f47cdda45f7..6f5e072aa1fa7 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -30,10 +30,16 @@ import { executionContextConfig, } from '@kbn/core-execution-context-server-internal'; import { PrebootService } from '@kbn/core-preboot-server-internal'; +import { ContextService } from '@kbn/core-http-context-server-internal'; +import { + HttpService, + config as httpConfig, + cspConfig, + externalUrlConfig, +} from '@kbn/core-http-server-internal'; import { CoreApp } from './core_app'; import { I18nService } from './i18n'; import { ElasticsearchService } from './elasticsearch'; -import { HttpService } from './http'; import { HttpResourcesService } from './http_resources'; import { RenderingService } from './rendering'; import { UiSettingsService } from './ui_settings'; @@ -45,12 +51,10 @@ import { CapabilitiesService } from './capabilities'; import { StatusService } from './status/status_service'; import { config as elasticsearchConfig } from './elasticsearch'; -import { config as httpConfig, cspConfig, externalUrlConfig } from './http'; import { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects'; import { config as uiSettingsConfig } from './ui_settings'; import { config as statusConfig } from './status'; import { config as i18nConfig } from './i18n'; -import { ContextService } from './context'; import { InternalCorePreboot, InternalCoreSetup, InternalCoreStart } from './internal_types'; import { CoreUsageDataService } from './core_usage_data'; import { DeprecationsService, config as deprecationConfig } from './deprecations'; diff --git a/src/core/server/status/routes/integration_tests/status.test.ts b/src/core/server/status/routes/integration_tests/status.test.ts index 0b7599941ae48..6034542fab932 100644 --- a/src/core/server/status/routes/integration_tests/status.test.ts +++ b/src/core/server/status/routes/integration_tests/status.test.ts @@ -10,17 +10,17 @@ import { BehaviorSubject, firstValueFrom } from 'rxjs'; import supertest from 'supertest'; import { omit } from 'lodash'; -import { createCoreContext, createHttpServer } from '../../../http/test_utils'; -import { ContextService } from '../../../context'; +import { ContextService } from '@kbn/core-http-context-server-internal'; +import { createCoreContext, createHttpServer } from '@kbn/core-http-server-mocks'; +import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { metricsServiceMock } from '../../../metrics/metrics_service.mock'; -import { MetricsServiceSetup } from '../../../metrics'; -import { HttpService, InternalHttpServiceSetup } from '../../../http'; +import type { MetricsServiceSetup } from '../../../metrics'; import { registerStatusRoute } from '../status'; import { ServiceStatus, ServiceStatusLevels, ServiceStatusLevel } from '../../types'; import { statusServiceMock } from '../../status_service.mock'; import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks'; -import { contextServiceMock } from '../../../context/context_service.mock'; +import { contextServiceMock } from '@kbn/core-http-context-server-mocks'; const coreId = Symbol('core'); diff --git a/src/core/server/status/status_service.test.ts b/src/core/server/status/status_service.test.ts index 35870b4a7540e..13f2b65f75b99 100644 --- a/src/core/server/status/status_service.test.ts +++ b/src/core/server/status/status_service.test.ts @@ -18,9 +18,9 @@ import { StatusService } from './status_service'; import { first, take, toArray } from 'rxjs/operators'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { environmentServiceMock } from '@kbn/core-environment-server-mocks'; +import { mockRouter, RouterMock } from '@kbn/core-http-router-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { ServiceStatusLevelSnapshotSerializer } from './test_utils'; -import { httpServiceMock } from '../http/http_service.mock'; -import { mockRouter, RouterMock } from '../http/router/router.mock'; import { metricsServiceMock } from '../metrics/metrics_service.mock'; import { configServiceMock } from '@kbn/config-mocks'; import { coreUsageDataServiceMock } from '../core_usage_data/core_usage_data_service.mock'; diff --git a/src/core/server/status/status_service.ts b/src/core/server/status/status_service.ts index 119069d310f9c..dc73bd83c4625 100644 --- a/src/core/server/status/status_service.ts +++ b/src/core/server/status/status_service.ts @@ -24,8 +24,8 @@ import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; import type { PluginName } from '@kbn/core-base-common'; import type { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; import type { InternalEnvironmentServiceSetup } from '@kbn/core-environment-server-internal'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { InternalElasticsearchServiceSetup } from '../elasticsearch'; -import { InternalHttpServiceSetup } from '../http'; import { InternalSavedObjectsServiceSetup } from '../saved_objects'; import { InternalMetricsServiceSetup } from '../metrics'; import { registerStatusRoute } from './routes'; diff --git a/src/core/server/test_utils.ts b/src/core/server/test_utils.ts index 4e2f8855209ff..ac7a70fae470d 100644 --- a/src/core/server/test_utils.ts +++ b/src/core/server/test_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -export { createHttpServer } from './http/test_utils'; +export { createHttpServer } from '@kbn/core-http-server-mocks'; export { ServiceStatusLevelSnapshotSerializer } from './status/test_utils'; export { setupServer } from './saved_objects/routes/test_utils'; export { diff --git a/src/core/server/types.ts b/src/core/server/types.ts index 33998dd92c555..0e49ebbf851d6 100644 --- a/src/core/server/types.ts +++ b/src/core/server/types.ts @@ -44,4 +44,4 @@ export type { } from './saved_objects/service'; export type { DomainDeprecationDetails, DeprecationsGetResponse } from './deprecations/types'; export * from './ui_settings/types'; -export type { ExternalUrlConfig } from './http'; +export type { ExternalUrlConfig } from '@kbn/core-http-server-internal'; diff --git a/src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts b/src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts index 544d113cd3622..e94c696b4eca8 100644 --- a/src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts +++ b/src/core/server/ui_settings/create_or_upgrade_saved_config/integration_tests/create_or_upgrade.test.ts @@ -16,7 +16,7 @@ import { } from '../../../../test_helpers/kbn_server'; import { createOrUpgradeSavedConfig } from '../create_or_upgrade_saved_config'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { httpServerMock } from '../../../http/http_server.mocks'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; const logger = loggingSystemMock.create().get(); describe('createOrUpgradeSavedConfig()', () => { diff --git a/src/core/server/ui_settings/integration_tests/lib/servers.ts b/src/core/server/ui_settings/integration_tests/lib/servers.ts index 8beb13e2d2534..be76df74e88ab 100644 --- a/src/core/server/ui_settings/integration_tests/lib/servers.ts +++ b/src/core/server/ui_settings/integration_tests/lib/servers.ts @@ -8,8 +8,9 @@ import type supertest from 'supertest'; import type { Client } from '@elastic/elasticsearch'; -import type { SavedObjectsClientContract, IUiSettingsClient } from '../../..'; +import { httpServerMock } from '@kbn/core-http-server-mocks'; +import type { SavedObjectsClientContract, IUiSettingsClient } from '../../..'; import { createTestServers, TestElasticsearchUtils, @@ -18,7 +19,6 @@ import { HttpMethod, getSupertest, } from '../../../../test_helpers/kbn_server'; -import { httpServerMock } from '../../../http/http_server.mocks'; let servers: TestUtils; let esServer: TestElasticsearchUtils; diff --git a/src/core/server/ui_settings/ui_settings_service.test.ts b/src/core/server/ui_settings/ui_settings_service.test.ts index ad72f29dc4bd7..64ba0880816e0 100644 --- a/src/core/server/ui_settings/ui_settings_service.test.ts +++ b/src/core/server/ui_settings/ui_settings_service.test.ts @@ -10,13 +10,13 @@ import { BehaviorSubject } from 'rxjs'; import { schema } from '@kbn/config-schema'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; +import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { MockUiSettingsClientConstructor, MockUiSettingsDefaultsClientConstructor, getCoreSettingsMock, } from './ui_settings_service.test.mock'; import { UiSettingsService, SetupDeps } from './ui_settings_service'; -import { httpServiceMock } from '../http/http_service.mock'; import { savedObjectsClientMock } from '../mocks'; import { savedObjectsServiceMock } from '../saved_objects/saved_objects_service.mock'; import { uiSettingsType } from './saved_objects'; diff --git a/src/core/server/ui_settings/ui_settings_service.ts b/src/core/server/ui_settings/ui_settings_service.ts index 342514660e8d1..b386396af8e33 100644 --- a/src/core/server/ui_settings/ui_settings_service.ts +++ b/src/core/server/ui_settings/ui_settings_service.ts @@ -11,9 +11,9 @@ import { mapToObject } from '@kbn/std'; import type { Logger } from '@kbn/logging'; import type { CoreContext, CoreService } from '@kbn/core-base-server-internal'; +import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; import { SavedObjectsClientContract } from '../saved_objects/types'; import { InternalSavedObjectsServiceSetup } from '../saved_objects'; -import { InternalHttpServiceSetup } from '../http'; import { UiSettingsConfigType, config as uiConfigDefinition } from './ui_settings_config'; import { UiSettingsClient } from './ui_settings_client'; import { diff --git a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts index 8cd0400d82cb0..1fc22ca685cc5 100644 --- a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts +++ b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts @@ -15,8 +15,7 @@ import { KibanaRequest, RequestHandler } from '@kbn/core/server'; // TODO: find a better way to get information from the request like remoteAddress and remotePort // for forwarding. -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ensureRawRequest } from '@kbn/core/server/http/router'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; import { ESConfigForProxy } from '../../../../types'; import { getElasticsearchProxyConfig, diff --git a/src/plugins/console/server/routes/api/console/proxy/headers.test.ts b/src/plugins/console/server/routes/api/console/proxy/headers.test.ts index 27cad7d948696..f30cc5a4711cf 100644 --- a/src/plugins/console/server/routes/api/console/proxy/headers.test.ts +++ b/src/plugins/console/server/routes/api/console/proxy/headers.test.ts @@ -6,14 +6,17 @@ * Side Public License, v 1. */ -jest.mock('@kbn/core/server/http/router/request', () => ({ - ensureRawRequest: jest.fn(), -})); +jest.mock('@kbn/core-http-router-server-internal', () => { + const realModule = jest.requireActual('@kbn/core-http-router-server-internal'); + return { + ...realModule, + ensureRawRequest: jest.fn(), + }; +}); import { kibanaResponseFactory } from '@kbn/core/server'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ensureRawRequest } from '@kbn/core/server/http/router/request'; +import { ensureRawRequest } from '@kbn/core-http-router-server-internal'; import { getProxyRouteHandlerDeps } from './mocks'; diff --git a/src/plugins/data/server/search/session/mocks.ts b/src/plugins/data/server/search/session/mocks.ts index 047f12df822c4..33715810060a9 100644 --- a/src/plugins/data/server/search/session/mocks.ts +++ b/src/plugins/data/server/search/session/mocks.ts @@ -10,9 +10,7 @@ import moment from 'moment'; import type { IScopedSearchSessionsClient } from './types'; import { SearchSessionsConfigSchema } from '../../../config'; -export function createSearchSessionsClientMock(): jest.Mocked< - IScopedSearchSessionsClient -> { +export function createSearchSessionsClientMock(): jest.Mocked { return { getId: jest.fn(), trackId: jest.fn(), diff --git a/src/plugins/data/server/search/session/session_service.ts b/src/plugins/data/server/search/session/session_service.ts index 02f12a972f8b5..e46c9bc80a2cc 100644 --- a/src/plugins/data/server/search/session/session_service.ts +++ b/src/plugins/data/server/search/session/session_service.ts @@ -85,9 +85,7 @@ interface UpdateOrCreateQueueEntry { function sleep(ms: number) { return new Promise((r) => setTimeout(r, ms)); } -export class SearchSessionService - implements ISearchSessionService -{ +export class SearchSessionService implements ISearchSessionService { private sessionConfig: SearchSessionsConfigSchema; private readonly updateOrCreateBatchQueue: UpdateOrCreateQueueEntry[] = []; private security?: SecurityPluginSetup; diff --git a/src/plugins/data/server/search/session/types.ts b/src/plugins/data/server/search/session/types.ts index 1571136891106..e39a33774f073 100644 --- a/src/plugins/data/server/search/session/types.ts +++ b/src/plugins/data/server/search/session/types.ts @@ -27,7 +27,7 @@ import { SearchSessionSavedObjectAttributes } from '../../../common'; import { IKibanaSearchRequest, ISearchOptions } from '../../../common/search'; import { SearchSessionsConfigSchema, ConfigSchema } from '../../../config'; -export interface IScopedSearchSessionsClient { +export interface IScopedSearchSessionsClient { getId: (request: IKibanaSearchRequest, options: ISearchOptions) => Promise; trackId: ( request: IKibanaSearchRequest, @@ -35,18 +35,29 @@ export interface IScopedSearchSessionsClient { options: ISearchOptions ) => Promise; getSearchIdMapping: (sessionId: string) => Promise>; - save: (sessionId: string, attributes: Partial) => Promise | undefined>; - get: (sessionId: string) => Promise>; - find: (options: Omit) => Promise>; - update: (sessionId: string, attributes: Partial) => Promise>; + save: ( + sessionId: string, + attributes: Partial + ) => Promise | undefined>; + get: (sessionId: string) => Promise>; + find: ( + options: Omit + ) => Promise>; + update: ( + sessionId: string, + attributes: Partial + ) => Promise>; cancel: (sessionId: string) => Promise<{}>; delete: (sessionId: string) => Promise<{}>; - extend: (sessionId: string, expires: Date) => Promise>; + extend: ( + sessionId: string, + expires: Date + ) => Promise>; getConfig: () => SearchSessionsConfigSchema | null; } -export interface ISearchSessionService { - asScopedProvider: (core: CoreStart) => (request: KibanaRequest) => IScopedSearchSessionsClient; +export interface ISearchSessionService { + asScopedProvider: (core: CoreStart) => (request: KibanaRequest) => IScopedSearchSessionsClient; } export enum SearchStatus { diff --git a/src/plugins/data_view_editor/public/components/data_view_editor.tsx b/src/plugins/data_view_editor/public/components/data_view_editor.tsx index f984b8451b061..ff236e804c2b7 100644 --- a/src/plugins/data_view_editor/public/components/data_view_editor.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_editor.tsx @@ -24,6 +24,7 @@ export const DataViewEditor = ({ defaultTypeIsRollup = false, requireTimestampField = false, editData, + allowAdHocDataView, }: DataViewEditorPropsWithServices) => { const { Provider: KibanaReactContextProvider } = createKibanaReactContext(services); @@ -37,6 +38,7 @@ export const DataViewEditor = ({ defaultTypeIsRollup={defaultTypeIsRollup} requireTimestampField={requireTimestampField} editData={editData} + allowAdHocDataView={allowAdHocDataView} /> diff --git a/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx b/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx index dc000de1e20fd..744e3824e3c68 100644 --- a/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx @@ -20,6 +20,7 @@ import { useFormData, useKibana, GetFieldsOptions, + UseField, } from '../shared_imports'; import { ensureMinimumTime, getIndices, extractTimeFields, getMatchedIndices } from '../lib'; @@ -55,7 +56,7 @@ export interface Props { /** * Handler for the "save" footer button */ - onSave: (dataViewSpec: DataViewSpec) => void; + onSave: (dataViewSpec: DataViewSpec, persist: boolean) => void; /** * Handler for the "cancel" footer button */ @@ -63,6 +64,7 @@ export interface Props { defaultTypeIsRollup?: boolean; requireTimestampField?: boolean; editData?: DataView; + allowAdHoc: boolean; } const editorTitle = i18n.translate('indexPatternEditor.title', { @@ -79,6 +81,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ defaultTypeIsRollup, requireTimestampField = false, editData, + allowAdHoc, }: Props) => { const { services: { http, dataViews, uiSettings, overlays }, @@ -88,6 +91,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ // Prefill with data if editData exists defaultValue: { type: defaultTypeIsRollup ? INDEX_PATTERN_TYPE.ROLLUP : INDEX_PATTERN_TYPE.DEFAULT, + isAdHoc: false, ...(editData ? { title: editData.title, @@ -129,11 +133,11 @@ const IndexPatternEditorFlyoutContentComponent = ({ dataViewName: formData.name || formData.title, overlays, onEdit: async () => { - await onSave(indexPatternStub); + await onSave(indexPatternStub, !formData.isAdHoc); }, }); } else { - await onSave(indexPatternStub); + await onSave(indexPatternStub, !formData.isAdHoc); } }, }); @@ -371,6 +375,7 @@ const IndexPatternEditorFlyoutContentComponent = ({

{editData ? editorTitleEditMode : editorTitle}

+ {indexPatternTypeSelect} @@ -409,9 +414,13 @@ const IndexPatternEditorFlyoutContentComponent = ({