Skip to content

Commit

Permalink
Update search session saved object mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Apr 4, 2023
1 parent 3b951e1 commit 2e45bf6
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 additions & 30 deletions src/plugins/data/server/search/saved_objects/search_session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { schema } from '@kbn/config-schema';
import { SavedObjectsType } from '@kbn/core/server';
import { SEARCH_SESSION_TYPE } from '../../../common';
import { searchSessionSavedObjectMigrations } from './search_session_migration';
Expand All @@ -15,37 +16,14 @@ export const searchSessionSavedObjectType: SavedObjectsType = {
namespaceType: 'single',
hidden: true,
mappings: {
dynamic: false,
properties: {
sessionId: {
type: 'keyword',
},
name: {
type: 'keyword',
},
created: {
type: 'date',
},
expires: {
type: 'date',
},
appId: {
type: 'keyword',
},
locatorId: {
type: 'keyword',
},
initialState: {
dynamic: false,
properties: {},
},
restoreState: {
dynamic: false,
properties: {},
},
idMapping: {
dynamic: false,
properties: {},
},
realmType: {
type: 'keyword',
},
Expand All @@ -55,14 +33,32 @@ export const searchSessionSavedObjectType: SavedObjectsType = {
username: {
type: 'keyword',
},
version: {
type: 'keyword',
},
isCanceled: {
type: 'boolean',
},
},
},
schemas: {
'8.8.0': schema.object({
sessionId: schema.string(),
name: schema.maybe(schema.string()),
created: schema.string(),
expires: schema.string(),
appId: schema.maybe(schema.string()),
locatorId: schema.maybe(schema.string()),
initialState: schema.maybe(schema.object({}, { unknowns: 'allow' })),
restoreState: schema.maybe(schema.object({}, { unknowns: 'allow' })),
idMapping: schema.mapOf(
schema.string(),
schema.object({
id: schema.string(),
strategy: schema.string(),
})
),
realmType: schema.maybe(schema.string()),
realmName: schema.maybe(schema.string()),
username: schema.maybe(schema.string()),
version: schema.string(),
isCanceled: schema.maybe(schema.boolean()),
}),
},
migrations: searchSessionSavedObjectMigrations,
excludeOnUpgrade: async () => {
return {
Expand Down

0 comments on commit 2e45bf6

Please sign in to comment.