chore(NA): splits types from code on @kbn/securitysolution-io-ts-utils (#121677)

* chore(NA): splits types from code on @kbn/securitysolution-io-ts-utils

* chore(NA): fix package.json

* chore(NA): merge and solve conflicts with main

* chore(NA): remove any from types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tiago Costa 2021-12-22 00:24:58 +00:00 committed by GitHub
parent 9ca9fe7577
commit 0a75d426b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 43 additions and 20 deletions

View file

@ -52,8 +52,6 @@ TYPES_DEPS = [
"@npm//@types/react",
"@npm//@types/testing-library__react-hooks",
"@npm//fp-ts",
# TODO: Remove once the bug on pkg_npm_types around transitive type deps got solved
"@npm//io-ts",
"@npm//tslib",
]

View file

@ -74,11 +74,11 @@ export const transformInput = (exceptionItem: ExceptionListItemSchema): Exceptio
export const addIdToExceptionItemEntries = (
exceptionItem: ExceptionListItemSchema
): ExceptionListItemSchema => {
const entries = exceptionItem.entries.map((entry: any) => {
const entries = exceptionItem.entries.map((entry) => {
if (entry.type === 'nested') {
return addIdToItem({
...entry,
entries: entry.entries.map((nestedEntry: any) => addIdToItem(nestedEntry)),
entries: entry.entries.map((nestedEntry) => addIdToItem(nestedEntry)),
});
} else {
return addIdToItem(entry);
@ -100,11 +100,11 @@ export const removeIdFromExceptionItemsEntries = <T extends { entries: EntriesAr
exceptionItem: T
): T => {
const { entries } = exceptionItem;
const entriesNoId = entries.map((entry: any) => {
const entriesNoId = entries.map((entry) => {
if (entry.type === 'nested') {
return removeIdFromItem({
...entry,
entries: entry.entries.map((nestedEntry: any) => removeIdFromItem(nestedEntry)),
entries: entry.entries.map((nestedEntry) => removeIdFromItem(nestedEntry)),
});
} else {
return removeIdFromItem<Entry>(entry);

View file

@ -203,7 +203,7 @@ export const useApi = (http: HttpStart): ExceptionsApi => {
// This data transform is UI specific and useful for UI concerns
// to compensate for the differences and preferences of how ReactJS might prefer
// data vs. how we want to model data. View `transformInput` for more details
exceptions: data.map((item: any) => transformInput(item)),
exceptions: data.map((item) => transformInput(item)),
pagination: {
page,
perPage,

View file

@ -120,7 +120,7 @@ export const useExceptionListItems = ({
// Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes
// for context around the temporary `id`
const transformedData = data.map((item: any) => transformInput(item));
const transformedData = data.map((item) => transformInput(item));
if (isSubscribed) {
setPagination({