Skip to content

Commit 4a207ae

Browse files
[SIEM] Add types to the mappings objects so extra keys cannot be introduced
Add types to the mappings objects so extra keys cannot be introduced by accident and makes it easier to see mistakes as you type things within the mappings.
1 parent 23e7cc7 commit 4a207ae

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

x-pack/plugins/siem/server/lib/detection_engine/rule_actions/saved_object_mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SavedObjectsType } from '../../../../../../../src/core/server';
88

99
export const ruleActionsSavedObjectType = 'siem-detection-engine-rule-actions';
1010

11-
export const ruleActionsSavedObjectMappings = {
11+
export const ruleActionsSavedObjectMappings: SavedObjectsType['mappings'] = {
1212
properties: {
1313
alertThrottle: {
1414
type: 'keyword',

x-pack/plugins/siem/server/lib/detection_engine/rules/saved_object_mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SavedObjectsType } from '../../../../../../../src/core/server';
88

99
export const ruleStatusSavedObjectType = 'siem-detection-engine-rule-status';
1010

11-
export const ruleStatusSavedObjectMappings = {
11+
export const ruleStatusSavedObjectMappings: SavedObjectsType['mappings'] = {
1212
properties: {
1313
alertId: {
1414
type: 'keyword',

x-pack/plugins/siem/server/lib/note/saved_object_mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SavedObjectsType } from '../../../../../../src/core/server';
88

99
export const noteSavedObjectType = 'siem-ui-timeline-note';
1010

11-
export const noteSavedObjectMappings = {
11+
export const noteSavedObjectMappings: SavedObjectsType['mappings'] = {
1212
properties: {
1313
timelineId: {
1414
type: 'keyword',

x-pack/plugins/siem/server/lib/pinned_event/saved_object_mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SavedObjectsType } from '../../../../../../src/core/server';
88

99
export const pinnedEventSavedObjectType = 'siem-ui-timeline-pinned-event';
1010

11-
export const pinnedEventSavedObjectMappings = {
11+
export const pinnedEventSavedObjectMappings: SavedObjectsType['mappings'] = {
1212
properties: {
1313
timelineId: {
1414
type: 'keyword',

x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SavedObjectsType } from '../../../../../../src/core/server';
88

99
export const timelineSavedObjectType = 'siem-ui-timeline';
1010

11-
export const timelineSavedObjectMappings = {
11+
export const timelineSavedObjectMappings: SavedObjectsType['mappings'] = {
1212
properties: {
1313
columns: {
1414
properties: {

0 commit comments

Comments
 (0)