[Security Solution] Add missing Lists API OpenAPI specifications (#185865)

**Resolves:** https://github.com/elastic/kibana/issues/183821

## Summary

This PR adds missing OpenAPI specifications for Lists API which are the following

- `POST /api/lists`
- `GET /api/lists`
- `PUT /api/lists`
- `DELETE /api/lists`
- `PATCH /api/lists`
- `GET /api/lists/_find`
- `GET /api/lists/privileges`
- `POST /api/lists/items`
- `GET /api/lists/items`
- `PUT /api/lists/items`
- `DELETE /api/lists/items`
- `PATCH /api/lists/items`
- `POST /api/lists/items/_export`
- `POST /api/lists/items/_import`
- `GET /api/lists/items/_find`
- `POST /api/lists/index`
- `GET /api/lists/index`
- `DELETE /api/lists/index`

**Note:** Code generation is enabled for the added specs to verify that it works and produces expected results. Generated Zod schemas and types aren't integrated in the route's code.
This commit is contained in:
Maxim Palenov 2024-06-18 22:22:19 +02:00 committed by GitHub
parent a455012d70
commit 7a0065d5b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
133 changed files with 2964 additions and 511 deletions

View file

@ -6,5 +6,17 @@ source .buildkite/scripts/common/util.sh
echo --- Security Solution OpenAPI Code Generation
echo OpenAPI Common Package
(cd packages/kbn-openapi-common && yarn openapi:generate)
check_for_changed_files "yarn openapi:generate" true
echo Lists API Common Package
(cd packages/kbn-securitysolution-lists-common && yarn openapi:generate)
check_for_changed_files "yarn openapi:generate" true
echo Security Solution Plugin
(cd x-pack/plugins/security_solution && yarn openapi:generate)
check_for_changed_files "yarn openapi:generate" true

2
.github/CODEOWNERS vendored
View file

@ -622,6 +622,7 @@ x-pack/plugins/observability_solution/observability_shared @elastic/observabilit
x-pack/test/security_api_integration/plugins/oidc_provider @elastic/kibana-security
test/common/plugins/otel_metrics @elastic/obs-ux-infra_services-team
packages/kbn-openapi-bundler @elastic/security-detection-rule-management
packages/kbn-openapi-common @elastic/security-detection-rule-management
packages/kbn-openapi-generator @elastic/security-detection-rule-management
packages/kbn-optimizer @elastic/kibana-operations
packages/kbn-optimizer-webpack-helpers @elastic/kibana-operations
@ -752,6 +753,7 @@ packages/kbn-securitysolution-list-api @elastic/security-detection-engine
packages/kbn-securitysolution-list-constants @elastic/security-detection-engine
packages/kbn-securitysolution-list-hooks @elastic/security-detection-engine
packages/kbn-securitysolution-list-utils @elastic/security-detection-engine
packages/kbn-securitysolution-lists-common @elastic/security-detection-engine
packages/kbn-securitysolution-rules @elastic/security-detection-engine
packages/kbn-securitysolution-t-grid @elastic/security-detection-engine
packages/kbn-securitysolution-utils @elastic/security-detection-engine

View file

@ -647,6 +647,7 @@
"@kbn/observability-shared-plugin": "link:x-pack/plugins/observability_solution/observability_shared",
"@kbn/oidc-provider-plugin": "link:x-pack/test/security_api_integration/plugins/oidc_provider",
"@kbn/open-telemetry-instrumented-plugin": "link:test/common/plugins/otel_metrics",
"@kbn/openapi-common": "link:packages/kbn-openapi-common",
"@kbn/osquery-io-ts-types": "link:packages/kbn-osquery-io-ts-types",
"@kbn/osquery-plugin": "link:x-pack/plugins/osquery",
"@kbn/paertial-results-example-plugin": "link:examples/partial_results_example",
@ -762,6 +763,7 @@
"@kbn/securitysolution-list-constants": "link:packages/kbn-securitysolution-list-constants",
"@kbn/securitysolution-list-hooks": "link:packages/kbn-securitysolution-list-hooks",
"@kbn/securitysolution-list-utils": "link:packages/kbn-securitysolution-list-utils",
"@kbn/securitysolution-lists-common": "link:packages/kbn-securitysolution-lists-common",
"@kbn/securitysolution-rules": "link:packages/kbn-securitysolution-rules",
"@kbn/securitysolution-t-grid": "link:packages/kbn-securitysolution-t-grid",
"@kbn/securitysolution-utils": "link:packages/kbn-securitysolution-utils",

View file

@ -0,0 +1,3 @@
# OpenAPI Common Schemas
This package contains common reusable schemas like `NonEmptyString` to be reused by any OpenAPI specification defined inside Kibana.

View file

@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/openapi-common",
"owner": "@elastic/security-detection-rule-management"
}

View file

@ -0,0 +1,11 @@
{
"description": "OpenAPI common schemas for Kibana",
"license": "SSPL-1.0 OR Elastic License 2.0",
"name": "@kbn/openapi-common",
"private": true,
"version": "1.0.0",
"scripts": {
"openapi:generate": "node scripts/openapi_generate"
}
}

View file

@ -0,0 +1,31 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Error response schemas
* version: not applicable
*/
import { z } from 'zod';
export type PlatformErrorResponse = z.infer<typeof PlatformErrorResponse>;
export const PlatformErrorResponse = z.object({
statusCode: z.number().int(),
error: z.string(),
message: z.string(),
});
export type SiemErrorResponse = z.infer<typeof SiemErrorResponse>;
export const SiemErrorResponse = z.object({
status_code: z.number().int(),
message: z.string(),
});

View file

@ -0,0 +1,32 @@
openapi: 3.0.0
info:
title: Error response schemas
version: 'not applicable'
paths: {}
components:
x-codegen-enabled: true
schemas:
PlatformErrorResponse:
type: object
properties:
statusCode:
type: integer
error:
type: string
message:
type: string
required:
- statusCode
- error
- message
SiemErrorResponse:
type: object
properties:
status_code:
type: integer
message:
type: string
required:
- status_code
- message

View file

@ -0,0 +1,33 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Shared Primitives Schema
* version: not applicable
*/
import { z } from 'zod';
/**
* A string that is not empty and does not contain only whitespace
*/
export type NonEmptyString = z.infer<typeof NonEmptyString>;
export const NonEmptyString = z
.string()
.min(1)
.regex(/^(?! *$).+$/);
/**
* A universally unique identifier
*/
export type UUID = z.infer<typeof UUID>;
export const UUID = z.string().uuid();

View file

@ -0,0 +1,18 @@
openapi: 3.0.0
info:
title: Shared Primitives Schema
version: 'not applicable'
paths: {}
components:
x-codegen-enabled: true
schemas:
NonEmptyString:
type: string
pattern: ^(?! *$).+$
minLength: 1
description: A string that is not empty and does not contain only whitespace
UUID:
type: string
format: uuid
description: A universally unique identifier

View file

@ -0,0 +1,22 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
require('../../../src/setup_node_env');
const { resolve } = require('path');
const { generate } = require('@kbn/openapi-generator');
const ROOT = resolve(__dirname, '..');
(async () => {
await generate({
title: 'OpenAPI Common Schemas (kbn-openapi-common)',
rootDir: ROOT,
sourceGlob: './schemas/**/*.schema.yaml',
templateName: 'zod_operation_schema',
});
})();

View file

@ -0,0 +1,10 @@
{
"compilerOptions": {
"outDir": "target/types",
"types": ["jest", "node"]
},
"exclude": ["target/**/*"],
"extends": "../../tsconfig.base.json",
"include": ["**/*.ts"],
"kbn_references": []
}

View file

@ -0,0 +1,20 @@
# Security Solution Lists common package
The package contains common files for the Lists feature.
`common` in the name highlights that this package is intended to combine any common entities related to Lists in this package. E.g. the other `kbn-securitysolution-list-*` packages
content should be moved here while `kbn-securitysolution-io-ts-list-types` package should be
gone eventually.
## API folder
`api` folder contains OpenAPI schemas for Security Solution Lists feature. There are automatically generated Zod schemas and TS types for each schemas located in corresponding
`*.gen.ts` files.
**Please add any Lists feature related schemas to this package.**
TS types and/or Zod schemas can be imported in a plugin or another package like
```ts
import { CreateListRequestBody } from '@kbn/securitysolution-lists-common/api';
```

View file

