* Move SIEM public/ folder to NP plugin
This is solely renames; fixes come next.
* Update relative imports in our API tests
* Fix linter errors following move to NP folder
These paths got a little shorter, so some lines could be collapsed.
* Move client dependencies to NP package.json
I'm removing the @types/js-yaml for now because I'm not sure we need it;
I'll add it back later if we do.
* Fix relative imports to other plugins
* Fix errant uses of ui/chrome
* Remove legacy plugin shim
* Move feature registration into plugin
This previously had to be part of legacy bootstrapping due to an order
of operations issue.
* Disconnect legacy plugin
The index file should now be redundant with what's in the plugin:
* app registration
* feature registration
* Move public gitattributes
* Remove references to legacy embeddables
We can now use the NP API. Maps embeddable will not work here until
their work is merged, but this should prevent us from importing legacy
code and thus breaking the build.
* Add our frontend dependencies to kibana.json
These are all required for now, because that's how they're typed. If
they _should_ be optional (and I think several should), we need to
update the type and handle the null case within the app.
* Replace use of ui/new_platform mocks in embeddable utils
* Fix remaining jest tests
* Replace build-breaking ui/new_platform mocks with equivalents in core
proper
* Remove unnecessary mocks of ui/new_platform
* Remove references to legacy SIEM folder
* I left the reference in CODEOWNERS in case someone tries to sneak
something back
* I left the .gitignore reference for the same reason
* Fix mocks of relative paths
These were not caught by typescript and were causing test failures.
* Export our client plugin contracts
They're empty for now.
* Move from deprecated appmount API
The new one dropped a param we weren't using.
* Add missing mock causing test failures
* Don't re-export core types from our plugin
Import them from core where we need them, instead
* Move Actions UI registry outside of mount
This is already imported, there's no benefit (and potential timing
issues) with doing this inside the mount.
* Add security's setup contract to our StartServices
This doesn't change what's used, only how we're typing it. The types are now a
little more truthful as:
* our StartPlugins don't include setup contracts
* our StartServices includes everything we use at Start time, including
the one setup plugin.
* Add order and icon back to the sidebar link
* Replace plugin class properties with constants
These are shared, and should be consistent.
* Enable our UI on NP
* Add missed plugin dependencies
We're not using their contracts, but we are importing code from them.
* Revert use of constant in translation
Can't do that, whoops
* i18n our feature catalogue entry
* Remove unnecessary array from single element
* Remove unused keys
These were the legacy translations used... well, I don't know where they
were used.
* Ignore circular dependencies in external plugins
* Normalize exclusions
* Add undeclared dependencies to kibana.json
We import our maps embeddable from maps, and we pass inspector to the
embeddable. I just missed these in my audit. This was causing errors in
the map embeddable.
* Await our call to setLayerList
This is an async call that we need to complete before we can render.
* Reduce siem plugin size
When we load our initial plugin (before our app is loaded), were were
implicitly importing all of kibana_react with this import. While a
global module prevents this from affecting our bundle size currently,
that could change in the future. Since we only need a reference to our
class, we just import that instead.
This removes unneeded use of `any` throughout:
1. alerting
2. alerting_builtin
3. actions
4. task manager
5. event log
It also adds a linting rule that will prevent us from adding more `any` in the future unless an explicit exemption is made.
Major cleanup of the no_restricted_paths rule for imports of core.
For relative imports, we use eslint-module-utils/resolve which resolves
to the full filesystem path. So, to support relative and absolute
imports from the src alias we need to define both the directory and the
index including file extension.
This rule was handling both core imports, as well as imports from other
plugins. Imports from other plugins are being used much more liberally
allowed through the exceptions in tests. I choose to break these up,
removing this exception for tests for core imports.
Fixes:
Absolute imports of src/core/server/mocks were not allowed in src. This
was not an issue in x-pack due to the target excluding
!x-pack/**/*.test.* and !x-pack/test/**/*.
Non-top-level public and server imports were allowed from X-Pack tests
to the previously mentioned exclusion.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* Convert common/services and server/lib to TypeScript. Update Jest tests.
- Remove deserializeAutoFollowPattern behavior that returned an empty object if the pattern was undefined.
* Localize mocks with the component integration tests.
* Update API unit tests to use NP mocks.
- Break up test files.
- Use inline mocked ES response instead of fixture files.
- Move remaining fixture files into client integration tests directory.
* Make API route validation more strict.
* Publish isUiDisabled as part of Remote Clusters contract.
* Default trackUiMetric service to be a no-op.
* Remove security dependency.
- Fix license check so that CCR won't render if the license is invalid.
- Fix server security check to be more precise by checking if ES has security disabled.
* Render timestamp for autofollow errors.
* Move server code into NP folder
* NP config is not yet used
* Relative imports are somewhat broken
* Move common folder into NP
* Move cypress folder into NP
* Move scripts folder into NP
* Move misc. config into NP folder
A few of these were moved into the cypress folder as they're
cypress-specific.
I tried to update all the relative paths but some are likely broken. I'm
not going to know until other stuff is fixed, though.
* Move value for siem index pattern into common/constants
The other default values live in there, this is no different.
* Update paths following file move
If this was referencing the full project, it now references both paths
(legacy for UI, and NP for server).
* Fix typescript errors related to module resolution
These are mostly updating imports to the common/ folder on the UI side
(since things changed relative to those files).
* Replace Legacy Config with NP Config
* Updates plugin to use NP config
* defines new config previously coming from savedObjects config
* cleans up legacy types
Conflicts:
x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts
x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts
x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts
x-pack/plugins/siem/server/plugin.ts
x-pack/plugins/siem/server/routes/index.ts
x-pack/plugins/siem/server/types.ts
* Remove local SIEM tsconfig
This was originally added to address an issue with tsserver, but that
issue is no longer relevant. The presence of this file confuses
typescript into thinking that siem is a separate TS project.
* Update kibana.json to declare our dependencies
These are not necessarily correct in terms of what's required/optional,
but this is what's declared in our types.
* Remove legacy plugin instantiation
* Removes legacy instantiation of server plugin, which is now handled by
NP
* Loosens legacy config spec so we no longer have to duplicate config
types
* Update tests with NP config
These were written against the old Hapi config function; now, we just
have a POJO.
* Update es_archiver helpers' paths
I'm not quite sure if these are working yet, but they're no longer
throwing errors.
* Ignore restricted path on script
This was cribbed from infra, who has made a similar change.
* Ignore restricted path on temporary savedObject mappings import
This will be changed subsequently when we switch to the NP form of
savedObject type registration.
* Add symlink to lockfile
* Fix paths on circular deps script
* Add separate config for Rule and Timeline saved objects
We had previously used the savedObjects' config, but those are not
currently exposed to us on New Platform. For now, we're going to split
this into two sets of values for the SOs we deal with
importing/exporting within the SIEM app, with the same defaults as
savedObjects.
* Fixing relative paths within cypress
These are strings that wouldn't be caught by typescript.
* Move the default_editor to NP
* Fix paths
* Import styles through the visualize
* Other fixes
* Fix ip_ranges exhaustive-deps array
* Fix filters and extend bounds
* Other fixes
* Fix date_ranges tests
* Use useMount on first render
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [ML] Client side cut over
* updating paths and commented code
* changes based on review
* disabling telemetry tests
* fixing start job stylesheets
* fixing everything that is broken
* fixing types and ml icon order
* using icon constant
* Shim the default_editor
* Update paths in vis_default_editor
* Update paths in dependent plugins
* Update the dependent plugins
* Create an entry point
* Wrap the editor with kibana context
* Fix circular re-renders
* Update sub aggs mapping
* Move schemas and agg_groups to agg_types, update jest tests
* Use services from kibana context, other fixes
* Fix useEffect maximum update depth
* Create i18n namesapce for visDefaultEditor, rename translations
* Fix tests
* Resolve paths
* Remove ui/vis/vis_types
* Fix vis import
* Move editor_config_provider to ui/vis
* Disallow importing Joi client side
* Move elasticsearch lib into server folder
* Add a comment about the 'joi' eslint rule
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* shim of kbn_vislib_vis_types (now vis_type_vislib)
* Move vislib into vis_type_vislib plugin
* Convert remaining plugin files to typescript
* Rename vis to vis_type_vislib
* share specific instances of some ui packages
* remove unnecessary eslint changes, every package will define deps anyway
* remove mentions of moment webpackShims in eslint resolver
* remove use of lodash
* list angular as dep for x-pack
* add operations as codeowner of shared-deps pkg
* Delete uptime eslint rules.
* Update hooks usage to adhere to new eslint rules.
* Delete code accidentally added during rebase.
* WIP trying things.
* Clean up types and hook usage to comply with kibana eslint rules.
* Clean up code.
* Update new useEffect hooks that are missing dependencies.
* Fix edits that broke a page.
* Licensing plugin and XPackInfo uses the same license data (#52507)
* convert xpackinfo to TS
* use NP Licensing plugin in XPackInfo
* update mocks
* put license regresh hack back.
otherwise new license won't be re-fetched when signature changed. was deleted by mistake
* add functional test for legacy xpackmain
* declare setup types on client & server explicitly
* rename mock license --> licensing to match plugin name
* add tests for createLicensePoller
* fix type error
* adopt tests for xpack_info
* createXPackInfo uses new platform API
* put back error mute
* address comments
* fix renamed import
* address comment
* update tests to reduce delays
* deprecate xpack.xpack_main.xpack_api_polling_frequency_millis
* use snake_case in config
* fix wrong import
* First iteration of watch public -> new platform
Still need to switch to np ready version of use_request
* - Switched to using np ready request
- Some updates after API changes
* First attempt at server shim
* Rename file and re-enable react hooks linting
* Fix some public types and react hooks lint rules
* Fix types
* More ES lint react hooks fixes
* Migrated server lib -> ts. Part way done with migrating routes to NP router and TS
* Big subset of routes to TS and NP router - almost there
* Delete legacy error wrappers and moved last set of routes to TS and NP router
* Remove @ts-ignore's and update route registration to use shim with http router
* Added routes validations, fixes for hooks and fixes for types
* Fix more types and finish testing API routes
* Fix usage of feature catalogue and fix time buckets types
* Fix error message shape [skip ci]
* Split legacy from new platform dependencies server-side
* Refactor: Seperate client legacy and NP dependencies
* Add file: added types file
* Fix UISettings client type import
* Update license pre-routing factory spec
* Update variable names, use of I18nContext (use NP) and docs
* Use NP elasticsearchclient
* Simplify is_es_error_factory
* Fix types
* Improve code legibility and remove second use of `useAppContext`
* Use @kbn/config-schema (not validate: false) on routes!
* Fix watch create JSON spec
* Create threshold test working
* Unskip watch_edit.test.ts
* Unskip watch_list.test.ts
* Done re-enabling component integration tests
* TimeBuckets typo + remove unnecessary // @ts-ignore
* create service skeleton
* move registerCapabilitiesModifier to capabilities service and rename to registerCapabilitiesSwitcher
* starts to move capabilities logic to CapabilitiesService
* move capabilities route to service
* add initial integration test for capabilities route
* capabilitiesMixin now delegates to capability service
* use server-side Capabilities import in server code
* update generated doc
* remove capabilities from injectedMetadatas
* use applications sent from client instead of server-registered navLinks
* disable authRequired for capabilities route
* (temp) exposes two endpoints for capabilities
* Add fetch-mock on capabilities call for karma tests
* adapt xpack Capabilities test - first attempt
* adapt x-pack ui_capabilities test
* add '/status' to the list of anonymous pages
* Add documentation on Capabilities APIs
* move Capabilities to core/types
* update generated docs
* add service tests
* protecting resolveCapabilities against added/removed capabilities
* update generated docs
* adapt mocks due to rebase
* add forgotten exports
* improve capabilities routes registering
* name capabilities registering methods
* resolve conflicts due to merge
* address review issues
* add comment about reason for exposing two routes
* extract createHttpServer test helper
* fix merge conflicts
* improve documentation
* remove `/status` anon registration as now done in NP status plugin
* fix merge conflicts