Commit graph

60 commits

Author SHA1 Message Date
Pierre Gayvallet
a16c2ac56a
Migrate server-side Root and Server to packages (#144990)
## Summary

Fix https://github.com/elastic/kibana/issues/144255

Create the `@kbn/core-root-server-internal` package, and move `Root`,
`Server` and `bootstrap` to it.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-15 03:11:37 -07:00
Tiago Costa
7fbf260cc9
chore(NA): enable missing ts performant flags (#144872)
This PR enables `incremental` and `skipDefaultLibCheck` across the board
on our TS setup as recommended on the official TS performance wiki.
2022-11-09 09:36:34 -07:00
Sébastien Loix
2590173096
[ContentManagement] Inspector flyout (#144240) 2022-11-09 06:01:53 -07:00
Luke Elmers
4b863abc18
Adds base implementation of the Kibana Health Gateway. (#141172) 2022-11-07 09:14:42 -07:00
Gerard Soldevila
88815398e8
Add notifications plugin, offering basic email service (#143303)
* Misc enhancements following PR comments

* Adding functional tests

* Fixing types

* Fixing tests

* Removing unnecessary Promise.all

* Cleanup

* Misc fixes and simplifications

* Add missing tsconfig.json

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* Add dependency to Actions plugin in tsconfig.json

* Separate setup logic from start logic

* Fix bulkEnqueueExecution params structure

* Update README

* Add UTs

* Check license type >platinum for email notifications

* Fix incorrect UTs

* Import types when possible

* Misc enhancements and code cleanup

* Transform factory => provider, update start contract

* Code cleanup, update README

* Fix TS error

* Fix CI types error

* Address PR remarks

* Address PR remarks #2

Co-authored-by: Ying Mao <ying.mao@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-03 15:33:52 +01:00
Christiane (Tina) Heiligers
0ba81e12d4
IDM: Migrate core server-side core_app to package (#144075)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spencer@elastic.co>
2022-11-02 12:00:17 -07:00
Spencer
7d77d39e1f
[ts] set allowJs to true by default (#144281)
* [ts] set allowJs to true by default

* fix scripts/check_ts_projects, original implementation is now wildly inefficient

* produce stats in check_ts_projects to make sure it's actually working

* fix imports
2022-11-01 15:26:44 -07:00
Pierre Gayvallet
2fb12fbc54
Implement base browser-side logging system (#144107)
* start refactoring and moving stuff around

* add abstraction for BaseLogger

* plug logging into core system

* add logger factory to plugin init context

* add unit tests for browser package

* add more unit tests

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* fix mock

* add mocks, update system tests

* update files due to merge

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* update readme and package

* remove chalk usages from client-side

* add plugin context tests

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix new packages

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-01 01:16:32 -07:00
Jean-Louis Leysens
1ed2ec8e57
[Files] move to src (#144044) 2022-10-31 06:46:52 -07:00
spalger
e5d186a6f0
[ts] stop building @types packages in bootstrap 2022-10-28 14:03:55 -05:00
Yuliia Naumenko
64b5efebdd
Cleaned up Observability plugin from timelines unused dependencies on TGrid usage (#143607)
* Clean Observability plugin from timelines unused deps on TGrid usage

* -

* End of standalone version of TGrid

* fixed unused deps

* -

* Clean up variables

* Fixed tests

* FIxed tests

* Removed unused tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-19 15:52:39 -07:00
Cecilia Bollini
cea0d57cd9
[POC] Add Gainsight shipper for cloud (#141132)
* Add gainsight

* Fix gainsight build

* lint and prettier

* tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* fix tests

* test

* fix tests

* move the configuration out of the cloud plugin 2

* tests

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* pass deploymentId as user key

* Add css and widget

* lint

* tests

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* tests

* add render Css

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix gainSightApi

* replace cluster id with cluster name

* fix types and tests

* Fix license

* rename gainsight

* remove formatpayload

- remove formatPayload
- remove typeDeps from shipper/g/kibana.jsonc
- replace type shared-common with shared-browser

* Add and fix tests

- Add test for renderCss
- update tests checking identify with different userId
- remove optionalplugin security

* add tests to gainsight shipper

- test globalcontext request (set and remove)
- hash only in dist ==false

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* move check on gainsight init

* Remove translation update docs

- update docs
- always update userId

* licence

* fix tests

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-19 13:54:10 +01:00
Davis McPhee
39d193444f
[Discover] Create unified histogram plugin (#141872)
* [Discover] Create unifiedHistogram plugin

* [Discover] Move discover resizable panels to unifiedHistogram

* [Discover] Replace DiscoverPanels with unifiedHistogram Panels

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* [Discover] Fix types and limtis.yml for unifiedHistogram

* [Discover] Begin migrating layout and chart to unified_histogram

* [Discover] Update i18n keys from discover to unifiedHistogram

* [Discover] Update data-test-subj tags from discover to unifiedHistogram

* [Discover] Update classNames, ids, and scss to change discover to unifiedHistogram

* [Discover] Remove more references to discover from unifiedHistogram

* [Discover] Replace DiscoverServices with UnifiedHistogramServices

* [Discover] Replacing CHART_HIDDEN_KEY with chartHiddenKey prop

* [Discover] Add missing tsconfig references

* [Discover] Remove remaining references to discover from unifiedHistogram

* [Discover] Migrate HitsCounter to unifiedHistogram

* [Discover] Continue removing discover dependencies from unifiedHistogram

* [Discover] Replace SCSS with emotion

* [Discover] Changing PANELS_MODE to be internal

* [Discover] Clean up types

* [Discover] Clean up props and types

* [Discover] Update layout to use Chart component

* [Discover] Update discover_main_content

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [Discover] Update discover_main_content to use UnifiedHistogramLayout, clean up unifiedHistogram implementation and props, add missing bundles

* [Discover] Fix missing styles in unifiedHistogram

* [Discover] Fix issue where mouse can get out of sync with the resize handle with the Discover resizable layout

* [Discover] Fix some Jest tests

* [Discover] Update discoverQueryHits to unifiedHistogramQueryHits in tests

* [Discover] Finish decoupling discover_main_content from unified histogram layout

* [Discover] Create useDiscoverHistogram hook and remove old histogram dependencies from Discover

* [Discover] Move functions to create chart data from discover to unifiedHistogram

* [Discover] Continue fixing broken Jest tests

* Revert unifiedHistogram.reloadSavedSearchButton removal

* [Discover] Add missing type export and a better suspense fallback

* [Discover] Make callback names consistent

* [Discover] Continue cleanup and add documentation to unifiedHistogram

* [Discover] Update genChartAggConfigs to take object

* [Discover] Update UnifiedHistogramHitsContext.number to total

* [Discover] Cleanup imports

* [Discover] Add support for hiding the entire top panel in the unified histogram by leaving all context props undefined

* [Discover] Fix broken discover_layout unit tests

* [Discover] Clean up naming in discover_main_content

* [Discover] Continue fixing Jest tests and adding new tests

* [Discover] Finish writing Jest tests

* [Discover] Fix conflicts with getVisualizeInformation and triggerVisualizeActions after merge

* [Discover] Fix hiding reset chart height button when default chart height

* [Discover] Update CODEOWNER file

* [Discover] Removed types for @link comments

* [Discover] Fix broken discover_layout.test.tsx file

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-17 18:12:50 -03:00
Alejandro Fernández Haro
74f30dcf8e
Move Cloud Integrations out of the cloud plugin (#141103)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-04 12:25:25 +02:00
Alejandro Fernández Haro
8c4e8b5e66
A/B Testing via LaunchDarkly (#139212)
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-20 04:36:17 -07:00
Ying Mao
914d1cd41c
[Response Ops] [Connectors] Move connectors to own plugin (#139867)
* Initial commit of stack connectors plugin

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Fixing up xmatters. Moving library functions around

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* Fixing up webhook

* Fixing up teams and slack

* Fixing up index, email, pagerduty, server log

* Fixing i18n

* wip

* Moving well know email route to stack connectors plugin

* Fixing types

* Fixing unit tests

* Adding index.ts

* Cleanup

* Updating READMEs

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* Moving to domain specific folders and updating codeowners

* Fixing codeowners

* Fixing types

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-15 15:50:15 -04:00
Dario Gieselaar
b66cf585ca
[Profiling] Add Profiling application (#140722)
Co-authored-by: Joseph Crail <jbcrail@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: Joseph Crail <joseph.crail@elastic.co>
Co-authored-by: Stephanie Boomsma <stephanieboomsma@optimyze.cloud>
Co-authored-by: inge4pres <fgualazzi@gmail.com>
Co-authored-by: inge4pres <francesco.gualazzi@elastic.co>
Co-authored-by: Francesco Gualazzi <inge4pres@users.noreply.github.com>
Co-authored-by: Tim Rühsen <tim.ruhsen@elastic.co>
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>
2022-09-15 19:24:41 +02:00
Yulia Čech
95086f4365
[Onboarding] Create guided_onboarding plugin (#138611)
* [Guided onboarding] Smashed commit of all POC work for guided onboarding and guided onboarding example plugins

* [Guided onboarding] Fixed type errors

* [Guided onboarding] Removed guidedOnboardingExample limit

* [Guided onboarding] Fixed a functonal test for exposed configs

* [Guided onboarding] Fixed plugin limit

* [Guided onboarding] Added more information to the example plugin

* [Guided onboarding] Fixed no-console error

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [Guided onboarding] Fixed snake case errors

* move guided_onboarding out of x-pack

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alison.goryachev@elastic.co>
2022-09-15 11:35:35 +02:00
Davis McPhee
cb0a8057c8
[Discover] Enable tags for saved searches (#136162)
* [Discover] Add initial support for tags to saved search modal

* [Discover] Add tags to savedSearch types

* [Discover] Finish initial support for adding tags to saved searches

* [Discover] Start to convert saved object finder to a table in order to support tags

* [Discover] Add support for displaying saved search tags in open search flyout

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [Discover] Continue support for tags in saved object finder

* [Discover] Clean up saved object finder

* [Discover] Finish initial support for tags in saved object finder

* [Discover] Update SimpleSavedObject constructor to SimpleSavedObjectImpl

* [Discover] Remove orig files

* [Discover] Saved search tag type registration and telemetry

* [Discover] Create new saved_objects_finder plugin

* [Discover] Continue work creating saved_objects_finder plugin

* [Discover] Revert some changes in saved_objects

* [Discover] Revert some changes in saved_objects again

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [Discover] Update saved_objects_finder i18n keys

* [Discover] Update docs

* [Discover] Add plugins to saved_object_finder and fix broken types

* [Discover] Finish creating saved_objects_finder plugin and use it in Discover

* [Discover] Update SavedObjectFinderProps type export, and update x-pack telemetry

* [Discover] Fix broken jest tests

* [Discover] Update saved_objects_finder API

* [Discover] Remove unused translations

* [Discover] Fix issue with initial saved object finder fetch

* [Discover] Fix some of the saved object finder jest tests

* [Discover] Clean up finder after merge

* [Discover] Fixing saved_object_finder.tsx

* [Discover] Add savedObjectsTaggingOss reference to saved_search plugin

* [Discover] Fix broken open_search_panel test

* [Discover] Removed allowed types from saved object finder

* [Discover] Removing type column when there's only one saved object type, and adjusting column widths

* [Discover] Fix issue where visible types were entirely removed, fixed pageSizeOptions

* [Discover] Add showFilter to open_search_panel's saved_objects_finder, fallback to all available types when no type filter is applied to saved_objects_finder, hide type column and filter button when there is only one type in metadata list

* [Discover] Fix remaining saved_object_finder Jest tests

* [Discover] Update snapshot

* [Discover] Fix failing functional tests

* [Discover] Add tagging Jest tests for saved_objects_finder

* [Discover] Fix small bugs in saved_object_finder, update Jest tests, add functional tests for Discover saved search tagging

* [Discover] Removed unused variable in functional test

* [Discover] Update Discover Jest tests with tagging tests

* [Discover] Remove translations

* [Discover] Updating saved_objects_finder to use static export vs preconfigured component, adding lazy load support

* [Discover] Move saved_object_finder service deps to a 'services' prop, fix broken open_search_panel Jest test

* [Discover] Fix broken Jest test

* [Discover] Fix broken Jest test from merge

* [Discover] Fix discover tags integration test description

* - Updated tags prop to be `string | undefined`
- Type imports cleanup
- Added loading indicator for saved object finder
- Changed `savedObjectsPlugin.settings.getListingLimit()` to `uiSettings.get(LISTING_LIMIT_SETTING)`
- Removed old saved object finder comment
- Removed tag changes from transform plugin
- Change code owners of saved_objects_finder to Data Discovery

* [Discover] Fixed LISTING_LIMIT_SETTING import

* [Discover] Revert tags saving change that introduced a bug

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* [Discover] Try again to fix LISTING_LIMIT_SETTINGS import

* [Discover] Fix failing snapshot

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-01 13:14:13 -03:00
Jean-Louis Leysens
ac0688b90f
[Files] Create files example plugin (#139019)
* created files example stub

* implementing whimsical design

* added base64d image

* updated files client and example plugin to work end-to-end with browser

* added file deletion funcitonality

* added codeowners entry

* refactor downloadSrc to getDownloadHref

* react-query -> @tanstack/react-query

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-23 10:38:22 +02:00
Julia Rechkunova
47b69298a5
[UnifiedFieldList] Move Field Stats from Lens to UnifiedFieldList plugin (#136328)
* [UnifiedFieldList] Bootstrap a new unifiedFieldList plugin

* [UnifiedFieldList] Move backend API for field stats from Lens to UnifiedFieldList plugin

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* [Discover] Address CI checks

* [UnifiedFieldList] Move field stats UI from Lens to UnifiedFieldList plugin

* [Discover] Integrate FieldStats into Discover field popover

* [Discover] Show both views side to side

* [Discover] Allow for some customization

* [Discover] Allow for more customization

* [UnifiedFieldList] Remove temporary code

* [UnifiedFieldList] Extract styles

* [UnifiedFieldList] Fix after merge

* [UnifiedFieldList] Extend i18n

* [UnifiedFieldList] Migrate stats API from server to public

* [UnifiedFieldList] Update types

* [UnifiedFieldList] Update Lens tests

* [UnifiedFieldList] Update Lens tests

* [UnifiedFieldList] Before merging

* [UnifiedFieldList] After merging

* [UnifiedFieldList] Refactor localization keys

* [UnifiedFieldList] Update types

* [UnifiedFieldList] Reintroduce server API for field stats and refactor integration tests

* [UnifiedFieldList] Update limits

* [UnifiedFieldList] Rename the component

* [UnifiedFieldList] Improve types

* [UnifiedFieldList] Add AbortController

* [UnifiedFieldList] Render counts in PopoverFooter in Lens

* [UnifiedFieldList] Hide new stats from Discover for now

* [UnifiedFieldList] Fix tests

* [UnifiedFieldList] Rename to loadFieldStats

* [UnifiedFieldList] Rearrange utils

* [UnifiedFieldList] Fix types

* [UnifiedFieldList] Fix references

* [UnifiedFieldList] Use emotion css

* [UnifiedFieldList] Increase limits

* [UnifiedFieldList] Add first tests

* [UnifiedFieldList] Add more tests

* [UnifiedFieldList] Refactor interface to accept services object

* [UnifiedFieldList] Update types

* [UnifiedFieldList] Add docs

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* [UnifiedFieldList] Add missing references

* [UnifiedFieldList] Tmp

* [UnifiedFieldList] Revert changes from Discover for now

* [Discover] Add again new translation keys

* [UnifiedFieldList] Remove old translation keys

* [UnifiedFieldList] Update tests

* [UnifiedFieldList] Update data test subj prop

* Update src/plugins/unified_field_list/public/services/field_stats.ts

Co-authored-by: Davis McPhee <davismcphee@hotmail.com>

* [UnifiedFieldList] Lazy load FieldStats component

* [UnifiedFieldList] Lazy load loadFieldStats function

* [UnifiedFieldList] Fix tests

* [UnifiedFieldList] Remove newly added translations

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2022-08-23 10:08:37 +02:00
Clint Andrew Hall
0fbd0afdb1
[Shared UX] Complete package migration; delete plugin (#138962)
* [Shared UX] Complete package migration; delete plugin

* [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest'

* Fix types, fix tests

* Create Storybook config package; organize Storybook

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* Revise Storybook config package; make mock packages compatible with web

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-18 13:00:03 -05:00
Joe Reuter
fcf3b8bb21
[Discover] Split saved searches out of discover plugin (#138388) 2022-08-12 11:19:40 +02:00
Jean-Louis Leysens
a182b8e9be
Files plugin (#137421)
* added files plugin

* [Files] Create files saved object and blob storage (#131886)

* initial version of file saved objects

* initial version of file saved objects part ii

* added .blob index and setup logic for the file service and the blob service

* wip: need to add .blob access to kibana_system role

* use multiple-isolated after speaking of oleg

* added metadata field

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* updated file statuses per feedback

* removed created_by and added "alt" text field and converted "name" to type "text" too

* split content_type into mime and extension

* use BlobStorage interface in adapters prop

* minor fixes

* handle multiple Kibanas at startup time

* fix jest test

* do not set up index at setup time

* set importable exportable to false explicitly

* remove use of non-existent function

* added plugin ID, use type instead of interface to avoid specific interface issue and use typescript to check that properties map corresponds to type

* remove storage_id for now

* make the name snake case!

* added fixmes

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

* [Files] Implement ES-based blob store (#132123)

* minor clean up

* remove unused import

* added modified version of the content stream from reporting

* remove plugin_id, replace with file_kind

* remove unused commented out code and clean up imports

* added jest.config.js

* added FileChunkDocument interface and added the head_chunk_id for easier deletion of related file chunks

* added an additional test case for writing with content stream

* first implementation of ES blob storage

* fix imports

* get closer to a final version of the blobstore interface, use esClient.get rather than esClient.search since we are using IDs

* added jest integration tests

* add some comments

* fix: eslint types issues

* remove unused values

* minor refactor for clarity

* fix when saved objects are registered

* remove unused variable

* fix jest tests and make getMaxSize function sync

* fix logger prefixes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* [Files] File service CRUD functionality and audit logging (#132416)

* big ol wipperooni, but got a lot of initial functionality written out

* added some todos and fixed import

* finish adding integration tests for file service! also added the partial update capability to file

* added file service integration tests and finalized Files and InternalFileService APIs

* added security plugin

* big refactor for security audit logging: FileServiceFactory

* type lint

* update delete file integration test and remove done TODOs

* move comment

* docs, accessibility modifiers and updated some import ordering

* fix comments

* pass in index name to ES blob store

* tidy up debug and error messages

* [Files] Added more chunking Jest integration tests (#132530)

* added more thorough integration tests of chunking

* refactor chunksize to a value that is passed to the ES constructor, update a comment and update tests

* [Files] Public API v1 (#132602)

* created public API, everything except the file registry

* ensure the custom meta types are working as expected

* added index: false to content

* Revert "added index: false to content"

This reverts commit 74259f86638aefc24755874cbd6ac89e0170c192.

* updated comment

* update how ids are generated

* also filter out deleted files

* fix id generation

* test file deletion after upload failure

* [Files] File kinds registry v0.1 (#132700)

* initial commit of file kind registry

* add actual registry

* updated attributes reduceer slightly

* separate blob storage interface, make the blob storage type a unique const

* added integration test for file kinds

* update test after adding registry logic

* partial attributes

* [Files] Blob storage with attributes (#134057)

* updated blob storage interface with attributes

* added dynamic: false to the file chunk doc for ES blob store

* update mocks

* support attributes at the blob store level part i

* actually test setting of attributes, also refactor app_extra_data to app_meta_data

* remove unused import

* some corrections to tests, also refresh after creating a blob that has attributes to enable search

* remove unnecessary default

* getBaseId -> getContentReferenceId and added a bunch of doc comments

* refactored getting of attribute chunk id, encapsulate everything inside content stream

* remove app_search_data

* app_meta_data -> app_metadata

* [Files] Added `Transform` to blob stores (#134846)

* added max byte size stream transform

* added stream transforms to files

* rename MaxByteSize to MaxByteSizeTransform

* try a cool cool ternary, yeah

* minor refactor

* address PR feedback

* [Files] File kind HTTP APIs and tests (#134655)

* first version of dynamically creating file kinds routes

* added update, delete, download, list and find endpoints and some minor refactoring

* added return statement and additional requirement for file kind ids to be URI safe

* update comment

* added API integration tests for the file kinds routes, a lot of refactoring; removed the upload endpoint service since this does not make since with proxies, fixed a bunch of issues in registering routes and the enhanced file kind router

* move the method to the specific route file too

* remove unused function

* add download content type response header

* remove unused import

* download http method should be "get" not "delete"

* actually pass through the mime type

* slight refactor after changing the create file response

* findFile => getById

* remove trailing verbs

* update copy

* addressing pr feedback

* added missing property

* fix copy

* added comment

* regrouping imoprts

* rename "find" route to "getById"

* [File storage] Public-side Client (#135403)

* refactor store name

* wip: first version of restful-ish endpoint types captured in one place except for path

* use the endpoint definition directly

* added first iteration of files client based on shared types

* slight refactor

* added content type headers and removed unused type

* slight refactor and expose server and public side types

* finish refactor

* updated files plugin ui limits

* [Files] Public file sharing service (#135598)

* add new public file saved object type

* generate random token

* file share service, first iteration

* initial version of files share service work, we can create a file share

* delete shares when a file is deleted

* refactor to InternalFileSharingService because certain events need to be audited

* further clean up and added a comment

* finish refactor

* update tests

* refactor tractor

* move integration tests folder

* does not need to be async, also added some samples to doc comment

* added comment

* use SO object references instead of hacking it yourself, also added comments and moved some stuff around

* refactor to internal file share service

* fix type lint

* valid_until as unix ts

* commit simplify random string generator

* fix type issues and update SO integration tests

* woops, 51 not 55

* change label

* minor refactor to file service (#135836)

* remove attributes from blobstore layer and update IDs to be xxxxx.1 instead of 1.xxxxx (#136294)

* [Files] Refactor File metadata (#136370)

* refactor tractor keeps on rolling

* fix type issues

* [Files] Conform with new blob store specification (#136396)

* refactor es mappings

* move puid file

* updated the content stream implementation to support identifying "last" chunk

* updated the es blob store

* updated es mappings

* minor updates to the file object, but importantly, passing the file ID to the blob store so that files and blobs are connected

* updated test assertion

* rather use cuid because it uses cryptography to reduce the chance of collisions (#136658)

* do not index bid field (#136707)

* [Files] Find endpoint (#136529)

* refactor http endpoint interface names

* wip on find files route, need to create shared test harness and test utils

* added toJSON helper

* pass through the filter

* fix refactor to "getById" on file service instead of find and move order of attributes

* actually add the toJSON utility

* added shared integration test setup code

* added find route path to common

* return if 400 is returned when trying to create blob storage index. This is an edge case that can be hit if creation happens at the same time

* update the find algo to build a kuery expression string that we pass to SO service, note: we want to prevent query injection shenanigans so we JSON.stringify

* updated the create endpoint to enforce mime type from file type, thank you

* updated the create endpoint to enforce mime type from file type, thank you

* updated some tests and actually register the find enpoint, also updated to use mimeType

* added a few integration level tests for the new find endpoint

* updated the new setup integration test harness for use in new find and old file kinds integration tests

* use flattened type for "Meta" and "hash" fields on saved object so that we can store multiple values in an object and search

* updated import with "type" annotation

* added readme explaining patterns used for routes

* fix file kind integration tests

* remove unused endpoint

* do not expose chunk size and compression for now

* use nodeBuilder rather than manually building a kuery string

* make query strings limited in length and refactor "Extension" to "extension" plus some other minor changes

* reorg some lines

* [Files] Use `application/cbor` to optimise file uploads and downloads (#136528)

* move puid file

* added cbor-x dependency

* remove all references to "raw" from the test code

* remove "encoding" parameter and refactor to use cbor encoding for blob chunks, in this way we do not encoding our payloads to UTF-8 or Base64 Kibana side, only decode

* fixed content stream tests

* require instead of import cbor-x for now

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* try disable eslint comment scoped

* download also as cbor to buffer directly, also updated upload endpoint to report when content has already been uploaded

* updated tests and handle some edge case when reading buffers

* remove unused require and added a comment

* moved lengthy comment to separate file

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

* [Files] Added metrics endpoint and functionality (#136725)

* added service-level functionality for getting usage metrics

* built the metrics endpoint

* do not count size of deleted files

* updated comment

* added agg by status and extension

* update test assertions

* [Files] File errors (#136946)

* added domain-specific errors

* map file errors to http responses and clean up list endpoint

* [Files] Public File share HTTP endpoints (#137172)

* refactor where server and client routes are declared

* added new endpoint types and refactor api/files/files/metrics|share to api/files/metrics|share

* added some more comments, a new error type for the file share service and created the endpoint handler for creating file shares

* added doc comments to the file kind interface

* rename test utils folder to "test_utils" and added a basic test for creating a share

* added test_util folder and updated share test

* added new endpoint types, updated import to test utils, updated share name

* added unshare endpoint

* added share list endpoint and refactored share JSON with version that contains token and version without

* actually register the list shares route

* a bunch of refactoring for saved object type "id" rather than "token" for the object id, also added the public download endpoint

* updated error behavior on download endpoint

* fixed test

* use unix timestamp in seconds

* added file name param to public download endpoint and added shared fileName schema

* remove unused file and added public download tests

* share to shares

* added get endopint and updated tests and test titles per feedback

* added get endpoint

* updated test and back to milliseconds on validUntil

* updated name of params in route and update error message in response

* return only known messages in the expected format

* update test

* use Readable.from

* reintroduce crazy typecasting

* added security audit log tests (#137253)

* [Files] Generate download headers utility tests (#137203)

* move common schema to common schema file and move THAT file to a shared location

* update mime type behaviour

* update integration tests

* added a little something to the README

* update cbor-x to latest

* delete "require" of cbor-x

* upgrade cbor-x

* rename "public" to "public_facing"

* remove old lint rule

* added a bunch of docs

* fix interface surface area

* more doc comments

* more more doc comments

* more more more doc comments

* more more more more doc comments

* more more more more more more doc comments

* Actually 50GiB

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>

* Remove unnecessary comment

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>

* hasContent -> isReady

* only call the createIndexIfNotExists function once per instance

* [Files] Create files client (#137879)

* biig refactor to use FileClient in File and remove all metadata functionality from file service

* update file service factory to work with metadata client after refactor

* also rename file share updateable attrs interface

* updated use of types in saved objects client

* export function arg types

* added the creation helper file and added an example file for using it

* implement find for the es index client

* moved the query builder logic to a shared place

* rename file, add prefixes and embed es doc in "file" key in ES document

* type exports

* fix bad rebase

* Minor changes and updates to types

* fix another minor type issue

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix minor type issues and update "update" behavior to only apply updatable fields bru

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* actually be able to update status... also some other types cleanups

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

* remove TODO

* update link to team

* throw errors more consistently

* createAuditLog -> writeAuditLog

* more more more more more more more doc comments

* more more more more more more more more doc comments

* more more more more more more more more more doc comments

* more more more more more more more more more more doc comments

* more more more more more more more more more more more more  doc comments

* [Files] ES client tests (#138174)

* move test utils and update expected metric size

* remove cuid from "file"

* update file client to set id using cuid and update types

* moved test utils and wip of integration tests for file client

* added es-index backed file client tests

* adjust the upload endpoint to also return the file size

* added size to response expect

* fix some type issues

* fix type issues

* [Files] Register routes at setup time (#138392)

* updated the fileKindRegistory to live behind a getter setter so that instantation can be taken care of in one place

* refactor conditional endpoint registration and update tests to register file kind after setup

* register routes at setup time

* remove outdated README

* fix import of non-existent function

* register routes...

* [Files] PR feedback 1 (#138417)

* update comments and plugin description

* filter lists and finds on non-deleted files

* updated comment

* added tests for larger files and files exactly divisible by chunk size

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* do not use regexp

* fix test assertion

* update content stream tests

* make fewer fields searchable

* ok

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

* remove legacy comment

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
2022-08-11 12:31:49 +02:00
Thom Heymann
a0731f139e
Add user profile selectable (#137424)
* Add reusable user profile selector component

* Move to package and add examples

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Add server side example

* CI Fixes

* fix tests

* Addd tests

* Addressed suggestions from code review

* Fix types

* Updated user avatar component

* Tweak styling and copy

* Add missing jsdoc comments

* .

* .

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-04 22:09:01 +01:00
Nick Peihl
69dc7e2b77
[Maps] Custom raster source example plugin (#136761) 2022-07-26 14:41:45 -07:00
Philippe Oberti
19aa51e5a8
[TIP] Add new Threat intelligence plugin (#136479)
* [TIP] Add Threat Intelligence plugin

- create Threat Intelligence plugin and integrate with Security Solution plugin
- setup jest unit tests, i18n, Cypress tests and  Storybook
- fetch Indicator of Compromise, and display in data-grid
- add flyout components to show IOCs details (table and JSON)
- add new threatIntelInt entry to kbn-doc-links package

https://github.com/elastic/security-team/issues/4329
https://github.com/elastic/security-team/issues/4138
https://github.com/elastic/security-team/issues/4241
https://github.com/elastic/security-team/issues/4242
https://github.com/elastic/security-team/issues/4244
https://github.com/elastic/security-team/issues/4245

Co-authored-by: lgmys <lgmys@pm.me>
Co-authored-by: Maxim Kholod <maxim.kholod@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-07-25 19:27:05 +02:00
Spencer
03f1a218c5
[core] remove root index.ts file (#137001)
* [core] remove root index.ts file

* remove support for `kibana/*` imports, replace instances in docs
2022-07-22 15:04:23 -07:00
Jiawei Wu
09872f071c
[RAM] Refactor: move shareable component sandbox to its own plugin (#134611)
* Move shareable component sandbox to its own plugin

* Add newline and fix test

* disable lint for no-default-export on example tests

* Fix lint

* Address feedback

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-19 09:30:11 -07:00
Carlos Crespo
b58d07e05b
[Stack Monitoring] Add OpenTelemetry metrics to Monitoring Collection plugin (#135999)
* Add otel metrics to alerting plugin

* clean up otel poc

* Bump @opentelemetry/api-metrics and @opentelemetry/exporter-metrics-otlp-grpc versions to 0.30.0

* Add integration test for prometheus endpoint; improve reademe.md

* Fix tsconfig.base.json missing entries

* Bump @opentelemetry/sdk-metrics-base; clean up

* Rename PrometheusExporter properties

* Readme formatting tweaks

* Fix incorrect path

* Remove grpc dependency

* Add grpc back for handling auth headers

* Fix comment positioning

* Include authenticated OTLP in readme

* Extract dynamic route into a new file

* Enable otlp logging and compatibility with env vars

* Enable OTEL_EXPORTER_OTLP_ENDPOINT env var

Co-authored-by: Mat Schaffer <mat@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-14 13:29:09 +02:00
Andrew Tate
3891aeb95f
[Chart expressions] new metric vis expression (#135461) 2022-07-08 12:07:43 -05:00
Christos Nasikas
65834334d3
[Cases] Attach framework registry (#134744)
* Create external reference attachment registry

* Pass externalReferenceAttachmentTypeRegistry to cases client

* Better types

* Show external references user action

* Handle unregistered events

* Add e2e tests

* Fixe fixture plugin naming

* Add cases fixture plugin to tsconfig

* Fix types

* Improvements

* Fix types

* Fixes

* Fix bug

* Add unit test
2022-06-30 12:58:16 -07:00
Alejandro Fernández Haro
a2b0927e65
[EBT] Better FTR helper APIs (#135298) 2022-06-29 14:11:13 +02:00
Vadim Kibana
1b2c58f58e
ui_actions_enchanced to /src (#133512)
* move ui_actions_enhanced to /src

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* move translations to /src

* fix typescript errors

* update config files

* update ts configs

* fix config path

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-06-07 18:33:21 +02:00
Jack
4b1a049559
[Security Solution] Create security solution kubernetes experimental page and kubernetes_security plugin (#131858)
* Add kubernetes link on nav sidebar

* Create new plugin for k8s vis page

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paulo Henrique <paulo.scape@gmail.com>
2022-05-31 11:40:37 -04:00
Walter Rafelsberger
c968e508f6
[ML] Explain log rate spikes: Move API stream demos to Kibana examples. (#132590)
This creates a response_stream plugin in the Kibana /examples section. The plugin demonstrates API endpoints that can stream data chunks with a single request with gzip/compression support. gzip-streams get decompressed natively by browsers. The plugin demonstrates two use cases to get started: Streaming a raw string as well as a more complex example that streams Redux-like actions to the client which update React state via useReducer().
2022-05-24 16:59:31 +02:00
Walter Rafelsberger
6df1b28a82
[ML] Explain log rate spikes: Plugin setup (#131317)
Sets up the boilerplate code for the aiops plugin and adds a demo page within the ML app to demonstrate single API request data streaming from Kibana server to UI client.
2022-05-12 13:36:53 +02:00
Anton Dosov
e603d92552
Remove data_enhanced plugin (#122075)
Code moved into `data` plugin
2022-04-29 16:43:59 +02:00
Shahzad
a4a082271e
[Synthetics] Rename uptime plugin to synthetics (#130037)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-04-20 11:53:28 -07:00
spalger
bd8171c13e [plugins] use module ids to import across plugins 2022-04-16 01:19:05 -05:00
Clint Andrew Hall
d92b7feeff
[typescript] Create Ambient Types package (#129368)
* WIP

* tweak @kbn/ambient-ui-types for special usecase

* remove @types/ for ambient-ui-types, the package is a types package

* Split types; remove duplicate types in packages

* Adjust README

* Update CODEOWNERS

* Addressing feedback

* Move to tsconfig.base.json

* Fix missing types array in kbn/field-types

* Addressing errors

* Return declaration

* move storybook types to storybook specific package

* add codeowner for new package

Co-authored-by: spalger <spencer@elastic.co>
2022-04-06 19:21:24 -05:00
Brian Seeders
16af3e612d
[TypeScript] Upgrade to 4.5.3 (#120812) 2021-12-13 12:54:17 -05:00
Tyler Smalley
92a8636f0f
Upgrade Typescript to 4.3.5 (#104470)
Co-authored-by: Mikhail Shustov <restrry@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
Co-authored-by: Kyle Pollich <kpollich1@gmail.com>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Kevin Qualters <kevin.qualters@elastic.co>
Co-authored-by: Candace Park <candace.park@elastic.co>
Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: spalger <spencer@elastic.co>
2021-12-02 16:27:41 -08:00
Frank Hassanabad
fcf86628a0
Adds missing DOM.Iterable (#115218)
## Summary

It was brought to our attention from security solutions that developers found we are missing the iterators and entries and others from TypeScript that are available when you include within `lib` `DOM.iterable`.

For example without it you cannot use `entries` like this:

<img width="985" alt="Screen Shot 2021-10-15 at 9 10 17 AM" src="https://user-images.githubusercontent.com/1151048/137512234-d14dc43c-129a-49d4-bc6c-410baf2d46f7.png">

Until you add it within he base config. Developers are indicating they noticed that workarounds such as lodash or casting is possible but I think this is the wrong direction to go and it's just an oversight that we missed adding the `DOM.iterable` unless someone tells us otherwise. If it is intentional to omit I would like to add docs to the `tsconfig.base.json` about why we omit it for programmers to understand the intention and why we should discourage use or recommend a library such as lodash instead.
2021-10-18 13:22:49 -04:00
Spencer
c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
Greg Thompson
fa03028688
Enable CSS-in-JS styling with emotion (#98157)
* emotion deps

* kbn-babel

* kbn-test

* examples

* babel-plugin-styled-components config

* css prop type fixes

* type context

* declaration location

* some emotion types resolved

* clean up

* emotion v10 accomodations

* types

* kbn-crypto

* kbn-telemetry-tools

* bazel

* eslint rule; shared file regex array

* update paths

* Update packages/kbn-eslint-plugin-eslint/rules/module_migration.js

Co-authored-by: Spencer <email@spalger.com>

* remove placeholder styles

* doc api changes

* snapshot updates

* storybook comments

* use constant

* bump new deps

* condense versions

Co-authored-by: Spencer <email@spalger.com>
2021-07-09 13:42:50 -05:00
Tiago Costa
f69d63e8be
fix(NA): windows ts_project outside sandbox compilation (#100947)
* fix(NA): windows ts_project outside sandbox compilation adding tsconfig paths for packages

* chore(NA): missing @kbn paths for node_modules so types can work

* chore(NA): missing @kbn paths for node_modules so types can work

* chore(NA): organizing deps on non ts_project packages

* chore(NA): change order to find @kbn packages on node_modules first

* chore(NA): add @kbn/expect typings setting on package.json

* chore(NA): fix typechecking

* chore(NA): add missing change on tsconfig file

* chore(NA): unblock windows build by not depending on the pkg_npm rule symlink in the package.json

* chore(NA): add missing depedencies on BUILD.bazel file for io-ts-list-types

* chore(NA): remove rootDirs configs

* chore(NA): change kbn/monaco targets order

* chore(NA): update kbn-monaco build

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-03 17:53:39 +01:00
Greg Thompson
38fd8a268a
Upgrade EUI to v33.0.0 (#99382)
* eui to 33.0.0

* resize observer type inclusion - revisit

* src snapshot updates

* x-pack snapshot updates

* table sort test updates

* code block language sh -> bash

* datagrid datetime sort inversion

* types

* kbn-crypto

* refractor yarn resolution

* refractor yarn resolution

* update cypress tests

* url state test

* trial

* Revert "trial"

This reverts commit adc3538145.

* trial anomaly timeout

* Revert "trial anomaly timeout"

This reverts commit 9a11711ba8.

* kbn-telemetry-tools

* Change a useMemo to useCallback so the code executes when intended

* Removed no-longer-used import

* exitOrFail already retries for longer than tryForTime

* Wait for loading indicator to disappear

* Intentionally adding `.only`

* Revert .only

* Increase wait time for the ML chart to load

* Remove unused var

* overflow

* chartWidth

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
2021-06-01 10:53:07 -05:00
Mikhail Shustov
e457f212c4
Revert "TS Incremental build exclude test files (#95610)" (#96223)
This reverts commit b6e582c53e.
2021-04-05 11:59:26 -07:00
Mikhail Shustov
b6e582c53e
TS Incremental build exclude test files (#95610)
* add base config for all the TS projects

* all the project use new tsconfig.project.json

* compile test files in the high-level tsconfig.json

* fix TS error in maps plugin

* fix TS error in infra plugin

* exclude mote test and test until folders

* uptime. do not import test code within prod code

* expressions. do not import test code within prod code

* data: export mocks from high level folder

* task_manager: comply with es client typings

* infra: remove unused enzyme_helpers

* check_ts_project requires "include" key

* ts_check should handle parent configs

* all ts configs should extend base one

* exclude test folders from plugins

* update patterns to fix ts_check errors

* Apply suggestions from code review

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* uptime: MountWithReduxProvider to test helpers

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-01 14:40:47 +02:00