-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cases] Split attachment types for versioned http apis (#155440)
This PR separates the http API io-ts types from the types that are used in the cases service layer to interact with the saved object client. This PR is specifically for the attachments it only affects the types used when interacting with the saved object client and doesn't touch the transformation logic yet. Issue: #153726
- Loading branch information
1 parent
6aea93f
commit 9f9eb79
Showing
10 changed files
with
219 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { JsonValue } from '@kbn/utility-types'; | ||
import type { User } from './user'; | ||
|
||
interface AttachmentCommonPersistedAttributes { | ||
created_at: string; | ||
created_by: User; | ||
owner: string; | ||
pushed_at: string | null; | ||
pushed_by: User | null; | ||
updated_at: string | null; | ||
updated_by: User | null; | ||
} | ||
|
||
export interface AttachmentRequestAttributes { | ||
type: string; | ||
alertId?: string | string[]; | ||
index?: string | string[]; | ||
rule?: { | ||
id: string | null; | ||
name: string | null; | ||
}; | ||
comment?: string; | ||
actions?: { | ||
targets: Array<{ | ||
hostname: string; | ||
endpointId: string; | ||
}>; | ||
type: string; | ||
}; | ||
externalReferenceMetadata?: Record<string, JsonValue> | null; | ||
externalReferenceAttachmentTypeId?: string; | ||
externalReferenceStorage?: { | ||
type: string; | ||
soType?: string; | ||
}; | ||
persistableStateAttachmentState?: Record<string, JsonValue>; | ||
persistableStateAttachmentTypeId?: string; | ||
} | ||
|
||
export type AttachmentPersistedAttributes = AttachmentRequestAttributes & | ||
AttachmentCommonPersistedAttributes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.