import { ImportExceptionListItemSchema , ImportExceptionListItemSchemaDecoded , ImportExceptionListSchemaDecoded , ImportExceptionsListSchema , } from '@kbn/securitysolution-io-ts-list-types' ; import { ENTRIES } from '../../constants.mock' ; export const getImportExceptionsListSchemaMock = ( listId = 'detection_list_id' ) : ImportExceptionsListSchema => ( { description : 'some description' , list_id : listId , name : 'Query with a rule id' , type : 'detection' , } ) ; export const getImportExceptionsListItemSchemaMock = ( itemId = 'item_id_1' , listId = 'detection_list_id' ) : ImportExceptionListItemSchema => ( { description : 'some description' , entries : ENTRIES , item_id : itemId , list_id : listId , name : 'Query with a rule id' , type : 'simple' , } ) ; export const getImportExceptionsListSchemaDecodedMock = ( listId = 'detection_list_id' ) : ImportExceptionListSchemaDecoded => ( { ... getImportExceptionsListSchemaMock ( listId ) , immutable : false , meta : undefined , namespace_type : 'single' , os_types : [ ] , tags : [ ] , version : 1 , } ) ; export const getImportExceptionsListItemSchemaDecodedMock = ( itemId = 'item_id_1' , listId = 'detection_list_id' ) : ImportExceptionListItemSchemaDecoded => ( { ... getImportExceptionsListItemSchemaMock ( itemId , listId ) , comments : [ ] , meta : undefined , namespace_type : 'single' , os_types : [ ] , tags : [ ] , } ) ; param items export const toNdJsonString = ( items ) : string => { const stringOfExceptions = items . map ( ( item ) => JSON . stringify ( item ) ) ; return stringOfExceptions . join ( '\n' ) ; } ;