@ -0,0 +1,43 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Create list API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import {
ListId,
ListName,
ListDescription,
ListType,
ListMetadata,
} from '../model/list_common.gen';
import { List } from '../model/list_schemas.gen';
export type CreateListRequestBody = z.infer<typeof CreateListRequestBody>;
export const CreateListRequestBody = z.object({
id: ListId.optional(),
name: ListName,
description: ListDescription,
type: ListType,
serializer: z.string().optional(),
deserializer: z.string().optional(),
meta: ListMetadata.optional(),
version: z.number().int().min(1).optional().default(1),
});
export type CreateListRequestBodyInput = z.input<typeof CreateListRequestBody>;
export type CreateListResponse = z.infer<typeof CreateListResponse>;
export const CreateListResponse = List;

View file

@ -0,0 +1,82 @@
openapi: 3.0.0
info:
title: Create list API endpoint
version: '2023-10-31'
paths:
/api/lists:
post:
x-labels: [serverless, ess]
operationId: CreateList
x-codegen-enabled: true
summary: Creates a list
tags:
- List API
requestBody:
description: List's properties
required: true
content:
application/json:
schema:
type: object
properties:
id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
name:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListName'
description:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription'
type:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListType'
serializer:
type: string
deserializer:
type: string
meta:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata'
version:
type: integer
minimum: 1
default: 1
required:
- name
- description
- type
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
409:
description: List already exists response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,23 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Create list DS API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
export type CreateListIndexResponse = z.infer<typeof CreateListIndexResponse>;
export const CreateListIndexResponse = z.object({
acknowledged: z.boolean(),
});

View file

@ -0,0 +1,56 @@
openapi: 3.0.0
info:
title: Create list DS API endpoint
version: '2023-10-31'
paths:
/api/lists/index:
post:
x-labels: [serverless, ess]
operationId: CreateListIndex
x-codegen-enabled: true
summary: Creates necessary list data streams
tags:
- List API
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
required: [acknowledged]
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
409:
description: List data stream exists response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,37 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Create list item API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListItemId, ListId, ListItemValue, ListItemMetadata } from '../model/list_common.gen';
import { ListItem } from '../model/list_schemas.gen';
export type CreateListItemRequestBody = z.infer<typeof CreateListItemRequestBody>;
export const CreateListItemRequestBody = z.object({
id: ListItemId.optional(),
list_id: ListId,
value: ListItemValue,
meta: ListItemMetadata.optional(),
/**
* Determines when changes made by the request are made visible to search
*/
refresh: z.enum(['true', 'false', 'wait_for']).optional(),
});
export type CreateListItemRequestBodyInput = z.input<typeof CreateListItemRequestBody>;
export type CreateListItemResponse = z.infer<typeof CreateListItemResponse>;
export const CreateListItemResponse = ListItem;

View file

@ -0,0 +1,78 @@
openapi: 3.0.0
info:
title: Create list item API endpoint
version: '2023-10-31'
paths:
/api/lists/items:
post:
x-labels: [serverless, ess]
operationId: CreateListItem
x-codegen-enabled: true
summary: Creates a list item
tags:
- List item API
requestBody:
description: List item's properties
required: true
content:
application/json:
schema:
type: object
properties:
id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId'
list_id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
value:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue'
meta:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata'
refresh:
type: string
enum:
- 'true'
- 'false'
- wait_for
description: Determines when changes made by the request are made visible to search
required:
- list_id
- value
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
409:
description: List item already exists response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,36 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Delete list API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { BooleanFromString } from '@kbn/zod-helpers';
import { ListId } from '../model/list_common.gen';
import { List } from '../model/list_schemas.gen';
export type DeleteListRequestQuery = z.infer<typeof DeleteListRequestQuery>;
export const DeleteListRequestQuery = z.object({
/**
* List's `id` value
*/
id: ListId,
deleteReferences: BooleanFromString.optional().default(false),
ignoreReferences: BooleanFromString.optional().default(false),
});
export type DeleteListRequestQueryInput = z.input<typeof DeleteListRequestQuery>;
export type DeleteListResponse = z.infer<typeof DeleteListResponse>;
export const DeleteListResponse = List;

View file

@ -0,0 +1,71 @@
openapi: 3.0.0
info:
title: Delete list API endpoint
version: '2023-10-31'
paths:
/api/lists:
delete:
x-labels: [serverless, ess]
operationId: DeleteList
x-codegen-enabled: true
summary: Deletes a list
tags:
- List API
parameters:
- name: id
in: query
required: true
description: List's `id` value
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: deleteReferences
in: query
required: false
schema:
type: boolean
default: false
- name: ignoreReferences
in: query
required: false
schema:
type: boolean
default: false
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,23 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Delete list DS API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
export type DeleteListIndexResponse = z.infer<typeof DeleteListIndexResponse>;
export const DeleteListIndexResponse = z.object({
acknowledged: z.boolean(),
});

View file

@ -0,0 +1,56 @@
openapi: 3.0.0
info:
title: Delete list DS API endpoint
version: '2023-10-31'
paths:
/api/lists/index:
delete:
x-labels: [serverless, ess]
operationId: DeleteListIndex
x-codegen-enabled: true
summary: Deletes list data streams
tags:
- List API
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
required: [acknowledged]
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List data stream not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,45 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Delete list item API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId } from '../model/list_common.gen';
import { ListItem } from '../model/list_schemas.gen';
export type DeleteListItemRequestQuery = z.infer<typeof DeleteListItemRequestQuery>;
export const DeleteListItemRequestQuery = z.object({
/**
* Required if `list_id` and `value` are not specified
*/
id: ListId.optional(),
/**
* Required if `id` is not specified
*/
list_id: ListId.optional(),
/**
* Required if `id` is not specified
*/
value: z.string().optional(),
/**
* Determines when changes made by the request are made visible to search
*/
refresh: z.enum(['true', 'false', 'wait_for']).optional().default('false'),
});
export type DeleteListItemRequestQueryInput = z.input<typeof DeleteListItemRequestQuery>;
export type DeleteListItemResponse = z.infer<typeof DeleteListItemResponse>;
export const DeleteListItemResponse = z.union([ListItem, z.array(ListItem)]);

View file

@ -0,0 +1,83 @@
openapi: 3.0.0
info:
title: Delete list item API endpoint
version: '2023-10-31'
paths:
/api/lists/items:
delete:
x-labels: [serverless, ess]
operationId: DeleteListItem
x-codegen-enabled: true
summary: Deletes a list item
tags:
- List item API
parameters:
- name: id
in: query
required: false
description: Required if `list_id` and `value` are not specified
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: list_id
in: query
required: false
description: Required if `id` is not specified
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: value
in: query
required: false
description: Required if `id` is not specified
schema:
type: string
- name: refresh
in: query
required: false
description: Determines when changes made by the request are made visible to search
schema:
type: string
enum: ['true', 'false', 'wait_for']
default: 'false'
responses:
200:
description: Successful response
content:
application/json:
schema:
oneOf:
- $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
- type: array
items:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List item not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,29 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Export list items API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId } from '../model/list_common.gen';
export type ExportListItemsRequestQuery = z.infer<typeof ExportListItemsRequestQuery>;
export const ExportListItemsRequestQuery = z.object({
/**
* List's id to export
*/
list_id: ListId,
});
export type ExportListItemsRequestQueryInput = z.input<typeof ExportListItemsRequestQuery>;

View file

@ -0,0 +1,61 @@
openapi: 3.0.0
info:
title: Export list items API endpoint
version: '2023-10-31'
paths:
/api/lists/items/_export:
post:
operationId: ExportListItems
x-codegen-enabled: true
summary: Exports list items
description: Exports list item values from the specified list
tags:
- List items Import/Export API
parameters:
- name: list_id
in: query
required: true
description: List's id to export
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
responses:
200:
description: Successful response
content:
application/ndjson:
schema:
type: string
format: binary
description: A `.txt` file containing list items from the specified list
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,70 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Find lists API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen';
import { List } from '../model/list_schemas.gen';
export type FindListsCursor = z.infer<typeof FindListsCursor>;
export const FindListsCursor = NonEmptyString;
export type FindListsFilter = z.infer<typeof FindListsFilter>;
export const FindListsFilter = NonEmptyString;
export type FindListsRequestQuery = z.infer<typeof FindListsRequestQuery>;
export const FindListsRequestQuery = z.object({
/**
* The page number to return
*/
page: z.coerce.number().int().optional(),
/**
* The number of lists to return per page
*/
per_page: z.coerce.number().int().optional(),
/**
* Determines which field is used to sort the results
*/
sort_field: NonEmptyString.optional(),
/**
* Determines the sort order, which can be `desc` or `asc`
*/
sort_order: z.enum(['desc', 'asc']).optional(),
/**
* Returns the list that come after the last list returned in the previous call
(use the cursor value returned in the previous call). This parameter uses
the `tie_breaker_id` field to ensure all lists are sorted and returned correctly.
*/
cursor: FindListsCursor.optional(),
/**
* Filters the returned results according to the value of the specified field,
using the <field name>:<field value> syntax.
*/
filter: FindListsFilter.optional(),
});
export type FindListsRequestQueryInput = z.input<typeof FindListsRequestQuery>;
export type FindListsResponse = z.infer<typeof FindListsResponse>;
export const FindListsResponse = z.object({
data: z.array(List),
page: z.number().int().min(0),
per_page: z.number().int().min(0),
total: z.number().int().min(0),
cursor: FindListsCursor,
});

