Skip to content

Commit

Permalink
[Saved Objects] Remove deprecation notices from server SO types (#150839
Browse files Browse the repository at this point in the history
)

## Summary

After merging #148979 there are a
few interfaces in the server-side code that export a reference to a
deprecated SO type.

In this PR we fix them by updating a few imports to use the
non-deprecated SO type. Additionally, we resolve a potential circular
reference issue between `core-saved-objects-server` and
`core-saved-objects-api-server` by "moving" saved objects and related
types exports to `core-saved-objects-api-server`
  • Loading branch information
jloleysens authored Feb 15, 2023
1 parent 15d558c commit 5b0b09b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ export type {
SavedObjectsBulkDeleteStatus,
SavedObjectsBulkDeleteResponse,
} from './src/apis';

export type {
SavedObject,
SavedObjectAttribute,
SavedObjectAttributes,
SavedObjectAttributeSingle,
SavedObjectReference,
} from '@kbn/core-saved-objects-common/src/server_types';
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { SavedObject } from '@kbn/core-saved-objects-common';
import type { SavedObject } from '../..';

/**
* Base options used by most of the savedObject APIs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
* Side Public License, v 1.
*/

import type {
SavedObjectReference,
SavedObjectsMigrationVersion,
} from '@kbn/core-saved-objects-common';
import type { SavedObjectsMigrationVersion } from '@kbn/core-saved-objects-common';
import type { SavedObjectReference } from '../..';

/**
* Object parameters for the bulk create operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import type { SavedObjectsMigrationVersion } from '@kbn/core-saved-objects-common';
import type { SavedObjectReference } from '@kbn/core-saved-objects-common';
import type { SavedObjectReference } from '../..';
import type { MutatingOperationRefreshSetting, SavedObjectsBaseOptions } from './base';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
AggregationsAggregationContainer,
SortResults,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { SavedObject } from '@kbn/core-saved-objects-common';
import type { SavedObject } from '../..';

type KueryNode = any;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { SavedObject } from '@kbn/core-saved-objects-common';
import type { SavedObject } from '../..';

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { SavedObjectReference, SavedObject } from '@kbn/core-saved-objects-common';
import type { SavedObject, SavedObjectReference } from '../..';
import type { MutatingOperationRefreshSetting, SavedObjectsBaseOptions } from './base';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { SavedObject } from '@kbn/core-saved-objects-common';
import type { SavedObject } from '..';
import type {
SavedObjectsBaseOptions,
SavedObjectsFindOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ export type {
SavedObjectModelTransformationResult,
} from './src/model_version';

// We re-export the SavedObject types here for convenience.
export type {
SavedObject,
SavedObjectAttribute,
SavedObjectAttributes,
SavedObjectAttributeSingle,
SavedObjectReference,
} from '@kbn/core-saved-objects-common/src/server_types';
} from '@kbn/core-saved-objects-api-server';

0 comments on commit 5b0b09b

Please sign in to comment.