diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md index d8202545f0ea..a8894286de91 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md @@ -25,6 +25,5 @@ This is only internal for now, and will only be public when we expose the regist | [mappings](./kibana-plugin-core-server.savedobjectstype.mappings.md) | SavedObjectsTypeMappingDefinition | The [mapping definition](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) for the type. | | [migrations](./kibana-plugin-core-server.savedobjectstype.migrations.md) | SavedObjectMigrationMap | An optional map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) to be used to migrate the type. | | [name](./kibana-plugin-core-server.savedobjectstype.name.md) | string | The name of the type, which is also used as the internal id. | -| [namespaceAgnostic](./kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md) | boolean | Is the type global (true), or not (false). | | [namespaceType](./kibana-plugin-core-server.savedobjectstype.namespacetype.md) | SavedObjectsNamespaceType | The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) for the type. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md deleted file mode 100644 index e34742159048..000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md +++ /dev/null @@ -1,18 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsType](./kibana-plugin-core-server.savedobjectstype.md) > [namespaceAgnostic](./kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md) - -## SavedObjectsType.namespaceAgnostic property - -> Warning: This API is now obsolete. -> -> Use `namespaceType` instead. -> - -Is the type global (true), or not (false). - -Signature: - -```typescript -namespaceAgnostic?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md index 69912f914498..3a3b0f7f3a9a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md @@ -9,5 +9,5 @@ The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) f Signature: ```typescript -namespaceType?: SavedObjectsNamespaceType; +namespaceType: SavedObjectsNamespaceType; ``` diff --git a/examples/embeddable_examples/server/todo_saved_object.ts b/examples/embeddable_examples/server/todo_saved_object.ts index 0f67c53cfa3e..58da2014de49 100644 --- a/examples/embeddable_examples/server/todo_saved_object.ts +++ b/examples/embeddable_examples/server/todo_saved_object.ts @@ -22,7 +22,7 @@ import { SavedObjectsType } from 'kibana/server'; export const todoSavedObject: SavedObjectsType = { name: 'todo', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { title: { diff --git a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts index 44add4e97700..2c710d4eaa07 100644 --- a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts @@ -26,7 +26,7 @@ const createRegistry = (...types: Array>) => { types.forEach(type => registry.registerType({ name: 'unknown', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, migrations: {}, @@ -41,7 +41,7 @@ test('mappings without index pattern goes to default index', () => { kibanaIndexName: '.kibana', registry: createRegistry({ name: 'type1', - namespaceAgnostic: false, + namespaceType: 'single', }), indexMap: { type1: { @@ -73,7 +73,7 @@ test(`mappings with custom index pattern doesn't go to default index`, () => { kibanaIndexName: '.kibana', registry: createRegistry({ name: 'type1', - namespaceAgnostic: false, + namespaceType: 'single', indexPattern: '.other_kibana', }), indexMap: { @@ -106,7 +106,7 @@ test('creating a script gets added to the index pattern', () => { kibanaIndexName: '.kibana', registry: createRegistry({ name: 'type1', - namespaceAgnostic: false, + namespaceType: 'single', indexPattern: '.other_kibana', convertToAliasScript: `ctx._id = ctx._source.type + ':' + ctx._id`, }), @@ -141,12 +141,12 @@ test('throws when two scripts are defined for an index pattern', () => { const registry = createRegistry( { name: 'type1', - namespaceAgnostic: false, + namespaceType: 'single', convertToAliasScript: `ctx._id = ctx._source.type + ':' + ctx._id`, }, { name: 'type2', - namespaceAgnostic: false, + namespaceType: 'single', convertToAliasScript: `ctx._id = ctx._source.type + ':' + ctx._id`, } ); diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts index ef3f546b5e57..64270c677ff2 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts @@ -32,7 +32,7 @@ const createRegistry = (...types: Array>) => { types.forEach(type => registry.registerType({ name: 'unknown', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, migrations: {}, diff --git a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.mock.ts b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.mock.ts index 257b32c1e4c2..3f5c0c387661 100644 --- a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.mock.ts +++ b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.mock.ts @@ -27,7 +27,7 @@ const defaultSavedObjectTypes: SavedObjectsType[] = [ { name: 'testtype', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { name: { type: 'keyword' }, diff --git a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts index 336eeff99f47..cda0e86f15bd 100644 --- a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts @@ -28,8 +28,8 @@ const createRegistry = (types: Array>) => { types.forEach(type => registry.registerType({ name: 'unknown', - namespaceAgnostic: false, hidden: false, + namespaceType: 'single', mappings: { properties: {} }, migrations: {}, ...type, @@ -120,7 +120,7 @@ function mockOptions(): KibanaMigratorOptions { { name: 'testtype', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { name: { type: 'keyword' }, @@ -131,7 +131,7 @@ function mockOptions(): KibanaMigratorOptions { { name: 'testtype2', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', indexPattern: 'other-index', mappings: { properties: { diff --git a/src/core/server/saved_objects/routes/integration_tests/test_utils.ts b/src/core/server/saved_objects/routes/integration_tests/test_utils.ts index 82a889f75d3c..23e0285201dc 100644 --- a/src/core/server/saved_objects/routes/integration_tests/test_utils.ts +++ b/src/core/server/saved_objects/routes/integration_tests/test_utils.ts @@ -49,7 +49,7 @@ export const createExportableType = (name: string): SavedObjectsType => { return { name, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: {}, }, diff --git a/src/core/server/saved_objects/saved_objects_type_registry.test.ts b/src/core/server/saved_objects/saved_objects_type_registry.test.ts index 84337474f3ee..f82822f90f48 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.test.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.test.ts @@ -183,14 +183,6 @@ describe('SavedObjectTypeRegistry', () => { expectResult(false, { namespaceType: 'single' }); expectResult(false, { namespaceType: undefined }); }); - - // deprecated test cases - it(`returns true when namespaceAgnostic is true`, () => { - expectResult(true, { namespaceAgnostic: true, namespaceType: 'agnostic' }); - expectResult(true, { namespaceAgnostic: true, namespaceType: 'multiple' }); - expectResult(true, { namespaceAgnostic: true, namespaceType: 'single' }); - expectResult(true, { namespaceAgnostic: true, namespaceType: undefined }); - }); }); describe('#isSingleNamespace', () => { @@ -213,14 +205,6 @@ describe('SavedObjectTypeRegistry', () => { expectResult(false, { namespaceType: 'agnostic' }); expectResult(false, { namespaceType: 'multiple' }); }); - - // deprecated test cases - it(`returns false when namespaceAgnostic is true`, () => { - expectResult(false, { namespaceAgnostic: true, namespaceType: 'agnostic' }); - expectResult(false, { namespaceAgnostic: true, namespaceType: 'multiple' }); - expectResult(false, { namespaceAgnostic: true, namespaceType: 'single' }); - expectResult(false, { namespaceAgnostic: true, namespaceType: undefined }); - }); }); describe('#isMultiNamespace', () => { @@ -243,14 +227,6 @@ describe('SavedObjectTypeRegistry', () => { expectResult(false, { namespaceType: 'single' }); expectResult(false, { namespaceType: undefined }); }); - - // deprecated test cases - it(`returns false when namespaceAgnostic is true`, () => { - expectResult(false, { namespaceAgnostic: true, namespaceType: 'agnostic' }); - expectResult(false, { namespaceAgnostic: true, namespaceType: 'multiple' }); - expectResult(false, { namespaceAgnostic: true, namespaceType: 'single' }); - expectResult(false, { namespaceAgnostic: true, namespaceType: undefined }); - }); }); describe('#isHidden', () => { diff --git a/src/core/server/saved_objects/saved_objects_type_registry.ts b/src/core/server/saved_objects/saved_objects_type_registry.ts index be3fdb86a994..740313a53d1e 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.ts @@ -72,11 +72,7 @@ export class SavedObjectTypeRegistry { * resolves to `false` if the type is not registered */ public isNamespaceAgnostic(type: string) { - return ( - this.types.get(type)?.namespaceType === 'agnostic' || - this.types.get(type)?.namespaceAgnostic || - false - ); + return this.types.get(type)?.namespaceType === 'agnostic'; } /** @@ -84,6 +80,7 @@ export class SavedObjectTypeRegistry { * resolves to `true` if the type is not registered */ public isSingleNamespace(type: string) { + // in the case we somehow registered a type with an invalid `namespaceType`, treat it as single-namespace return !this.isNamespaceAgnostic(type) && !this.isMultiNamespace(type); } @@ -92,7 +89,7 @@ export class SavedObjectTypeRegistry { * resolves to `false` if the type is not registered */ public isMultiNamespace(type: string) { - return !this.isNamespaceAgnostic(type) && this.types.get(type)?.namespaceType === 'multiple'; + return this.types.get(type)?.namespaceType === 'multiple'; } /** diff --git a/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts b/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts index a6b580e9b346..ea881805e1ae 100644 --- a/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts +++ b/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts @@ -32,7 +32,7 @@ describe('SavedObjectsRepository#createRepository', () => { typeRegistry.registerType({ name: 'nsAgnosticType', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { name: { type: 'keyword' }, @@ -44,7 +44,7 @@ describe('SavedObjectsRepository#createRepository', () => { typeRegistry.registerType({ name: 'nsType', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', indexPattern: 'beats', mappings: { properties: { @@ -56,7 +56,7 @@ describe('SavedObjectsRepository#createRepository', () => { typeRegistry.registerType({ name: 'hiddenType', hidden: true, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { name: { type: 'keyword' }, diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index 9efc82603b17..b50c6dc9a1ab 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -202,15 +202,10 @@ export interface SavedObjectsType { * See {@link SavedObjectsServiceStart.createInternalRepository | createInternalRepository}. */ hidden: boolean; - /** - * Is the type global (true), or not (false). - * @deprecated Use `namespaceType` instead. - */ - namespaceAgnostic?: boolean; /** * The {@link SavedObjectsNamespaceType | namespace type} for the type. */ - namespaceType?: SavedObjectsNamespaceType; + namespaceType: SavedObjectsNamespaceType; /** * If defined, the type instances will be stored in the given index instead of the default one. */ diff --git a/src/core/server/saved_objects/utils.test.ts b/src/core/server/saved_objects/utils.test.ts index 64bdf1771dec..033aeea7c018 100644 --- a/src/core/server/saved_objects/utils.test.ts +++ b/src/core/server/saved_objects/utils.test.ts @@ -421,14 +421,6 @@ describe('convertTypesToLegacySchema', () => { namespaceType: 'multiple', mappings: { properties: {} }, }, - // deprecated test case - { - name: 'typeD', - hidden: false, - namespaceAgnostic: true, - namespaceType: 'multiple', // if namespaceAgnostic and namespaceType are both set, namespaceAgnostic takes precedence - mappings: { properties: {} }, - }, ]; expect(convertTypesToLegacySchema(types)).toEqual({ typeA: { @@ -448,12 +440,6 @@ describe('convertTypesToLegacySchema', () => { isNamespaceAgnostic: false, multiNamespace: true, }, - // deprecated test case - typeD: { - hidden: false, - isNamespaceAgnostic: true, - multiNamespace: false, - }, }); }); }); diff --git a/src/core/server/saved_objects/utils.ts b/src/core/server/saved_objects/utils.ts index 534896381262..af7c08d1fbfc 100644 --- a/src/core/server/saved_objects/utils.ts +++ b/src/core/server/saved_objects/utils.ts @@ -82,8 +82,8 @@ export const convertTypesToLegacySchema = ( return { ...schema, [type.name]: { - isNamespaceAgnostic: type.namespaceAgnostic || type.namespaceType === 'agnostic', - multiNamespace: !type.namespaceAgnostic && type.namespaceType === 'multiple', + isNamespaceAgnostic: type.namespaceType === 'agnostic', + multiNamespace: type.namespaceType === 'multiple', hidden: type.hidden, indexPattern: type.indexPattern, convertToAliasScript: type.convertToAliasScript, diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 37051da4b17d..e549112f7d72 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -2251,9 +2251,7 @@ export interface SavedObjectsType { mappings: SavedObjectsTypeMappingDefinition; migrations?: SavedObjectMigrationMap; name: string; - // @deprecated - namespaceAgnostic?: boolean; - namespaceType?: SavedObjectsNamespaceType; + namespaceType: SavedObjectsNamespaceType; } // @public diff --git a/src/core/server/ui_settings/saved_objects/ui_settings.ts b/src/core/server/ui_settings/saved_objects/ui_settings.ts index 031315bec0da..1bea65ddee92 100644 --- a/src/core/server/ui_settings/saved_objects/ui_settings.ts +++ b/src/core/server/ui_settings/saved_objects/ui_settings.ts @@ -22,7 +22,7 @@ import { SavedObjectsType } from '../../saved_objects'; export const uiSettingsType: SavedObjectsType = { name: 'config', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { // we don't want to allow `true` in the public `SavedObjectsTypeMappingDefinition` type, however // this is needed for the config that is kinda a special type. To avoid adding additional internal types diff --git a/src/plugins/data/server/saved_objects/index_patterns.ts b/src/plugins/data/server/saved_objects/index_patterns.ts index 9838071eee5a..497dbb7d6f63 100644 --- a/src/plugins/data/server/saved_objects/index_patterns.ts +++ b/src/plugins/data/server/saved_objects/index_patterns.ts @@ -23,7 +23,7 @@ import { indexPatternSavedObjectTypeMigrations } from './index_pattern_migration export const indexPatternSavedObjectType: SavedObjectsType = { name: 'index-pattern', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', management: { icon: 'indexPatternApp', defaultSearchField: 'title', diff --git a/src/plugins/data/server/saved_objects/query.ts b/src/plugins/data/server/saved_objects/query.ts index ff0a6cfde811..015cc7c6cb13 100644 --- a/src/plugins/data/server/saved_objects/query.ts +++ b/src/plugins/data/server/saved_objects/query.ts @@ -22,7 +22,7 @@ import { SavedObjectsType } from 'kibana/server'; export const querySavedObjectType: SavedObjectsType = { name: 'query', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', management: { icon: 'search', defaultSearchField: 'title', diff --git a/src/plugins/data/server/saved_objects/search.ts b/src/plugins/data/server/saved_objects/search.ts index 8b30ff7d0820..54de35a90ae0 100644 --- a/src/plugins/data/server/saved_objects/search.ts +++ b/src/plugins/data/server/saved_objects/search.ts @@ -23,7 +23,7 @@ import { searchSavedObjectTypeMigrations } from './search_migrations'; export const searchSavedObjectType: SavedObjectsType = { name: 'search', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', management: { icon: 'discoverApp', defaultSearchField: 'title', diff --git a/src/plugins/saved_objects_management/server/services/management.test.ts b/src/plugins/saved_objects_management/server/services/management.test.ts index 6b95048749fa..3625a3f91344 100644 --- a/src/plugins/saved_objects_management/server/services/management.test.ts +++ b/src/plugins/saved_objects_management/server/services/management.test.ts @@ -28,7 +28,7 @@ describe('SavedObjectsManagement', () => { registry.registerType({ name: 'unknown', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: {} }, migrations: {}, ...type, diff --git a/src/plugins/telemetry/server/collectors/application_usage/saved_objects_types.ts b/src/plugins/telemetry/server/collectors/application_usage/saved_objects_types.ts index 9f997ab7b5df..a0de79da565e 100644 --- a/src/plugins/telemetry/server/collectors/application_usage/saved_objects_types.ts +++ b/src/plugins/telemetry/server/collectors/application_usage/saved_objects_types.ts @@ -33,7 +33,7 @@ export function registerMappings(registerType: SavedObjectsServiceSetup['registe registerType({ name: 'application_usage_totals', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { appId: { type: 'keyword' }, @@ -46,7 +46,7 @@ export function registerMappings(registerType: SavedObjectsServiceSetup['registe registerType({ name: 'application_usage_transactional', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { timestamp: { type: 'date' }, diff --git a/src/plugins/telemetry/server/collectors/ui_metric/telemetry_ui_metric_collector.ts b/src/plugins/telemetry/server/collectors/ui_metric/telemetry_ui_metric_collector.ts index 3f6e1836cac7..603742f612a6 100644 --- a/src/plugins/telemetry/server/collectors/ui_metric/telemetry_ui_metric_collector.ts +++ b/src/plugins/telemetry/server/collectors/ui_metric/telemetry_ui_metric_collector.ts @@ -38,7 +38,7 @@ export function registerUiMetricUsageCollector( registerType({ name: 'ui-metric', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { count: { diff --git a/src/plugins/telemetry/server/plugin.ts b/src/plugins/telemetry/server/plugin.ts index 1df6a665e4d7..d1530c272027 100644 --- a/src/plugins/telemetry/server/plugin.ts +++ b/src/plugins/telemetry/server/plugin.ts @@ -125,7 +125,7 @@ export class TelemetryPlugin implements Plugin { registerType({ name: 'telemetry', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { enabled: { diff --git a/src/plugins/vis_type_timeseries/server/validation_telemetry/saved_object_type.ts b/src/plugins/vis_type_timeseries/server/validation_telemetry/saved_object_type.ts index 77b49e824334..f18fa1e4cc2f 100644 --- a/src/plugins/vis_type_timeseries/server/validation_telemetry/saved_object_type.ts +++ b/src/plugins/vis_type_timeseries/server/validation_telemetry/saved_object_type.ts @@ -31,7 +31,7 @@ const resetCount: SavedObjectMigrationFn = doc => ({ export const tsvbTelemetrySavedObjectType: SavedObjectsType = { name: 'tsvb-validation-telemetry', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { failedRequests: { diff --git a/src/plugins/visualizations/server/saved_objects/visualization.ts b/src/plugins/visualizations/server/saved_objects/visualization.ts index 9f4782f3ec73..cd2211c18553 100644 --- a/src/plugins/visualizations/server/saved_objects/visualization.ts +++ b/src/plugins/visualizations/server/saved_objects/visualization.ts @@ -23,7 +23,7 @@ import { visualizationSavedObjectTypeMigrations } from './visualization_migratio export const visualizationSavedObjectType: SavedObjectsType = { name: 'visualization', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', management: { icon: 'visualizeApp', defaultSearchField: 'title', diff --git a/test/api_integration/apis/saved_objects/migrations.js b/test/api_integration/apis/saved_objects/migrations.js index bd207ccb41b2..9d908b95ca57 100644 --- a/test/api_integration/apis/saved_objects/migrations.js +++ b/test/api_integration/apis/saved_objects/migrations.js @@ -383,7 +383,7 @@ function migrationsToTypes(migrations) { return Object.entries(migrations).map(([type, migrations]) => ({ name: type, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: {} }, migrations: { ...migrations }, })); diff --git a/x-pack/plugins/canvas/server/saved_objects/custom_element.ts b/x-pack/plugins/canvas/server/saved_objects/custom_element.ts index dadead0263be..14223455cbc2 100644 --- a/x-pack/plugins/canvas/server/saved_objects/custom_element.ts +++ b/x-pack/plugins/canvas/server/saved_objects/custom_element.ts @@ -10,7 +10,7 @@ import { CUSTOM_ELEMENT_TYPE } from '../../../../legacy/plugins/canvas/common/li export const customElementType: SavedObjectsType = { name: CUSTOM_ELEMENT_TYPE, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { dynamic: false, properties: { diff --git a/x-pack/plugins/canvas/server/saved_objects/workpad.ts b/x-pack/plugins/canvas/server/saved_objects/workpad.ts index e83ba9720b43..918f4bf99107 100644 --- a/x-pack/plugins/canvas/server/saved_objects/workpad.ts +++ b/x-pack/plugins/canvas/server/saved_objects/workpad.ts @@ -11,7 +11,7 @@ import { removeAttributesId } from './migrations/remove_attributes_id'; export const workpadType: SavedObjectsType = { name: CANVAS_TYPE, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { dynamic: false, properties: { diff --git a/x-pack/plugins/case/server/saved_object_types/cases.ts b/x-pack/plugins/case/server/saved_object_types/cases.ts index a4c5dab0feeb..cc2b1e74b38c 100644 --- a/x-pack/plugins/case/server/saved_object_types/cases.ts +++ b/x-pack/plugins/case/server/saved_object_types/cases.ts @@ -11,7 +11,7 @@ export const CASE_SAVED_OBJECT = 'cases'; export const caseSavedObjectType: SavedObjectsType = { name: CASE_SAVED_OBJECT, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { closed_at: { diff --git a/x-pack/plugins/case/server/saved_object_types/comments.ts b/x-pack/plugins/case/server/saved_object_types/comments.ts index 73b1852bafe5..8b69f272d5b0 100644 --- a/x-pack/plugins/case/server/saved_object_types/comments.ts +++ b/x-pack/plugins/case/server/saved_object_types/comments.ts @@ -11,7 +11,7 @@ export const CASE_COMMENT_SAVED_OBJECT = 'cases-comments'; export const caseCommentSavedObjectType: SavedObjectsType = { name: CASE_COMMENT_SAVED_OBJECT, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { comment: { diff --git a/x-pack/plugins/case/server/saved_object_types/configure.ts b/x-pack/plugins/case/server/saved_object_types/configure.ts index d66c38b6ea8f..d6bc3c9f2e22 100644 --- a/x-pack/plugins/case/server/saved_object_types/configure.ts +++ b/x-pack/plugins/case/server/saved_object_types/configure.ts @@ -11,7 +11,7 @@ export const CASE_CONFIGURE_SAVED_OBJECT = 'cases-configure'; export const caseConfigureSavedObjectType: SavedObjectsType = { name: CASE_CONFIGURE_SAVED_OBJECT, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { created_at: { diff --git a/x-pack/plugins/case/server/saved_object_types/user_actions.ts b/x-pack/plugins/case/server/saved_object_types/user_actions.ts index b61bfafc3b33..826c6907efea 100644 --- a/x-pack/plugins/case/server/saved_object_types/user_actions.ts +++ b/x-pack/plugins/case/server/saved_object_types/user_actions.ts @@ -11,7 +11,7 @@ export const CASE_USER_ACTION_SAVED_OBJECT = 'cases-user-actions'; export const caseUserActionSavedObjectType: SavedObjectsType = { name: CASE_USER_ACTION_SAVED_OBJECT, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { action_field: { diff --git a/x-pack/plugins/file_upload/server/telemetry/mappings.ts b/x-pack/plugins/file_upload/server/telemetry/mappings.ts index ca935fea3449..97a5ed9eeef8 100644 --- a/x-pack/plugins/file_upload/server/telemetry/mappings.ts +++ b/x-pack/plugins/file_upload/server/telemetry/mappings.ts @@ -10,7 +10,7 @@ import { TELEMETRY_DOC_ID } from './telemetry'; export const fileUploadTelemetryMappingsType: SavedObjectsType = { name: TELEMETRY_DOC_ID, hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { filesUploadedTotalCount: { diff --git a/x-pack/plugins/lens/server/saved_objects.ts b/x-pack/plugins/lens/server/saved_objects.ts index b2eb325c0926..ac80eb098e78 100644 --- a/x-pack/plugins/lens/server/saved_objects.ts +++ b/x-pack/plugins/lens/server/saved_objects.ts @@ -12,7 +12,7 @@ export function setupSavedObjects(core: CoreSetup) { core.savedObjects.registerType({ name: 'lens', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', management: { icon: 'lensApp', defaultSearchField: 'title', @@ -46,7 +46,7 @@ export function setupSavedObjects(core: CoreSetup) { core.savedObjects.registerType({ name: 'lens-ui-telemetry', hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { name: { diff --git a/x-pack/plugins/ml/server/lib/telemetry/mappings.ts b/x-pack/plugins/ml/server/lib/telemetry/mappings.ts index 87e224332842..5aaf9f8c79dc 100644 --- a/x-pack/plugins/ml/server/lib/telemetry/mappings.ts +++ b/x-pack/plugins/ml/server/lib/telemetry/mappings.ts @@ -10,7 +10,7 @@ import { TELEMETRY_DOC_ID } from './telemetry'; export const mlTelemetryMappingsType: SavedObjectsType = { name: TELEMETRY_DOC_ID, hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { file_data_visualizer: { diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/copy_to_spaces.test.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/copy_to_spaces.test.ts index 72faab0d2c89..d842f07cdb20 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/copy_to_spaces.test.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/copy_to_spaces.test.ts @@ -57,26 +57,26 @@ describe('copySavedObjectsToSpaces', () => { typeRegistry.getAllTypes.mockReturnValue([ { name: 'dashboard', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'visualization', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'globaltype', - namespaceAgnostic: true, + namespaceType: 'agnostic', hidden: false, mappings: { properties: {} }, }, ]); typeRegistry.isNamespaceAgnostic.mockImplementation((type: string) => - typeRegistry.getAllTypes().some(t => t.name === type && t.namespaceAgnostic) + typeRegistry.getAllTypes().some(t => t.name === type && t.namespaceType === 'agnostic') ); coreStart.savedObjects.getTypeRegistry.mockReturnValue(typeRegistry); diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/resolve_copy_conflicts.test.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/resolve_copy_conflicts.test.ts index aa1d5e9a4783..0654712ecff0 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/resolve_copy_conflicts.test.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/resolve_copy_conflicts.test.ts @@ -57,26 +57,26 @@ describe('resolveCopySavedObjectsToSpacesConflicts', () => { typeRegistry.getAllTypes.mockReturnValue([ { name: 'dashboard', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'visualization', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'globaltype', - namespaceAgnostic: true, + namespaceType: 'agnostic', hidden: false, mappings: { properties: {} }, }, ]); typeRegistry.isNamespaceAgnostic.mockImplementation((type: string) => - typeRegistry.getAllTypes().some(t => t.name === type && t.namespaceAgnostic) + typeRegistry.getAllTypes().some(t => t.name === type && t.namespaceType === 'agnostic') ); coreStart.savedObjects.getTypeRegistry.mockReturnValue(typeRegistry); diff --git a/x-pack/plugins/spaces/server/plugin.test.ts b/x-pack/plugins/spaces/server/plugin.test.ts index 0b9905d5e9c9..75ddee772b16 100644 --- a/x-pack/plugins/spaces/server/plugin.test.ts +++ b/x-pack/plugins/spaces/server/plugin.test.ts @@ -81,7 +81,7 @@ describe('Spaces Plugin', () => { expect(core.savedObjects.registerType).toHaveBeenCalledWith({ name: 'space', - namespaceAgnostic: true, + namespaceType: 'agnostic', hidden: true, mappings: expect.any(Object), migrations: expect.any(Object), diff --git a/x-pack/plugins/spaces/server/routes/api/__fixtures__/create_mock_so_service.ts b/x-pack/plugins/spaces/server/routes/api/__fixtures__/create_mock_so_service.ts index d8c318369834..cbe832e485d6 100644 --- a/x-pack/plugins/spaces/server/routes/api/__fixtures__/create_mock_so_service.ts +++ b/x-pack/plugins/spaces/server/routes/api/__fixtures__/create_mock_so_service.ts @@ -46,37 +46,37 @@ export const createMockSavedObjectsService = (spaces: any[] = []) => { typeRegistry.getAllTypes.mockReturnValue([ { name: 'visualization', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'dashboard', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'index-pattern', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }, { name: 'globalType', - namespaceAgnostic: true, + namespaceType: 'agnostic', hidden: false, mappings: { properties: {} }, }, { name: 'space', - namespaceAgnostic: true, + namespaceType: 'agnostic', hidden: true, mappings: { properties: {} }, }, ]); typeRegistry.isNamespaceAgnostic.mockImplementation((type: string) => - typeRegistry.getAllTypes().some(t => t.name === type && t.namespaceAgnostic) + typeRegistry.getAllTypes().some(t => t.name === type && t.namespaceType === 'agnostic') ); savedObjects.getTypeRegistry.mockReturnValue(typeRegistry); diff --git a/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.test.ts b/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.test.ts index 4a9756d9e03f..31f2c98d74c9 100644 --- a/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.test.ts +++ b/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.test.ts @@ -58,7 +58,7 @@ describe('SpacesSavedObjectsService', () => { "6.6.0": [Function], }, "name": "space", - "namespaceAgnostic": true, + "namespaceType": "agnostic", }, ] `); diff --git a/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts b/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts index 40ea49573e3c..58aa1fe08558 100644 --- a/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts +++ b/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts @@ -20,7 +20,7 @@ export class SpacesSavedObjectsService { core.savedObjects.registerType({ name: 'space', hidden: true, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: SpacesSavedObjectMappings, migrations: { '6.6.0': migrateToKibana660, diff --git a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts index f9961329c088..569219a0b899 100644 --- a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts +++ b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts @@ -13,21 +13,21 @@ import { SavedObjectTypeRegistry } from 'src/core/server'; const typeRegistry = new SavedObjectTypeRegistry(); typeRegistry.registerType({ name: 'foo', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }); typeRegistry.registerType({ name: 'bar', - namespaceAgnostic: false, + namespaceType: 'single', hidden: false, mappings: { properties: {} }, }); typeRegistry.registerType({ name: 'space', - namespaceAgnostic: true, + namespaceType: 'agnostic', hidden: true, mappings: { properties: {} }, }); diff --git a/x-pack/plugins/uptime/server/lib/saved_objects.ts b/x-pack/plugins/uptime/server/lib/saved_objects.ts index 175634ef797c..01004ad7c642 100644 --- a/x-pack/plugins/uptime/server/lib/saved_objects.ts +++ b/x-pack/plugins/uptime/server/lib/saved_objects.ts @@ -26,7 +26,7 @@ export const settingsObjectId = 'uptime-dynamic-settings-singleton'; export const umDynamicSettings: SavedObjectsType = { name: settingsObjectType, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { heartbeatIndices: { diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts index 170b7e0c6d09..1a01cf8929c0 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts @@ -29,7 +29,7 @@ export const plugin: PluginInitializer = core.savedObjects.registerType({ name: SAVED_OBJECT_WITH_SECRET_TYPE, hidden: false, - namespaceAgnostic: false, + namespaceType: 'single', mappings: deepFreeze({ properties: { publicProperty: { type: 'keyword' }, diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts b/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts index eccbd4fb7f90..1b6db3a9a31b 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts +++ b/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts @@ -50,7 +50,7 @@ export class EventLogFixturePlugin core.savedObjects.registerType({ name: 'event_log_test', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: {}, },