View file

@ -0,0 +1,119 @@
openapi: 3.0.0
info:
title: Find lists API endpoint
version: '2023-10-31'
paths:
/api/lists/_find:
get:
x-labels: [serverless, ess]
operationId: FindLists
x-codegen-enabled: true
summary: Finds lists
tags:
- List API
parameters:
- name: page
in: query
required: false
description: The page number to return
schema:
type: integer
- name: per_page
in: query
required: false
description: The number of lists to return per page
schema:
type: integer
- name: sort_field
in: query
required: false
description: Determines which field is used to sort the results
schema:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
- name: sort_order
in: query
required: false
description: Determines the sort order, which can be `desc` or `asc`
schema:
type: string
enum: [desc, asc]
- name: cursor
in: query
required: false
description: |
Returns the list that come after the last list returned in the previous call
(use the cursor value returned in the previous call). This parameter uses
the `tie_breaker_id` field to ensure all lists are sorted and returned correctly.
schema:
$ref: '#/components/schemas/FindListsCursor'
- name: filter
in: query
required: false
description: |
Filters the returned results according to the value of the specified field,
using the <field name>:<field value> syntax.
schema:
$ref: '#/components/schemas/FindListsFilter'
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
page:
type: integer
minimum: 0
per_page:
type: integer
minimum: 0
total:
type: integer
minimum: 0
cursor:
$ref: '#/components/schemas/FindListsCursor'
required:
- data
- page
- per_page
- total
- cursor
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
components:
schemas:
FindListsCursor:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
FindListsFilter:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'

View file

@ -0,0 +1,75 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Find list items API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen';
import { ListId } from '../model/list_common.gen';
import { ListItem } from '../model/list_schemas.gen';
export type FindListItemsCursor = z.infer<typeof FindListItemsCursor>;
export const FindListItemsCursor = NonEmptyString;
export type FindListItemsFilter = z.infer<typeof FindListItemsFilter>;
export const FindListItemsFilter = NonEmptyString;
export type FindListItemsRequestQuery = z.infer<typeof FindListItemsRequestQuery>;
export const FindListItemsRequestQuery = z.object({
/**
* List's ide
*/
list_id: ListId,
/**
* The page number to return
*/
page: z.coerce.number().int().optional(),
/**
* The number of list items to return per page
*/
per_page: z.coerce.number().int().optional(),
/**
* Determines which field is used to sort the results
*/
sort_field: NonEmptyString.optional(),
/**
* Determines the sort order, which can be `desc` or `asc`
*/
sort_order: z.enum(['desc', 'asc']).optional(),
/**
* Returns the list that come after the last list returned in the previous call
(use the cursor value returned in the previous call). This parameter uses
the `tie_breaker_id` field to ensure all lists are sorted and returned correctly.
*/
cursor: FindListItemsCursor.optional(),
/**
* Filters the returned results according to the value of the specified field,
using the <field name>:<field value> syntax.
*/
filter: FindListItemsFilter.optional(),
});
export type FindListItemsRequestQueryInput = z.input<typeof FindListItemsRequestQuery>;
export type FindListItemsResponse = z.infer<typeof FindListItemsResponse>;
export const FindListItemsResponse = z.object({
data: z.array(ListItem),
page: z.number().int().min(0),
per_page: z.number().int().min(0),
total: z.number().int().min(0),
cursor: FindListItemsCursor,
});

View file

@ -0,0 +1,125 @@
openapi: 3.0.0
info:
title: Find list items API endpoint
version: '2023-10-31'
paths:
/api/lists/_find:
get:
x-labels: [serverless, ess]
operationId: FindListItems
x-codegen-enabled: true
summary: Finds list items
tags:
- List API
parameters:
- name: list_id
in: query
required: true
description: List's ide
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: page
in: query
required: false
description: The page number to return
schema:
type: integer
- name: per_page
in: query
required: false
description: The number of list items to return per page
schema:
type: integer
- name: sort_field
in: query
required: false
description: Determines which field is used to sort the results
schema:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
- name: sort_order
in: query
required: false
description: Determines the sort order, which can be `desc` or `asc`
schema:
type: string
enum: [desc, asc]
- name: cursor
in: query
required: false
description: |
Returns the list that come after the last list returned in the previous call
(use the cursor value returned in the previous call). This parameter uses
the `tie_breaker_id` field to ensure all lists are sorted and returned correctly.
schema:
$ref: '#/components/schemas/FindListItemsCursor'
- name: filter
in: query
required: false
description: |
Filters the returned results according to the value of the specified field,
using the <field name>:<field value> syntax.
schema:
$ref: '#/components/schemas/FindListItemsFilter'
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
page:
type: integer
minimum: 0
per_page:
type: integer
minimum: 0
total:
type: integer
minimum: 0
cursor:
$ref: '#/components/schemas/FindListItemsCursor'
required:
- data
- page
- per_page
- total
- cursor
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
components:
schemas:
FindListItemsCursor:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
FindListItemsFilter:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'

View file

@ -0,0 +1,43 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Get list privileges API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
export type ListPrivileges = z.infer<typeof ListPrivileges>;
export const ListPrivileges = z.object({
username: z.string(),
has_all_requested: z.boolean(),
cluster: z.object({}).catchall(z.boolean()),
index: z.object({}).catchall(z.object({}).catchall(z.boolean())),
application: z.object({}).catchall(z.boolean()),
});
export type ListItemPrivileges = z.infer<typeof ListItemPrivileges>;
export const ListItemPrivileges = z.object({
username: z.string(),
has_all_requested: z.boolean(),
cluster: z.object({}).catchall(z.boolean()),
index: z.object({}).catchall(z.object({}).catchall(z.boolean())),
application: z.object({}).catchall(z.boolean()),
});
export type GetListPrivilegesResponse = z.infer<typeof GetListPrivilegesResponse>;
export const GetListPrivilegesResponse = z.object({
lists: ListPrivileges,
listItems: ListItemPrivileges,
is_authenticated: z.boolean(),
});

View file

@ -0,0 +1,115 @@
openapi: 3.0.0
info:
title: Get list privileges API endpoint
version: '2023-10-31'
paths:
/api/lists/privileges:
get:
x-labels: [serverless, ess]
operationId: GetListPrivileges
x-codegen-enabled: true
summary: Gets list privileges
tags:
- List API
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
lists:
$ref: '#/components/schemas/ListPrivileges'
listItems:
$ref: '#/components/schemas/ListItemPrivileges'
is_authenticated:
type: boolean
required:
- lists
- listItems
- is_authenticated
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
components:
schemas:
ListPrivileges:
type: object
properties:
username:
type: string
has_all_requested:
type: boolean
cluster:
type: object
additionalProperties:
type: boolean
index:
type: object
additionalProperties:
type: object
additionalProperties:
type: boolean
application:
type: object
additionalProperties:
type: boolean
required:
- username
- has_all_requested
- cluster
- index
- application
ListItemPrivileges:
type: object
properties:
username:
type: string
has_all_requested:
type: boolean
cluster:
type: object
additionalProperties:
type: boolean
index:
type: object
additionalProperties:
type: object
additionalProperties:
type: boolean
application:
type: object
additionalProperties:
type: boolean
required:
- username
- has_all_requested
- cluster
- index
- application

View file

@ -0,0 +1,49 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Import list items API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId, ListType } from '../model/list_common.gen';
import { List } from '../model/list_schemas.gen';
export type ImportListItemsRequestQuery = z.infer<typeof ImportListItemsRequestQuery>;
export const ImportListItemsRequestQuery = z.object({
/**
* List's id.
Required when importing to an existing list.
*/
list_id: ListId.optional(),
/**
* Type of the importing list.
Required when importing a new list that is `list_id` is not specified.
*/
type: ListType.optional(),
serializer: z.string().optional(),
deserializer: z.string().optional(),
/**
* Determines when changes made by the request are made visible to search
*/
refresh: z.enum(['true', 'false', 'wait_for']).optional(),
});
export type ImportListItemsRequestQueryInput = z.input<typeof ImportListItemsRequestQuery>;
export type ImportListItemsResponse = z.infer<typeof ImportListItemsResponse>;
export const ImportListItemsResponse = List;

View file

