-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose saved object import/export from core #42022
Conversation
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
@rudolf this PR looks big, but a lot of it is |
src/core/server/index.ts
Outdated
SavedObjectsImportResponse, | ||
SavedObjectsImportRetry, | ||
SavedObjectsResolveImportErrorsOptions, | ||
getSortedObjectsForExport, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to export types from src/core/server/index.ts
since the functionality will get exposed through core.savedObjects
(next up on my todo list).
To prevent you from being blocked by my work, you can remove getSortedObjectsForExport
, importSavedObjects
& resolveImportErrors
from this file and then in saved_objects_mixin.js import them from src/core/server/saved_objects/export
and add a ts-lint ignore comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I'll make this change
src/core/server/server.api.md
Outdated
@@ -515,6 +532,14 @@ export class SavedObjectsClient { | |||
// @public | |||
export type SavedObjectsClientContract = Pick<SavedObjectsClient, keyof SavedObjectsClient>; | |||
|
|||
// Warning: (ae-missing-release-tag) "SavedObjectsClientProviderOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a doc comment block above every exported type like:
/**
* @public
*/
Bonus points for adding a one liner to explain what the type does 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got it!
💚 Build Succeeded |
@rudolf ready for another review whenever you get a chance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the docs! 😍Happy for you to merge if you can expose the missing type.
src/core/server/server.api.md
Outdated
@@ -752,5 +872,6 @@ export interface SessionStorageFactory<T> { | |||
// | |||
// src/core/server/plugins/plugin_context.ts:34:10 - (ae-forgotten-export) The symbol "EnvironmentMode" needs to be exported by the entry point index.d.ts | |||
// src/core/server/plugins/plugins_service.ts:37:5 - (ae-forgotten-export) The symbol "DiscoveredPluginInternal" needs to be exported by the entry point index.d.ts | |||
// src/core/server/saved_objects/service/index.ts:47:5 - (ae-forgotten-export) The symbol "ExportObjectsOptions" needs to be exported by the entry point index.d.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you missed this type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops! good catch
💚 Build Succeeded |
* expose saved object import/export from core * additional tests * removing unused mock * updater snapshots * add objectLimit to saved objects service * don't export the import/export functionality from core; only types * documenting exported types * export missing type
* expose saved object import/export from core * additional tests * removing unused mock * updater snapshots * add objectLimit to saved objects service * don't export the import/export functionality from core; only types * documenting exported types * export missing type
Summary
This is an extraction of the core changes from #38014 for easier review.
Exposes the saved object import/export functionality to the public saved objects service for plugins to use. In my case, the spaces plugin for the Copy-to-Space functionality.
This also tweaks the import/export code to accept an optional
namespace
parameter, so that we can dictate which namespace to perform the import/export operation against.