@ -0,0 +1,102 @@
openapi: 3.0.0
info:
title: Import list items API endpoint
version: '2023-10-31'
paths:
/api/lists/items/_import:
post:
operationId: ImportListItems
x-codegen-enabled: true
summary: Imports list items
description: |
Imports a list of items from a `.txt` or `.csv` file. The maximum file size is 9 million bytes.
You can import items to a new or existing list.
tags:
- List items Import/Export API
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: A `.txt` or `.csv` file containing newline separated list items
parameters:
- name: list_id
in: query
required: false
description: |
List's id.
Required when importing to an existing list.
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: type
in: query
required: false
description: |
Type of the importing list.
Required when importing a new list that is `list_id` is not specified.
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListType'
- name: serializer
in: query
required: false
schema:
type: string
- name: deserializer
in: query
required: false
schema:
type: string
- name: refresh
in: query
required: false
description: Determines when changes made by the request are made visible to search
schema:
type: string
enum: ['true', 'false', 'wait_for']
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
409:
description: List with specified list_id does not exist response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,26 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export * from './model/list_common.gen';
export * from './model/list_schemas.gen';
export * from './create_list_index/create_list_index.gen';
export * from './create_list_item/create_list_item.gen';
export * from './create_list/create_list.gen';
export * from './delete_list_index/delete_list_index.gen';
export * from './delete_list_item/delete_list_item.gen';
export * from './delete_list/delete_list.gen';
export * from './find_list_item/find_list_item.gen';
export * from './find_list/find_list.gen';
export * from './export_list_item/export_list_item.gen';
export * from './import_list_item/import_list_item.gen';
export * from './patch_list_item/patch_list_item.gen';
export * from './patch_list/patch_list.gen';
export * from './read_list_index/read_list_index.gen';
export * from './read_list_item/read_list_item.gen';
export * from './read_list/read_list.gen';
export * from './update_list_item/update_list_item.gen';
export * from './update_list/update_list.gen';

View file

@ -0,0 +1,73 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Common List Attributes
* version: not applicable
*/
import { z } from 'zod';
import { NonEmptyString } from '@kbn/openapi-common/schemas/primitives.gen';
export type ListId = z.infer<typeof ListId>;
export const ListId = NonEmptyString;
export type ListType = z.infer<typeof ListType>;
export const ListType = z.enum([
'binary',
'boolean',
'byte',
'date',
'date_nanos',
'date_range',
'double',
'double_range',
'float',
'float_range',
'geo_point',
'geo_shape',
'half_float',
'integer',
'integer_range',
'ip',
'ip_range',
'keyword',
'long',
'long_range',
'shape',
'short',
'text',
]);
export type ListTypeEnum = typeof ListType.enum;
export const ListTypeEnum = ListType.enum;
export type ListName = z.infer<typeof ListName>;
export const ListName = NonEmptyString;
export type ListDescription = z.infer<typeof ListDescription>;
export const ListDescription = NonEmptyString;
export type ListMetadata = z.infer<typeof ListMetadata>;
export const ListMetadata = z.object({}).catchall(z.unknown());
export type ListItemId = z.infer<typeof ListItemId>;
export const ListItemId = NonEmptyString;
export type ListItemValue = z.infer<typeof ListItemValue>;
export const ListItemValue = NonEmptyString;
export type ListItemDescription = z.infer<typeof ListItemDescription>;
export const ListItemDescription = NonEmptyString;
export type ListItemMetadata = z.infer<typeof ListItemMetadata>;
export const ListItemMetadata = z.object({}).catchall(z.unknown());

View file

@ -0,0 +1,59 @@
openapi: 3.0.0
info:
title: Common List Attributes
version: 'not applicable'
paths: {}
components:
schemas:
ListId:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
ListType:
type: string
enum:
- binary
- boolean
- byte
- date
- date_nanos
- date_range
- double
- double_range
- float
- float_range
- geo_point
- geo_shape
- half_float
- integer
- integer_range
- ip
- ip_range
- keyword
- long
- long_range
- shape
- short
- text
ListName:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
ListDescription:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
ListMetadata:
type: object
additionalProperties: true
ListItemId:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
ListItemValue:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
ListItemDescription:
$ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString'
ListItemMetadata:
type: object
additionalProperties: true

View file

@ -0,0 +1,67 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: List Schemas
* version: not applicable
*/
import { z } from 'zod';
import {
ListId,
ListType,
ListName,
ListDescription,
ListMetadata,
ListItemId,
ListItemValue,
ListItemMetadata,
} from './list_common.gen';
export type List = z.infer<typeof List>;
export const List = z.object({
id: ListId,
type: ListType,
name: ListName,
description: ListDescription,
serializer: z.string().optional(),
deserializer: z.string().optional(),
immutable: z.boolean(),
meta: ListMetadata.optional(),
'@timestamp': z.string().datetime().optional(),
version: z.number().int().min(1),
_version: z.string().optional(),
tie_breaker_id: z.string(),
created_at: z.string().datetime(),
created_by: z.string(),
updated_at: z.string().datetime(),
updated_by: z.string(),
});
export type ListItem = z.infer<typeof ListItem>;
export const ListItem = z.object({
id: ListItemId,
type: ListType,
list_id: ListId,
value: ListItemValue,
serializer: z.string().optional(),
deserializer: z.string().optional(),
meta: ListItemMetadata.optional(),
'@timestamp': z.string().datetime().optional(),
_version: z.string().optional(),
tie_breaker_id: z.string(),
created_at: z.string().datetime(),
created_by: z.string(),
updated_at: z.string().datetime(),
updated_by: z.string(),
});

View file

@ -0,0 +1,103 @@
openapi: 3.0.0
info:
title: List Schemas
version: 'not applicable'
paths: {}
components:
schemas:
List:
type: object
properties:
id:
$ref: './list_common.schema.yaml#/components/schemas/ListId'
type:
$ref: './list_common.schema.yaml#/components/schemas/ListType'
name:
$ref: './list_common.schema.yaml#/components/schemas/ListName'
description:
$ref: './list_common.schema.yaml#/components/schemas/ListDescription'
serializer:
type: string
deserializer:
type: string
immutable:
type: boolean
meta:
$ref: './list_common.schema.yaml#/components/schemas/ListMetadata'
'@timestamp':
type: string
format: date-time
version:
type: integer
minimum: 1
_version:
type: string
tie_breaker_id:
type: string
created_at:
type: string
format: date-time
created_by:
type: string
updated_at:
type: string
format: date-time
updated_by:
type: string
required:
- id
- type
- name
- description
- immutable
- version
- tie_breaker_id
- created_at
- created_by
- updated_at
- updated_by
ListItem:
type: object
properties:
id:
$ref: './list_common.schema.yaml#/components/schemas/ListItemId'
type:
$ref: './list_common.schema.yaml#/components/schemas/ListType'
list_id:
$ref: './list_common.schema.yaml#/components/schemas/ListId'
value:
$ref: './list_common.schema.yaml#/components/schemas/ListItemValue'
serializer:
type: string
deserializer:
type: string
meta:
$ref: './list_common.schema.yaml#/components/schemas/ListItemMetadata'
'@timestamp':
type: string
format: date-time
_version:
type: string
tie_breaker_id:
type: string
created_at:
type: string
format: date-time
created_by:
type: string
updated_at:
type: string
format: date-time
updated_by:
type: string
required:
- id
- type
- list_id
- value
- tie_breaker_id
- created_at
- created_by
- updated_at
- updated_by

View file

@ -0,0 +1,35 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Patch list API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen';
import { List } from '../model/list_schemas.gen';
export type PatchListRequestBody = z.infer<typeof PatchListRequestBody>;
export const PatchListRequestBody = z.object({
id: ListId,
name: ListName.optional(),
description: ListDescription.optional(),
meta: ListMetadata.optional(),
version: z.number().int().min(1).optional(),
_version: z.string().optional(),
});
export type PatchListRequestBodyInput = z.input<typeof PatchListRequestBody>;
export type PatchListResponse = z.infer<typeof PatchListResponse>;
export const PatchListResponse = List;

View file

@ -0,0 +1,75 @@
openapi: 3.0.0
info:
title: Patch list API endpoint
version: '2023-10-31'
paths:
/api/lists:
patch:
x-labels: [serverless, ess]
operationId: PatchList
x-codegen-enabled: true
summary: Patches a list
tags:
- List API
requestBody:
description: List's properties
required: true
content:
application/json:
schema:
type: object
properties:
id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
name:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListName'
description:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription'
meta:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata'
version:
type: integer
minimum: 1
_version:
type: string
required:
- id
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,37 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Patch list item API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen';
import { ListItem } from '../model/list_schemas.gen';
export type PatchListItemRequestBody = z.infer<typeof PatchListItemRequestBody>;
export const PatchListItemRequestBody = z.object({
id: ListItemId,
value: ListItemValue.optional(),
meta: ListItemMetadata.optional(),
_version: z.string().optional(),
/**
* Determines when changes made by the request are made visible to search
*/
refresh: z.enum(['true', 'false', 'wait_for']).optional(),
});
export type PatchListItemRequestBodyInput = z.input<typeof PatchListItemRequestBody>;
export type PatchListItemResponse = z.infer<typeof PatchListItemResponse>;
export const PatchListItemResponse = ListItem;

View file

@ -0,0 +1,77 @@
openapi: 3.0.0
info:
title: Patch list item API endpoint
version: '2023-10-31'
paths:
/api/lists/items:
patch:
x-labels: [serverless, ess]
operationId: PatchListItem
x-codegen-enabled: true
summary: Patches a list item
tags:
- List item API
requestBody:
description: List item's properties
required: true
content:
application/json:
schema:
type: object
properties:
id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId'
value:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue'
meta:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata'
_version:
type: string
refresh:
type: string
enum:
- 'true'
- 'false'
- wait_for
description: Determines when changes made by the request are made visible to search
required:
- id
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List item not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,33 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Get list API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId } from '../model/list_common.gen';
import { List } from '../model/list_schemas.gen';
export type GetListRequestQuery = z.infer<typeof GetListRequestQuery>;
export const GetListRequestQuery = z.object({
/**
* List's `id` value
*/
id: ListId,
});
export type GetListRequestQueryInput = z.input<typeof GetListRequestQuery>;
export type GetListResponse = z.infer<typeof GetListResponse>;
export const GetListResponse = List;

View file

@ -0,0 +1,59 @@
openapi: 3.0.0
info:
title: Get list API endpoint
version: '2023-10-31'
paths:
/api/lists:
get:
x-labels: [serverless, ess]
operationId: GetList
x-codegen-enabled: true
summary: Retrieves a list using its id field
tags:
- List API
parameters:
- name: id
in: query
required: true
description: List's `id` value
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,24 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Get list DS existence status API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
export type GetListIndexResponse = z.infer<typeof GetListIndexResponse>;
export const GetListIndexResponse = z.object({
list_index: z.boolean(),
list_item_index: z.boolean(),
});

View file

@ -0,0 +1,58 @@
openapi: 3.0.0
info:
title: Get list DS existence status API endpoint
version: '2023-10-31'
paths:
/api/lists/index:
get:
x-labels: [serverless, ess]
operationId: GetListIndex
x-codegen-enabled: true
summary: Get list data stream existence status
tags:
- List API
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
list_index:
type: boolean
list_item_index:
type: boolean
required: [list_index, list_item_index]
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List data stream(s) not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,41 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Get list item API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId } from '../model/list_common.gen';
import { ListItem } from '../model/list_schemas.gen';
export type GetListItemRequestQuery = z.infer<typeof GetListItemRequestQuery>;
export const GetListItemRequestQuery = z.object({
/**
* Required if `list_id` and `value` are not specified
*/
id: ListId.optional(),
/**
* Required if `id` is not specified
*/
list_id: ListId.optional(),
/**
* Required if `id` is not specified
*/
value: z.string().optional(),
});
export type GetListItemRequestQueryInput = z.input<typeof GetListItemRequestQuery>;
export type GetListItemResponse = z.infer<typeof GetListItemResponse>;
export const GetListItemResponse = z.union([ListItem, z.array(ListItem)]);

View file

@ -0,0 +1,75 @@
openapi: 3.0.0
info:
title: Get list item API endpoint
version: '2023-10-31'
paths:
/api/lists/items:
get:
x-labels: [serverless, ess]
operationId: GetListItem
x-codegen-enabled: true
summary: Gets a list item
tags:
- List item API
parameters:
- name: id
in: query
required: false
description: Required if `list_id` and `value` are not specified
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: list_id
in: query
required: false
description: Required if `id` is not specified
schema:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
- name: value
in: query
required: false
description: Required if `id` is not specified
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
oneOf:
- $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
- type: array
items:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List item not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,35 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Update list API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen';
import { List } from '../model/list_schemas.gen';
export type UpdateListRequestBody = z.infer<typeof UpdateListRequestBody>;
export const UpdateListRequestBody = z.object({
id: ListId,
name: ListName,
description: ListDescription,
meta: ListMetadata.optional(),
version: z.number().int().min(1).optional(),
_version: z.string().optional(),
});
export type UpdateListRequestBodyInput = z.input<typeof UpdateListRequestBody>;
export type UpdateListResponse = z.infer<typeof UpdateListResponse>;
export const UpdateListResponse = List;

View file

@ -0,0 +1,77 @@
openapi: 3.0.0
info:
title: Update list API endpoint
version: '2023-10-31'
paths:
/api/lists:
put:
x-labels: [serverless, ess]
operationId: UpdateList
x-codegen-enabled: true
summary: Updates a list
tags:
- List API
requestBody:
description: List's properties
required: true
content:
application/json:
schema:
type: object
properties:
id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListId'
name:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListName'
description:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription'
meta:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata'
version:
type: integer
minimum: 1
_version:
type: string
required:
- id
- name
- description
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/List'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,33 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* NOTICE: Do not edit this file manually.
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Update list item API endpoint
* version: 2023-10-31
*/
import { z } from 'zod';
import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen';
import { ListItem } from '../model/list_schemas.gen';
export type UpdateListItemRequestBody = z.infer<typeof UpdateListItemRequestBody>;
export const UpdateListItemRequestBody = z.object({
id: ListItemId,
value: ListItemValue,
meta: ListItemMetadata.optional(),
_version: z.string().optional(),
});
export type UpdateListItemRequestBodyInput = z.input<typeof UpdateListItemRequestBody>;
export type UpdateListItemResponse = z.infer<typeof UpdateListItemResponse>;
export const UpdateListItemResponse = ListItem;

View file

@ -0,0 +1,71 @@
openapi: 3.0.0
info:
title: Update list item API endpoint
version: '2023-10-31'
paths:
/api/lists/items:
put:
x-labels: [serverless, ess]
operationId: UpdateListItem
x-codegen-enabled: true
summary: Updates a list item
tags:
- List item API
requestBody:
description: List item's properties
required: true
content:
application/json:
schema:
type: object
properties:
id:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId'
value:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue'
meta:
$ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata'
_version:
type: string
required:
- id
- value
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem'
400:
description: Invalid input data response
content:
application/json:
schema:
oneOf:
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
- $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
401:
description: Unsuccessful authentication response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
403:
description: Not enough privileges response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse'
404:
description: List item not found response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'
500:
description: Internal server error response
content:
application/json:
schema:
$ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse'

View file

@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/securitysolution-lists-common",
"owner": "@elastic/security-detection-engine"
}

View file

@ -0,0 +1,10 @@
{
"description": "Security Solution Lists common package",
"license": "SSPL-1.0 OR Elastic License 2.0",
"name": "@kbn/securitysolution-lists-common",
"private": true,
"version": "1.0.0",
"scripts": {
"openapi:generate": "node scripts/openapi_generate"
}
}

View file

@ -0,0 +1,22 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
require('../../../src/setup_node_env');
const { resolve } = require('path');
const { generate } = require('@kbn/openapi-generator');
const ROOT = resolve(__dirname, '..');
(async () => {
await generate({
title: 'OpenAPI Lists API Schemas',
rootDir: ROOT,
sourceGlob: './**/*.schema.yaml',
templateName: 'zod_operation_schema',
});
})();

View file

@ -0,0 +1,10 @@
{
"compilerOptions": {
"outDir": "target/types",
"types": ["jest", "node"]
},
"exclude": ["target/**/*"],
"extends": "../../tsconfig.base.json",
"include": ["**/*.ts"],
"kbn_references": ["@kbn/zod-helpers", "@kbn/openapi-common"]
}

View file

@ -14,3 +14,4 @@ export * from './src/is_valid_date_math';
export * from './src/required_optional';
export * from './src/safe_parse_result';
export * from './src/stringify_zod_error';
export * from './src/build_route_validation_with_zod';

View file

@ -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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { TypeOf, ZodType } from 'zod';
import type { RouteValidationFunction, RouteValidationResultFactory } from '@kbn/core/server';
import { stringifyZodError } from './stringify_zod_error';
/**
* Zod validation factory for Kibana route's request validation.
* It allows to pass a Zod schema for parameters, query and/or body validation.
*
* Example:
*
* ```ts
* router.versioned
* .post({
* access: 'public',
* path: MY_URL,
* })
* .addVersion(
* {
* version: 'my-version',
* validate: {
* request: {
* params: buildRouteValidationWithZod(MyRequestParamsZodSchema),
* query: buildRouteValidationWithZod(MyRequestQueryZodSchema),
* body: buildRouteValidationWithZod(MyRequestBodyZodSchema),
* },
* },
* },
* ```
*/
export function buildRouteValidationWithZod<ZodSchema extends ZodType, Type = TypeOf<ZodSchema>>(
schema: ZodSchema
): RouteValidationFunction<Type> {
return (inputValue: unknown, validationResult: RouteValidationResultFactory) => {
const decoded = schema.safeParse(inputValue);
return decoded.success
? validationResult.ok(decoded.data)
: validationResult.badRequest(stringifyZodError(decoded.error));
};
}

View file

@ -6,7 +6,5 @@
"exclude": ["target/**/*"],
"extends": "../../tsconfig.base.json",
"include": ["**/*.ts"],
"kbn_references": [
"@kbn/datemath",
]
"kbn_references": ["@kbn/datemath", "@kbn/core"]
}

View file

@ -1238,6 +1238,8 @@
"@kbn/open-telemetry-instrumented-plugin/*": ["test/common/plugins/otel_metrics/*"],
"@kbn/openapi-bundler": ["packages/kbn-openapi-bundler"],
"@kbn/openapi-bundler/*": ["packages/kbn-openapi-bundler/*"],
"@kbn/openapi-common": ["packages/kbn-openapi-common"],
"@kbn/openapi-common/*": ["packages/kbn-openapi-common/*"],
"@kbn/openapi-generator": ["packages/kbn-openapi-generator"],
"@kbn/openapi-generator/*": ["packages/kbn-openapi-generator/*"],
"@kbn/optimizer": ["packages/kbn-optimizer"],
@ -1498,6 +1500,8 @@
"@kbn/securitysolution-list-hooks/*": ["packages/kbn-securitysolution-list-hooks/*"],
"@kbn/securitysolution-list-utils": ["packages/kbn-securitysolution-list-utils"],
"@kbn/securitysolution-list-utils/*": ["packages/kbn-securitysolution-list-utils/*"],
"@kbn/securitysolution-lists-common": ["packages/kbn-securitysolution-lists-common"],
"@kbn/securitysolution-lists-common/*": ["packages/kbn-securitysolution-lists-common/*"],
"@kbn/securitysolution-rules": ["packages/kbn-securitysolution-rules"],
"@kbn/securitysolution-rules/*": ["packages/kbn-securitysolution-rules/*"],
"@kbn/securitysolution-t-grid": ["packages/kbn-securitysolution-t-grid"],

View file

@ -27,20 +27,4 @@ export * from './exceptions/summary_exception_list/summary_exception_list_route'
export * from './exceptions/update_endpoint_list_item/update_endpoint_list_item_route';
export * from './exceptions/update_exception_list_item/update_exception_list_item_route';
export * from './exceptions/update_exception_list/update_exception_list_route';
export * from './values/create_list_index/create_list_index_route';
export * from './values/create_list_item/create_list_item_route';
export * from './values/create_list/create_list_route';
export * from './values/delete_list_index/delete_list_index_route';
export * from './values/delete_list_item/delete_list_item_route';
export * from './values/delete_list/delete_list_route';
export * from './values/find_list_item/find_list_item_route';
export * from './values/find_list/find_list_route';
export * from './values/find_lists_by_size/find_lists_by_size_route';
export * from './values/import_list_item/import_list_item_route';
export * from './values/patch_list_item/patch_list_item_route';
export * from './values/patch_list/patch_list_route';
export * from './values/read_list_index/read_list_index_route';
export * from './values/read_list_item/read_list_item_route';
export * from './values/read_list/read_list_route';
export * from './values/update_list_item/update_list_item_route';
export * from './values/update_list/update_list_route';

View file

@ -1,15 +0,0 @@
/*
* 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 {
CreateListSchemaDecoded,
createListSchema,
listSchema,
} from '@kbn/securitysolution-io-ts-list-types';
export { createListSchema as createListRequest, listSchema as createListResponse };
export type { CreateListSchemaDecoded as CreateListRequestDecoded };

View file

@ -1,10 +0,0 @@
/*
* 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 { acknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types';
export { acknowledgeSchema as createListIndexResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { createListItemSchema, listItemSchema } from '@kbn/securitysolution-io-ts-list-types';
export { createListItemSchema as createListItemRequest, listItemSchema as createListItemResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { deleteListSchema, listSchema } from '@kbn/securitysolution-io-ts-list-types';
export { deleteListSchema as deleteListRequestQuery, listSchema as deleteListResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { acknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types';
export { acknowledgeSchema as deleteListIndexResponse };

View file

@ -1,18 +0,0 @@
/*
* 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 {
deleteListItemSchema,
listItemArraySchema,
listItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
export {
deleteListItemSchema as deleteListItemRequestQuery,
listItemSchema as deleteListItemResponse,
listItemArraySchema as deleteListItemArrayResponse,
};

View file

@ -1,10 +0,0 @@
/*
* 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 { findListSchema, foundListSchema } from '@kbn/securitysolution-io-ts-list-types';
export { findListSchema as findListRequestQuery, foundListSchema as findListResponse };

View file

@ -1,18 +0,0 @@
/*
* 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 {
FindListItemSchemaDecoded,
findListItemSchema,
foundListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
export {
findListItemSchema as findListItemRequestQuery,
foundListItemSchema as findListItemResponse,
};
export type { FindListItemSchemaDecoded as FindListItemRequestQueryDecoded };

View file

@ -1,13 +0,0 @@
/*
* 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 { importListItemQuerySchema, listSchema } from '@kbn/securitysolution-io-ts-list-types';
export {
importListItemQuerySchema as importListItemRequestQuery,
listSchema as importListItemResponse,
};

View file

@ -1,10 +0,0 @@
/*
* 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 { listSchema, patchListSchema } from '@kbn/securitysolution-io-ts-list-types';
export { patchListSchema as patchListRequest, listSchema as patchListResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { listItemSchema, patchListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
export { patchListItemSchema as patchListItemRequest, listItemSchema as patchListItemResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { listSchema, readListSchema } from '@kbn/securitysolution-io-ts-list-types';
export { readListSchema as readListRequestQuery, listSchema as readListResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { listItemIndexExistSchema } from '@kbn/securitysolution-io-ts-list-types';
export { listItemIndexExistSchema as readListIndexResponse };

View file

@ -1,18 +0,0 @@
/*
* 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 {
listItemArraySchema,
listItemSchema,
readListItemSchema,
} from '@kbn/securitysolution-io-ts-list-types';
export {
readListItemSchema as readListItemRequestQuery,
listItemSchema as readListItemResponse,
listItemArraySchema as readListItemArrayResponse,
};

View file

@ -1,10 +0,0 @@
/*
* 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 { listSchema, updateListSchema } from '@kbn/securitysolution-io-ts-list-types';
export { updateListSchema as updateListRequest, listSchema as updateListResponse };

View file

@ -1,10 +0,0 @@
/*
* 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 { listItemSchema, updateListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
export { updateListItemSchema as updateListItemRequest, listItemSchema as updateListItemResponse };

View file

@ -5,11 +5,11 @@
* 2.0.
*/
import type { CreateListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { CreateListRequestBodyInput } from '@kbn/securitysolution-lists-common/api';
import { DESCRIPTION, LIST_ID, META, NAME, TYPE, VERSION } from '../../constants.mock';
export const getCreateListSchemaMock = (): CreateListSchema => ({
export const getCreateListSchemaMock = (): CreateListRequestBodyInput => ({
description: DESCRIPTION,
deserializer: undefined,
id: LIST_ID,
@ -23,7 +23,7 @@ export const getCreateListSchemaMock = (): CreateListSchema => ({
/**
* Useful for end to end tests and other mechanisms which want to fill in the values
*/
export const getCreateMinimalListSchemaMock = (): CreateListSchema => ({
export const getCreateMinimalListSchemaMock = (): CreateListRequestBodyInput => ({
description: DESCRIPTION,
id: LIST_ID,
name: NAME,
@ -33,7 +33,7 @@ export const getCreateMinimalListSchemaMock = (): CreateListSchema => ({
/**
* Useful for end to end tests and other mechanisms which want to fill in the values
*/
export const getCreateMinimalListSchemaMockWithoutId = (): CreateListSchema => ({
export const getCreateMinimalListSchemaMockWithoutId = (): CreateListRequestBodyInput => ({
description: DESCRIPTION,
name: NAME,
type: TYPE,

View file

@ -5,11 +5,11 @@
* 2.0.
*/
import type { UpdateListSchema } from '@kbn/securitysolution-io-ts-list-types';
import type { UpdateListRequestBody } from '@kbn/securitysolution-lists-common/api';
import { DESCRIPTION, LIST_ID, META, NAME, _VERSION } from '../../constants.mock';
export const getUpdateListSchemaMock = (): UpdateListSchema => ({
export const getUpdateListSchemaMock = (): UpdateListRequestBody => ({
_version: _VERSION,
description: DESCRIPTION,
id: LIST_ID,
@ -21,7 +21,7 @@ export const getUpdateListSchemaMock = (): UpdateListSchema => ({
* Useful for end to end tests and other mechanisms which want to fill in the values
* after doing a get of the structure.
*/
export const getUpdateMinimalListSchemaMock = (): UpdateListSchema => ({
export const getUpdateMinimalListSchemaMock = (): UpdateListRequestBody => ({
description: DESCRIPTION,
id: LIST_ID,
name: NAME,

View file

@ -5,17 +5,13 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { CreateListRequestBody, CreateListResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import {
CreateListRequestDecoded,
createListRequest,
createListResponse,
} from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const createListRoute = (router: ListsPluginRouter): void => {
@ -31,9 +27,7 @@ export const createListRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
body: buildRouteValidation<typeof createListRequest, CreateListRequestDecoded>(
createListRequest
),
body: buildRouteValidationWithZod(CreateListRequestBody),
},
},
version: '2023-10-31',
@ -77,12 +71,8 @@ export const createListRoute = (router: ListsPluginRouter): void => {
type,
version,
});
const [validated, errors] = validate(list, createListResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: CreateListResponse.parse(list) });
}
} catch (err) {
const error = transformError(err);

View file

@ -17,12 +17,13 @@ import {
} from '@kbn/securitysolution-io-ts-list-types';
import { getSavedObjectType } from '@kbn/securitysolution-list-utils';
import { LIST_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { DeleteListRequestQuery, DeleteListResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import type { ExceptionListClient } from '../../services/exception_lists/exception_list_client';
import { escapeQuotes } from '../../services/utils/escape_query';
import { deleteListRequestQuery, deleteListResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getExceptionListClient, getListClient } from '..';
export const deleteListRoute = (router: ListsPluginRouter): void => {
@ -38,7 +39,7 @@ export const deleteListRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation(deleteListRequestQuery),
query: buildRouteValidationWithZod(DeleteListRequestQuery),
},
},
version: '2023-10-31',
@ -49,7 +50,6 @@ export const deleteListRoute = (router: ListsPluginRouter): void => {
const lists = await getListClient(context);
const exceptionLists = await getExceptionListClient(context);
const { id, deleteReferences, ignoreReferences } = request.query;
let deleteExceptionItemResponses;
// ignoreReferences=true maintains pre-7.11 behavior of deleting value list without performing any additional checks
if (!ignoreReferences) {
@ -75,7 +75,7 @@ export const deleteListRoute = (router: ListsPluginRouter): void => {
if (deleteReferences) {
// Delete referenced exception list items
// TODO: Create deleteListItems to delete in batch
deleteExceptionItemResponses = await Promise.all(
await Promise.all(
referencedExceptionListItems.map(async (listItem) => {
// Ensure only the single entry is deleted as there could be a separate value list referenced that is okay to keep // TODO: Add API to delete single entry
const remainingEntries = listItem.entries.filter(
@ -122,16 +122,9 @@ export const deleteListRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(deleted, deleteListResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({
body: validated ?? {
deleteItemResponses: deleteExceptionItemResponses,
},
});
}
return response.ok({
body: DeleteListResponse.parse(deleted),
});
}
} catch (err) {
const error = transformError(err);

View file

@ -8,14 +8,17 @@
import { extname } from 'path';
import { schema } from '@kbn/config-schema';
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
ImportListItemsRequestQuery,
ImportListItemsResponse,
} from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { ConfigType } from '../../config';
import { importListItemRequestQuery, importListItemResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { createStreamFromBuffer } from '../utils/create_stream_from_buffer';
import { getListClient } from '..';
@ -43,7 +46,7 @@ export const importListItemRoute = (router: ListsPluginRouter, config: ConfigTyp
validate: {
request: {
body: schema.buffer(),
query: buildRouteValidation(importListItemRequestQuery),
query: buildRouteValidationWithZod(ImportListItemsRequestQuery),
},
},
version: '2023-10-31',
@ -119,12 +122,7 @@ export const importListItemRoute = (router: ListsPluginRouter, config: ConfigTyp
version: 1,
});
const [validated, errors] = validate(list, importListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: ImportListItemsResponse.parse(list) });
} else if (type != null) {
const importedList = await lists.importListItemsToStream({
deserializer,
@ -142,12 +140,8 @@ export const importListItemRoute = (router: ListsPluginRouter, config: ConfigTyp
statusCode: 400,
});
}
const [validated, errors] = validate(importedList, importListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: ImportListItemsResponse.parse(importedList) });
} else {
return siemResponse.error({
body: 'Either type or list_id need to be defined in the query',

View file

@ -5,13 +5,13 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { PatchListRequestBody, PatchListResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { patchListRequest, patchListResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const patchListRoute = (router: ListsPluginRouter): void => {
@ -27,7 +27,7 @@ export const patchListRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
body: buildRouteValidation(patchListRequest),
body: buildRouteValidationWithZod(PatchListRequestBody),
},
},
version: '2023-10-31',
@ -54,12 +54,7 @@ export const patchListRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(list, patchListResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: PatchListResponse.parse(list) });
}
} catch (err) {
const error = transformError(err);

View file

@ -5,13 +5,13 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { GetListRequestQuery, GetListResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { readListRequestQuery, readListResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const readListRoute = (router: ListsPluginRouter): void => {
@ -27,7 +27,7 @@ export const readListRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation(readListRequestQuery),
query: buildRouteValidationWithZod(GetListRequestQuery),
},
},
version: '2023-10-31',
@ -44,12 +44,7 @@ export const readListRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(list, readListResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: GetListResponse.parse(list) });
}
} catch (err) {
const error = transformError(err);

View file

@ -5,13 +5,13 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { UpdateListRequestBody, UpdateListResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { updateListRequest, updateListResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const updateListRoute = (router: ListsPluginRouter): void => {
@ -27,7 +27,7 @@ export const updateListRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
body: buildRouteValidation(updateListRequest),
body: buildRouteValidationWithZod(UpdateListRequestBody),
},
},
version: '2023-10-31',
@ -54,12 +54,7 @@ export const updateListRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(list, updateListResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: UpdateListResponse.parse(list) });
}
} catch (err) {
const error = transformError(err);

View file

@ -5,11 +5,10 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_INDEX } from '@kbn/securitysolution-list-constants';
import { CreateListIndexResponse } from '@kbn/securitysolution-lists-common/api';
import { createListIndexResponse } from '../../../common/api';
import type { ListsPluginRouter } from '../../types';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
@ -64,12 +63,7 @@ export const createListIndexRoute = (router: ListsPluginRouter): void => {
: lists.createListItemDataStream());
}
const [validated, errors] = validate({ acknowledged: true }, createListIndexResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: CreateListIndexResponse.parse({ acknowledged: true }) });
} catch (err) {
const error = transformError(err);
return siemResponse.error({

View file

@ -5,13 +5,12 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_INDEX } from '@kbn/securitysolution-list-constants';
import { DeleteListIndexResponse } from '@kbn/securitysolution-lists-common/api';
import { ListClient } from '../../services/lists/list_client';
import type { ListsPluginRouter } from '../../types';
import { deleteListIndexResponse } from '../../../common/api';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
@ -83,12 +82,7 @@ export const deleteListIndexRoute = (router: ListsPluginRouter): void => {
await deleteIndexTemplates(lists);
const [validated, errors] = validate({ acknowledged: true }, deleteListIndexResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: DeleteListIndexResponse.parse({ acknowledged: true }) });
} catch (err) {
const error = transformError(err);
return siemResponse.error({

View file

@ -9,10 +9,11 @@ import { Stream } from 'stream';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { ExportListItemsRequestQuery } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { exportListItemRequestQuery } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const exportListItemRoute = (router: ListsPluginRouter): void => {
@ -28,7 +29,7 @@ export const exportListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation(exportListItemRequestQuery),
query: buildRouteValidationWithZod(ExportListItemsRequestQuery),
},
},
version: '2023-10-31',

View file

@ -5,14 +5,14 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { FindListsRequestQuery, FindListsResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { decodeCursor } from '../../services/utils';
import { findListRequestQuery, findListResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse, getListClient } from '../utils';
import { buildSiemResponse, getListClient } from '../utils';
export const findListRoute = (router: ListsPluginRouter): void => {
router.versioned
@ -27,7 +27,7 @@ export const findListRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation(findListRequestQuery),
query: buildRouteValidationWithZod(FindListsRequestQuery),
},
},
version: '2023-10-31',
@ -74,12 +74,8 @@ export const findListRoute = (router: ListsPluginRouter): void => {
sortField,
sortOrder,
});
const [validated, errors] = validate(exceptionList, findListResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: FindListsResponse.parse(exceptionList) });
}
} catch (err) {
const error = transformError(err);

View file

@ -5,12 +5,11 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_INDEX } from '@kbn/securitysolution-list-constants';
import { GetListIndexResponse } from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { readListIndexResponse } from '../../../common/api';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
@ -37,15 +36,12 @@ export const readListIndexRoute = (router: ListsPluginRouter): void => {
const listItemDataStreamExists = await lists.getListItemDataStreamExists();
if (listDataStreamExists && listItemDataStreamExists) {
const [validated, errors] = validate(
{ list_index: listDataStreamExists, list_item_index: listItemDataStreamExists },
readListIndexResponse
);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({
body: GetListIndexResponse.parse({
list_index: listDataStreamExists,
list_item_index: listItemDataStreamExists,
}),
});
} else if (!listDataStreamExists && listItemDataStreamExists) {
return siemResponse.error({
body: `data stream ${lists.getListName()} does not exist`,

View file

@ -5,13 +5,16 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
CreateListItemRequestBody,
CreateListItemResponse,
} from '@kbn/securitysolution-lists-common/api';
import { createListItemRequest, createListItemResponse } from '../../../common/api';
import type { ListsPluginRouter } from '../../types';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const createListItemRoute = (router: ListsPluginRouter): void => {
@ -27,7 +30,7 @@ export const createListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
body: buildRouteValidation(createListItemRequest),
body: buildRouteValidationWithZod(CreateListItemRequestBody),
},
},
version: '2023-10-31',
@ -63,13 +66,9 @@ export const createListItemRoute = (router: ListsPluginRouter): void => {
type: list.type,
value,
});
if (createdListItem != null) {
const [validated, errors] = validate(createdListItem, createListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: CreateListItemResponse.parse(createdListItem) });
} else {
return siemResponse.error({
body: 'list item invalid',

View file

@ -5,17 +5,16 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
DeleteListItemRequestQuery,
DeleteListItemResponse,
} from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import {
deleteListItemArrayResponse,
deleteListItemRequestQuery,
deleteListItemResponse,
} from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const deleteListItemRoute = (router: ListsPluginRouter): void => {
@ -31,7 +30,7 @@ export const deleteListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation(deleteListItemRequestQuery),
query: buildRouteValidationWithZod(DeleteListItemRequestQuery),
},
},
version: '2023-10-31',
@ -50,12 +49,7 @@ export const deleteListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(deleted, deleteListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: DeleteListItemResponse.parse(deleted) });
}
} else if (listId != null && value != null) {
const list = await lists.getList({ id: listId });
@ -77,12 +71,7 @@ export const deleteListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(deleted, deleteListItemArrayResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: DeleteListItemResponse.parse(deleted) });
}
}
} else {

View file

@ -5,18 +5,17 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
FindListItemsRequestQuery,
FindListItemsResponse,
} from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { decodeCursor } from '../../services/utils';
import {
FindListItemRequestQueryDecoded,
findListItemRequestQuery,
findListItemResponse,
} from '../../../common/api';
import { buildRouteValidation, buildSiemResponse, getListClient } from '../utils';
import { buildSiemResponse, getListClient } from '../utils';
export const findListItemRoute = (router: ListsPluginRouter): void => {
router.versioned
@ -31,10 +30,7 @@ export const findListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation<
typeof findListItemRequestQuery,
FindListItemRequestQueryDecoded
>(findListItemRequestQuery),
query: buildRouteValidationWithZod(FindListItemsRequestQuery),
},
},
version: '2023-10-31',
@ -90,12 +86,7 @@ export const findListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(exceptionList, findListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: FindListItemsResponse.parse(exceptionList) });
}
}
} catch (err) {

View file

@ -5,13 +5,16 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
PatchListItemRequestBody,
PatchListItemResponse,
} from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { patchListItemRequest, patchListItemResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const patchListItemRoute = (router: ListsPluginRouter): void => {
@ -27,7 +30,7 @@ export const patchListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
body: buildRouteValidation(patchListItemRequest),
body: buildRouteValidationWithZod(PatchListItemRequestBody),
},
},
version: '2023-10-31',
@ -61,12 +64,7 @@ export const patchListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(listItem, patchListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: PatchListItemResponse.parse(listItem) });
}
} catch (err) {
const error = transformError(err);

View file

@ -5,17 +5,16 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
GetListItemRequestQuery,
GetListItemResponse,
} from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import {
readListItemArrayResponse,
readListItemRequestQuery,
readListItemResponse,
} from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const readListItemRoute = (router: ListsPluginRouter): void => {
@ -31,7 +30,7 @@ export const readListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
query: buildRouteValidation(readListItemRequestQuery),
query: buildRouteValidationWithZod(GetListItemRequestQuery),
},
},
version: '2023-10-31',
@ -49,12 +48,7 @@ export const readListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(listItem, readListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: GetListItemResponse.parse(listItem) });
}
} else if (listId != null && value != null) {
const list = await lists.getList({ id: listId });
@ -75,12 +69,7 @@ export const readListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(listItem, readListItemArrayResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: GetListItemResponse.parse(listItem) });
}
}
} else {

View file

@ -5,13 +5,16 @@
* 2.0.
*/
import { validate } from '@kbn/securitysolution-io-ts-utils';
import { transformError } from '@kbn/securitysolution-es-utils';
import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import {
UpdateListItemRequestBody,
UpdateListItemResponse,
} from '@kbn/securitysolution-lists-common/api';
import type { ListsPluginRouter } from '../../types';
import { updateListItemRequest, updateListItemResponse } from '../../../common/api';
import { buildRouteValidation, buildSiemResponse } from '../utils';
import { buildSiemResponse } from '../utils';
import { getListClient } from '..';
export const updateListItemRoute = (router: ListsPluginRouter): void => {
@ -27,7 +30,7 @@ export const updateListItemRoute = (router: ListsPluginRouter): void => {
{
validate: {
request: {
body: buildRouteValidation(updateListItemRequest),
body: buildRouteValidationWithZod(UpdateListItemRequestBody),
},
},
version: '2023-10-31',
@ -59,12 +62,7 @@ export const updateListItemRoute = (router: ListsPluginRouter): void => {
statusCode: 404,
});
} else {
const [validated, errors] = validate(listItem, updateListItemResponse);
if (errors != null) {
return siemResponse.error({ body: errors, statusCode: 500 });
} else {
return response.ok({ body: validated ?? {} });
}
return response.ok({ body: UpdateListItemResponse.parse(listItem) });
}
} catch (err) {
const error = transformError(err);

View file

@ -1,15 +1,14 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"outDir": "target/types"
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"server/**/*.json",
"server/**/*.json"
],
"kbn_references": [
"@kbn/core",
@ -20,6 +19,7 @@
"@kbn/securitysolution-list-constants",
"@kbn/securitysolution-list-hooks",
"@kbn/securitysolution-list-api",
"@kbn/securitysolution-lists-common",
"@kbn/kibana-react-plugin",
"@kbn/i18n",
"@kbn/data-plugin",
@ -39,8 +39,7 @@
"@kbn/utility-types",
"@kbn/core-elasticsearch-client-server-mocks",
"@kbn/core-saved-objects-server",
"@kbn/zod-helpers"
],
"exclude": [
"target/**/*",
]
"exclude": ["target/**/*"]
}

View file

@ -6,11 +6,11 @@
*/
import { transformError, BadRequestError, getIndexAliases } from '@kbn/securitysolution-es-utils';
import { buildRouteValidationWithZod } from '@kbn/zod-helpers';
import { CreateAlertsMigrationRequestBody } from '../../../../../common/api/detection_engine/signals_migration';
import type { SecuritySolutionPluginRouter } from '../../../../types';
import type { SetupPlugins } from '../../../../plugin';
import { DETECTION_ENGINE_SIGNALS_MIGRATION_URL } from '../../../../../common/constants';
import { buildRouteValidationWithZod } from '../../../../utils/build_validation/route_validation';
import { buildSiemResponse } from '../utils';
import { getTemplateVersion } from '../index/check_template_version';

Some files were not shown because too many files have changed in this diff Show more