diff --git a/fleet_packages.json b/fleet_packages.json index da78baac4651a..76dd27e8c27f0 100644 --- a/fleet_packages.json +++ b/fleet_packages.json @@ -30,7 +30,7 @@ }, { "name": "elastic_agent", - "version": "1.19.2" + "version": "1.20.0" }, { "name": "endpoint", diff --git a/package.json b/package.json index 989341509eb04..338db19ea67a1 100644 --- a/package.json +++ b/package.json @@ -1675,6 +1675,7 @@ "mochawesome-merge": "^4.3.0", "mock-fs": "^5.1.2", "ms-chromium-edge-driver": "^0.5.1", + "msw": "^2.3.1", "multistream": "^4.1.0", "mutation-observer": "^1.0.3", "native-hdr-histogram": "^1.0.0", diff --git a/packages/kbn-openapi-generator/src/openapi_generator.ts b/packages/kbn-openapi-generator/src/openapi_generator.ts index bdbc8ecec3c97..b5e73613139aa 100644 --- a/packages/kbn-openapi-generator/src/openapi_generator.ts +++ b/packages/kbn-openapi-generator/src/openapi_generator.ts @@ -100,6 +100,7 @@ export const generate = async (config: GeneratorConfig) => { version: 'Bundle (no version)', }, imports: {}, + circularRefs: new Set(), }); await fs.writeFile(bundle.outFile, result); diff --git a/packages/kbn-openapi-generator/src/parser/get_generation_context.ts b/packages/kbn-openapi-generator/src/parser/get_generation_context.ts index 7f161c0bc7645..2813ff85201e0 100644 --- a/packages/kbn-openapi-generator/src/parser/get_generation_context.ts +++ b/packages/kbn-openapi-generator/src/parser/get_generation_context.ts @@ -13,12 +13,14 @@ import { getImportsMap, ImportsMap } from './lib/get_imports_map'; import { normalizeSchema } from './lib/normalize_schema'; import { NormalizedOperation, OpenApiDocument } from './openapi_types'; import { getInfo } from './lib/get_info'; +import { getCircularRefs } from './lib/get_circular_refs'; export interface GenerationContext { components: OpenAPIV3.ComponentsObject | undefined; operations: NormalizedOperation[]; info: OpenAPIV3.InfoObject; imports: ImportsMap; + circularRefs: Set; } export function getGenerationContext(document: OpenApiDocument): GenerationContext { @@ -28,11 +30,13 @@ export function getGenerationContext(document: OpenApiDocument): GenerationConte const operations = getApiOperationsList(normalizedDocument); const info = getInfo(normalizedDocument); const imports = getImportsMap(normalizedDocument); + const circularRefs = getCircularRefs(normalizedDocument); return { components, operations, info, imports, + circularRefs, }; } diff --git a/packages/kbn-openapi-generator/src/parser/lib/find_refs.ts b/packages/kbn-openapi-generator/src/parser/lib/find_refs.ts new file mode 100644 index 0000000000000..1829c0a5e7ee2 --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/find_refs.ts @@ -0,0 +1,28 @@ +/* + * 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 { hasRef } from './helpers/has_ref'; +import { traverseObject } from './helpers/traverse_object'; + +/** + * Traverse the OpenAPI document recursively and find all references + * + * @param obj Any object + * @returns A list of external references + */ +export function findRefs(obj: unknown): string[] { + const refs: string[] = []; + + traverseObject(obj, (element) => { + if (hasRef(element)) { + refs.push(element.$ref); + } + }); + + return refs; +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts b/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts new file mode 100644 index 0000000000000..da9649d5f0c6d --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts @@ -0,0 +1,105 @@ +/* + * 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 { OpenApiDocument } from '../openapi_types'; +import type { PlainObject } from './helpers/plain_object'; +import { extractByJsonPointer } from './helpers/extract_by_json_pointer'; +import { findRefs } from './find_refs'; + +/** + * Extracts circular references from a provided document. + * Currently only local references are supported. + */ +export function getCircularRefs(document: OpenApiDocument): Set { + const localRefs = findLocalRefs(document); + const circularRefs = new Set(); + const resolveLocalRef = (localRef: string): PlainObject => + extractByJsonPointer(document, extractJsonPointer(localRef)); + + // In general references represent a disconnected graph. To find + // all references cycles we need to check each reference. + for (const startRef of new Set(localRefs)) { + const cycleHeadRef = findCycleHeadRef(startRef, resolveLocalRef); + + if (cycleHeadRef) { + circularRefs.add(cycleHeadRef); + } + } + + return circularRefs; +} + +/** + * Searches for a cycle head. A search starts from `startRef` reference. + * + * A cycle head is a first ref in a cycle. If `startRef` inside a cycle + * a cycle head is the starting ref. It can be illustrated as + * + * c1 - c2 - c3 + * / | + * r1 -> r2 -> r3 -> head c4 + * \ | + * c7 - c6 - c5 + * + * On the schema above references `r1`, `r2` and `r3` depend on the cycle but + * aren't part of the cycle. When search is started from them `head` is + * returned. If a search starts from `c3` then `c3` will be returned. + * + * @param startRef A starting point to find a cycle + * @param resolveRef A callback function to resolve an encountered reference. + * It should return a document node the provided ref resolves to. + * @returns a Set representing a cycle or an empty set if a cycle is not found + */ +function findCycleHeadRef( + startRef: string, + resolveRef: (ref: string) => PlainObject +): string | undefined { + let result: string | undefined; + + const visitedRefs = new Set(); + const search = (ref: string): void => { + if (visitedRefs.has(ref)) { + result = ref; + return; + } + + const refNode = resolveRef(ref); + const nextRefs = findLocalRefs(refNode); + + visitedRefs.add(ref); + nextRefs.forEach(search); + visitedRefs.delete(ref); + }; + + search(startRef); + + return result; +} + +/** + * Finds local references + */ +function findLocalRefs(obj: unknown): string[] { + return findRefs(obj).filter((ref) => isLocalRef(ref)); +} + +/** + * Checks whether the provided ref is local. + * Local references start with `#/` + */ +function isLocalRef(ref: string): boolean { + return ref.startsWith('#/'); +} + +/** + * Extracts a JSON Pointer from a local reference + * by getting rid of the leading slash + */ +function extractJsonPointer(ref: string): string { + return ref.substring(1); +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts b/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts index c2259052e0cb6..634ac82aaae8c 100644 --- a/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts @@ -8,7 +8,7 @@ import { uniq } from 'lodash'; import type { OpenApiDocument } from '../openapi_types'; -import { traverseObject } from './traverse_object'; +import { findRefs } from './find_refs'; export interface ImportsMap { [importPath: string]: string[]; @@ -37,31 +37,3 @@ export const getImportsMap = (parsedSchema: OpenApiDocument): ImportsMap => { return importMap; }; - -/** - * Check if an object has a $ref property - * - * @param obj Any object - * @returns True if the object has a $ref property - */ -const hasRef = (obj: unknown): obj is { $ref: string } => { - return typeof obj === 'object' && obj !== null && '$ref' in obj; -}; - -/** - * Traverse the OpenAPI document recursively and find all references - * - * @param obj Any object - * @returns A list of external references - */ -function findRefs(obj: unknown): string[] { - const refs: string[] = []; - - traverseObject(obj, (element) => { - if (hasRef(element)) { - refs.push(element.$ref); - } - }); - - return refs; -} diff --git a/packages/kbn-openapi-generator/src/parser/lib/helpers/extract_by_json_pointer.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/extract_by_json_pointer.ts new file mode 100644 index 0000000000000..bdfe59965b576 --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/extract_by_json_pointer.ts @@ -0,0 +1,47 @@ +/* + * 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 { PlainObject } from './plain_object'; +import { isPlainObjectType } from './is_plain_object_type'; + +/** + * Extract a node from a document using a provided [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901). + * + * JSON Pointer is the second part in [JSON Reference](https://datatracker.ietf.org/doc/html/draft-pbryan-zyp-json-ref-03). + * For example an object `{ $ref: "./some-file.yaml#/components/schemas/MySchema"}` is a reference node. + * Where `/components/schemas/MySchema` is a JSON pointer. `./some-file.yaml` is a document reference. + * Yaml shares the same JSON reference standard and basically can be considered just as a different + * JS Object serialization format. See OpenAPI [Using $ref](https://swagger.io/docs/specification/using-ref/) for more information. + * + * @param document a document containing node to resolve by using the pointer + * @param pointer a JSON Pointer + * @returns resolved document node (it's always a JS object) + */ +export function extractByJsonPointer(document: unknown, pointer: string): PlainObject { + if (!pointer.startsWith('/')) { + throw new Error('$ref pointer must start with a leading slash'); + } + + if (!isPlainObjectType(document)) { + throw new Error('document must be an object'); + } + + let target = document; + + for (const segment of pointer.slice(1).split('/')) { + const nextTarget = target[segment]; + + if (!isPlainObjectType(nextTarget)) { + throw new Error(`JSON Pointer "${pointer}" is not found in "${JSON.stringify(document)}"`); + } + + target = nextTarget; + } + + return target; +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/helpers/has_ref.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/has_ref.ts new file mode 100644 index 0000000000000..4457665070f7b --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/has_ref.ts @@ -0,0 +1,19 @@ +/* + * 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 { NormalizedReferenceObject } from '../../openapi_types'; + +/** + * Check if an object has a $ref property + * + * @param obj Any object + * @returns True if the object has a $ref property + */ +export function hasRef(obj: unknown): obj is NormalizedReferenceObject { + return typeof obj === 'object' && obj !== null && '$ref' in obj; +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/helpers/is_plain_object_type.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/is_plain_object_type.ts new file mode 100644 index 0000000000000..c3612443800e9 --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/is_plain_object_type.ts @@ -0,0 +1,14 @@ +/* + * 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 { isPlainObject } from 'lodash'; +import type { PlainObject } from './plain_object'; + +export function isPlainObjectType(maybeObj: unknown): maybeObj is PlainObject { + return isPlainObject(maybeObj); +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/helpers/plain_object.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/plain_object.ts new file mode 100644 index 0000000000000..8a3fead0f8b80 --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/plain_object.ts @@ -0,0 +1,9 @@ +/* + * 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 type PlainObject = Record; diff --git a/packages/kbn-openapi-generator/src/parser/lib/traverse_object.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/traverse_object.ts similarity index 100% rename from packages/kbn-openapi-generator/src/parser/lib/traverse_object.ts rename to packages/kbn-openapi-generator/src/parser/lib/helpers/traverse_object.ts diff --git a/packages/kbn-openapi-generator/src/parser/lib/normalize_schema.ts b/packages/kbn-openapi-generator/src/parser/lib/normalize_schema.ts index 0ed02a28585eb..d082b9a96dc44 100644 --- a/packages/kbn-openapi-generator/src/parser/lib/normalize_schema.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/normalize_schema.ts @@ -7,41 +7,31 @@ */ import { OpenAPIV3 } from 'openapi-types'; -import { NormalizedReferenceObject } from '../openapi_types'; -import { traverseObject } from './traverse_object'; - -/** - * Check if an object has a $ref property - * - * @param obj Any object - * @returns True if the object has a $ref property - */ -const hasRef = (obj: unknown): obj is NormalizedReferenceObject => { - return typeof obj === 'object' && obj !== null && '$ref' in obj; -}; - -const stringIsUrl = (str: string) => { - try { - new URL(str); - return true; - } catch { - return false; - } -}; - -export function normalizeSchema(schema: OpenAPIV3.Document) { +import { URL } from 'node:url'; +import { traverseObject } from './helpers/traverse_object'; +import { hasRef } from './helpers/has_ref'; + +function isUrl(maybeUrl: string): boolean { + return URL.canParse(maybeUrl); +} + +export function normalizeSchema(schema: OpenAPIV3.Document): OpenAPIV3.Document { traverseObject(schema, (element) => { - if (hasRef(element)) { - if (stringIsUrl(element.$ref)) { - throw new Error(`URL references are not supported: ${element.$ref}`); - } - const referenceName = element.$ref.split('/').pop(); - if (!referenceName) { - throw new Error(`Cannot parse reference name: ${element.$ref}`); - } - - element.referenceName = referenceName; + if (!hasRef(element)) { + return; + } + + if (isUrl(element.$ref)) { + throw new Error(`URL references are not supported: ${element.$ref}`); } + + const referenceName = element.$ref.split('/').pop(); + + if (!referenceName) { + throw new Error(`Cannot parse reference name: ${element.$ref}`); + } + + element.referenceName = referenceName; }); return schema; diff --git a/packages/kbn-openapi-generator/src/template_service/register_helpers.ts b/packages/kbn-openapi-generator/src/template_service/register_helpers.ts index c676ae869c7ab..55f2d9d60f37a 100644 --- a/packages/kbn-openapi-generator/src/template_service/register_helpers.ts +++ b/packages/kbn-openapi-generator/src/template_service/register_helpers.ts @@ -7,6 +7,7 @@ */ import type Handlebars from '@kbn/handlebars'; +import { HelperOptions } from 'handlebars'; import { snakeCase, camelCase } from 'lodash'; export function registerHelpers(handlebarsInstance: typeof Handlebars) { @@ -47,13 +48,43 @@ export function registerHelpers(handlebarsInstance: typeof Handlebars) { handlebarsInstance.registerHelper('isUnknown', (val: object) => { return !('type' in val || '$ref' in val || 'anyOf' in val || 'oneOf' in val || 'allOf' in val); }); - handlebarsInstance.registerHelper('startsWithSpecialChar', (val: string) => { - return /^[^a-zA-Z0-9]/.test(val); - }); handlebarsInstance.registerHelper( 'replace', (val: string, searchValue: string, replaceValue: string) => { return val.replace(searchValue, replaceValue); } ); + + /** + * Checks whether provided reference is a known circular reference or a part of circular chain. + * + * It's expected that `context.recursiveRefs` has been filled by the parser. + */ + handlebarsInstance.registerHelper('isCircularRef', (ref: string, options: HelperOptions) => { + if (!options.data?.root?.circularRefs) { + return false; + } + + const circularRefs: Set = options.data.root.circularRefs; + + return circularRefs.has(ref); + }); + + /** + * Checks whether provided schema is circular or a part of the circular chain. + * + * It's expected that `context.circularRefs` has been filled by the parser. + */ + handlebarsInstance.registerHelper( + 'isCircularSchema', + (schemaName: string, options: HelperOptions) => { + if (!options.data?.root?.circularRefs) { + return false; + } + + const circularRefs: Set = options.data.root.circularRefs; + + return circularRefs.has(`#/components/schemas/${schemaName}`); + } + ); } diff --git a/packages/kbn-openapi-generator/src/template_service/templates/ts_input_type.handlebars b/packages/kbn-openapi-generator/src/template_service/templates/ts_input_type.handlebars new file mode 100644 index 0000000000000..453e4cdf452d5 --- /dev/null +++ b/packages/kbn-openapi-generator/src/template_service/templates/ts_input_type.handlebars @@ -0,0 +1,84 @@ +{{~#if type~}} + {{~> (concat "type_" type)~}} +{{~/if~}} + +{{~#if $ref~}} + {{referenceName}}Input + {{~#if nullable}} | null {{/if~}} +{{~/if~}} + +{{~#if allOf~}} + {{~#each allOf~}} + {{~> ts_input_type ~}} + {{~#unless @last~}}&{{~/unless~}} + {{~/each~}} +{{~/if~}} + +{{~#if anyOf~}} + {{~#each anyOf~}} + {{~> ts_input_type ~}} + {{~#unless @last~}}|{{~/unless~}} + {{~/each~}} +{{~/if~}} + +{{~#if oneOf~}} + {{~#each oneOf~}} + {{~> ts_input_type ~}} + {{~#unless @last~}}|{{~/unless~}} + {{~/each~}} +{{~/if~}} + +{{#if (isUnknown .)}} +unknown +{{/if}} + +{{~#*inline "type_array"~}} + ({{~> ts_input_type items ~}})[] +{{~/inline~}} + +{{~#*inline "type_boolean"~}} + boolean +{{~/inline~}} + +{{~#*inline "type_integer"~}} + number +{{~/inline~}} + +{{~#*inline "type_number"~}} + number +{{~/inline~}} + +{{~#*inline "type_object"~}} + {{~#if (eq x-modify "required")}} Required< {{/if~}} + {{~#if (eq x-modify "partial")}} Partial< {{/if~}} + { + {{#each properties}} + {{#if description}} + /** + * {{{description}}} + */ + {{/if}} + '{{@key}}'{{~#unless (includes ../required @key)}}?{{/unless~}}: {{> ts_input_type }}; + {{/each}} + {{~#if additionalProperties}} + {{~#if (eq additionalProperties true)~}} + [key: string]: unknown; + {{~else~}} + [key: string]: {{> ts_input_type additionalProperties}}; + {{~/if~}} + {{~/if~}} + } + {{~#if (eq x-modify "partial")}} > {{/if~}} + {{~#if (eq x-modify "required")}} > {{/if~}} +{{~/inline~}} + +{{~#*inline "type_string"~}} + {{~#if enum~}} + {{~#each enum~}} + '{{.}}' + {{~#unless @last~}}|{{~/unless~}} + {{~/each~}} + {{~else~}} + string + {{~/if~}} +{{~/inline~}} diff --git a/packages/kbn-openapi-generator/src/template_service/templates/ts_type.handlebars b/packages/kbn-openapi-generator/src/template_service/templates/ts_type.handlebars new file mode 100644 index 0000000000000..5017af3aa5df0 --- /dev/null +++ b/packages/kbn-openapi-generator/src/template_service/templates/ts_type.handlebars @@ -0,0 +1,84 @@ +{{~#if type~}} + {{~> (concat "type_" type)~}} +{{~/if~}} + +{{~#if $ref~}} + {{referenceName}} + {{~#if nullable}} | null {{/if~}} +{{~/if~}} + +{{~#if allOf~}} + {{~#each allOf~}} + {{~> ts_type ~}} + {{~#unless @last~}}&{{~/unless~}} + {{~/each~}} +{{~/if~}} + +{{~#if anyOf~}} + {{~#each anyOf~}} + {{~> ts_type ~}} + {{~#unless @last~}}|{{~/unless~}} + {{~/each~}} +{{~/if~}} + +{{~#if oneOf~}} + {{~#each oneOf~}} + {{~> ts_type ~}} + {{~#unless @last~}}|{{~/unless~}} + {{~/each~}} +{{~/if~}} + +{{#if (isUnknown .)}} +unknown +{{/if}} + +{{~#*inline "type_array"~}} + ({{~> ts_type items ~}})[] +{{~/inline~}} + +{{~#*inline "type_boolean"~}} + boolean +{{~/inline~}} + +{{~#*inline "type_integer"~}} + number +{{~/inline~}} + +{{~#*inline "type_number"~}} + number +{{~/inline~}} + +{{~#*inline "type_object"~}} + {{~#if (eq x-modify "required")}} Required< {{/if~}} + {{~#if (eq x-modify "partial")}} Partial< {{/if~}} + { + {{#each properties}} + {{#if description}} + /** + * {{{description}}} + */ + {{/if}} + '{{@key}}'{{~#unless (or (includes ../required @key) (defined default))}}?{{/unless~}}: {{> ts_type }}; + {{/each}} + {{~#if additionalProperties}} + {{~#if (eq additionalProperties true)~}} + [key: string]: unknown; + {{~else~}} + [key: string]: {{> ts_type additionalProperties}}; + {{~/if~}} + {{~/if~}} + } + {{~#if (eq x-modify "partial")}} > {{/if~}} + {{~#if (eq x-modify "required")}} > {{/if~}} +{{~/inline~}} + +{{~#*inline "type_string"~}} + {{~#if enum~}} + {{~#each enum~}} + '{{.}}' + {{~#unless @last~}}|{{~/unless~}} + {{~/each~}} + {{~else~}} + string + {{~/if~}} +{{~/inline~}} diff --git a/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars b/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars index 30bc647b1fb25..6e5d21363a5ae 100644 --- a/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars +++ b/packages/kbn-openapi-generator/src/template_service/templates/zod_operation_schema.handlebars @@ -7,8 +7,9 @@ {{> disclaimer}} -import { z } from "zod"; -import { requiredOptional, isValidDateMath, ArrayFromString, BooleanFromString } from "@kbn/zod-helpers" +import type { ZodTypeDef } from 'zod'; +import { z } from 'zod'; +import { requiredOptional, isValidDateMath, ArrayFromString, BooleanFromString } from '@kbn/zod-helpers'; {{#each imports}} import { @@ -25,8 +26,14 @@ import { {{/if}} */ {{/if}} +{{#if (isCircularSchema @key)}} +export type {{@key}} = {{> ts_type}}; +export type {{@key}}Input = {{> ts_input_type }}; +export const {{@key}}: z.ZodType<{{@key}}, ZodTypeDef, {{@key}}Input> = {{> zod_schema_item }}; +{{else}} export type {{@key}} = z.infer; export const {{@key}} = {{> zod_schema_item}}; +{{/if}} {{#if enum}} {{#unless (isSingle enum)}} export type {{@key}}Enum = typeof {{@key}}.enum; diff --git a/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars b/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars index 29d4453da4d7b..7ad0abaf1cad8 100644 --- a/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars +++ b/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars @@ -6,7 +6,11 @@ {{~/if~}} {{~#if $ref~}} - {{referenceName}} + {{~#if (isCircularRef $ref)~}} + z.lazy(() => {{referenceName}}) + {{~else~}} + {{referenceName}} + {{~/if~}} {{~#if nullable}}.nullable(){{/if~}} {{~#if (eq requiredBool false)}}.optional(){{/if~}} {{~#if (defined default)}}.default({{{toJSON default}}}){{/if~}} @@ -87,11 +91,7 @@ z.unknown() * {{{description}}} */ {{/if}} - {{#if (startsWithSpecialChar @key)}} - '{{@key}}': {{> zod_schema_item requiredBool=(includes ../required @key)}}, - {{else}} - {{@key}}: {{> zod_schema_item requiredBool=(includes ../required @key)}}, - {{/if}} + '{{@key}}':{{~> zod_schema_item requiredBool=(includes ../required @key)~}}, {{/each}} }) {{~#if (eq additionalProperties false)}}.strict(){{/if~}} @@ -127,4 +127,3 @@ z.unknown() {{~#if pattern}}.regex(/{{pattern}}/){{/if~}} {{~/if~}} {{~/inline~}} - diff --git a/renovate.json b/renovate.json index 2cb7a55cfb4ae..f0995502bb1bc 100644 --- a/renovate.json +++ b/renovate.json @@ -427,6 +427,14 @@ "prCreation": "not-pending", "minimumReleaseAge": "7 days", "enabled": true + }, + { + "groupName": "MSW", + "matchPackageNames": ["msw"], + "reviewers": ["team:kibana-cloud-security-posture"], + "matchBaseBranches": ["main"], + "labels": ["Team: Cloud Security", "release_note:skip", "backport:skip"], + "enabled": true } ] } diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json index ae6e418dc775e..df93f77a5ab20 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.json +++ b/x-pack/plugins/actions/docs/openapi/bundled.json @@ -1,5 +1,5 @@ { - "openapi": "3.1.0", + "openapi": "3.0.3", "info": { "title": "Connectors", "description": "OpenAPI schema for Connectors endpoints", @@ -32,16 +32,20 @@ } ], "paths": { - "/api/actions/connector": { + "/s/{spaceId}/api/actions/connector": { "post": { - "summary": "Creates a connector.", - "operationId": "createConnector", + "summary": "Create a connector", + "operationId": "createConnectorWithSpaceId", + "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "tags": [ "connectors" ], "parameters": [ { "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/space_id" } ], "requestBody": { @@ -99,16 +103,20 @@ } } }, - "/api/actions/connector/{connectorId}": { + "/s/{spaceId}/api/actions/connector/{connectorId}": { "get": { - "summary": "Retrieves a connector by ID.", - "operationId": "getConnector", + "summary": "Get connector information", + "operationId": "getConnectorWithSpaceId", + "description": "You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "tags": [ "connectors" ], "parameters": [ { "$ref": "#/components/parameters/connector_id" + }, + { + "$ref": "#/components/parameters/space_id" } ], "responses": { @@ -136,8 +144,9 @@ } }, "delete": { - "summary": "Deletes a connector.", - "operationId": "deleteConnector", + "summary": "Delete a connector", + "operationId": "deleteConnectorWithSpaceId", + "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. WARNING: When you delete a connector, it cannot be recovered.\n", "tags": [ "connectors" ], @@ -147,6 +156,9 @@ }, { "$ref": "#/components/parameters/connector_id" + }, + { + "$ref": "#/components/parameters/space_id" } ], "responses": { @@ -162,8 +174,9 @@ } }, "post": { - "summary": "Creates a connector.", - "operationId": "createConnectorId", + "summary": "Create a connector", + "operationId": "createConnectorIdWithSpaceId", + "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "tags": [ "connectors" ], @@ -171,16 +184,17 @@ { "$ref": "#/components/parameters/kbn_xsrf" }, + { + "$ref": "#/components/parameters/space_id" + }, { "in": "path", "name": "connectorId", - "description": "A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.\n", + "description": "A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.", "required": true, "schema": { "type": "string", - "examples": [ - "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" - ] + "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" } } ], @@ -221,8 +235,9 @@ } }, "put": { - "summary": "Updates the attributes for a connector.", - "operationId": "updateConnector", + "summary": "Update a connector", + "operationId": "updateConnectorWithSpaceId", + "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "tags": [ "connectors" ], @@ -232,6 +247,9 @@ }, { "$ref": "#/components/parameters/connector_id" + }, + { + "$ref": "#/components/parameters/space_id" } ], "requestBody": { @@ -272,10 +290,138 @@ } } }, - "/api/actions/connector/{connectorId}/_execute": { + "/s/{spaceId}/api/actions/connectors": { + "get": { + "summary": "Get all connectors", + "operationId": "getConnectorsWithSpaceId", + "description": "You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", + "tags": [ + "connectors" + ], + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector_response_properties" + } + }, + "examples": { + "getConnectorsResponse": { + "$ref": "#/components/examples/get_connectors_response" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/401" + } + } + } + }, + "/s/{spaceId}/api/actions/connector_types": { + "get": { + "summary": "Get all connector types", + "operationId": "getConnectorTypesWithSpaceId", + "description": "You do not need any Kibana feature privileges to run this API.\n", + "tags": [ + "connectors" + ], + "parameters": [ + { + "$ref": "#/components/parameters/space_id" + }, + { + "in": "query", + "name": "feature_id", + "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", + "schema": { + "$ref": "#/components/schemas/features" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "title": "Get connector types response body properties", + "description": "The properties vary for each connector type.", + "type": "array", + "items": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Indicates whether the connector type is enabled in Kibana.", + "example": true + }, + "enabled_in_config": { + "type": "boolean", + "description": "Indicates whether the connector type is enabled in the Kibana `.yml` file.", + "example": true + }, + "enabled_in_license": { + "type": "boolean", + "description": "Indicates whether the connector is enabled in the license.", + "example": true + }, + "id": { + "$ref": "#/components/schemas/connector_types" + }, + "minimum_license_required": { + "type": "string", + "description": "The license that is required to use the connector type.", + "example": "basic" + }, + "name": { + "type": "string", + "description": "The name of the connector type.", + "example": "Index" + }, + "supported_feature_ids": { + "type": "array", + "description": "The Kibana features that are supported by the connector type.", + "items": { + "$ref": "#/components/schemas/features" + }, + "example": [ + "alerting", + "uptime", + "siem" + ] + } + } + } + }, + "examples": { + "getConnectorTypesResponse": { + "$ref": "#/components/examples/get_connector_types_response" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/401" + } + } + } + }, + "/s/{spaceId}/api/actions/connector/{connectorId}/_execute": { "post": { - "summary": "Runs a connector.", - "operationId": "runConnector", + "summary": "Run a connector", + "operationId": "runConnectorWithSpaceId", "description": "You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges.\n", "tags": [ "connectors" @@ -286,6 +432,9 @@ }, { "$ref": "#/components/parameters/connector_id" + }, + { + "$ref": "#/components/parameters/space_id" } ], "requestBody": { @@ -296,21 +445,12 @@ "$ref": "#/components/schemas/run_connector_request" }, "examples": { - "runCasesWebhookConnectorRequest": { - "$ref": "#/components/examples/run_cases_webhook_connector_request" - }, - "runEmailConnectorRequest": { - "$ref": "#/components/examples/run_email_connector_request" - }, "runIndexConnectorRequest": { "$ref": "#/components/examples/run_index_connector_request" }, "runJiraConnectorRequest": { "$ref": "#/components/examples/run_jira_connector_request" }, - "runPagerDutyConnectorRequest": { - "$ref": "#/components/examples/run_pagerduty_connector_request" - }, "runServerLogConnectorRequest": { "$ref": "#/components/examples/run_server_log_connector_request" }, @@ -359,6 +499,12 @@ } ] }, + "message": { + "type": "string" + }, + "service_message": { + "type": "string" + }, "status": { "type": "string", "description": "The status of the action.", @@ -370,21 +516,12 @@ } }, "examples": { - "runCasesWebhookConnectorResponse": { - "$ref": "#/components/examples/run_cases_webhook_connector_response" - }, - "runEmailConnectorResponse": { - "$ref": "#/components/examples/run_email_connector_response" - }, "runIndexConnectorResponse": { "$ref": "#/components/examples/run_index_connector_response" }, "runJiraConnectorResponse": { "$ref": "#/components/examples/run_jira_connector_response" }, - "runPagerDutyConnectorResponse": { - "$ref": "#/components/examples/run_pagerduty_connector_response" - }, "runServerLogConnectorResponse": { "$ref": "#/components/examples/run_server_log_connector_response" }, @@ -407,27 +544,62 @@ } } }, - "/api/actions/connectors": { - "get": { - "summary": "Retrieves all connectors.", - "operationId": "getConnectors", + "/api/actions/connector": { + "post": { + "summary": "Create a connector", + "operationId": "createConnector", "tags": [ "connectors" ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/create_connector_request" + }, + "examples": { + "createEmailConnectorRequest": { + "$ref": "#/components/examples/create_email_connector_request" + }, + "createIndexConnectorRequest": { + "$ref": "#/components/examples/create_index_connector_request" + }, + "createWebhookConnectorRequest": { + "$ref": "#/components/examples/create_webhook_connector_request" + }, + "createXmattersConnectorRequest": { + "$ref": "#/components/examples/create_xmatters_connector_request" + } + } + } + } + }, "responses": { "200": { "description": "Indicates a successful call.", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/connector_response_properties" - } + "$ref": "#/components/schemas/connector_response_properties" }, "examples": { - "getConnectorsResponse": { - "$ref": "#/components/examples/get_connectors_response" + "createEmailConnectorResponse": { + "$ref": "#/components/examples/create_email_connector_response" + }, + "createIndexConnectorResponse": { + "$ref": "#/components/examples/create_index_connector_response" + }, + "createWebhookConnectorResponse": { + "$ref": "#/components/examples/create_webhook_connector_response" + }, + "createXmattersConnectorResponse": { + "$ref": "#/components/examples/create_xmatters_connector_response" } } } @@ -439,195 +611,16 @@ } } }, - "/api/actions/connector_types": { + "/api/actions/connector/{connectorId}": { "get": { - "summary": "Retrieves a list of all connector types.", - "operationId": "getConnectorTypes", + "summary": "Get a connector information", + "operationId": "getConnector", "tags": [ "connectors" ], "parameters": [ { - "in": "query", - "name": "feature_id", - "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", - "schema": { - "$ref": "#/components/schemas/features" - } - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "title": "Get connector types response body properties", - "description": "The properties vary for each connector type.", - "type": "array", - "items": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Indicates whether the connector type is enabled in Kibana.", - "examples": [ - true - ] - }, - "enabled_in_config": { - "type": "boolean", - "description": "Indicates whether the connector type is enabled in the Kibana configuration file.", - "examples": [ - true - ] - }, - "enabled_in_license": { - "type": "boolean", - "description": "Indicates whether the connector is enabled in the license.", - "examples": [ - true - ] - }, - "id": { - "$ref": "#/components/schemas/connector_types" - }, - "is_system_action_type": { - "type": "boolean", - "examples": [ - false - ] - }, - "minimum_license_required": { - "type": "string", - "description": "The license that is required to use the connector type.", - "examples": [ - "basic" - ] - }, - "name": { - "type": "string", - "description": "The name of the connector type.", - "examples": [ - "Index" - ] - }, - "supported_feature_ids": { - "type": "array", - "description": "The features that are supported by the connector type.", - "items": { - "$ref": "#/components/schemas/features" - }, - "examples": [ - [ - "alerting", - "cases", - "siem" - ] - ] - } - } - } - }, - "examples": { - "getConnectorTypesServerlessResponse": { - "$ref": "#/components/examples/get_connector_types_generativeai_response" - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/401" - } - } - } - }, - "/s/{spaceId}/api/actions/connector": { - "post": { - "summary": "Creates a connector.", - "operationId": "createConnectorWithSpaceId", - "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", - "tags": [ - "connectors" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/space_id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/create_connector_request" - }, - "examples": { - "createEmailConnectorRequest": { - "$ref": "#/components/examples/create_email_connector_request" - }, - "createIndexConnectorRequest": { - "$ref": "#/components/examples/create_index_connector_request" - }, - "createWebhookConnectorRequest": { - "$ref": "#/components/examples/create_webhook_connector_request" - }, - "createXmattersConnectorRequest": { - "$ref": "#/components/examples/create_xmatters_connector_request" - } - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/connector_response_properties" - }, - "examples": { - "createEmailConnectorResponse": { - "$ref": "#/components/examples/create_email_connector_response" - }, - "createIndexConnectorResponse": { - "$ref": "#/components/examples/create_index_connector_response" - }, - "createWebhookConnectorResponse": { - "$ref": "#/components/examples/create_webhook_connector_response" - }, - "createXmattersConnectorResponse": { - "$ref": "#/components/examples/create_xmatters_connector_response" - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/401" - } - } - } - }, - "/s/{spaceId}/api/actions/connector/{connectorId}": { - "get": { - "summary": "Retrieves a connector by ID.", - "operationId": "getConnectorWithSpaceId", - "description": "You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", - "tags": [ - "connectors" - ], - "parameters": [ - { - "$ref": "#/components/parameters/connector_id" - }, - { - "$ref": "#/components/parameters/space_id" + "$ref": "#/components/parameters/connector_id" } ], "responses": { @@ -655,9 +648,8 @@ } }, "delete": { - "summary": "Deletes a connector.", - "operationId": "deleteConnectorWithSpaceId", - "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. WARNING: When you delete a connector, it cannot be recovered.\n", + "summary": "Delete a connector", + "operationId": "deleteConnector", "tags": [ "connectors" ], @@ -667,9 +659,6 @@ }, { "$ref": "#/components/parameters/connector_id" - }, - { - "$ref": "#/components/parameters/space_id" } ], "responses": { @@ -685,9 +674,8 @@ } }, "post": { - "summary": "Creates a connector.", - "operationId": "createConnectorIdWithSpaceId", - "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", + "summary": "Create a connector", + "operationId": "createConnectorId", "tags": [ "connectors" ], @@ -695,19 +683,14 @@ { "$ref": "#/components/parameters/kbn_xsrf" }, - { - "$ref": "#/components/parameters/space_id" - }, { "in": "path", "name": "connectorId", - "description": "A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.", + "description": "A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.\n", "required": true, "schema": { "type": "string", - "examples": [ - "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" - ] + "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" } } ], @@ -748,9 +731,8 @@ } }, "put": { - "summary": "Updates the attributes for a connector.", - "operationId": "updateConnectorWithSpaceId", - "description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", + "summary": "Update a connector", + "operationId": "updateConnector", "tags": [ "connectors" ], @@ -760,9 +742,6 @@ }, { "$ref": "#/components/parameters/connector_id" - }, - { - "$ref": "#/components/parameters/space_id" } ], "requestBody": { @@ -803,150 +782,10 @@ } } }, - "/s/{spaceId}/api/actions/connectors": { - "get": { - "summary": "Retrieves all connectors.", - "operationId": "getConnectorsWithSpaceId", - "description": "You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", - "tags": [ - "connectors" - ], - "parameters": [ - { - "$ref": "#/components/parameters/space_id" - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/connector_response_properties" - } - }, - "examples": { - "getConnectorsResponse": { - "$ref": "#/components/examples/get_connectors_response" - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/401" - } - } - } - }, - "/s/{spaceId}/api/actions/connector_types": { - "get": { - "summary": "Retrieves a list of all connector types.", - "operationId": "getConnectorTypesWithSpaceId", - "description": "You do not need any Kibana feature privileges to run this API.\n", - "tags": [ - "connectors" - ], - "parameters": [ - { - "$ref": "#/components/parameters/space_id" - }, - { - "in": "query", - "name": "feature_id", - "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", - "schema": { - "$ref": "#/components/schemas/features" - } - } - ], - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "title": "Get connector types response body properties", - "description": "The properties vary for each connector type.", - "type": "array", - "items": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Indicates whether the connector type is enabled in Kibana.", - "examples": [ - true - ] - }, - "enabled_in_config": { - "type": "boolean", - "description": "Indicates whether the connector type is enabled in the Kibana `.yml` file.", - "examples": [ - true - ] - }, - "enabled_in_license": { - "type": "boolean", - "description": "Indicates whether the connector is enabled in the license.", - "examples": [ - true - ] - }, - "id": { - "$ref": "#/components/schemas/connector_types" - }, - "minimum_license_required": { - "type": "string", - "description": "The license that is required to use the connector type.", - "examples": [ - "basic" - ] - }, - "name": { - "type": "string", - "description": "The name of the connector type.", - "examples": [ - "Index" - ] - }, - "supported_feature_ids": { - "type": "array", - "description": "The Kibana features that are supported by the connector type.", - "items": { - "$ref": "#/components/schemas/features" - }, - "examples": [ - [ - "alerting", - "uptime", - "siem" - ] - ] - } - } - } - }, - "examples": { - "getConnectorTypesResponse": { - "$ref": "#/components/examples/get_connector_types_response" - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/401" - } - } - } - }, - "/s/{spaceId}/api/actions/connector/{connectorId}/_execute": { + "/api/actions/connector/{connectorId}/_execute": { "post": { - "summary": "Runs a connector.", - "operationId": "runConnectorWithSpaceId", + "summary": "Run a connector", + "operationId": "runConnector", "description": "You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges.\n", "tags": [ "connectors" @@ -957,9 +796,6 @@ }, { "$ref": "#/components/parameters/connector_id" - }, - { - "$ref": "#/components/parameters/space_id" } ], "requestBody": { @@ -970,12 +806,21 @@ "$ref": "#/components/schemas/run_connector_request" }, "examples": { + "runCasesWebhookConnectorRequest": { + "$ref": "#/components/examples/run_cases_webhook_connector_request" + }, + "runEmailConnectorRequest": { + "$ref": "#/components/examples/run_email_connector_request" + }, "runIndexConnectorRequest": { "$ref": "#/components/examples/run_index_connector_request" }, "runJiraConnectorRequest": { "$ref": "#/components/examples/run_jira_connector_request" }, + "runPagerDutyConnectorRequest": { + "$ref": "#/components/examples/run_pagerduty_connector_request" + }, "runServerLogConnectorRequest": { "$ref": "#/components/examples/run_server_log_connector_request" }, @@ -1024,12 +869,6 @@ } ] }, - "message": { - "type": "string" - }, - "service_message": { - "type": "string" - }, "status": { "type": "string", "description": "The status of the action.", @@ -1041,12 +880,21 @@ } }, "examples": { + "runCasesWebhookConnectorResponse": { + "$ref": "#/components/examples/run_cases_webhook_connector_response" + }, + "runEmailConnectorResponse": { + "$ref": "#/components/examples/run_email_connector_response" + }, "runIndexConnectorResponse": { "$ref": "#/components/examples/run_index_connector_response" }, "runJiraConnectorResponse": { "$ref": "#/components/examples/run_jira_connector_response" }, + "runPagerDutyConnectorResponse": { + "$ref": "#/components/examples/run_pagerduty_connector_response" + }, "runServerLogConnectorResponse": { "$ref": "#/components/examples/run_server_log_connector_response" }, @@ -1069,9 +917,131 @@ } } }, + "/api/actions/connectors": { + "get": { + "summary": "Get all connectors", + "operationId": "getConnectors", + "tags": [ + "connectors" + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector_response_properties" + } + }, + "examples": { + "getConnectorsResponse": { + "$ref": "#/components/examples/get_connectors_response" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/401" + } + } + } + }, + "/api/actions/connector_types": { + "get": { + "summary": "Get all connector types", + "operationId": "getConnectorTypes", + "tags": [ + "connectors" + ], + "parameters": [ + { + "in": "query", + "name": "feature_id", + "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", + "schema": { + "$ref": "#/components/schemas/features" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "title": "Get connector types response body properties", + "description": "The properties vary for each connector type.", + "type": "array", + "items": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Indicates whether the connector type is enabled in Kibana.", + "example": true + }, + "enabled_in_config": { + "type": "boolean", + "description": "Indicates whether the connector type is enabled in the Kibana configuration file.", + "example": true + }, + "enabled_in_license": { + "type": "boolean", + "description": "Indicates whether the connector is enabled in the license.", + "example": true + }, + "id": { + "$ref": "#/components/schemas/connector_types" + }, + "is_system_action_type": { + "type": "boolean", + "example": false + }, + "minimum_license_required": { + "type": "string", + "description": "The license that is required to use the connector type.", + "example": "basic" + }, + "name": { + "type": "string", + "description": "The name of the connector type.", + "example": "Index" + }, + "supported_feature_ids": { + "type": "array", + "description": "The features that are supported by the connector type.", + "items": { + "$ref": "#/components/schemas/features" + }, + "example": [ + "alerting", + "cases", + "siem" + ] + } + } + } + }, + "examples": { + "getConnectorTypesServerlessResponse": { + "$ref": "#/components/examples/get_connector_types_generativeai_response" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/401" + } + } + } + }, "/s/{spaceId}/api/actions/action/{actionId}": { "delete": { - "summary": "Deletes a connector.", + "summary": "Delete a connector", "operationId": "legacyDeleteConnector", "deprecated": true, "description": "Deprecated in 7.13.0. Use the delete connector API instead. WARNING: When you delete a connector, it cannot be recovered.\n", @@ -1099,7 +1069,7 @@ } }, "get": { - "summary": "Retrieves a connector by ID.", + "summary": "Get connector information", "operationId": "legacyGetConnector", "description": "Deprecated in 7.13.0. Use the get connector API instead.", "deprecated": true, @@ -1124,7 +1094,7 @@ } }, "put": { - "summary": "Updates the attributes for a connector.", + "summary": "Update a connector", "operationId": "legacyUpdateConnector", "deprecated": true, "description": "Deprecated in 7.13.0. Use the update connector API instead.", @@ -1180,7 +1150,7 @@ }, "/s/{spaceId}/api/actions": { "get": { - "summary": "Retrieves all connectors.", + "summary": "Get all connectors", "operationId": "legacyGetConnectors", "deprecated": true, "description": "Deprecated in 7.13.0. Use the get all connectors API instead.", @@ -1212,7 +1182,7 @@ } }, "post": { - "summary": "Creates a connector.", + "summary": "Create a connector", "operationId": "legacyCreateConnector", "deprecated": true, "description": "Deprecated in 7.13.0. Use the create connector API instead.", @@ -1268,7 +1238,7 @@ }, "/s/{spaceId}/api/actions/list_action_types": { "get": { - "summary": "Retrieves a list of all connector types.", + "summary": "Get connector types", "operationId": "legacyGetConnectorTypes", "deprecated": true, "description": "Deprecated in 7.13.0. Use the get all connector types API instead.", @@ -1303,9 +1273,7 @@ "enabledInLicense": { "type": "boolean", "description": "Indicates whether the connector is enabled in the license.", - "examples": [ - true - ] + "example": true }, "id": { "type": "string", @@ -1333,7 +1301,7 @@ }, "/s/{spaceId}/api/actions/action/{actionId}/_execute": { "post": { - "summary": "Runs a connector.", + "summary": "Run a connector", "operationId": "legacyRunConnector", "deprecated": true, "description": "Deprecated in 7.13.0. Use the run connector API instead.", @@ -1438,28 +1406,24 @@ "description": "Cross-site request forgery protection", "required": true }, - "connector_id": { + "space_id": { "in": "path", - "name": "connectorId", - "description": "An identifier for the connector.", + "name": "spaceId", + "description": "An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used.", "required": true, "schema": { "type": "string", - "examples": [ - "df770e30-8b8b-11ed-a780-3b746c987a81" - ] + "example": "default" } }, - "space_id": { + "connector_id": { "in": "path", - "name": "spaceId", - "description": "An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used.", + "name": "connectorId", + "description": "An identifier for the connector.", "required": true, "schema": { "type": "string", - "examples": [ - "default" - ] + "example": "df770e30-8b8b-11ed-a780-3b746c987a81" } }, "action_id": { @@ -1469,9 +1433,7 @@ "required": true, "schema": { "type": "string", - "examples": [ - "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad" - ] + "example": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad" } } }, @@ -1496,16 +1458,12 @@ "enum": [ ".bedrock" ], - "examples": [ - ".bedrock" - ] + "example": ".bedrock" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_bedrock" @@ -1532,16 +1490,12 @@ "enum": [ ".gemini" ], - "examples": [ - ".gemini" - ] + "example": ".gemini" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_gemini" @@ -1567,16 +1521,12 @@ "enum": [ ".cases-webhook" ], - "examples": [ - ".cases-webhook" - ] + "example": ".cases-webhook" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_cases_webhook" @@ -1603,16 +1553,12 @@ "enum": [ ".d3security" ], - "examples": [ - ".d3security" - ] + "example": ".d3security" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_d3security" @@ -1639,16 +1585,12 @@ "enum": [ ".email" ], - "examples": [ - ".email" - ] + "example": ".email" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_email" @@ -1675,16 +1617,12 @@ "enum": [ ".gen-ai" ], - "examples": [ - ".gen-ai" - ] + "example": ".gen-ai" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_genai" @@ -1710,16 +1648,12 @@ "enum": [ ".index" ], - "examples": [ - ".index" - ] + "example": ".index" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" } } }, @@ -1743,16 +1677,12 @@ "enum": [ ".jira" ], - "examples": [ - ".jira" - ] + "example": ".jira" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_jira" @@ -1779,16 +1709,12 @@ "enum": [ ".opsgenie" ], - "examples": [ - ".opsgenie" - ] + "example": ".opsgenie" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_opsgenie" @@ -1815,16 +1741,12 @@ "enum": [ ".pagerduty" ], - "examples": [ - ".pagerduty" - ] + "example": ".pagerduty" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_pagerduty" @@ -1848,9 +1770,7 @@ "connector_type_id": { "description": "The type of connector.", "type": "string", - "examples": [ - ".resilient" - ], + "example": ".resilient", "enum": [ ".resilient" ] @@ -1858,9 +1778,7 @@ "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_resilient" @@ -1888,16 +1806,12 @@ "enum": [ ".sentinelone" ], - "examples": [ - ".sentinelone" - ] + "example": ".sentinelone" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_sentinelone" @@ -1919,16 +1833,12 @@ "enum": [ ".server-log" ], - "examples": [ - ".server-log" - ] + "example": ".server-log" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" } } }, @@ -1952,16 +1862,12 @@ "enum": [ ".servicenow" ], - "examples": [ - ".servicenow" - ] + "example": ".servicenow" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_servicenow" @@ -1988,16 +1894,12 @@ "enum": [ ".servicenow-itom" ], - "examples": [ - ".servicenow-itom" - ] + "example": ".servicenow-itom" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_servicenow" @@ -2024,16 +1926,12 @@ "enum": [ ".servicenow-sir" ], - "examples": [ - ".servicenow-sir" - ] + "example": ".servicenow-sir" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_servicenow" @@ -2059,16 +1957,12 @@ "enum": [ ".slack_api" ], - "examples": [ - ".slack_api" - ] + "example": ".slack_api" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_slack_api" @@ -2091,16 +1985,12 @@ "enum": [ ".slack" ], - "examples": [ - ".slack" - ] + "example": ".slack" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_slack_webhook" @@ -2127,16 +2017,12 @@ "enum": [ ".swimlane" ], - "examples": [ - ".swimlane" - ] + "example": ".swimlane" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_swimlane" @@ -2159,16 +2045,12 @@ "enum": [ ".teams" ], - "examples": [ - ".teams" - ] + "example": ".teams" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_teams" @@ -2195,16 +2077,12 @@ "enum": [ ".tines" ], - "examples": [ - ".tines" - ] + "example": ".tines" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_tines" @@ -2231,16 +2109,12 @@ "enum": [ ".torq" ], - "examples": [ - ".torq" - ] + "example": ".torq" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_torq" @@ -2267,16 +2141,12 @@ "enum": [ ".webhook" ], - "examples": [ - ".webhook" - ] + "example": ".webhook" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_webhook" @@ -2303,16 +2173,12 @@ "enum": [ ".xmatters" ], - "examples": [ - ".xmatters" - ] + "example": ".xmatters" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_xmatters" @@ -2418,9 +2284,7 @@ "createCommentJson": { "type": "string", "description": "A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass.\n", - "examples": [ - "{\"body\": {{{case.comment}}}}" - ] + "example": "{\"body\": {{{case.comment}}}}" }, "createCommentMethod": { "type": "string", @@ -2435,16 +2299,12 @@ "createCommentUrl": { "type": "string", "description": "The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts.\n", - "examples": [ - "https://example.com/issue/{{{external.system.id}}}/comment" - ] + "example": "https://example.com/issue/{{{external.system.id}}}/comment" }, "createIncidentJson": { "type": "string", "description": "A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review.\n", - "examples": [ - "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" - ] + "example": "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" }, "createIncidentMethod": { "type": "string", @@ -2471,9 +2331,7 @@ "getIncidentUrl": { "type": "string", "description": "The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass.\n", - "examples": [ - "https://example.com/issue/{{{external.system.id}}}" - ] + "example": "https://example.com/issue/{{{external.system.id}}}" }, "hasAuth": { "type": "boolean", @@ -2487,9 +2345,7 @@ "updateIncidentJson": { "type": "string", "description": "The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review.\n", - "examples": [ - "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" - ] + "example": "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" }, "updateIncidentMethod": { "type": "string", @@ -2504,16 +2360,12 @@ "updateIncidentUrl": { "type": "string", "description": "The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts.\n", - "examples": [ - "https://example.com/issue/{{{external.system.ID}}}" - ] + "example": "https://example.com/issue/{{{external.system.ID}}}" }, "viewIncidentUrl": { "type": "string", "description": "The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL.\n", - "examples": [ - "https://testing-jira.atlassian.net/browse/{{{external.system.title}}}" - ] + "example": "https://testing-jira.atlassian.net/browse/{{{external.system.title}}}" } } }, @@ -2569,10 +2421,8 @@ "properties": { "clientId": { "description": "The client identifier, which is a part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required.\n", - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "from": { "description": "The from address for all emails sent by the connector. It must be specified in `user@host-name` format.\n", @@ -2588,10 +2438,8 @@ "type": "string" }, "oauthTokenUrl": { - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "port": { "description": "The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. \n", @@ -2615,10 +2463,8 @@ }, "tenantId": { "description": "The tenant identifier, which is part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required.\n", - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true } } }, @@ -2730,10 +2576,8 @@ "executionTimeField": { "description": "A field that indicates when the document was indexed.", "default": null, - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "index": { "description": "The Elasticsearch index to be written to.", @@ -2819,13 +2663,9 @@ "properties": { "apiUrl": { "description": "The PagerDuty event URL.", - "type": [ - "string", - "null" - ], - "examples": [ - "https://events.pagerduty.com/v2/enqueue" - ] + "type": "string", + "nullable": true, + "example": "https://events.pagerduty.com/v2/enqueue" } } }, @@ -3395,10 +3235,10 @@ "properties": { "authType": { "type": "string", + "nullable": true, "enum": [ "webhook-authentication-basic", - "webhook-authentication-ssl", - "null" + "webhook-authentication-ssl" ], "description": "The type of authentication to use: basic, SSL, or none.\n" }, @@ -3419,10 +3259,8 @@ "description": "If `true`, a user name and password must be provided for login type authentication.\n" }, "headers": { - "type": [ - "object", - "null" - ], + "type": "object", + "nullable": true, "description": "A set of key-value pairs sent as headers with the request." }, "method": { @@ -3484,10 +3322,8 @@ "properties": { "configUrl": { "description": "The request URL for the Elastic Alerts trigger in xMatters. It is applicable only when `usesBasic` is `true`.\n", - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "usesBasic": { "description": "Specifies whether the connector uses HTTP basic authentication (`true`) or URL authentication (`false`).", @@ -4184,10 +4020,8 @@ ], "properties": { "config": { - "type": [ - "object", - "null" - ] + "type": "object", + "nullable": true }, "connector_type_id": { "type": "string", @@ -4727,37 +4561,27 @@ "is_deprecated": { "type": "boolean", "description": "Indicates whether the connector type is deprecated.", - "examples": [ - false - ] + "example": false }, "is_missing_secrets": { "type": "boolean", "description": "Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type.", - "examples": [ - false - ] + "example": false }, "is_preconfigured": { "type": "boolean", "description": "Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. \n", - "examples": [ - false - ] + "example": false }, "is_system_action": { "type": "boolean", "description": "Indicates whether the connector is used for system actions.", - "examples": [ - false - ] + "example": false }, "referenced_by_count": { "type": "integer", "description": "Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. This property is returned only by the get all connectors API.\n", - "examples": [ - 2 - ] + "example": 2 }, "connector_response_properties": { "title": "Connector response properties", @@ -4920,9 +4744,7 @@ "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_cases_webhook" @@ -5199,9 +5021,7 @@ "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_swimlane" @@ -5384,6 +5204,51 @@ } ] }, + "features": { + "type": "string", + "description": "The feature that uses the connector.\n", + "enum": [ + "alerting", + "cases", + "generativeAIForSecurity", + "generativeAIForObservability", + "generativeAIForSearchPlayground", + "siem", + "uptime" + ] + }, + "connector_types": { + "title": "Connector types", + "type": "string", + "description": "The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`.", + "enum": [ + ".bedrock", + ".gemini", + ".cases-webhook", + ".d3security", + ".email", + ".gen-ai", + ".index", + ".jira", + ".opsgenie", + ".pagerduty", + ".resilient", + ".sentinelone", + ".servicenow", + ".servicenow-itom", + ".servicenow-sir", + ".server-log", + ".slack", + ".slack_api", + ".swimlane", + ".teams", + ".tines", + ".torq", + ".webhook", + ".xmatters" + ], + "example": ".server-log" + }, "run_connector_params_acknowledge_resolve_pagerduty": { "title": "PagerDuty connector parameters", "description": "Test an action that acknowledges or resolves a PagerDuty alert.", @@ -5537,16 +5402,12 @@ "class": { "description": "The class or type of the event.", "type": "string", - "examples": [ - "cpu load" - ] + "example": "cpu load" }, "component": { "description": "The component of the source machine that is responsible for the event.", "type": "string", - "examples": [ - "eth0" - ] + "example": "eth0" }, "customDetails": { "description": "Additional details to add to the event.", @@ -5567,9 +5428,7 @@ "group": { "description": "The logical grouping of components of a service.", "type": "string", - "examples": [ - "app-stack" - ] + "example": "app-stack" }, "links": { "description": "A list of links to add to the event.", @@ -5762,19 +5621,15 @@ ], "properties": { "correlation_id": { - "type": [ - "null", - "string" - ], + "type": "string", + "nullable": true, "description": "An identifier that is assigned to the incident when it is created by the connector. NOTE: If you use the default value and the rule generates multiple alerts that use the same alert IDs, the latest open incident for this correlation ID is closed unless you specify the external ID.\n", "maxLength": 100, "default": "{{rule.id}}:{{alert.id}}" }, "externalId": { - "type": [ - "null", - "string" - ], + "type": "string", + "nullable": true, "description": "The unique identifier (`incidentId`) for the incident in ServiceNow." } } @@ -5824,12 +5679,10 @@ "type": "object", "description": "The custom properties of the alert.", "additionalProperties": true, - "examples": [ - { - "key1": "value1", - "key2": "value2" - } - ] + "example": { + "key1": "value1", + "key2": "value2" + } }, "entity": { "type": "string", @@ -5961,9 +5814,7 @@ "id": { "type": "string", "description": "The Jira issue type identifier.", - "examples": [ - 10024 - ] + "example": 10024 } } } @@ -6045,9 +5896,7 @@ "externalId": { "type": "string", "description": "The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier.", - "examples": [ - 71778 - ] + "example": 71778 } } } @@ -6077,9 +5926,7 @@ "id": { "type": "string", "description": "The Jira issue identifier.", - "examples": [ - 71778 - ] + "example": 71778 } } } @@ -6514,53 +6361,6 @@ } } }, - "features": { - "type": "string", - "description": "The feature that uses the connector.\n", - "enum": [ - "alerting", - "cases", - "generativeAIForSecurity", - "generativeAIForObservability", - "generativeAIForSearchPlayground", - "siem", - "uptime" - ] - }, - "connector_types": { - "title": "Connector types", - "type": "string", - "description": "The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`.", - "enum": [ - ".bedrock", - ".gemini", - ".cases-webhook", - ".d3security", - ".email", - ".gen-ai", - ".index", - ".jira", - ".opsgenie", - ".pagerduty", - ".resilient", - ".sentinelone", - ".servicenow", - ".servicenow-itom", - ".servicenow-sir", - ".server-log", - ".slack", - ".slack_api", - ".swimlane", - ".teams", - ".tines", - ".torq", - ".webhook", - ".xmatters" - ], - "examples": [ - ".server-log" - ] - }, "action_response_properties": { "title": "Action response properties", "description": "The properties vary depending on the action type.", @@ -6753,51 +6553,77 @@ } } }, - "run_cases_webhook_connector_request": { - "summary": "Run a Webhook - Case Management connector to create a case.", - "value": { - "params": { - "subAction": "pushToService", - "subActionParams": { - "comments": [ - { - "commentId": 1, - "comment": "A comment about the incident." - } - ], - "incident": { - "title": "Case title", - "description": "Description of the incident.", - "tags": [ - "tag1", - "tag2" - ], - "severity": "low", - "status": "open", - "id": "caseID" - } - } + "get_connectors_response": { + "summary": "A list of connectors", + "value": [ + { + "id": "preconfigured-email-connector", + "name": "my-preconfigured-email-notification", + "connector_type_id": ".email", + "is_preconfigured": true, + "is_deprecated": false, + "referenced_by_count": 0, + "is_system_action": false + }, + { + "id": "e07d0c80-8b8b-11ed-a780-3b746c987a81", + "name": "my-index-connector", + "config": { + "index": "test-index", + "refresh": false, + "executionTimeField": null + }, + "connector_type_id": ".index", + "is_preconfigured": false, + "is_deprecated": false, + "referenced_by_count": 2, + "is_missing_secrets": false, + "is_system_action": false } - } + ] }, - "run_email_connector_request": { - "summary": "Send an email message from an email connector.", - "value": { - "params": { - "bcc": [ - "user1@example.com" - ], - "cc": [ - "user2@example.com", - "user3@example.com" - ], - "message": "Test email message.", - "subject": "Test message subject", - "to": [ - "user4@example.com" + "get_connector_types_response": { + "summary": "A list of connector types", + "value": [ + { + "id": ".swimlane", + "name": "Swimlane", + "enabled": true, + "enabled_in_config": true, + "enabled_in_license": true, + "minimum_license_required": "gold", + "supported_feature_ids": [ + "alerting", + "cases", + "siem" + ] + }, + { + "id": ".index", + "name": "Index", + "enabled": true, + "enabled_in_config": true, + "enabled_in_license": true, + "minimum_license_required": "basic", + "supported_feature_ids": [ + "alerting", + "uptime", + "siem" + ] + }, + { + "id": ".server-log", + "name": "Server log", + "enabled": true, + "enabled_in_config": true, + "enabled_in_license": true, + "minimum_license_required": "basic", + "supported_feature_ids": [ + "alerting", + "uptime" ] } - } + ] }, "run_index_connector_request": { "summary": "Run an index connector.", @@ -6821,24 +6647,6 @@ } } }, - "run_pagerduty_connector_request": { - "summary": "Run a PagerDuty connector to trigger an alert.", - "value": { - "params": { - "eventAction": "trigger", - "summary": "A brief event summary", - "links": [ - { - "href": "http://example.com/pagerduty", - "text": "An example link" - } - ], - "customDetails": { - "my_data_1": "test data" - } - } - } - }, "run_server_log_connector_request": { "summary": "Run a server log connector.", "value": { @@ -6875,75 +6683,26 @@ } } } - }, - "run_swimlane_connector_request": { - "summary": "Run a Swimlane connector to create an incident.", - "value": { - "params": { - "subAction": "pushToService", - "subActionParams": { - "comments": [ - { - "commentId": 1, - "comment": "A comment about the incident." - } - ], - "incident": { - "caseId": "1000", - "caseName": "Case name", - "description": "Description of the incident." - } - } - } - } - }, - "run_cases_webhook_connector_response": { - "summary": "Response from a pushToService action for a Webhook - Case Management connector.", - "value": { - "connector_id": "1824b5b8-c005-4dcc-adac-57f92db46459", - "data": { - "id": 100665, - "title": "TEST-29034", - "url": "https://example.com/browse/TEST-29034", - "pushedDate": "2023-12-05T19:43:36.360Z", - "comments": [ - { - "commentId": 1, - "pushedDate": "2023-12-05T19:43:36.360Z" - } - ] - }, - "status": "ok" - } - }, - "run_email_connector_response": { - "summary": "Response for sending a message from an email connector.", + }, + "run_swimlane_connector_request": { + "summary": "Run a Swimlane connector to create an incident.", "value": { - "connector_id": "7fc7b9a0-ecc9-11ec-8736-e7d63118c907", - "data": { - "accepted": [ - "user1@example.com", - "user2@example.com", - "user3@example.com", - "user4@example.com" - ], - "envelope": { - "from": "tester@example.com", - "to": [ - "user1@example.com", - "user2@example.com", - "user3@example.com", - "user4@example.com" - ] - }, - "envelopeTime": 8, - "messageTime": 3, - "messageSize": 729, - "response": "250 Message queued as QzEXKcGJ", - "messageId": "<08a92d29-642a-0706-750c-de5996bd5cf3@example.com>", - "rejected": [] - }, - "status": "ok" + "params": { + "subAction": "pushToService", + "subActionParams": { + "comments": [ + { + "commentId": 1, + "comment": "A comment about the incident." + } + ], + "incident": { + "caseId": "1000", + "caseName": "Case name", + "description": "Description of the incident." + } + } + } } }, "run_index_connector_response": { @@ -7008,18 +6767,6 @@ "status": "ok" } }, - "run_pagerduty_connector_response": { - "summary": "Response from running a PagerDuty connector.", - "value": { - "connector_id": "45de9f70-954f-4608-b12a-db7cf808e49d", - "data": { - "dedup_key": "5115e138b26b484a81eaea779faa6016", - "message": "Event processed", - "status": "success" - }, - "status": "ok" - } - }, "run_server_log_connector_response": { "summary": "Response from running a server log connector.", "value": { @@ -7158,34 +6905,130 @@ "status": "ok" } }, - "get_connectors_response": { - "summary": "A list of connectors", - "value": [ - { - "id": "preconfigured-email-connector", - "name": "my-preconfigured-email-notification", - "connector_type_id": ".email", - "is_preconfigured": true, - "is_deprecated": false, - "referenced_by_count": 0, - "is_system_action": false + "run_cases_webhook_connector_request": { + "summary": "Run a Webhook - Case Management connector to create a case.", + "value": { + "params": { + "subAction": "pushToService", + "subActionParams": { + "comments": [ + { + "commentId": 1, + "comment": "A comment about the incident." + } + ], + "incident": { + "title": "Case title", + "description": "Description of the incident.", + "tags": [ + "tag1", + "tag2" + ], + "severity": "low", + "status": "open", + "id": "caseID" + } + } + } + } + }, + "run_email_connector_request": { + "summary": "Send an email message from an email connector.", + "value": { + "params": { + "bcc": [ + "user1@example.com" + ], + "cc": [ + "user2@example.com", + "user3@example.com" + ], + "message": "Test email message.", + "subject": "Test message subject", + "to": [ + "user4@example.com" + ] + } + } + }, + "run_pagerduty_connector_request": { + "summary": "Run a PagerDuty connector to trigger an alert.", + "value": { + "params": { + "eventAction": "trigger", + "summary": "A brief event summary", + "links": [ + { + "href": "http://example.com/pagerduty", + "text": "An example link" + } + ], + "customDetails": { + "my_data_1": "test data" + } + } + } + }, + "run_cases_webhook_connector_response": { + "summary": "Response from a pushToService action for a Webhook - Case Management connector.", + "value": { + "connector_id": "1824b5b8-c005-4dcc-adac-57f92db46459", + "data": { + "id": 100665, + "title": "TEST-29034", + "url": "https://example.com/browse/TEST-29034", + "pushedDate": "2023-12-05T19:43:36.360Z", + "comments": [ + { + "commentId": 1, + "pushedDate": "2023-12-05T19:43:36.360Z" + } + ] }, - { - "id": "e07d0c80-8b8b-11ed-a780-3b746c987a81", - "name": "my-index-connector", - "config": { - "index": "test-index", - "refresh": false, - "executionTimeField": null + "status": "ok" + } + }, + "run_email_connector_response": { + "summary": "Response for sending a message from an email connector.", + "value": { + "connector_id": "7fc7b9a0-ecc9-11ec-8736-e7d63118c907", + "data": { + "accepted": [ + "user1@example.com", + "user2@example.com", + "user3@example.com", + "user4@example.com" + ], + "envelope": { + "from": "tester@example.com", + "to": [ + "user1@example.com", + "user2@example.com", + "user3@example.com", + "user4@example.com" + ] }, - "connector_type_id": ".index", - "is_preconfigured": false, - "is_deprecated": false, - "referenced_by_count": 2, - "is_missing_secrets": false, - "is_system_action": false - } - ] + "envelopeTime": 8, + "messageTime": 3, + "messageSize": 729, + "response": "250 Message queued as QzEXKcGJ", + "messageId": "<08a92d29-642a-0706-750c-de5996bd5cf3@example.com>", + "rejected": [] + }, + "status": "ok" + } + }, + "run_pagerduty_connector_response": { + "summary": "Response from running a PagerDuty connector.", + "value": { + "connector_id": "45de9f70-954f-4608-b12a-db7cf808e49d", + "data": { + "dedup_key": "5115e138b26b484a81eaea779faa6016", + "message": "Event processed", + "status": "success" + }, + "status": "ok" + } }, "get_connector_types_generativeai_response": { "summary": "A list of connector types for the `generativeAI` feature.", @@ -7231,49 +7074,6 @@ "is_system_action_type": false } ] - }, - "get_connector_types_response": { - "summary": "A list of connector types", - "value": [ - { - "id": ".swimlane", - "name": "Swimlane", - "enabled": true, - "enabled_in_config": true, - "enabled_in_license": true, - "minimum_license_required": "gold", - "supported_feature_ids": [ - "alerting", - "cases", - "siem" - ] - }, - { - "id": ".index", - "name": "Index", - "enabled": true, - "enabled_in_config": true, - "enabled_in_license": true, - "minimum_license_required": "basic", - "supported_feature_ids": [ - "alerting", - "uptime", - "siem" - ] - }, - { - "id": ".server-log", - "name": "Server log", - "enabled": true, - "enabled_in_config": true, - "enabled_in_license": true, - "minimum_license_required": "basic", - "supported_feature_ids": [ - "alerting", - "uptime" - ] - } - ] } }, "responses": { @@ -7287,9 +7087,7 @@ "properties": { "error": { "type": "string", - "examples": [ - "Unauthorized" - ], + "example": "Unauthorized", "enum": [ "Unauthorized" ] @@ -7299,9 +7097,7 @@ }, "statusCode": { "type": "integer", - "examples": [ - 401 - ], + "example": 401, "enum": [ 401 ] @@ -7321,24 +7117,18 @@ "properties": { "error": { "type": "string", - "examples": [ - "Not Found" - ], + "example": "Not Found", "enum": [ "Not Found" ] }, "message": { "type": "string", - "examples": [ - "Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found" - ] + "example": "Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found" }, "statusCode": { "type": "integer", - "examples": [ - 404 - ], + "example": 404, "enum": [ 404 ] diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml index c9628f9916c6f..95a0449bec192 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.3 info: title: Connectors description: OpenAPI schema for Connectors endpoints @@ -17,14 +17,17 @@ tags: - name: connectors description: Connector APIs enable you to create and manage connectors. paths: - /api/actions/connector: + /s/{spaceId}/api/actions/connector: post: - summary: Creates a connector. - operationId: createConnector + summary: Create a connector + operationId: createConnectorWithSpaceId + description: | + You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' requestBody: required: true content: @@ -58,14 +61,17 @@ paths: $ref: '#/components/examples/create_xmatters_connector_response' '401': $ref: '#/components/responses/401' - /api/actions/connector/{connectorId}: + /s/{spaceId}/api/actions/connector/{connectorId}: get: - summary: Retrieves a connector by ID. - operationId: getConnector + summary: Get connector information + operationId: getConnectorWithSpaceId + description: | + You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - connectors parameters: - $ref: '#/components/parameters/connector_id' + - $ref: '#/components/parameters/space_id' responses: '200': description: Indicates a successful call. @@ -81,13 +87,16 @@ paths: '404': $ref: '#/components/responses/404' delete: - summary: Deletes a connector. - operationId: deleteConnector + summary: Delete a connector + operationId: deleteConnectorWithSpaceId + description: | + You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. WARNING: When you delete a connector, it cannot be recovered. tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/connector_id' + - $ref: '#/components/parameters/space_id' responses: '204': description: Indicates a successful call. @@ -96,21 +105,22 @@ paths: '404': $ref: '#/components/responses/404' post: - summary: Creates a connector. - operationId: createConnectorId + summary: Create a connector + operationId: createConnectorIdWithSpaceId + description: | + You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' - in: path name: connectorId - description: | - A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. + description: A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. required: true schema: type: string - examples: - - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 requestBody: required: true content: @@ -133,13 +143,16 @@ paths: '401': $ref: '#/components/responses/401' put: - summary: Updates the attributes for a connector. - operationId: updateConnector + summary: Update a connector + operationId: updateConnectorWithSpaceId + description: | + You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/connector_id' + - $ref: '#/components/parameters/space_id' requestBody: required: true content: @@ -162,10 +175,97 @@ paths: $ref: '#/components/responses/401' '404': $ref: '#/components/responses/404' - /api/actions/connector/{connectorId}/_execute: + /s/{spaceId}/api/actions/connectors: + get: + summary: Get all connectors + operationId: getConnectorsWithSpaceId + description: | + You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + tags: + - connectors + parameters: + - $ref: '#/components/parameters/space_id' + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/connector_response_properties' + examples: + getConnectorsResponse: + $ref: '#/components/examples/get_connectors_response' + '401': + $ref: '#/components/responses/401' + /s/{spaceId}/api/actions/connector_types: + get: + summary: Get all connector types + operationId: getConnectorTypesWithSpaceId + description: | + You do not need any Kibana feature privileges to run this API. + tags: + - connectors + parameters: + - $ref: '#/components/parameters/space_id' + - in: query + name: feature_id + description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). + schema: + $ref: '#/components/schemas/features' + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + title: Get connector types response body properties + description: The properties vary for each connector type. + type: array + items: + type: object + properties: + enabled: + type: boolean + description: Indicates whether the connector type is enabled in Kibana. + example: true + enabled_in_config: + type: boolean + description: Indicates whether the connector type is enabled in the Kibana `.yml` file. + example: true + enabled_in_license: + type: boolean + description: Indicates whether the connector is enabled in the license. + example: true + id: + $ref: '#/components/schemas/connector_types' + minimum_license_required: + type: string + description: The license that is required to use the connector type. + example: basic + name: + type: string + description: The name of the connector type. + example: Index + supported_feature_ids: + type: array + description: The Kibana features that are supported by the connector type. + items: + $ref: '#/components/schemas/features' + example: + - alerting + - uptime + - siem + examples: + getConnectorTypesResponse: + $ref: '#/components/examples/get_connector_types_response' + '401': + $ref: '#/components/responses/401' + /s/{spaceId}/api/actions/connector/{connectorId}/_execute: post: - summary: Runs a connector. - operationId: runConnector + summary: Run a connector + operationId: runConnectorWithSpaceId description: | You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges. tags: @@ -173,6 +273,7 @@ paths: parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/connector_id' + - $ref: '#/components/parameters/space_id' requestBody: required: true content: @@ -180,16 +281,10 @@ paths: schema: $ref: '#/components/schemas/run_connector_request' examples: - runCasesWebhookConnectorRequest: - $ref: '#/components/examples/run_cases_webhook_connector_request' - runEmailConnectorRequest: - $ref: '#/components/examples/run_email_connector_request' runIndexConnectorRequest: $ref: '#/components/examples/run_index_connector_request' runJiraConnectorRequest: $ref: '#/components/examples/run_jira_connector_request' - runPagerDutyConnectorRequest: - $ref: '#/components/examples/run_pagerduty_connector_request' runServerLogConnectorRequest: $ref: '#/components/examples/run_server_log_connector_request' runServiceNowITOMConnectorRequest: @@ -221,6 +316,10 @@ paths: description: An array of information returned from the action. items: type: object + message: + type: string + service_message: + type: string status: type: string description: The status of the action. @@ -228,16 +327,10 @@ paths: - error - ok examples: - runCasesWebhookConnectorResponse: - $ref: '#/components/examples/run_cases_webhook_connector_response' - runEmailConnectorResponse: - $ref: '#/components/examples/run_email_connector_response' runIndexConnectorResponse: $ref: '#/components/examples/run_index_connector_response' runJiraConnectorResponse: $ref: '#/components/examples/run_jira_connector_response' - runPagerDutyConnectorResponse: - $ref: '#/components/examples/run_pagerduty_connector_response' runServerLogConnectorResponse: $ref: '#/components/examples/run_server_log_connector_response' runServiceNowITOMConnectorResponse: @@ -248,106 +341,14 @@ paths: $ref: '#/components/examples/run_swimlane_connector_response' '401': $ref: '#/components/responses/401' - /api/actions/connectors: - get: - summary: Retrieves all connectors. - operationId: getConnectors - tags: - - connectors - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/connector_response_properties' - examples: - getConnectorsResponse: - $ref: '#/components/examples/get_connectors_response' - '401': - $ref: '#/components/responses/401' - /api/actions/connector_types: - get: - summary: Retrieves a list of all connector types. - operationId: getConnectorTypes - tags: - - connectors - parameters: - - in: query - name: feature_id - description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). - schema: - $ref: '#/components/schemas/features' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - title: Get connector types response body properties - description: The properties vary for each connector type. - type: array - items: - type: object - properties: - enabled: - type: boolean - description: Indicates whether the connector type is enabled in Kibana. - examples: - - true - enabled_in_config: - type: boolean - description: Indicates whether the connector type is enabled in the Kibana configuration file. - examples: - - true - enabled_in_license: - type: boolean - description: Indicates whether the connector is enabled in the license. - examples: - - true - id: - $ref: '#/components/schemas/connector_types' - is_system_action_type: - type: boolean - examples: - - false - minimum_license_required: - type: string - description: The license that is required to use the connector type. - examples: - - basic - name: - type: string - description: The name of the connector type. - examples: - - Index - supported_feature_ids: - type: array - description: The features that are supported by the connector type. - items: - $ref: '#/components/schemas/features' - examples: - - - alerting - - cases - - siem - examples: - getConnectorTypesServerlessResponse: - $ref: '#/components/examples/get_connector_types_generativeai_response' - '401': - $ref: '#/components/responses/401' - /s/{spaceId}/api/actions/connector: + /api/actions/connector: post: - summary: Creates a connector. - operationId: createConnectorWithSpaceId - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + summary: Create a connector + operationId: createConnector tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' requestBody: required: true content: @@ -381,17 +382,14 @@ paths: $ref: '#/components/examples/create_xmatters_connector_response' '401': $ref: '#/components/responses/401' - /s/{spaceId}/api/actions/connector/{connectorId}: + /api/actions/connector/{connectorId}: get: - summary: Retrieves a connector by ID. - operationId: getConnectorWithSpaceId - description: | - You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + summary: Get a connector information + operationId: getConnector tags: - connectors parameters: - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' responses: '200': description: Indicates a successful call. @@ -407,16 +405,13 @@ paths: '404': $ref: '#/components/responses/404' delete: - summary: Deletes a connector. - operationId: deleteConnectorWithSpaceId - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. WARNING: When you delete a connector, it cannot be recovered. + summary: Delete a connector + operationId: deleteConnector tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' responses: '204': description: Indicates a successful call. @@ -425,23 +420,20 @@ paths: '404': $ref: '#/components/responses/404' post: - summary: Creates a connector. - operationId: createConnectorIdWithSpaceId - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + summary: Create a connector + operationId: createConnectorId tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' - in: path name: connectorId - description: A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. + description: | + A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. required: true schema: type: string - examples: - - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 requestBody: required: true content: @@ -464,16 +456,13 @@ paths: '401': $ref: '#/components/responses/401' put: - summary: Updates the attributes for a connector. - operationId: updateConnectorWithSpaceId - description: | - You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + summary: Update a connector + operationId: updateConnector tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' requestBody: required: true content: @@ -496,110 +485,17 @@ paths: $ref: '#/components/responses/401' '404': $ref: '#/components/responses/404' - /s/{spaceId}/api/actions/connectors: - get: - summary: Retrieves all connectors. - operationId: getConnectorsWithSpaceId + /api/actions/connector/{connectorId}/_execute: + post: + summary: Run a connector + operationId: runConnector description: | - You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/connector_response_properties' - examples: - getConnectorsResponse: - $ref: '#/components/examples/get_connectors_response' - '401': - $ref: '#/components/responses/401' - /s/{spaceId}/api/actions/connector_types: - get: - summary: Retrieves a list of all connector types. - operationId: getConnectorTypesWithSpaceId - description: | - You do not need any Kibana feature privileges to run this API. - tags: - - connectors - parameters: - - $ref: '#/components/parameters/space_id' - - in: query - name: feature_id - description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). - schema: - $ref: '#/components/schemas/features' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - title: Get connector types response body properties - description: The properties vary for each connector type. - type: array - items: - type: object - properties: - enabled: - type: boolean - description: Indicates whether the connector type is enabled in Kibana. - examples: - - true - enabled_in_config: - type: boolean - description: Indicates whether the connector type is enabled in the Kibana `.yml` file. - examples: - - true - enabled_in_license: - type: boolean - description: Indicates whether the connector is enabled in the license. - examples: - - true - id: - $ref: '#/components/schemas/connector_types' - minimum_license_required: - type: string - description: The license that is required to use the connector type. - examples: - - basic - name: - type: string - description: The name of the connector type. - examples: - - Index - supported_feature_ids: - type: array - description: The Kibana features that are supported by the connector type. - items: - $ref: '#/components/schemas/features' - examples: - - - alerting - - uptime - - siem - examples: - getConnectorTypesResponse: - $ref: '#/components/examples/get_connector_types_response' - '401': - $ref: '#/components/responses/401' - /s/{spaceId}/api/actions/connector/{connectorId}/_execute: - post: - summary: Runs a connector. - operationId: runConnectorWithSpaceId - description: | - You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges. + You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges. tags: - connectors parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/connector_id' - - $ref: '#/components/parameters/space_id' requestBody: required: true content: @@ -607,10 +503,16 @@ paths: schema: $ref: '#/components/schemas/run_connector_request' examples: + runCasesWebhookConnectorRequest: + $ref: '#/components/examples/run_cases_webhook_connector_request' + runEmailConnectorRequest: + $ref: '#/components/examples/run_email_connector_request' runIndexConnectorRequest: $ref: '#/components/examples/run_index_connector_request' runJiraConnectorRequest: $ref: '#/components/examples/run_jira_connector_request' + runPagerDutyConnectorRequest: + $ref: '#/components/examples/run_pagerduty_connector_request' runServerLogConnectorRequest: $ref: '#/components/examples/run_server_log_connector_request' runServiceNowITOMConnectorRequest: @@ -642,10 +544,6 @@ paths: description: An array of information returned from the action. items: type: object - message: - type: string - service_message: - type: string status: type: string description: The status of the action. @@ -653,10 +551,16 @@ paths: - error - ok examples: + runCasesWebhookConnectorResponse: + $ref: '#/components/examples/run_cases_webhook_connector_response' + runEmailConnectorResponse: + $ref: '#/components/examples/run_email_connector_response' runIndexConnectorResponse: $ref: '#/components/examples/run_index_connector_response' runJiraConnectorResponse: $ref: '#/components/examples/run_jira_connector_response' + runPagerDutyConnectorResponse: + $ref: '#/components/examples/run_pagerduty_connector_response' runServerLogConnectorResponse: $ref: '#/components/examples/run_server_log_connector_response' runServiceNowITOMConnectorResponse: @@ -667,9 +571,92 @@ paths: $ref: '#/components/examples/run_swimlane_connector_response' '401': $ref: '#/components/responses/401' + /api/actions/connectors: + get: + summary: Get all connectors + operationId: getConnectors + tags: + - connectors + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/connector_response_properties' + examples: + getConnectorsResponse: + $ref: '#/components/examples/get_connectors_response' + '401': + $ref: '#/components/responses/401' + /api/actions/connector_types: + get: + summary: Get all connector types + operationId: getConnectorTypes + tags: + - connectors + parameters: + - in: query + name: feature_id + description: A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). + schema: + $ref: '#/components/schemas/features' + responses: + '200': + description: Indicates a successful call. + content: + application/json: + schema: + title: Get connector types response body properties + description: The properties vary for each connector type. + type: array + items: + type: object + properties: + enabled: + type: boolean + description: Indicates whether the connector type is enabled in Kibana. + example: true + enabled_in_config: + type: boolean + description: Indicates whether the connector type is enabled in the Kibana configuration file. + example: true + enabled_in_license: + type: boolean + description: Indicates whether the connector is enabled in the license. + example: true + id: + $ref: '#/components/schemas/connector_types' + is_system_action_type: + type: boolean + example: false + minimum_license_required: + type: string + description: The license that is required to use the connector type. + example: basic + name: + type: string + description: The name of the connector type. + example: Index + supported_feature_ids: + type: array + description: The features that are supported by the connector type. + items: + $ref: '#/components/schemas/features' + example: + - alerting + - cases + - siem + examples: + getConnectorTypesServerlessResponse: + $ref: '#/components/examples/get_connector_types_generativeai_response' + '401': + $ref: '#/components/responses/401' /s/{spaceId}/api/actions/action/{actionId}: delete: - summary: Deletes a connector. + summary: Delete a connector operationId: legacyDeleteConnector deprecated: true description: | @@ -686,7 +673,7 @@ paths: '401': $ref: '#/components/responses/401' get: - summary: Retrieves a connector by ID. + summary: Get connector information operationId: legacyGetConnector description: Deprecated in 7.13.0. Use the get connector API instead. deprecated: true @@ -701,7 +688,7 @@ paths: '401': $ref: '#/components/responses/401' put: - summary: Updates the attributes for a connector. + summary: Update a connector operationId: legacyUpdateConnector deprecated: true description: Deprecated in 7.13.0. Use the update connector API instead. @@ -736,7 +723,7 @@ paths: $ref: '#/components/responses/404' /s/{spaceId}/api/actions: get: - summary: Retrieves all connectors. + summary: Get all connectors operationId: legacyGetConnectors deprecated: true description: Deprecated in 7.13.0. Use the get all connectors API instead. @@ -756,7 +743,7 @@ paths: '401': $ref: '#/components/responses/401' post: - summary: Creates a connector. + summary: Create a connector operationId: legacyCreateConnector deprecated: true description: Deprecated in 7.13.0. Use the create connector API instead. @@ -793,7 +780,7 @@ paths: $ref: '#/components/responses/401' /s/{spaceId}/api/actions/list_action_types: get: - summary: Retrieves a list of all connector types. + summary: Get connector types operationId: legacyGetConnectorTypes deprecated: true description: Deprecated in 7.13.0. Use the get all connector types API instead. @@ -822,8 +809,7 @@ paths: enabledInLicense: type: boolean description: Indicates whether the connector is enabled in the license. - examples: - - true + example: true id: type: string description: The unique identifier for the connector type. @@ -837,7 +823,7 @@ paths: $ref: '#/components/responses/401' /s/{spaceId}/api/actions/action/{actionId}/_execute: post: - summary: Runs a connector. + summary: Run a connector operationId: legacyRunConnector deprecated: true description: Deprecated in 7.13.0. Use the run connector API instead. @@ -903,24 +889,22 @@ components: name: kbn-xsrf description: Cross-site request forgery protection required: true - connector_id: + space_id: in: path - name: connectorId - description: An identifier for the connector. + name: spaceId + description: An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. required: true schema: type: string - examples: - - df770e30-8b8b-11ed-a780-3b746c987a81 - space_id: + example: default + connector_id: in: path - name: spaceId - description: An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + name: connectorId + description: An identifier for the connector. required: true schema: type: string - examples: - - default + example: df770e30-8b8b-11ed-a780-3b746c987a81 action_id: in: path name: actionId @@ -928,8 +912,7 @@ components: required: true schema: type: string - examples: - - c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad + example: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad schemas: create_connector_request_bedrock: title: Create Amazon Bedrock connector request @@ -948,13 +931,11 @@ components: description: The type of connector. enum: - .bedrock - examples: - - .bedrock + example: .bedrock name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_bedrock' create_connector_request_gemini: @@ -974,13 +955,11 @@ components: description: The type of connector. enum: - .gemini - examples: - - .gemini + example: .gemini name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_gemini' create_connector_request_cases_webhook: @@ -1000,13 +979,11 @@ components: description: The type of connector. enum: - .cases-webhook - examples: - - .cases-webhook + example: .cases-webhook name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_cases_webhook' create_connector_request_d3security: @@ -1027,13 +1004,11 @@ components: description: The type of connector. enum: - .d3security - examples: - - .d3security + example: .d3security name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_d3security' create_connector_request_email: @@ -1054,13 +1029,11 @@ components: description: The type of connector. enum: - .email - examples: - - .email + example: .email name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_email' create_connector_request_genai: @@ -1081,13 +1054,11 @@ components: description: The type of connector. enum: - .gen-ai - examples: - - .gen-ai + example: .gen-ai name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_genai' create_connector_request_index: @@ -1106,13 +1077,11 @@ components: description: The type of connector. enum: - .index - examples: - - .index + example: .index name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector create_connector_request_jira: title: Create Jira connector request description: The Jira connector uses the REST API v2 to create Jira issues. @@ -1130,13 +1099,11 @@ components: description: The type of connector. enum: - .jira - examples: - - .jira + example: .jira name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_jira' create_connector_request_opsgenie: @@ -1156,13 +1123,11 @@ components: description: The type of connector. enum: - .opsgenie - examples: - - .opsgenie + example: .opsgenie name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_opsgenie' create_connector_request_pagerduty: @@ -1183,13 +1148,11 @@ components: description: The type of connector. enum: - .pagerduty - examples: - - .pagerduty + example: .pagerduty name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_pagerduty' create_connector_request_resilient: @@ -1207,15 +1170,13 @@ components: connector_type_id: description: The type of connector. type: string - examples: - - .resilient + example: .resilient enum: - .resilient name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_resilient' create_connector_request_sentinelone: @@ -1237,13 +1198,11 @@ components: description: The type of connector. enum: - .sentinelone - examples: - - .sentinelone + example: .sentinelone name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_sentinelone' create_connector_request_serverlog: @@ -1259,13 +1218,11 @@ components: description: The type of connector. enum: - .server-log - examples: - - .server-log + example: .server-log name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector create_connector_request_servicenow: title: Create ServiceNow ITSM connector request description: | @@ -1284,13 +1241,11 @@ components: description: The type of connector. enum: - .servicenow - examples: - - .servicenow + example: .servicenow name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_servicenow' create_connector_request_servicenow_itom: @@ -1311,13 +1266,11 @@ components: description: The type of connector. enum: - .servicenow-itom - examples: - - .servicenow-itom + example: .servicenow-itom name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_servicenow' create_connector_request_servicenow_sir: @@ -1338,13 +1291,11 @@ components: description: The type of connector. enum: - .servicenow-sir - examples: - - .servicenow-sir + example: .servicenow-sir name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_servicenow' create_connector_request_slack_api: @@ -1363,13 +1314,11 @@ components: description: The type of connector. enum: - .slack_api - examples: - - .slack_api + example: .slack_api name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_slack_api' create_connector_request_slack_webhook: @@ -1386,13 +1335,11 @@ components: description: The type of connector. enum: - .slack - examples: - - .slack + example: .slack name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_slack_webhook' create_connector_request_swimlane: @@ -1412,13 +1359,11 @@ components: description: The type of connector. enum: - .swimlane - examples: - - .swimlane + example: .swimlane name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_swimlane' create_connector_request_teams: @@ -1435,13 +1380,11 @@ components: description: The type of connector. enum: - .teams - examples: - - .teams + example: .teams name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_teams' create_connector_request_tines: @@ -1462,13 +1405,11 @@ components: description: The type of connector. enum: - .tines - examples: - - .tines + example: .tines name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_tines' create_connector_request_torq: @@ -1489,13 +1430,11 @@ components: description: The type of connector. enum: - .torq - examples: - - .torq + example: .torq name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_torq' create_connector_request_webhook: @@ -1516,13 +1455,11 @@ components: description: The type of connector. enum: - .webhook - examples: - - .webhook + example: .webhook name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_webhook' create_connector_request_xmatters: @@ -1543,13 +1480,11 @@ components: description: The type of connector. enum: - .xmatters - examples: - - .xmatters + example: .xmatters name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_xmatters' config_properties_bedrock: @@ -1631,8 +1566,7 @@ components: type: string description: | A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - examples: - - '{"body": {{{case.comment}}}}' + example: '{"body": {{{case.comment}}}}' createCommentMethod: type: string description: | @@ -1646,14 +1580,12 @@ components: type: string description: | The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. - examples: - - https://example.com/issue/{{{external.system.id}}}/comment + example: https://example.com/issue/{{{external.system.id}}}/comment createIncidentJson: type: string description: | A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - examples: - - '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' + example: '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' createIncidentMethod: type: string description: | @@ -1677,8 +1609,7 @@ components: type: string description: | The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - examples: - - https://example.com/issue/{{{external.system.id}}} + example: https://example.com/issue/{{{external.system.id}}} hasAuth: type: boolean description: If true, a username and password for login type authentication must be provided. @@ -1691,8 +1622,7 @@ components: type: string description: | The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - examples: - - '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' + example: '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' updateIncidentMethod: type: string description: | @@ -1706,14 +1636,12 @@ components: type: string description: | The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - examples: - - https://example.com/issue/{{{external.system.ID}}} + example: https://example.com/issue/{{{external.system.ID}}} viewIncidentUrl: type: string description: | The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL. - examples: - - https://testing-jira.atlassian.net/browse/{{{external.system.title}}} + example: https://testing-jira.atlassian.net/browse/{{{external.system.title}}} secrets_properties_cases_webhook: title: Connector secrets properties for Webhook - Case Management connector type: object @@ -1755,9 +1683,8 @@ components: clientId: description: | The client identifier, which is a part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. - type: - - string - - 'null' + type: string + nullable: true from: description: | The from address for all emails sent by the connector. It must be specified in `user@host-name` format. @@ -1772,9 +1699,8 @@ components: The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. type: string oauthTokenUrl: - type: - - string - - 'null' + type: string + nullable: true port: description: | The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. @@ -1797,9 +1723,8 @@ components: tenantId: description: | The tenant identifier, which is part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. - type: - - string - - 'null' + type: string + nullable: true secrets_properties_email: title: Connector secrets properties for an email connector description: Defines secrets for connectors when type is `.email`. @@ -1883,9 +1808,8 @@ components: executionTimeField: description: A field that indicates when the document was indexed. default: null - type: - - string - - 'null' + type: string + nullable: true index: description: The Elasticsearch index to be written to. type: string @@ -1950,11 +1874,9 @@ components: properties: apiUrl: description: The PagerDuty event URL. - type: - - string - - 'null' - examples: - - https://events.pagerduty.com/v2/enqueue + type: string + nullable: true + example: https://events.pagerduty.com/v2/enqueue secrets_properties_pagerduty: title: Connector secrets properties for a PagerDuty connector description: Defines secrets for connectors when type is `.pagerduty`. @@ -2390,10 +2312,10 @@ components: properties: authType: type: string + nullable: true enum: - webhook-authentication-basic - webhook-authentication-ssl - - 'null' description: | The type of authentication to use: basic, SSL, or none. ca: @@ -2412,9 +2334,8 @@ components: description: | If `true`, a user name and password must be provided for login type authentication. headers: - type: - - object - - 'null' + type: object + nullable: true description: A set of key-value pairs sent as headers with the request. method: type: string @@ -2467,9 +2388,8 @@ components: configUrl: description: | The request URL for the Elastic Alerts trigger in xMatters. It is applicable only when `usesBasic` is `true`. - type: - - string - - 'null' + type: string + nullable: true usesBasic: description: Specifies whether the connector uses HTTP basic authentication (`true`) or URL authentication (`false`). type: boolean @@ -2952,9 +2872,8 @@ components: - name properties: config: - type: - - object - - 'null' + type: object + nullable: true connector_type_id: type: string description: The type of connector. @@ -3340,30 +3259,25 @@ components: is_deprecated: type: boolean description: Indicates whether the connector type is deprecated. - examples: - - false + example: false is_missing_secrets: type: boolean description: Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - examples: - - false + example: false is_preconfigured: type: boolean description: | Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - examples: - - false + example: false is_system_action: type: boolean description: Indicates whether the connector is used for system actions. - examples: - - false + example: false referenced_by_count: type: integer description: | Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. This property is returned only by the get all connectors API. - examples: - - 2 + example: 2 connector_response_properties: title: Connector response properties description: The properties vary depending on the connector type. @@ -3459,8 +3373,7 @@ components: name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_cases_webhook' update_connector_request_d3security: @@ -3657,8 +3570,7 @@ components: name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_swimlane' update_connector_request_teams: @@ -3760,6 +3672,48 @@ components: - $ref: '#/components/schemas/update_connector_request_torq' - $ref: '#/components/schemas/update_connector_request_webhook' - $ref: '#/components/schemas/update_connector_request_xmatters' + features: + type: string + description: | + The feature that uses the connector. + enum: + - alerting + - cases + - generativeAIForSecurity + - generativeAIForObservability + - generativeAIForSearchPlayground + - siem + - uptime + connector_types: + title: Connector types + type: string + description: The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. + enum: + - .bedrock + - .gemini + - .cases-webhook + - .d3security + - .email + - .gen-ai + - .index + - .jira + - .opsgenie + - .pagerduty + - .resilient + - .sentinelone + - .servicenow + - .servicenow-itom + - .servicenow-sir + - .server-log + - .slack + - .slack_api + - .swimlane + - .teams + - .tines + - .torq + - .webhook + - .xmatters + example: .server-log run_connector_params_acknowledge_resolve_pagerduty: title: PagerDuty connector parameters description: Test an action that acknowledges or resolves a PagerDuty alert. @@ -3876,13 +3830,11 @@ components: class: description: The class or type of the event. type: string - examples: - - cpu load + example: cpu load component: description: The component of the source machine that is responsible for the event. type: string - examples: - - eth0 + example: eth0 customDetails: description: Additional details to add to the event. type: object @@ -3899,8 +3851,7 @@ components: group: description: The logical grouping of components of a service. type: string - examples: - - app-stack + example: app-stack links: description: A list of links to add to the event. type: array @@ -4040,17 +3991,15 @@ components: - externalId properties: correlation_id: - type: - - 'null' - - string + type: string + nullable: true description: | An identifier that is assigned to the incident when it is created by the connector. NOTE: If you use the default value and the rule generates multiple alerts that use the same alert IDs, the latest open incident for this correlation ID is closed unless you specify the external ID. maxLength: 100 default: '{{rule.id}}:{{alert.id}}' externalId: - type: - - 'null' - - string + type: string + nullable: true description: The unique identifier (`incidentId`) for the incident in ServiceNow. run_connector_subaction_createalert: title: The createAlert subaction @@ -4085,9 +4034,9 @@ components: type: object description: The custom properties of the alert. additionalProperties: true - examples: - - key1: value1 - key2: value2 + example: + key1: value1 + key2: value2 entity: type: string description: The domain of the alert. For example, the application or server name. @@ -4185,8 +4134,7 @@ components: id: type: string description: The Jira issue type identifier. - examples: - - 10024 + example: 10024 run_connector_subaction_getchoices: title: The getChoices subaction type: object @@ -4244,8 +4192,7 @@ components: externalId: type: string description: The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. - examples: - - 71778 + example: 71778 run_connector_subaction_issue: title: The issue subaction type: object @@ -4266,8 +4213,7 @@ components: id: type: string description: The Jira issue identifier. - examples: - - 71778 + example: 71778 run_connector_subaction_issues: title: The issues subaction type: object @@ -4556,49 +4502,6 @@ components: issues: '#/components/schemas/run_connector_subaction_issues' issueTypes: '#/components/schemas/run_connector_subaction_issuetypes' pushToService: '#/components/schemas/run_connector_subaction_pushtoservice' - features: - type: string - description: | - The feature that uses the connector. - enum: - - alerting - - cases - - generativeAIForSecurity - - generativeAIForObservability - - generativeAIForSearchPlayground - - siem - - uptime - connector_types: - title: Connector types - type: string - description: The type of connector. For example, `.email`, `.index`, `.jira`, `.opsgenie`, or `.server-log`. - enum: - - .bedrock - - .gemini - - .cases-webhook - - .d3security - - .email - - .gen-ai - - .index - - .jira - - .opsgenie - - .pagerduty - - .resilient - - .sentinelone - - .servicenow - - .servicenow-itom - - .servicenow-sir - - .server-log - - .slack - - .slack_api - - .swimlane - - .teams - - .tines - - .torq - - .webhook - - .xmatters - examples: - - .server-log action_response_properties: title: Action response properties description: The properties vary depending on the action type. @@ -4749,37 +4652,60 @@ components: name: updated-connector config: index: updated-index - run_cases_webhook_connector_request: - summary: Run a Webhook - Case Management connector to create a case. + get_connectors_response: + summary: A list of connectors value: - params: - subAction: pushToService - subActionParams: - comments: - - commentId: 1 - comment: A comment about the incident. - incident: - title: Case title - description: Description of the incident. - tags: - - tag1 - - tag2 - severity: low - status: open - id: caseID - run_email_connector_request: - summary: Send an email message from an email connector. + - id: preconfigured-email-connector + name: my-preconfigured-email-notification + connector_type_id: .email + is_preconfigured: true + is_deprecated: false + referenced_by_count: 0 + is_system_action: false + - id: e07d0c80-8b8b-11ed-a780-3b746c987a81 + name: my-index-connector + config: + index: test-index + refresh: false + executionTimeField: null + connector_type_id: .index + is_preconfigured: false + is_deprecated: false + referenced_by_count: 2 + is_missing_secrets: false + is_system_action: false + get_connector_types_response: + summary: A list of connector types value: - params: - bcc: - - user1@example.com - cc: - - user2@example.com - - user3@example.com - message: Test email message. - subject: Test message subject - to: - - user4@example.com + - id: .swimlane + name: Swimlane + enabled: true + enabled_in_config: true + enabled_in_license: true + minimum_license_required: gold + supported_feature_ids: + - alerting + - cases + - siem + - id: .index + name: Index + enabled: true + enabled_in_config: true + enabled_in_license: true + minimum_license_required: basic + supported_feature_ids: + - alerting + - uptime + - siem + - id: .server-log + name: Server log + enabled: true + enabled_in_config: true + enabled_in_license: true + minimum_license_required: basic + supported_feature_ids: + - alerting + - uptime run_index_connector_request: summary: Run an index connector. value: @@ -4793,17 +4719,6 @@ components: value: params: subAction: issueTypes - run_pagerduty_connector_request: - summary: Run a PagerDuty connector to trigger an alert. - value: - params: - eventAction: trigger - summary: A brief event summary - links: - - href: http://example.com/pagerduty - text: An example link - customDetails: - my_data_1: test data run_server_log_connector_request: summary: Run a server log connector. value: @@ -4841,43 +4756,6 @@ components: caseId: '1000' caseName: Case name description: Description of the incident. - run_cases_webhook_connector_response: - summary: Response from a pushToService action for a Webhook - Case Management connector. - value: - connector_id: 1824b5b8-c005-4dcc-adac-57f92db46459 - data: - id: 100665 - title: TEST-29034 - url: https://example.com/browse/TEST-29034 - pushedDate: '2023-12-05T19:43:36.360Z' - comments: - - commentId: 1 - pushedDate: '2023-12-05T19:43:36.360Z' - status: ok - run_email_connector_response: - summary: Response for sending a message from an email connector. - value: - connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 - data: - accepted: - - user1@example.com - - user2@example.com - - user3@example.com - - user4@example.com - envelope: - from: tester@example.com - to: - - user1@example.com - - user2@example.com - - user3@example.com - - user4@example.com - envelopeTime: 8 - messageTime: 3 - messageSize: 729 - response: 250 Message queued as QzEXKcGJ - messageId: <08a92d29-642a-0706-750c-de5996bd5cf3@example.com> - rejected: [] - status: ok run_index_connector_response: summary: Response from running an index connector. value: @@ -4917,15 +4795,6 @@ components: - id: 10000 name: Epic status: ok - run_pagerduty_connector_response: - summary: Response from running a PagerDuty connector. - value: - connector_id: 45de9f70-954f-4608-b12a-db7cf808e49d - data: - dedup_key: 5115e138b26b484a81eaea779faa6016 - message: Event processed - status: success - status: ok run_server_log_connector_response: summary: Response from running a server log connector. value: @@ -5020,28 +4889,94 @@ components: - commentId: 1 pushedDate: '2022-09-08T16:52:27.865Z' status: ok - get_connectors_response: - summary: A list of connectors + run_cases_webhook_connector_request: + summary: Run a Webhook - Case Management connector to create a case. value: - - id: preconfigured-email-connector - name: my-preconfigured-email-notification - connector_type_id: .email - is_preconfigured: true - is_deprecated: false - referenced_by_count: 0 - is_system_action: false - - id: e07d0c80-8b8b-11ed-a780-3b746c987a81 - name: my-index-connector - config: - index: test-index - refresh: false - executionTimeField: null - connector_type_id: .index - is_preconfigured: false - is_deprecated: false - referenced_by_count: 2 - is_missing_secrets: false - is_system_action: false + params: + subAction: pushToService + subActionParams: + comments: + - commentId: 1 + comment: A comment about the incident. + incident: + title: Case title + description: Description of the incident. + tags: + - tag1 + - tag2 + severity: low + status: open + id: caseID + run_email_connector_request: + summary: Send an email message from an email connector. + value: + params: + bcc: + - user1@example.com + cc: + - user2@example.com + - user3@example.com + message: Test email message. + subject: Test message subject + to: + - user4@example.com + run_pagerduty_connector_request: + summary: Run a PagerDuty connector to trigger an alert. + value: + params: + eventAction: trigger + summary: A brief event summary + links: + - href: http://example.com/pagerduty + text: An example link + customDetails: + my_data_1: test data + run_cases_webhook_connector_response: + summary: Response from a pushToService action for a Webhook - Case Management connector. + value: + connector_id: 1824b5b8-c005-4dcc-adac-57f92db46459 + data: + id: 100665 + title: TEST-29034 + url: https://example.com/browse/TEST-29034 + pushedDate: '2023-12-05T19:43:36.360Z' + comments: + - commentId: 1 + pushedDate: '2023-12-05T19:43:36.360Z' + status: ok + run_email_connector_response: + summary: Response for sending a message from an email connector. + value: + connector_id: 7fc7b9a0-ecc9-11ec-8736-e7d63118c907 + data: + accepted: + - user1@example.com + - user2@example.com + - user3@example.com + - user4@example.com + envelope: + from: tester@example.com + to: + - user1@example.com + - user2@example.com + - user3@example.com + - user4@example.com + envelopeTime: 8 + messageTime: 3 + messageSize: 729 + response: 250 Message queued as QzEXKcGJ + messageId: <08a92d29-642a-0706-750c-de5996bd5cf3@example.com> + rejected: [] + status: ok + run_pagerduty_connector_response: + summary: Response from running a PagerDuty connector. + value: + connector_id: 45de9f70-954f-4608-b12a-db7cf808e49d + data: + dedup_key: 5115e138b26b484a81eaea779faa6016 + message: Event processed + status: success + status: ok get_connector_types_generativeai_response: summary: A list of connector types for the `generativeAI` feature. value: @@ -5076,38 +5011,6 @@ components: supported_feature_ids: - generativeAIForSecurity is_system_action_type: false - get_connector_types_response: - summary: A list of connector types - value: - - id: .swimlane - name: Swimlane - enabled: true - enabled_in_config: true - enabled_in_license: true - minimum_license_required: gold - supported_feature_ids: - - alerting - - cases - - siem - - id: .index - name: Index - enabled: true - enabled_in_config: true - enabled_in_license: true - minimum_license_required: basic - supported_feature_ids: - - alerting - - uptime - - siem - - id: .server-log - name: Server log - enabled: true - enabled_in_config: true - enabled_in_license: true - minimum_license_required: basic - supported_feature_ids: - - alerting - - uptime responses: '401': description: Authorization information is missing or invalid. @@ -5119,16 +5022,14 @@ components: properties: error: type: string - examples: - - Unauthorized + example: Unauthorized enum: - Unauthorized message: type: string statusCode: type: integer - examples: - - 401 + example: 401 enum: - 401 '404': @@ -5141,18 +5042,15 @@ components: properties: error: type: string - examples: - - Not Found + example: Not Found enum: - Not Found message: type: string - examples: - - Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found + example: Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found statusCode: type: integer - examples: - - 404 + example: 404 enum: - 404 200_actions: diff --git a/x-pack/plugins/actions/docs/openapi/bundled_serverless.json b/x-pack/plugins/actions/docs/openapi/bundled_serverless.json index 8de6f01f7f43a..928dbbfd758d7 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled_serverless.json +++ b/x-pack/plugins/actions/docs/openapi/bundled_serverless.json @@ -1,5 +1,5 @@ { - "openapi": "3.1.0", + "openapi": "3.0.3", "info": { "title": "Connectors", "description": "OpenAPI schema for connectors in Serverless projects", @@ -36,7 +36,7 @@ "paths": { "/api/actions/connector": { "post": { - "summary": "Creates a connector.", + "summary": "Create a connector", "operationId": "createConnector", "tags": [ "connectors" @@ -103,7 +103,7 @@ }, "/api/actions/connector/{connectorId}": { "get": { - "summary": "Retrieves a connector by ID.", + "summary": "Get a connector information", "operationId": "getConnector", "tags": [ "connectors" @@ -138,7 +138,7 @@ } }, "delete": { - "summary": "Deletes a connector.", + "summary": "Delete a connector", "operationId": "deleteConnector", "tags": [ "connectors" @@ -164,7 +164,7 @@ } }, "post": { - "summary": "Creates a connector.", + "summary": "Create a connector", "operationId": "createConnectorId", "tags": [ "connectors" @@ -180,9 +180,7 @@ "required": true, "schema": { "type": "string", - "examples": [ - "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" - ] + "example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74" } } ], @@ -223,7 +221,7 @@ } }, "put": { - "summary": "Updates the attributes for a connector.", + "summary": "Update a connector", "operationId": "updateConnector", "tags": [ "connectors" @@ -276,7 +274,7 @@ }, "/api/actions/connectors": { "get": { - "summary": "Retrieves all connectors.", + "summary": "Get all connectors", "operationId": "getConnectors", "tags": [ "connectors" @@ -308,7 +306,7 @@ }, "/api/actions/connector_types": { "get": { - "summary": "Retrieves a list of all connector types.", + "summary": "Get all connector types", "operationId": "getConnectorTypes", "tags": [ "connectors" @@ -338,46 +336,34 @@ "enabled": { "type": "boolean", "description": "Indicates whether the connector type is enabled in Kibana.", - "examples": [ - true - ] + "example": true }, "enabled_in_config": { "type": "boolean", "description": "Indicates whether the connector type is enabled in the Kibana configuration file.", - "examples": [ - true - ] + "example": true }, "enabled_in_license": { "type": "boolean", "description": "Indicates whether the connector is enabled in the license.", - "examples": [ - true - ] + "example": true }, "id": { "$ref": "#/components/schemas/connector_types" }, "is_system_action_type": { "type": "boolean", - "examples": [ - false - ] + "example": false }, "minimum_license_required": { "type": "string", "description": "The license that is required to use the connector type.", - "examples": [ - "basic" - ] + "example": "basic" }, "name": { "type": "string", "description": "The name of the connector type.", - "examples": [ - "Index" - ] + "example": "Index" }, "supported_feature_ids": { "type": "array", @@ -385,12 +371,10 @@ "items": { "$ref": "#/components/schemas/features" }, - "examples": [ - [ - "alerting", - "cases", - "siem" - ] + "example": [ + "alerting", + "cases", + "siem" ] } } @@ -417,7 +401,7 @@ "type": "apiKey", "in": "header", "name": "Authorization", - "description": "e.g. Authorization: ApiKey base64AccessApiKey" + "description": "Serverless APIs support only key-based authentication. You must create an API key and use the encoded value in the request header. For example: 'Authorization: ApiKey base64AccessApiKey'.\n" } }, "parameters": { @@ -437,9 +421,7 @@ "required": true, "schema": { "type": "string", - "examples": [ - "df770e30-8b8b-11ed-a780-3b746c987a81" - ] + "example": "df770e30-8b8b-11ed-a780-3b746c987a81" } } }, @@ -464,16 +446,12 @@ "enum": [ ".bedrock" ], - "examples": [ - ".bedrock" - ] + "example": ".bedrock" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_bedrock" @@ -500,16 +478,12 @@ "enum": [ ".gemini" ], - "examples": [ - ".gemini" - ] + "example": ".gemini" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_gemini" @@ -535,16 +509,12 @@ "enum": [ ".cases-webhook" ], - "examples": [ - ".cases-webhook" - ] + "example": ".cases-webhook" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_cases_webhook" @@ -571,16 +541,12 @@ "enum": [ ".d3security" ], - "examples": [ - ".d3security" - ] + "example": ".d3security" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_d3security" @@ -607,16 +573,12 @@ "enum": [ ".email" ], - "examples": [ - ".email" - ] + "example": ".email" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_email" @@ -643,16 +605,12 @@ "enum": [ ".gen-ai" ], - "examples": [ - ".gen-ai" - ] + "example": ".gen-ai" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_genai" @@ -678,16 +636,12 @@ "enum": [ ".index" ], - "examples": [ - ".index" - ] + "example": ".index" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" } } }, @@ -711,16 +665,12 @@ "enum": [ ".jira" ], - "examples": [ - ".jira" - ] + "example": ".jira" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_jira" @@ -747,16 +697,12 @@ "enum": [ ".opsgenie" ], - "examples": [ - ".opsgenie" - ] + "example": ".opsgenie" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_opsgenie" @@ -783,16 +729,12 @@ "enum": [ ".pagerduty" ], - "examples": [ - ".pagerduty" - ] + "example": ".pagerduty" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_pagerduty" @@ -816,9 +758,7 @@ "connector_type_id": { "description": "The type of connector.", "type": "string", - "examples": [ - ".resilient" - ], + "example": ".resilient", "enum": [ ".resilient" ] @@ -826,9 +766,7 @@ "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_resilient" @@ -856,16 +794,12 @@ "enum": [ ".sentinelone" ], - "examples": [ - ".sentinelone" - ] + "example": ".sentinelone" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_sentinelone" @@ -887,16 +821,12 @@ "enum": [ ".server-log" ], - "examples": [ - ".server-log" - ] + "example": ".server-log" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" } } }, @@ -920,16 +850,12 @@ "enum": [ ".servicenow" ], - "examples": [ - ".servicenow" - ] + "example": ".servicenow" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_servicenow" @@ -956,16 +882,12 @@ "enum": [ ".servicenow-itom" ], - "examples": [ - ".servicenow-itom" - ] + "example": ".servicenow-itom" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_servicenow" @@ -992,16 +914,12 @@ "enum": [ ".servicenow-sir" ], - "examples": [ - ".servicenow-sir" - ] + "example": ".servicenow-sir" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_servicenow" @@ -1027,16 +945,12 @@ "enum": [ ".slack_api" ], - "examples": [ - ".slack_api" - ] + "example": ".slack_api" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_slack_api" @@ -1059,16 +973,12 @@ "enum": [ ".slack" ], - "examples": [ - ".slack" - ] + "example": ".slack" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_slack_webhook" @@ -1095,16 +1005,12 @@ "enum": [ ".swimlane" ], - "examples": [ - ".swimlane" - ] + "example": ".swimlane" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_swimlane" @@ -1127,16 +1033,12 @@ "enum": [ ".teams" ], - "examples": [ - ".teams" - ] + "example": ".teams" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_teams" @@ -1163,16 +1065,12 @@ "enum": [ ".tines" ], - "examples": [ - ".tines" - ] + "example": ".tines" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_tines" @@ -1199,16 +1097,12 @@ "enum": [ ".torq" ], - "examples": [ - ".torq" - ] + "example": ".torq" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_torq" @@ -1235,16 +1129,12 @@ "enum": [ ".webhook" ], - "examples": [ - ".webhook" - ] + "example": ".webhook" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_webhook" @@ -1271,16 +1161,12 @@ "enum": [ ".xmatters" ], - "examples": [ - ".xmatters" - ] + "example": ".xmatters" }, "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_xmatters" @@ -1386,9 +1272,7 @@ "createCommentJson": { "type": "string", "description": "A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass.\n", - "examples": [ - "{\"body\": {{{case.comment}}}}" - ] + "example": "{\"body\": {{{case.comment}}}}" }, "createCommentMethod": { "type": "string", @@ -1403,16 +1287,12 @@ "createCommentUrl": { "type": "string", "description": "The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts.\n", - "examples": [ - "https://example.com/issue/{{{external.system.id}}}/comment" - ] + "example": "https://example.com/issue/{{{external.system.id}}}/comment" }, "createIncidentJson": { "type": "string", "description": "A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review.\n", - "examples": [ - "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" - ] + "example": "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" }, "createIncidentMethod": { "type": "string", @@ -1439,9 +1319,7 @@ "getIncidentUrl": { "type": "string", "description": "The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass.\n", - "examples": [ - "https://example.com/issue/{{{external.system.id}}}" - ] + "example": "https://example.com/issue/{{{external.system.id}}}" }, "hasAuth": { "type": "boolean", @@ -1455,9 +1333,7 @@ "updateIncidentJson": { "type": "string", "description": "The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review.\n", - "examples": [ - "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" - ] + "example": "{\"fields\": {\"summary\": {{{case.title}}},\"description\": {{{case.description}}},\"labels\": {{{case.tags}}}}}" }, "updateIncidentMethod": { "type": "string", @@ -1472,16 +1348,12 @@ "updateIncidentUrl": { "type": "string", "description": "The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts.\n", - "examples": [ - "https://example.com/issue/{{{external.system.ID}}}" - ] + "example": "https://example.com/issue/{{{external.system.ID}}}" }, "viewIncidentUrl": { "type": "string", "description": "The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL.\n", - "examples": [ - "https://testing-jira.atlassian.net/browse/{{{external.system.title}}}" - ] + "example": "https://testing-jira.atlassian.net/browse/{{{external.system.title}}}" } } }, @@ -1537,10 +1409,8 @@ "properties": { "clientId": { "description": "The client identifier, which is a part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required.\n", - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "from": { "description": "The from address for all emails sent by the connector. It must be specified in `user@host-name` format.\n", @@ -1556,10 +1426,8 @@ "type": "string" }, "oauthTokenUrl": { - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "port": { "description": "The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. \n", @@ -1583,10 +1451,8 @@ }, "tenantId": { "description": "The tenant identifier, which is part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required.\n", - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true } } }, @@ -1698,10 +1564,8 @@ "executionTimeField": { "description": "A field that indicates when the document was indexed.", "default": null, - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "index": { "description": "The Elasticsearch index to be written to.", @@ -1787,13 +1651,9 @@ "properties": { "apiUrl": { "description": "The PagerDuty event URL.", - "type": [ - "string", - "null" - ], - "examples": [ - "https://events.pagerduty.com/v2/enqueue" - ] + "type": "string", + "nullable": true, + "example": "https://events.pagerduty.com/v2/enqueue" } } }, @@ -2363,10 +2223,10 @@ "properties": { "authType": { "type": "string", + "nullable": true, "enum": [ "webhook-authentication-basic", - "webhook-authentication-ssl", - "null" + "webhook-authentication-ssl" ], "description": "The type of authentication to use: basic, SSL, or none.\n" }, @@ -2387,10 +2247,8 @@ "description": "If `true`, a user name and password must be provided for login type authentication.\n" }, "headers": { - "type": [ - "object", - "null" - ], + "type": "object", + "nullable": true, "description": "A set of key-value pairs sent as headers with the request." }, "method": { @@ -2452,10 +2310,8 @@ "properties": { "configUrl": { "description": "The request URL for the Elastic Alerts trigger in xMatters. It is applicable only when `usesBasic` is `true`.\n", - "type": [ - "string", - "null" - ] + "type": "string", + "nullable": true }, "usesBasic": { "description": "Specifies whether the connector uses HTTP basic authentication (`true`) or URL authentication (`false`).", @@ -3152,10 +3008,8 @@ ], "properties": { "config": { - "type": [ - "object", - "null" - ] + "type": "object", + "nullable": true }, "connector_type_id": { "type": "string", @@ -3695,37 +3549,27 @@ "is_deprecated": { "type": "boolean", "description": "Indicates whether the connector type is deprecated.", - "examples": [ - false - ] + "example": false }, "is_missing_secrets": { "type": "boolean", "description": "Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type.", - "examples": [ - false - ] + "example": false }, "is_preconfigured": { "type": "boolean", "description": "Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. \n", - "examples": [ - false - ] + "example": false }, "is_system_action": { "type": "boolean", "description": "Indicates whether the connector is used for system actions.", - "examples": [ - false - ] + "example": false }, "referenced_by_count": { "type": "integer", "description": "Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. This property is returned only by the get all connectors API.\n", - "examples": [ - 2 - ] + "example": 2 }, "connector_response_properties": { "title": "Connector response properties", @@ -3888,9 +3732,7 @@ "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_cases_webhook" @@ -4167,9 +4009,7 @@ "name": { "type": "string", "description": "The display name for the connector.", - "examples": [ - "my-connector" - ] + "example": "my-connector" }, "secrets": { "$ref": "#/components/schemas/secrets_properties_swimlane" @@ -4395,9 +4235,7 @@ ".webhook", ".xmatters" ], - "examples": [ - ".server-log" - ] + "example": ".server-log" } }, "examples": { @@ -4646,9 +4484,7 @@ "properties": { "error": { "type": "string", - "examples": [ - "Unauthorized" - ], + "example": "Unauthorized", "enum": [ "Unauthorized" ] @@ -4658,9 +4494,7 @@ }, "statusCode": { "type": "integer", - "examples": [ - 401 - ], + "example": 401, "enum": [ 401 ] @@ -4680,24 +4514,18 @@ "properties": { "error": { "type": "string", - "examples": [ - "Not Found" - ], + "example": "Not Found", "enum": [ "Not Found" ] }, "message": { "type": "string", - "examples": [ - "Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found" - ] + "example": "Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found" }, "statusCode": { "type": "integer", - "examples": [ - 404 - ], + "example": 404, "enum": [ 404 ] diff --git a/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml b/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml index ab5cf28a73848..4fdc184e3fb90 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.3 info: title: Connectors description: OpenAPI schema for connectors in Serverless projects @@ -21,7 +21,7 @@ tags: paths: /api/actions/connector: post: - summary: Creates a connector. + summary: Create a connector operationId: createConnector tags: - connectors @@ -62,7 +62,7 @@ paths: $ref: '#/components/responses/401' /api/actions/connector/{connectorId}: get: - summary: Retrieves a connector by ID. + summary: Get a connector information operationId: getConnector tags: - connectors @@ -83,7 +83,7 @@ paths: '404': $ref: '#/components/responses/404' delete: - summary: Deletes a connector. + summary: Delete a connector operationId: deleteConnector tags: - connectors @@ -98,7 +98,7 @@ paths: '404': $ref: '#/components/responses/404' post: - summary: Creates a connector. + summary: Create a connector operationId: createConnectorId tags: - connectors @@ -111,8 +111,7 @@ paths: required: true schema: type: string - examples: - - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 requestBody: required: true content: @@ -135,7 +134,7 @@ paths: '401': $ref: '#/components/responses/401' put: - summary: Updates the attributes for a connector. + summary: Update a connector operationId: updateConnector tags: - connectors @@ -166,7 +165,7 @@ paths: $ref: '#/components/responses/404' /api/actions/connectors: get: - summary: Retrieves all connectors. + summary: Get all connectors operationId: getConnectors tags: - connectors @@ -186,7 +185,7 @@ paths: $ref: '#/components/responses/401' /api/actions/connector_types: get: - summary: Retrieves a list of all connector types. + summary: Get all connector types operationId: getConnectorTypes tags: - connectors @@ -211,43 +210,37 @@ paths: enabled: type: boolean description: Indicates whether the connector type is enabled in Kibana. - examples: - - true + example: true enabled_in_config: type: boolean description: Indicates whether the connector type is enabled in the Kibana configuration file. - examples: - - true + example: true enabled_in_license: type: boolean description: Indicates whether the connector is enabled in the license. - examples: - - true + example: true id: $ref: '#/components/schemas/connector_types' is_system_action_type: type: boolean - examples: - - false + example: false minimum_license_required: type: string description: The license that is required to use the connector type. - examples: - - basic + example: basic name: type: string description: The name of the connector type. - examples: - - Index + example: Index supported_feature_ids: type: array description: The features that are supported by the connector type. items: $ref: '#/components/schemas/features' - examples: - - - alerting - - cases - - siem + example: + - alerting + - cases + - siem examples: getConnectorTypesServerlessResponse: $ref: '#/components/examples/get_connector_types_generativeai_response' @@ -259,7 +252,8 @@ components: type: apiKey in: header name: Authorization - description: 'e.g. Authorization: ApiKey base64AccessApiKey' + description: | + Serverless APIs support only key-based authentication. You must create an API key and use the encoded value in the request header. For example: 'Authorization: ApiKey base64AccessApiKey'. parameters: kbn_xsrf: schema: @@ -275,8 +269,7 @@ components: required: true schema: type: string - examples: - - df770e30-8b8b-11ed-a780-3b746c987a81 + example: df770e30-8b8b-11ed-a780-3b746c987a81 schemas: create_connector_request_bedrock: title: Create Amazon Bedrock connector request @@ -295,13 +288,11 @@ components: description: The type of connector. enum: - .bedrock - examples: - - .bedrock + example: .bedrock name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_bedrock' create_connector_request_gemini: @@ -321,13 +312,11 @@ components: description: The type of connector. enum: - .gemini - examples: - - .gemini + example: .gemini name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_gemini' create_connector_request_cases_webhook: @@ -347,13 +336,11 @@ components: description: The type of connector. enum: - .cases-webhook - examples: - - .cases-webhook + example: .cases-webhook name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_cases_webhook' create_connector_request_d3security: @@ -374,13 +361,11 @@ components: description: The type of connector. enum: - .d3security - examples: - - .d3security + example: .d3security name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_d3security' create_connector_request_email: @@ -401,13 +386,11 @@ components: description: The type of connector. enum: - .email - examples: - - .email + example: .email name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_email' create_connector_request_genai: @@ -428,13 +411,11 @@ components: description: The type of connector. enum: - .gen-ai - examples: - - .gen-ai + example: .gen-ai name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_genai' create_connector_request_index: @@ -453,13 +434,11 @@ components: description: The type of connector. enum: - .index - examples: - - .index + example: .index name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector create_connector_request_jira: title: Create Jira connector request description: The Jira connector uses the REST API v2 to create Jira issues. @@ -477,13 +456,11 @@ components: description: The type of connector. enum: - .jira - examples: - - .jira + example: .jira name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_jira' create_connector_request_opsgenie: @@ -503,13 +480,11 @@ components: description: The type of connector. enum: - .opsgenie - examples: - - .opsgenie + example: .opsgenie name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_opsgenie' create_connector_request_pagerduty: @@ -530,13 +505,11 @@ components: description: The type of connector. enum: - .pagerduty - examples: - - .pagerduty + example: .pagerduty name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_pagerduty' create_connector_request_resilient: @@ -554,15 +527,13 @@ components: connector_type_id: description: The type of connector. type: string - examples: - - .resilient + example: .resilient enum: - .resilient name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_resilient' create_connector_request_sentinelone: @@ -584,13 +555,11 @@ components: description: The type of connector. enum: - .sentinelone - examples: - - .sentinelone + example: .sentinelone name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_sentinelone' create_connector_request_serverlog: @@ -606,13 +575,11 @@ components: description: The type of connector. enum: - .server-log - examples: - - .server-log + example: .server-log name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector create_connector_request_servicenow: title: Create ServiceNow ITSM connector request description: | @@ -631,13 +598,11 @@ components: description: The type of connector. enum: - .servicenow - examples: - - .servicenow + example: .servicenow name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_servicenow' create_connector_request_servicenow_itom: @@ -658,13 +623,11 @@ components: description: The type of connector. enum: - .servicenow-itom - examples: - - .servicenow-itom + example: .servicenow-itom name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_servicenow' create_connector_request_servicenow_sir: @@ -685,13 +648,11 @@ components: description: The type of connector. enum: - .servicenow-sir - examples: - - .servicenow-sir + example: .servicenow-sir name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_servicenow' create_connector_request_slack_api: @@ -710,13 +671,11 @@ components: description: The type of connector. enum: - .slack_api - examples: - - .slack_api + example: .slack_api name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_slack_api' create_connector_request_slack_webhook: @@ -733,13 +692,11 @@ components: description: The type of connector. enum: - .slack - examples: - - .slack + example: .slack name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_slack_webhook' create_connector_request_swimlane: @@ -759,13 +716,11 @@ components: description: The type of connector. enum: - .swimlane - examples: - - .swimlane + example: .swimlane name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_swimlane' create_connector_request_teams: @@ -782,13 +737,11 @@ components: description: The type of connector. enum: - .teams - examples: - - .teams + example: .teams name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_teams' create_connector_request_tines: @@ -809,13 +762,11 @@ components: description: The type of connector. enum: - .tines - examples: - - .tines + example: .tines name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_tines' create_connector_request_torq: @@ -836,13 +787,11 @@ components: description: The type of connector. enum: - .torq - examples: - - .torq + example: .torq name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_torq' create_connector_request_webhook: @@ -863,13 +812,11 @@ components: description: The type of connector. enum: - .webhook - examples: - - .webhook + example: .webhook name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_webhook' create_connector_request_xmatters: @@ -890,13 +837,11 @@ components: description: The type of connector. enum: - .xmatters - examples: - - .xmatters + example: .xmatters name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_xmatters' config_properties_bedrock: @@ -978,8 +923,7 @@ components: type: string description: | A JSON payload sent to the create comment URL to create a case comment. You can use variables to add Kibana Cases data to the payload. The required variable is `case.comment`. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - examples: - - '{"body": {{{case.comment}}}}' + example: '{"body": {{{case.comment}}}}' createCommentMethod: type: string description: | @@ -993,14 +937,12 @@ components: type: string description: | The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. - examples: - - https://example.com/issue/{{{external.system.id}}}/comment + example: https://example.com/issue/{{{external.system.id}}}/comment createIncidentJson: type: string description: | A JSON payload sent to the create case URL to create a case. You can use variables to add case data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - examples: - - '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' + example: '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' createIncidentMethod: type: string description: | @@ -1024,8 +966,7 @@ components: type: string description: | The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - examples: - - https://example.com/issue/{{{external.system.id}}} + example: https://example.com/issue/{{{external.system.id}}} hasAuth: type: boolean description: If true, a username and password for login type authentication must be provided. @@ -1038,8 +979,7 @@ components: type: string description: | The JSON payload sent to the update case URL to update the case. You can use variables to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - examples: - - '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' + example: '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' updateIncidentMethod: type: string description: | @@ -1053,14 +993,12 @@ components: type: string description: | The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - examples: - - https://example.com/issue/{{{external.system.ID}}} + example: https://example.com/issue/{{{external.system.ID}}} viewIncidentUrl: type: string description: | The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL. - examples: - - https://testing-jira.atlassian.net/browse/{{{external.system.title}}} + example: https://testing-jira.atlassian.net/browse/{{{external.system.title}}} secrets_properties_cases_webhook: title: Connector secrets properties for Webhook - Case Management connector type: object @@ -1102,9 +1040,8 @@ components: clientId: description: | The client identifier, which is a part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. - type: - - string - - 'null' + type: string + nullable: true from: description: | The from address for all emails sent by the connector. It must be specified in `user@host-name` format. @@ -1119,9 +1056,8 @@ components: The host name of the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. type: string oauthTokenUrl: - type: - - string - - 'null' + type: string + nullable: true port: description: | The port to connect to on the service provider. If the `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's well-known email service providers, this property is ignored. If `service` is `other`, this property must be defined. @@ -1144,9 +1080,8 @@ components: tenantId: description: | The tenant identifier, which is part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. - type: - - string - - 'null' + type: string + nullable: true secrets_properties_email: title: Connector secrets properties for an email connector description: Defines secrets for connectors when type is `.email`. @@ -1230,9 +1165,8 @@ components: executionTimeField: description: A field that indicates when the document was indexed. default: null - type: - - string - - 'null' + type: string + nullable: true index: description: The Elasticsearch index to be written to. type: string @@ -1297,11 +1231,9 @@ components: properties: apiUrl: description: The PagerDuty event URL. - type: - - string - - 'null' - examples: - - https://events.pagerduty.com/v2/enqueue + type: string + nullable: true + example: https://events.pagerduty.com/v2/enqueue secrets_properties_pagerduty: title: Connector secrets properties for a PagerDuty connector description: Defines secrets for connectors when type is `.pagerduty`. @@ -1737,10 +1669,10 @@ components: properties: authType: type: string + nullable: true enum: - webhook-authentication-basic - webhook-authentication-ssl - - 'null' description: | The type of authentication to use: basic, SSL, or none. ca: @@ -1759,9 +1691,8 @@ components: description: | If `true`, a user name and password must be provided for login type authentication. headers: - type: - - object - - 'null' + type: object + nullable: true description: A set of key-value pairs sent as headers with the request. method: type: string @@ -1814,9 +1745,8 @@ components: configUrl: description: | The request URL for the Elastic Alerts trigger in xMatters. It is applicable only when `usesBasic` is `true`. - type: - - string - - 'null' + type: string + nullable: true usesBasic: description: Specifies whether the connector uses HTTP basic authentication (`true`) or URL authentication (`false`). type: boolean @@ -2299,9 +2229,8 @@ components: - name properties: config: - type: - - object - - 'null' + type: object + nullable: true connector_type_id: type: string description: The type of connector. @@ -2687,30 +2616,25 @@ components: is_deprecated: type: boolean description: Indicates whether the connector type is deprecated. - examples: - - false + example: false is_missing_secrets: type: boolean description: Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. - examples: - - false + example: false is_preconfigured: type: boolean description: | Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. - examples: - - false + example: false is_system_action: type: boolean description: Indicates whether the connector is used for system actions. - examples: - - false + example: false referenced_by_count: type: integer description: | Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. This property is returned only by the get all connectors API. - examples: - - 2 + example: 2 connector_response_properties: title: Connector response properties description: The properties vary depending on the connector type. @@ -2806,8 +2730,7 @@ components: name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_cases_webhook' update_connector_request_d3security: @@ -3004,8 +2927,7 @@ components: name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: '#/components/schemas/secrets_properties_swimlane' update_connector_request_teams: @@ -3148,8 +3070,7 @@ components: - .torq - .webhook - .xmatters - examples: - - .server-log + example: .server-log examples: create_email_connector_request: summary: Create an email connector. @@ -3345,16 +3266,14 @@ components: properties: error: type: string - examples: - - Unauthorized + example: Unauthorized enum: - Unauthorized message: type: string statusCode: type: integer - examples: - - 401 + example: 401 enum: - 401 '404': @@ -3367,17 +3286,14 @@ components: properties: error: type: string - examples: - - Not Found + example: Not Found enum: - Not Found message: type: string - examples: - - Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found + example: Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found statusCode: type: integer - examples: - - 404 + example: 404 enum: - 404 diff --git a/x-pack/plugins/actions/docs/openapi/components/parameters/action_id.yaml b/x-pack/plugins/actions/docs/openapi/components/parameters/action_id.yaml index acbc6ab5acd63..3ee0b642c9dee 100644 --- a/x-pack/plugins/actions/docs/openapi/components/parameters/action_id.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/parameters/action_id.yaml @@ -4,5 +4,4 @@ description: An identifier for the action. required: true schema: type: string - examples: - - c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad + example: c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad diff --git a/x-pack/plugins/actions/docs/openapi/components/parameters/connector_id.yaml b/x-pack/plugins/actions/docs/openapi/components/parameters/connector_id.yaml index fdf1487e626a8..d98c2cec803ff 100644 --- a/x-pack/plugins/actions/docs/openapi/components/parameters/connector_id.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/parameters/connector_id.yaml @@ -4,5 +4,4 @@ description: An identifier for the connector. required: true schema: type: string - examples: - - df770e30-8b8b-11ed-a780-3b746c987a81 + example: df770e30-8b8b-11ed-a780-3b746c987a81 diff --git a/x-pack/plugins/actions/docs/openapi/components/parameters/space_id.yaml b/x-pack/plugins/actions/docs/openapi/components/parameters/space_id.yaml index 45787e844caec..0a9fba457e3e7 100644 --- a/x-pack/plugins/actions/docs/openapi/components/parameters/space_id.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/parameters/space_id.yaml @@ -4,5 +4,4 @@ description: An identifier for the space. If `/s/` and the identifier are omitte required: true schema: type: string - examples: - - default + example: default diff --git a/x-pack/plugins/actions/docs/openapi/components/responses/400.yaml b/x-pack/plugins/actions/docs/openapi/components/responses/400.yaml index 4f8890737ff40..263623dd1fb4c 100644 --- a/x-pack/plugins/actions/docs/openapi/components/responses/400.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/responses/400.yaml @@ -6,13 +6,10 @@ content: properties: error: type: string - examples: - - Bad Request + example: Bad Request message: type: string - examples: - - "error validating action type config: [index]: expected value of type [string] but got [undefined]" + example: "error validating action type config: [index]: expected value of type [string] but got [undefined]" statusCode: type: integer - examples: - - 400 \ No newline at end of file + example: 400 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/responses/401.yaml b/x-pack/plugins/actions/docs/openapi/components/responses/401.yaml index 78b77b3ab5f43..ff5cbfd4c2768 100644 --- a/x-pack/plugins/actions/docs/openapi/components/responses/401.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/responses/401.yaml @@ -7,15 +7,13 @@ content: properties: error: type: string - examples: - - Unauthorized + example: Unauthorized enum: - Unauthorized message: type: string statusCode: type: integer - examples: - - 401 + example: 401 enum: - 401 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/responses/404.yaml b/x-pack/plugins/actions/docs/openapi/components/responses/404.yaml index d4cf816f5903c..56964c6015c85 100644 --- a/x-pack/plugins/actions/docs/openapi/components/responses/404.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/responses/404.yaml @@ -7,17 +7,14 @@ content: properties: error: type: string - examples: - - Not Found + example: Not Found enum: - Not Found message: type: string - examples: - - "Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found" + example: "Saved object [action/baf33fc0-920c-11ed-b36a-874bd1548a00] not found" statusCode: type: integer - examples: - - 404 + example: 404 enum: - 404 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml index a452a1fdfd060..b2a1ea8848ba7 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml @@ -22,8 +22,7 @@ properties: connector. The JSON is validated once the Mustache variables have been placed when the REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - examples: - - '{"body": {{{case.comment}}}}' + example: '{"body": {{{case.comment}}}}' createCommentMethod: type: string description: > @@ -41,8 +40,7 @@ properties: You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. - examples: - - https://example.com/issue/{{{external.system.id}}}/comment + example: https://example.com/issue/{{{external.system.id}}}/comment createIncidentJson: type: string description: > @@ -54,8 +52,7 @@ properties: connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - examples: - - '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' + example: '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' createIncidentMethod: type: string description: > @@ -89,8 +86,7 @@ properties: variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. - examples: - - https://example.com/issue/{{{external.system.id}}} + example: https://example.com/issue/{{{external.system.id}}} hasAuth: type: boolean description: If true, a username and password for login type authentication must be provided. @@ -111,8 +107,7 @@ properties: connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. - examples: - - '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' + example: '{"fields": {"summary": {{{case.title}}},"description": {{{case.description}}},"labels": {{{case.tags}}}}}' updateIncidentMethod: type: string description: > @@ -129,14 +124,12 @@ properties: The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. - examples: - - https://example.com/issue/{{{external.system.ID}}} + example: https://example.com/issue/{{{external.system.ID}}} viewIncidentUrl: type: string description: > The URL to view the case in the external system. You can use variables to add the external system ID or external system title to the URL. - examples: - - https://testing-jira.atlassian.net/browse/{{{external.system.title}}} + example: https://testing-jira.atlassian.net/browse/{{{external.system.title}}} diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_email.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_email.yaml index 202f4022a6fbd..6d3618e2bba27 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_email.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_email.yaml @@ -8,9 +8,8 @@ properties: description: > The client identifier, which is a part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. - type: - - "string" - - "null" + type: string + nullable: true from: description: > The from address for all emails sent by the connector. It must be specified in `user@host-name` format. @@ -28,9 +27,8 @@ properties: type: string oauthTokenUrl: # description: TBD - type: - - "string" - - "null" + type: string + nullable: true port: description: > The port to connect to on the service provider. @@ -57,6 +55,5 @@ properties: description: > The tenant identifier, which is part of OAuth 2.0 client credentials authentication, in GUID format. If `service` is `exchange_server`, this property is required. - type: - - "string" - - "null" \ No newline at end of file + type: string + nullable: true \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_index.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_index.yaml index f6d3af59b4937..6c335b166d20a 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_index.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_index.yaml @@ -7,9 +7,8 @@ properties: executionTimeField: description: A field that indicates when the document was indexed. default: null - type: - - "string" - - "null" + type: string + nullable: true index: description: The Elasticsearch index to be written to. type: string diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_pagerduty.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_pagerduty.yaml index bfbec7b46190b..562557f548ece 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_pagerduty.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_pagerduty.yaml @@ -4,8 +4,6 @@ type: object properties: apiUrl: description: The PagerDuty event URL. - type: - - "string" - - "null" - examples: - - https://events.pagerduty.com/v2/enqueue \ No newline at end of file + type: string + nullable: true + example: https://events.pagerduty.com/v2/enqueue \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_webhook.yaml index 601d410666576..bf073419a4e09 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_webhook.yaml @@ -4,10 +4,10 @@ type: object properties: authType: type: string + nullable: true enum: - webhook-authentication-basic - webhook-authentication-ssl - - "null" description: > The type of authentication to use: basic, SSL, or none. ca: @@ -27,9 +27,8 @@ properties: description: > If `true`, a user name and password must be provided for login type authentication. headers: - type: - - "object" - - "null" + type: object + nullable: true description: A set of key-value pairs sent as headers with the request. method: type: string diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_xmatters.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_xmatters.yaml index 3393c11ecd90d..350e96f3aa63d 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_xmatters.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_xmatters.yaml @@ -6,9 +6,8 @@ properties: description: > The request URL for the Elastic Alerts trigger in xMatters. It is applicable only when `usesBasic` is `true`. - type: - - "string" - - "null" + type: string + nullable: true usesBasic: description: Specifies whether the connector uses HTTP basic authentication (`true`) or URL authentication (`false`). type: boolean diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_serverlog.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_serverlog.yaml index da741478864b4..a397e668102a6 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_serverlog.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_response_properties_serverlog.yaml @@ -8,9 +8,8 @@ required: - name properties: config: - type: - - "object" - - "null" + type: object + nullable: true connector_type_id: type: string description: The type of connector. diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml index f202efc087b00..db6262f04c010 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/connector_types.yaml @@ -26,5 +26,4 @@ enum: - .torq - .webhook - .xmatters -examples: - - .server-log \ No newline at end of file +example: .server-log \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml index e8feecb0051cd..2acc21bfbfac7 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_bedrock.yaml @@ -14,12 +14,10 @@ properties: description: The type of connector. enum: - .bedrock - examples: - - .bedrock + example: .bedrock name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_bedrock.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_cases_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_cases_webhook.yaml index 0cd030d740809..bcbe840c03513 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_cases_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_cases_webhook.yaml @@ -15,12 +15,10 @@ properties: description: The type of connector. enum: - .cases-webhook - examples: - - .cases-webhook + example: .cases-webhook name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_cases_webhook.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_d3security.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_d3security.yaml index 6b5389cc80f31..39cdda80b7dd2 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_d3security.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_d3security.yaml @@ -15,12 +15,10 @@ properties: description: The type of connector. enum: - .d3security - examples: - - .d3security + example: .d3security name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_d3security.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_email.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_email.yaml index 1f1c6c079770a..89f0b79c4e74b 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_email.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_email.yaml @@ -18,12 +18,10 @@ properties: description: The type of connector. enum: - .email - examples: - - .email + example: .email name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_email.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_gemini.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_gemini.yaml index b9f4a651003c0..5b9cc31ae3787 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_gemini.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_gemini.yaml @@ -14,12 +14,10 @@ properties: description: The type of connector. enum: - .gemini - examples: - - .gemini + example: .gemini name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_gemini.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml index 725f842f91093..95d65bdb80919 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_genai.yaml @@ -16,12 +16,10 @@ properties: description: The type of connector. enum: - .gen-ai - examples: - - .gen-ai + example: .gen-ai name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_genai.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_index.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_index.yaml index ad8e9be9a41dc..26d6e118c1fe8 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_index.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_index.yaml @@ -13,10 +13,8 @@ properties: description: The type of connector. enum: - .index - examples: - - .index + example: .index name: type: string description: The display name for the connector. - examples: - - my-connector \ No newline at end of file + example: my-connector \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_jira.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_jira.yaml index 95ccaa5b2ec6f..5b6077e875b24 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_jira.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_jira.yaml @@ -14,12 +14,10 @@ properties: description: The type of connector. enum: - .jira - examples: - - .jira + example: .jira name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_jira.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_opsgenie.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_opsgenie.yaml index 51c29f5cdd8fd..6de1296dac43c 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_opsgenie.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_opsgenie.yaml @@ -14,12 +14,10 @@ properties: description: The type of connector. enum: - .opsgenie - examples: - - .opsgenie + example: .opsgenie name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_opsgenie.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_pagerduty.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_pagerduty.yaml index 66ffc61d30f30..498488299afd3 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_pagerduty.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_pagerduty.yaml @@ -16,12 +16,10 @@ properties: description: The type of connector. enum: - .pagerduty - examples: - - .pagerduty + example: .pagerduty name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_pagerduty.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_resilient.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_resilient.yaml index 60467336c0d9a..c3f766625b7da 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_resilient.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_resilient.yaml @@ -12,14 +12,12 @@ properties: connector_type_id: description: The type of connector. type: string - examples: - - .resilient + example: .resilient enum: - .resilient name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_resilient.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_sentinelone.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_sentinelone.yaml index d741f9b35af35..0d2809f24d78b 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_sentinelone.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_sentinelone.yaml @@ -18,12 +18,10 @@ properties: description: The type of connector. enum: - .sentinelone - examples: - - .sentinelone + example: .sentinelone name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_sentinelone.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_serverlog.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_serverlog.yaml index 0cb85403663c6..eac0a0d65b69f 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_serverlog.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_serverlog.yaml @@ -10,10 +10,8 @@ properties: description: The type of connector. enum: - .server-log - examples: - - .server-log + example: .server-log name: type: string description: The display name for the connector. - examples: - - my-connector \ No newline at end of file + example: my-connector \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow.yaml index b0f35483cc39f..e03303dcada4f 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow.yaml @@ -16,12 +16,10 @@ properties: description: The type of connector. enum: - .servicenow - examples: - - .servicenow + example: .servicenow name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_servicenow.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_itom.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_itom.yaml index bfbeb231ca7dc..70a4c05c96522 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_itom.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_itom.yaml @@ -16,12 +16,10 @@ properties: description: The type of connector. enum: - .servicenow-itom - examples: - - .servicenow-itom + example: .servicenow-itom name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_servicenow.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_sir.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_sir.yaml index 37519eb63f27b..4d247c456f3e6 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_sir.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_servicenow_sir.yaml @@ -16,12 +16,10 @@ properties: description: The type of connector. enum: - .servicenow-sir - examples: - - .servicenow-sir + example: .servicenow-sir name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_servicenow.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml index 2044087fba78c..3870f418606a2 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_api.yaml @@ -13,12 +13,10 @@ properties: description: The type of connector. enum: - .slack_api - examples: - - .slack_api + example: .slack_api name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_slack_api.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml index 3e884daa6e3b8..1c046cc3f000c 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_slack_webhook.yaml @@ -11,12 +11,10 @@ properties: description: The type of connector. enum: - .slack - examples: - - .slack + example: .slack name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_slack_webhook.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_swimlane.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_swimlane.yaml index 633438a721ee9..3de4f5ecbccef 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_swimlane.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_swimlane.yaml @@ -14,12 +14,10 @@ properties: description: The type of connector. enum: - .swimlane - examples: - - .swimlane + example: .swimlane name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_swimlane.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_teams.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_teams.yaml index 787f057c09ce6..5e0d449bf5546 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_teams.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_teams.yaml @@ -11,12 +11,10 @@ properties: description: The type of connector. enum: - .teams - examples: - - .teams + example: .teams name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_teams.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_tines.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_tines.yaml index c5333c8acc479..224c3e03c4363 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_tines.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_tines.yaml @@ -15,12 +15,10 @@ properties: description: The type of connector. enum: - .tines - examples: - - .tines + example: .tines name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_tines.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_torq.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_torq.yaml index a4ab3cc92aa0d..934f9c9c1b395 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_torq.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_torq.yaml @@ -15,12 +15,10 @@ properties: description: The type of connector. enum: - .torq - examples: - - .torq + example: .torq name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_torq.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_webhook.yaml index 30e9663da8d99..e0ead115d48dc 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_webhook.yaml @@ -15,12 +15,10 @@ properties: description: The type of connector. enum: - .webhook - examples: - - .webhook + example: .webhook name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_webhook.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_xmatters.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_xmatters.yaml index 753888b16ae5e..13213d39561b2 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_xmatters.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/create_connector_request_xmatters.yaml @@ -16,12 +16,10 @@ properties: description: The type of connector. enum: - .xmatters - examples: - - .xmatters + example: .xmatters name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_xmatters.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/is_deprecated.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/is_deprecated.yaml index ac0a26102eed1..75fb1efe2f589 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/is_deprecated.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/is_deprecated.yaml @@ -1,4 +1,3 @@ type: boolean description: Indicates whether the connector type is deprecated. -examples: - - false \ No newline at end of file +example: false \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/is_missing_secrets.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/is_missing_secrets.yaml index a7ad3f9542b3f..cad03a44f8629 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/is_missing_secrets.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/is_missing_secrets.yaml @@ -1,4 +1,3 @@ type: boolean description: Indicates whether secrets are missing for the connector. Secrets configuration properties vary depending on the connector type. -examples: - - false \ No newline at end of file +example: false \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/is_preconfigured.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/is_preconfigured.yaml index d3f711c229399..e38741c83718e 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/is_preconfigured.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/is_preconfigured.yaml @@ -2,5 +2,4 @@ type: boolean description: > Indicates whether it is a preconfigured connector. If true, the `config` and `is_missing_secrets` properties are omitted from the response. -examples: - - false \ No newline at end of file +example: false \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/is_system_action.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/is_system_action.yaml index 5a78f4676646f..fd0dd06ef5fff 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/is_system_action.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/is_system_action.yaml @@ -1,4 +1,3 @@ type: boolean description: Indicates whether the connector is used for system actions. -examples: - - false \ No newline at end of file +example: false \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/referenced_by_count.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/referenced_by_count.yaml index 0a65bf9a854ff..61579fa3dc6ce 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/referenced_by_count.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/referenced_by_count.yaml @@ -3,5 +3,4 @@ description: > Indicates the number of saved objects that reference the connector. If `is_preconfigured` is true, this value is not calculated. This property is returned only by the get all connectors API. -examples: - - 2 \ No newline at end of file +example: 2 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_params_trigger_pagerduty.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_params_trigger_pagerduty.yaml index 75a59af156264..71410725cbeae 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_params_trigger_pagerduty.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_params_trigger_pagerduty.yaml @@ -7,13 +7,11 @@ properties: class: description: The class or type of the event. type: string - examples: - - cpu load + example: cpu load component: description: The component of the source machine that is responsible for the event. type: string - examples: - - eth0 + example: eth0 customDetails: description: Additional details to add to the event. type: object @@ -31,8 +29,7 @@ properties: group: description: The logical grouping of components of a service. type: string - examples: - - app-stack + example: app-stack links: description: A list of links to add to the event. type: array diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_closeincident.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_closeincident.yaml index a53c4f90b226e..82f9a97a60412 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_closeincident.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_closeincident.yaml @@ -22,13 +22,15 @@ properties: - required: [externalId] properties: correlation_id: - type: ['null', string] + type: string + nullable: true description: > An identifier that is assigned to the incident when it is created by the connector. NOTE: If you use the default value and the rule generates multiple alerts that use the same alert IDs, the latest open incident for this correlation ID is closed unless you specify the external ID. maxLength: 100 default: '{{rule.id}}:{{alert.id}}' externalId: - type: ['null', string] + type: string + nullable: true description: The unique identifier (`incidentId`) for the incident in ServiceNow. \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_createalert.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_createalert.yaml index a53560951361f..e739a9ed6c91d 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_createalert.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_createalert.yaml @@ -30,8 +30,7 @@ properties: type: object description: The custom properties of the alert. additionalProperties: true - examples: - - {"key1":"value1","key2":"value2"} + example: {"key1":"value1","key2":"value2"} entity: type: string description: The domain of the alert. For example, the application or server name. diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_fieldsbyissuetype.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_fieldsbyissuetype.yaml index 6c39957c29fc4..e8c8869e7d68b 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_fieldsbyissuetype.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_fieldsbyissuetype.yaml @@ -18,6 +18,5 @@ properties: id: type: string description: The Jira issue type identifier. - examples: - - 10024 + example: 10024 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_getincident.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_getincident.yaml index 7a16f3d9f8295..666c0257f68b8 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_getincident.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_getincident.yaml @@ -18,5 +18,4 @@ properties: externalId: type: string description: The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. - examples: - - 71778 + example: 71778 diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_issue.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_issue.yaml index 3743e7fa90bd3..56ee923b40063 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_issue.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_issue.yaml @@ -17,5 +17,4 @@ properties: id: type: string description: The Jira issue identifier. - examples: - - 71778 \ No newline at end of file + example: 71778 \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_cases_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_cases_webhook.yaml index 9201a1b1e1d70..66250b31a94eb 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_cases_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_cases_webhook.yaml @@ -9,7 +9,6 @@ properties: name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_cases_webhook.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_swimlane.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_swimlane.yaml index 771625841a042..81321351b74ec 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_swimlane.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/update_connector_request_swimlane.yaml @@ -10,7 +10,6 @@ properties: name: type: string description: The display name for the connector. - examples: - - my-connector + example: my-connector secrets: $ref: 'secrets_properties_swimlane.yaml' \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/entrypoint.yaml b/x-pack/plugins/actions/docs/openapi/entrypoint.yaml index d082d91a2a4e5..ba61b00c3c737 100644 --- a/x-pack/plugins/actions/docs/openapi/entrypoint.yaml +++ b/x-pack/plugins/actions/docs/openapi/entrypoint.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.3 info: title: Connectors description: OpenAPI schema for Connectors endpoints @@ -14,16 +14,6 @@ tags: servers: - url: / paths: - '/api/actions/connector': - $ref: 'paths/api@actions@connector.yaml' - '/api/actions/connector/{connectorId}': - $ref: 'paths/api@actions@connector@{connectorid}.yaml' - '/api/actions/connector/{connectorId}/_execute': - $ref: paths/api@actions@connector@{connectorid}@_execute.yaml - '/api/actions/connectors': - $ref: paths/api@actions@connectors.yaml - '/api/actions/connector_types': - $ref: paths/api@actions@connector_types.yaml '/s/{spaceId}/api/actions/connector': $ref: 'paths/s@{spaceid}@api@actions@connector.yaml' '/s/{spaceId}/api/actions/connector/{connectorId}': @@ -34,6 +24,17 @@ paths: $ref: paths/s@{spaceid}@api@actions@connector_types.yaml '/s/{spaceId}/api/actions/connector/{connectorId}/_execute': $ref: paths/s@{spaceid}@api@actions@connector@{connectorid}@_execute.yaml +# Default space + '/api/actions/connector': + $ref: 'paths/api@actions@connector.yaml' + '/api/actions/connector/{connectorId}': + $ref: 'paths/api@actions@connector@{connectorid}.yaml' + '/api/actions/connector/{connectorId}/_execute': + $ref: paths/api@actions@connector@{connectorid}@_execute.yaml + '/api/actions/connectors': + $ref: paths/api@actions@connectors.yaml + '/api/actions/connector_types': + $ref: paths/api@actions@connector_types.yaml # Deprecated endpoints: '/s/{spaceId}/api/actions/action/{actionId}': $ref: 'paths/s@{spaceid}@api@actions@action@{actionid}.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/entrypoint_serverless.yaml b/x-pack/plugins/actions/docs/openapi/entrypoint_serverless.yaml index 4780a65da6520..60cca6f18bc44 100644 --- a/x-pack/plugins/actions/docs/openapi/entrypoint_serverless.yaml +++ b/x-pack/plugins/actions/docs/openapi/entrypoint_serverless.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.3 info: title: Connectors description: OpenAPI schema for connectors in Serverless projects @@ -31,6 +31,9 @@ components: type: apiKey in: header name: Authorization - description: 'e.g. Authorization: ApiKey base64AccessApiKey' + description: > + Serverless APIs support only key-based authentication. + You must create an API key and use the encoded value in the request header. + For example: 'Authorization: ApiKey base64AccessApiKey'. security: - apiKeyAuth: [] diff --git a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector.yaml b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector.yaml index c6634bb6ea532..5f82202bed534 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector.yaml @@ -1,5 +1,5 @@ post: - summary: Creates a connector. + summary: Create a connector operationId: createConnector tags: - connectors diff --git a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}.yaml b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}.yaml index 6464b9592436a..c9b4c269e6cc2 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves a connector by ID. + summary: Get a connector information operationId: getConnector tags: - connectors @@ -21,7 +21,7 @@ get: $ref: '../components/responses/404.yaml' delete: - summary: Deletes a connector. + summary: Delete a connector operationId: deleteConnector tags: - connectors @@ -37,7 +37,7 @@ delete: $ref: '../components/responses/404.yaml' post: - summary: Creates a connector. + summary: Create a connector operationId: createConnectorId tags: - connectors @@ -51,8 +51,7 @@ post: required: true schema: type: string - examples: - - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 requestBody: required: true content: @@ -76,7 +75,7 @@ post: $ref: '../components/responses/401.yaml' put: - summary: Updates the attributes for a connector. + summary: Update a connector operationId: updateConnector tags: - connectors diff --git a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml index 6d4de54cda3bc..93037c6d21779 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml @@ -1,5 +1,5 @@ post: - summary: Runs a connector. + summary: Run a connector operationId: runConnector description: > You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. diff --git a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector_types.yaml b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector_types.yaml index 94dbb727eea4a..3284d79cd9a49 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector_types.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector_types.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves a list of all connector types. + summary: Get all connector types operationId: getConnectorTypes tags: - connectors @@ -24,41 +24,34 @@ get: enabled: type: boolean description: Indicates whether the connector type is enabled in Kibana. - examples: - - true + example: true enabled_in_config: type: boolean description: Indicates whether the connector type is enabled in the Kibana configuration file. - examples: - - true + example: true enabled_in_license: type: boolean description: Indicates whether the connector is enabled in the license. - examples: - - true + example: true id: $ref: '../components/schemas/connector_types.yaml' is_system_action_type: type: boolean - examples: - - false + example: false minimum_license_required: type: string description: The license that is required to use the connector type. - examples: - - basic + example: basic name: type: string description: The name of the connector type. - examples: - - Index + example: Index supported_feature_ids: type: array description: The features that are supported by the connector type. items: $ref: '../components/schemas/features.yaml' - examples: - - [alerting, cases, siem] + example: [alerting, cases, siem] examples: getConnectorTypesServerlessResponse: $ref: '../components/examples/get_connector_types_generativeai_response.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connectors.yaml b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connectors.yaml index 82b83651644e7..b94954173e22e 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connectors.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connectors.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves all connectors. + summary: Get all connectors operationId: getConnectors tags: - connectors diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions.yaml index aad5ca61ac3be..94aa1f5c420a1 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves all connectors. + summary: Get all connectors operationId: legacyGetConnectors deprecated: true description: Deprecated in 7.13.0. Use the get all connectors API instead. @@ -20,7 +20,7 @@ get: $ref: '../components/responses/401.yaml' post: - summary: Creates a connector. + summary: Create a connector operationId: legacyCreateConnector deprecated: true description: Deprecated in 7.13.0. Use the create connector API instead. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}.yaml index dcf7a2759a35a..f2a5f62516aba 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}.yaml @@ -1,5 +1,5 @@ delete: - summary: Deletes a connector. + summary: Delete a connector operationId: legacyDeleteConnector deprecated: true description: > @@ -18,7 +18,7 @@ delete: $ref: '../components/responses/401.yaml' get: - summary: Retrieves a connector by ID. + summary: Get connector information operationId: legacyGetConnector description: Deprecated in 7.13.0. Use the get connector API instead. deprecated: true @@ -34,7 +34,7 @@ get: $ref: '../components/responses/401.yaml' put: - summary: Updates the attributes for a connector. + summary: Update a connector operationId: legacyUpdateConnector deprecated: true description: Deprecated in 7.13.0. Use the update connector API instead. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}@_execute.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}@_execute.yaml index 9fe5cedda84de..1d1db3f341e52 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}@_execute.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@action@{actionid}@_execute.yaml @@ -1,5 +1,5 @@ post: - summary: Runs a connector. + summary: Run a connector operationId: legacyRunConnector deprecated: true description: Deprecated in 7.13.0. Use the run connector API instead. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml index f116a699ed868..749647e8b9ce5 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector.yaml @@ -1,5 +1,5 @@ post: - summary: Creates a connector. + summary: Create a connector operationId: createConnectorWithSpaceId description: > You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml index 27351f0954eee..d4511a486c0e1 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves a connector by ID. + summary: Get connector information operationId: getConnectorWithSpaceId description: > You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. @@ -24,7 +24,7 @@ get: $ref: '../components/responses/404.yaml' delete: - summary: Deletes a connector. + summary: Delete a connector operationId: deleteConnectorWithSpaceId description: > You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. @@ -44,7 +44,7 @@ delete: $ref: '../components/responses/404.yaml' post: - summary: Creates a connector. + summary: Create a connector operationId: createConnectorIdWithSpaceId description: > You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. @@ -59,8 +59,7 @@ post: required: true schema: type: string - examples: - - ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 + example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 requestBody: required: true content: @@ -84,7 +83,7 @@ post: $ref: '../components/responses/401.yaml' put: - summary: Updates the attributes for a connector. + summary: Update a connector operationId: updateConnectorWithSpaceId description: > You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}@_execute.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}@_execute.yaml index 507194f31c380..76a30f54bab80 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}@_execute.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector@{connectorid}@_execute.yaml @@ -1,5 +1,5 @@ post: - summary: Runs a connector. + summary: Run a connector operationId: runConnectorWithSpaceId description: > You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector_types.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector_types.yaml index 9a0fababdf166..88fbc1612e507 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector_types.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connector_types.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves a list of all connector types. + summary: Get all connector types operationId: getConnectorTypesWithSpaceId description: > You do not need any Kibana feature privileges to run this API. @@ -27,37 +27,31 @@ get: enabled: type: boolean description: Indicates whether the connector type is enabled in Kibana. - examples: - - true + example: true enabled_in_config: type: boolean description: Indicates whether the connector type is enabled in the Kibana `.yml` file. - examples: - - true + example: true enabled_in_license: type: boolean description: Indicates whether the connector is enabled in the license. - examples: - - true + example: true id: $ref: '../components/schemas/connector_types.yaml' minimum_license_required: type: string description: The license that is required to use the connector type. - examples: - - basic + example: basic name: type: string description: The name of the connector type. - examples: - - Index + example: Index supported_feature_ids: type: array description: The Kibana features that are supported by the connector type. items: $ref: '../components/schemas/features.yaml' - examples: - - [alerting, uptime, siem] + example: [alerting, uptime, siem] examples: getConnectorTypesResponse: $ref: '../components/examples/get_connector_types_response.yaml' diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connectors.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connectors.yaml index 7670187845710..3913919998e98 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connectors.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@connectors.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves all connectors. + summary: Get all connectors operationId: getConnectorsWithSpaceId description: > You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. diff --git a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@list_action_types.yaml b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@list_action_types.yaml index 6bc2b9e5e53a8..daea4ed5219eb 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@list_action_types.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/s@{spaceid}@api@actions@list_action_types.yaml @@ -1,5 +1,5 @@ get: - summary: Retrieves a list of all connector types. + summary: Get connector types operationId: legacyGetConnectorTypes deprecated: true description: Deprecated in 7.13.0. Use the get all connector types API instead. @@ -28,8 +28,7 @@ get: enabledInLicense: type: boolean description: Indicates whether the connector is enabled in the license. - examples: - - true + example: true id: type: string description: The unique identifier for the connector type. diff --git a/x-pack/plugins/cloud_security_posture/jest.config.js b/x-pack/plugins/cloud_security_posture/jest.config.js index eb1e880646e56..82ecbd0c85592 100644 --- a/x-pack/plugins/cloud_security_posture/jest.config.js +++ b/x-pack/plugins/cloud_security_posture/jest.config.js @@ -15,4 +15,13 @@ module.exports = { collectCoverageFrom: [ '/x-pack/plugins/cloud_security_posture/{common,public,server}/**/*.{ts,tsx}', ], + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + transformIgnorePatterns: [ + // ignore all node_modules except the modules below (monaco-editor, monaco-yaml, react-monaco-editor, etc) which requires babel transforms to handle dynamic import() + // since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842) + '[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|react-monaco-editor|d3-interpolate|d3-color|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|msw|@bundled-es-modules))[/\\\\].+\\.js$', + 'packages/kbn-pm/dist/index.js', + '[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain))/dist/[/\\\\].+\\.js$', + '[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain))/dist/util/[/\\\\].+\\.js$', + ], }; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx b/x-pack/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx index 963d9bfae9834..cbfd64b8e60a8 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx @@ -5,23 +5,21 @@ * 2.0. */ -import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../hooks/use_kibana'; const LICENSE_MANAGEMENT_LOCATOR = 'LICENSE_MANAGEMENT_LOCATOR'; -const getLicenseManagementLocatorKey = 'license_management_url_key'; - +/** + * Hook to get the license management locator + * @returns a callback to navigate to the license management page + */ export const useLicenseManagementLocatorApi = () => { const { share } = useKibana().services; - return useQuery([getLicenseManagementLocatorKey], () => { - const locator = share.url.locators.get(LICENSE_MANAGEMENT_LOCATOR); - // license management does not exist on serverless - if (!locator) return; + const locator = share.url.locators.get(LICENSE_MANAGEMENT_LOCATOR); + + // license management does not exist on serverless + if (!locator) return; - return locator.getUrl({ - page: 'dashboard', - }); - }); + return () => locator.navigate({ page: 'dashboard' }); }; diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx index f2e538194a2fa..05fedd4d8adec 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx @@ -43,12 +43,7 @@ describe('', () => { }) ); - (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: true, - }) - ); + (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(undefined); }); const renderCloudPosturePage = ( @@ -85,7 +80,10 @@ describe('', () => { }) ); + (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(() => 'http://license-url'); + renderCloudPosturePage(); + expect(screen.getByTestId('has_locator')).toBeInTheDocument(); }); @@ -97,12 +95,7 @@ describe('', () => { }) ); - (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: undefined, - }) - ); + (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(undefined); renderCloudPosturePage(); expect(screen.getByTestId('no_locator')).toBeInTheDocument(); diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx index bfcaf85cfc457..b2f1d892da907 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx @@ -15,7 +15,6 @@ import { SubscriptionNotAllowed } from './subscription_not_allowed'; import { useSubscriptionStatus } from '../common/hooks/use_subscription_status'; import { FullSizeCenteredPage } from './full_size_centered_page'; import { CspLoadingState } from './csp_loading_state'; -import { useLicenseManagementLocatorApi } from '../common/api/use_license_management_locator_api'; export const LOADING_STATE_TEST_SUBJECT = 'cloud_posture_page_loading'; export const ERROR_STATE_TEST_SUBJECT = 'cloud_posture_page_error'; @@ -151,9 +150,9 @@ export const defaultNoDataRenderer = () => ( ); -const subscriptionNotAllowedRenderer = (licenseManagementLocator?: string) => ( +const subscriptionNotAllowedRenderer = () => ( - + ); @@ -173,19 +172,18 @@ export const CloudPosturePage = ({ noDataRenderer = defaultNoDataRenderer, }: CloudPosturePageProps) => { const subscriptionStatus = useSubscriptionStatus(); - const getLicenseManagementLocator = useLicenseManagementLocatorApi(); const render = () => { if (subscriptionStatus.isError) { return defaultErrorRenderer(subscriptionStatus.error); } - if (subscriptionStatus.isLoading || getLicenseManagementLocator.isLoading) { + if (subscriptionStatus.isLoading) { return defaultLoadingRenderer(); } if (!subscriptionStatus.data) { - return subscriptionNotAllowedRenderer(getLicenseManagementLocator.data); + return subscriptionNotAllowedRenderer(); } if (!query) { diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states.test.tsx deleted file mode 100644 index 840aad9af2e94..0000000000000 --- a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states.test.tsx +++ /dev/null @@ -1,245 +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 React from 'react'; -import { render } from '@testing-library/react'; -import { createReactQueryResponse } from '../test/fixtures/react_query'; -import { TestProvider } from '../test/test_provider'; -import { NoFindingsStates } from './no_findings_states'; -import { useCspSetupStatusApi } from '../common/api/use_setup_status_api'; -import { useCspIntegrationLink } from '../common/navigation/use_csp_integration_link'; -import { useLicenseManagementLocatorApi } from '../common/api/use_license_management_locator_api'; -import { useSubscriptionStatus } from '../common/hooks/use_subscription_status'; - -jest.mock('../common/api/use_setup_status_api', () => ({ - useCspSetupStatusApi: jest.fn(), -})); - -jest.mock('../common/navigation/use_csp_integration_link', () => ({ - useCspIntegrationLink: jest.fn(), -})); - -jest.mock('../common/api/use_license_management_locator_api', () => ({ - useLicenseManagementLocatorApi: jest.fn(), -})); - -jest.mock('../common/hooks/use_subscription_status', () => ({ - useSubscriptionStatus: jest.fn(), -})); - -const customRederer = (postureType: 'cspm' | 'kspm') => { - return render( - - - - ); -}; - -describe('NoFindingsStates', () => { - beforeEach(() => { - jest.clearAllMocks(); - - (useSubscriptionStatus as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: true, - }) - ); - - (useLicenseManagementLocatorApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: true, - }) - ); - - (useCspIntegrationLink as jest.Mock).mockReturnValue('http://cspm-or-kspm-integration-link'); - }); - - it('should show the indexing notification when CSPM is not installed and KSPM is indexing', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - cspm: { - status: 'not-deployed', - }, - kspm: { - status: 'indexing', - }, - indicesDetails: [ - { index: 'logs-cloud_security_posture.findings_latest-default', status: 'empty' }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'empty' }, - ], - }, - }) - ); - - const { getByText } = customRederer('kspm'); - expect(getByText(/posture evaluation underway/i)).toBeInTheDocument(); - expect( - getByText( - /waiting for data to be collected and indexed. check back later to see your findings/i - ) - ).toBeInTheDocument(); - }); - - it('should show the indexing notification when KSPM is not installed and CSPM is indexing', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - kspm: { - status: 'not-deployed', - }, - cspm: { - status: 'indexing', - }, - indicesDetails: [ - { index: 'logs-cloud_security_posture.findings_latest-default', status: 'empty' }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'empty' }, - ], - }, - }) - ); - - const { getByText } = customRederer('cspm'); - expect(getByText(/posture evaluation underway/i)).toBeInTheDocument(); - expect( - getByText( - /waiting for data to be collected and indexed. Check back later to see your findings/i - ) - ).toBeInTheDocument(); - }); - - it('should show the indexing timout notification when CSPM is status is index-timeout', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - kspm: { - status: 'installed', - }, - cspm: { - status: 'index-timeout', - }, - indicesDetails: [ - { index: 'logs-cloud_security_posture.findings_latest-default', status: 'empty' }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'empty' }, - ], - }, - }) - ); - - const { getByText } = customRederer('cspm'); - expect(getByText(/waiting for findings data/i)).toBeInTheDocument(); - const indexTimeOutMessage = getByText(/collecting findings is taking longer than expected/i); - expect(indexTimeOutMessage).toBeInTheDocument(); - }); - - it('should show the indexing timout notification when KSPM is status is index-timeout', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - kspm: { - status: 'index-timeout', - }, - cspm: { - status: 'installed', - }, - indicesDetails: [ - { index: 'logs-cloud_security_posture.findings_latest-default', status: 'empty' }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'empty' }, - ], - }, - }) - ); - - const { getByText } = customRederer('kspm'); - expect(getByText(/waiting for findings data/i)).toBeInTheDocument(); - expect(getByText(/collecting findings is taking longer than expected/i)).toBeInTheDocument(); - }); - - it('should show the unprivileged notification when CSPM is status is index-timeout', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - kspm: { - status: 'installed', - }, - cspm: { - status: 'unprivileged', - }, - indicesDetails: [ - { - index: 'logs-cloud_security_posture.findings_latest-default', - status: 'unprivileged', - }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'unprivileged' }, - ], - }, - }) - ); - - const { getByText } = customRederer('cspm'); - expect(getByText(/privileges required/i)).toBeInTheDocument(); - }); - - it('should show the unprivileged notification when KSPM is status is index-timeout', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - kspm: { - status: 'unprivileged', - }, - cspm: { - status: 'installed', - }, - indicesDetails: [ - { - index: 'logs-cloud_security_posture.findings_latest-default', - status: 'unprivileged', - }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'unprivileged' }, - ], - }, - }) - ); - - const { getByText } = customRederer('kspm'); - expect(getByText(/privileges required/i)).toBeInTheDocument(); - }); - - it('should show the not-installed notification when CSPM and KSPM status is not-installed', async () => { - (useCspSetupStatusApi as jest.Mock).mockImplementation(() => - createReactQueryResponse({ - status: 'success', - data: { - kspm: { - status: 'not-installed', - }, - cspm: { - status: 'not-installed', - }, - indicesDetails: [ - { - index: 'logs-cloud_security_posture.findings_latest-default', - status: 'success', - }, - { index: 'logs-cloud_security_posture.findings-default*', status: 'success' }, - ], - }, - }) - ); - - const { getByText } = customRederer('cspm'); - expect(getByText(/learn more about cloud security posture/i)).toBeInTheDocument(); - }); -}); diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/index.ts b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/index.ts new file mode 100644 index 0000000000000..e136062ed2ccb --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export * from './no_findings_states'; diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.handlers.mock.ts b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.handlers.mock.ts new file mode 100644 index 0000000000000..904083ca86f5c --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.handlers.mock.ts @@ -0,0 +1,20 @@ +/* + * 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 { http, HttpResponse } from 'msw'; + +export const fleetCspPackageHandler = http.get( + `/api/fleet/epm/packages/cloud_security_posture`, + () => { + return HttpResponse.json({ + item: { + name: 'cloud_security_posture', + version: '1.9.0', + }, + }); + } +); diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx new file mode 100644 index 0000000000000..ad3e482f614f5 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx @@ -0,0 +1,163 @@ +/* + * 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 React from 'react'; +import { screen, waitFor } from '@testing-library/react'; +import { setupMockServer, startMockServer } from '../../test/mock_server/mock_server'; +import { renderWrapper } from '../../test/mock_server/mock_server_test_provider'; +import { NoFindingsStates } from './no_findings_states'; +import * as statusHandlers from '../../../server/routes/status/status.handlers.mock'; +import * as benchmarksHandlers from '../../../server/routes/benchmarks/benchmarks.handlers.mock'; +import { fleetCspPackageHandler } from './no_findings_states.handlers.mock'; + +const server = setupMockServer(); + +const renderNoFindingsStates = (postureType: 'cspm' | 'kspm' = 'cspm') => { + return renderWrapper(); +}; + +describe('NoFindingsStates', () => { + startMockServer(server); + + beforeEach(() => { + server.use(fleetCspPackageHandler); + }); + + it('shows integrations installation prompt with installation links when integration is not-installed', async () => { + server.use(statusHandlers.notInstalledHandler); + renderNoFindingsStates(); + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + + await waitFor(() => { + expect( + screen.getByText(/detect security misconfigurations in your cloud infrastructure!/i) + ).toBeInTheDocument(); + }); + + await waitFor(() => { + expect(screen.getByRole('link', { name: /add cspm integration/i })).toHaveAttribute( + 'href', + '/app/fleet/integrations/cloud_security_posture-1.9.0/add-integration/cspm' + ); + }); + + await waitFor(() => { + expect(screen.getByRole('link', { name: /add kspm integration/i })).toHaveAttribute( + 'href', + '/app/fleet/integrations/cloud_security_posture-1.9.0/add-integration/kspm' + ); + }); + }); + it('shows install agent prompt with install agent link when status is not-deployed', async () => { + server.use(statusHandlers.notDeployedHandler); + server.use(benchmarksHandlers.cspmInstalledHandler); + renderNoFindingsStates(); + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + + await waitFor(() => { + expect(screen.getByText(/no agents installed/i)).toBeInTheDocument(); + }); + + await waitFor(() => { + expect(screen.getByRole('link', { name: /install agent/i })).toHaveAttribute( + 'href', + '/app/integrations/detail/cloud_security_posture-1.9.0/policies?addAgentToPolicyId=30cba674-531c-4225-b392-3f7810957511&integration=630f3e42-659e-4499-9007-61e36adf1d97' + ); + }); + }); + it('shows install agent prompt with install agent link when status is not-deployed and postureType is KSPM', async () => { + server.use(statusHandlers.notDeployedHandler); + server.use(benchmarksHandlers.kspmInstalledHandler); + renderNoFindingsStates('kspm'); + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + + await waitFor(() => { + expect(screen.getByText(/no agents installed/i)).toBeInTheDocument(); + }); + + await waitFor(() => { + const link = screen.getByRole('link', { + name: /install agent/i, + }); + expect(link).toHaveAttribute( + 'href', + '/app/integrations/detail/cloud_security_posture-1.9.0/policies?addAgentToPolicyId=e2f72eea-bf76-4576-bed8-e29d2df102a7&integration=6aedf856-bc21-49aa-859a-a0952789f898' + ); + }); + }); + it('shows indexing message when status is indexing', async () => { + server.use(statusHandlers.indexingHandler); + + renderNoFindingsStates(); + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + + await waitFor(() => { + expect(screen.getByText(/posture evaluation underway/i)).toBeInTheDocument(); + }); + + expect( + screen.getByText( + /waiting for data to be collected and indexed. check back later to see your findings/i + ) + ).toBeInTheDocument(); + }); + it('shows timeout message when status is index-timeout', async () => { + server.use(statusHandlers.indexTimeoutHandler); + + renderNoFindingsStates(); + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + + await waitFor(() => { + screen.getByRole('heading', { + name: /waiting for findings data/i, + }); + }); + + expect( + screen.getByText(/collecting findings is taking longer than expected/i) + ).toBeInTheDocument(); + }); + it('shows unprivileged message when status is unprivileged', async () => { + server.use(statusHandlers.unprivilegedHandler); + + renderNoFindingsStates(); + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText(/privileges required/i)).toBeInTheDocument(); + + expect( + screen.getByText(/required elasticsearch index privilege for the following indices:/i) + ).toBeInTheDocument(); + expect( + screen.getByText('logs-cloud_security_posture.findings_latest-default') + ).toBeInTheDocument(); + expect(screen.getByText('logs-cloud_security_posture.findings-default*')).toBeInTheDocument(); + expect(screen.getByText('logs-cloud_security_posture.scores-default')).toBeInTheDocument(); + expect( + screen.getByText('logs-cloud_security_posture.vulnerabilities_latest-default') + ).toBeInTheDocument(); + }); + }); + it('renders empty container when the status does not match a no finding status', async () => { + server.use(statusHandlers.indexedHandler); + + const { container } = renderNoFindingsStates(); + + expect(screen.getByText(/loading/i)).toBeInTheDocument(); + + await waitFor(() => { + expect(screen.queryByText(/loading/i)).not.toBeInTheDocument(); + }); + expect(container).toMatchInlineSnapshot(` +
+
+
+ `); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states.tsx b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx similarity index 90% rename from x-pack/plugins/cloud_security_posture/public/components/no_findings_states.tsx rename to x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx index 8e20207719940..97dfce7b84c1e 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx @@ -20,21 +20,21 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; -import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../../common/constants'; -import { FullSizeCenteredPage } from './full_size_centered_page'; -import { useCISIntegrationPoliciesLink } from '../common/navigation/use_navigate_to_cis_integration_policies'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../../../common/constants'; +import { FullSizeCenteredPage } from '../full_size_centered_page'; +import { useCISIntegrationPoliciesLink } from '../../common/navigation/use_navigate_to_cis_integration_policies'; import { CSPM_NOT_INSTALLED_ACTION_SUBJ, KSPM_NOT_INSTALLED_ACTION_SUBJ, NO_FINDINGS_STATUS_TEST_SUBJ, -} from './test_subjects'; -import { CloudPosturePage, PACKAGE_NOT_INSTALLED_TEST_SUBJECT } from './cloud_posture_page'; -import { useCspSetupStatusApi } from '../common/api/use_setup_status_api'; -import type { IndexDetails, PostureTypes, CspStatusCode } from '../../common/types_old'; -import noDataIllustration from '../assets/illustrations/no_data_illustration.svg'; -import { useCspIntegrationLink } from '../common/navigation/use_csp_integration_link'; -import { NO_FINDINGS_STATUS_REFRESH_INTERVAL_MS } from '../common/constants'; -import { cspIntegrationDocsNavigation } from '../common/navigation/constants'; +} from '../test_subjects'; +import { CloudPosturePage, PACKAGE_NOT_INSTALLED_TEST_SUBJECT } from '../cloud_posture_page'; +import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import type { IndexDetails, PostureTypes, CspStatusCode } from '../../../common/types_old'; +import noDataIllustration from '../../assets/illustrations/no_data_illustration.svg'; +import { useCspIntegrationLink } from '../../common/navigation/use_csp_integration_link'; +import { NO_FINDINGS_STATUS_REFRESH_INTERVAL_MS } from '../../common/constants'; +import { cspIntegrationDocsNavigation } from '../../common/navigation/constants'; const NotDeployed = ({ postureType }: { postureType: PostureTypes }) => { const integrationPoliciesLink = useCISIntegrationPoliciesLink({ @@ -169,13 +169,10 @@ const Unprivileged = ({ unprivilegedIndices }: { unprivilegedIndices: string[] } /> ); -const EmptySecurityFindingsPrompt = ({ - kspmIntegrationLink, - cspmIntegrationLink, -}: { - kspmIntegrationLink?: string; - cspmIntegrationLink?: string; -}) => { +const EmptySecurityFindingsPrompt = () => { + const kspmIntegrationLink = useCspIntegrationLink(KSPM_POLICY_TEMPLATE); + const cspmIntegrationLink = useCspIntegrationLink(CSPM_POLICY_TEMPLATE); + return ( { - const kspmIntegrationLink = useCspIntegrationLink(KSPM_POLICY_TEMPLATE); - const cspmIntegrationLink = useCspIntegrationLink(CSPM_POLICY_TEMPLATE); - const unprivilegedIndices = indicesStatus && indicesStatus @@ -267,13 +263,7 @@ const NoFindingsStatesNotification = ({ return ; if (status === 'indexing' || status === 'waiting_for_results') return ; if (status === 'index-timeout') return ; - if (isNotInstalled) - return ( - - ); + if (isNotInstalled) return ; if (status === 'not-deployed') return ; return null; diff --git a/x-pack/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx b/x-pack/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx index a2d8f4fe32c0b..e527a2f9f0c0c 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx @@ -8,12 +8,11 @@ import React from 'react'; import { EuiEmptyPrompt, EuiLink, EuiPageSection } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useLicenseManagementLocatorApi } from '../common/api/use_license_management_locator_api'; + +export const SubscriptionNotAllowed = () => { + const handleNavigateToLicenseManagement = useLicenseManagementLocatorApi(); -export const SubscriptionNotAllowed = ({ - licenseManagementLocator, -}: { - licenseManagementLocator?: string; -}) => { return ( } body={ - licenseManagementLocator ? ( + handleNavigateToLicenseManagement ? (

+ ({ + data: dataPluginMock.createStartContract(), + unifiedSearch: unifiedSearchPluginMock.createStartContract(), + charts: chartPluginMock.createStartContract(), + discover: discoverPluginMock.createStartContract(), + fleet: fleetMock.createStartMock(), + licensing: licensingMock.createStart(), + uiActions: uiActionsPluginMock.createStartContract(), + storage: sessionStorageMock.create(), + share: sharePluginMock.createStartContract(), +}); diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts b/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts new file mode 100644 index 0000000000000..91eb25630b222 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts @@ -0,0 +1,15 @@ +/* + * 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 { defaultApiLicensingInfo } from './licensing.handlers.mock'; + +/** + * Default handlers for the mock server, these are the handlers that are always enabled + * when the mock server is started, but can be overridden by specific tests when needed. + * Recommended to use these handlers for common endpoints. + */ +export const defaultHandlers = [defaultApiLicensingInfo]; diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts b/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts new file mode 100644 index 0000000000000..de426f5c72144 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts @@ -0,0 +1,32 @@ +/* + * 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 { http, HttpResponse } from 'msw'; + +export const MOCK_SERVER_LICENSING_INFO_URL = `/api/licensing/info`; + +export const defaultApiLicensingInfo = http.get(MOCK_SERVER_LICENSING_INFO_URL, () => { + const date = new Date(); + const expiryDateInMillis = date.setDate(date.getDate() + 30); + + return HttpResponse.json({ + license: { + uid: '000000-0000-0000-0000-000000000', + type: 'trial', + mode: 'trial', + expiryDateInMillis, + status: 'active', + }, + features: { + security: { + isAvailable: true, + isEnabled: true, + }, + }, + signature: '0000000000000000000000000000000000000000000000000000000', + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts b/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts new file mode 100644 index 0000000000000..9fe4b156bc096 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts @@ -0,0 +1,174 @@ +/* + * 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 { setupServer, SetupServerApi } from 'msw/node'; +import { coreMock } from '@kbn/core/public/mocks'; +import type { CoreStart } from '@kbn/core/public'; +import { licenseMock } from '@kbn/licensing-plugin/common/licensing.mock'; +import { createStubDataView } from '@kbn/data-views-plugin/common/stubs'; +import { indexPatternFieldEditorPluginMock as dataViewFieldEditorMock } from '@kbn/data-view-field-editor-plugin/public/mocks'; +import SearchBar from '@kbn/unified-search-plugin/public/search_bar/search_bar'; +import { http, HttpResponse, JsonBodyType } from 'msw'; +import { defaultHandlers } from './handlers'; +import { getMockDependencies } from '../fixtures/get_mock_dependencies'; +import { CspClientPluginStartDeps } from '../../types'; +import { MOCK_SERVER_LICENSING_INFO_URL } from './handlers/licensing.handlers.mock'; + +/** + * Mock the lastValueFrom function from rxjs to return the result of the promise instead of the Observable + * This is for simplifying the testing by avoiding the need to subscribe to the Observable while producing the same result + */ +jest.mock('rxjs', () => { + const actual = jest.requireActual('rxjs'); + return { + ...actual, + lastValueFrom: async (source: Promise) => { + const value = await source; + return value.result; + }, + }; +}); + +/** + * Setup a mock server with the default handlers + * @param debug - If true, log all requests to the console + * @returns The mock server + */ +export const setupMockServer = ({ debug = false }: { debug?: boolean } = {}) => { + const server = setupServer(...defaultHandlers); + + if (debug) { + // Debug: log all requests to the console + server.events.on('request:start', async ({ request }) => { + const payload = await request.clone().text(); + // eslint-disable-next-line no-console + console.log('MSW intercepted request:', request.method, request.url, payload); + }); + server.events.on('response:mocked', async ({ request, response }) => { + const body = await response.json(); + // eslint-disable-next-line no-console + console.log( + '%s %s received %s %s %s', + request.method, + request.url, + response.status, + response.statusText, + JSON.stringify(body, null, 2) + ); + }); + } + return server; +}; + +/** + * This function wraps beforeAll, afterAll and beforeEach for setup MSW server into a single call. + * That makes the describe code further down easier to read and makes + * sure we don't forget the handlers. Can easily be shared between tests. + * @param server - The MSW server instance, created with setupMockServer + */ +export const startMockServer = (server: SetupServerApi) => { + beforeAll(() => server.listen({ onUnhandledRequest: 'warn' })); + afterAll(() => server.close()); + beforeEach(() => { + server.resetHandlers(); + }); +}; + +const MOCK_SERVER_BASE_URL = 'http://localhost'; + +/** + * Get a set of dependencies for the mock server overriding default mock dependencies to perform + * HTTP calls that will be intercepted by the mock server + * @returns The core and deps dependencies used by the KibanaContextProvider + */ +export const getMockServerDependencies = () => { + return { + deps: { + ...getMockDependencies(), + data: { + ...getMockDependencies().data, + search: { + ...getMockDependencies().data.search, + search: async ({ params }: { params: any }) => { + const response = await fetch(`${MOCK_SERVER_BASE_URL}/internal/bsearch`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(params), + }); + return response.json(); + }, + }, + dataViews: { + ...getMockDependencies().data.dataViews, + find: async (pattern: string) => { + const response = await fetch( + `${MOCK_SERVER_BASE_URL}/internal/data_views/fields?pattern=${pattern}` + ); + + const responseJson = await response.json(); + + const fields = responseJson.fields.reduce((acc: any, field: any) => { + acc[field.name] = field; + return acc; + }, {}); + + const dataView = createStubDataView({ + spec: { + id: pattern, + title: pattern, + fields, + }, + }); + + return [dataView]; + }, + }, + }, + licensing: { + ...getMockDependencies().licensing, + refresh: async () => { + const response = await fetch(MOCK_SERVER_LICENSING_INFO_URL); + const responseJson = await response.json(); + return licenseMock.createLicense(responseJson); + }, + }, + dataViewFieldEditor: dataViewFieldEditorMock.createStartContract(), + unifiedSearch: { + ...getMockDependencies().unifiedSearch, + ui: { + ...getMockDependencies().unifiedSearch.ui, + SearchBar, + }, + }, + storage: { + ...getMockDependencies().storage, + get: (key: string) => { + return localStorage.getItem(key); + }, + set: (key: string, value: string) => { + localStorage.setItem(key, value); + }, + }, + } as unknown as Partial, + core: { + ...coreMock.createStart(), + http: { + ...coreMock.createStart().http, + get: async (path: string, options: any) => { + const response = await fetch(`${MOCK_SERVER_BASE_URL}${path}`, options); + return response.json(); + }, + }, + } as unknown as CoreStart, + }; +}; + +export const mockGetRequest = (path: string, response: JsonBodyType) => { + return http.get(path, () => HttpResponse.json(response)); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx b/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx new file mode 100644 index 0000000000000..19143d4641836 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import type { CoreStart } from '@kbn/core/public'; +import { CspClientPluginStartDeps } from '../../types'; +import { TestProvider } from '../test_provider'; +import { getMockServerDependencies } from './mock_server'; +interface MockServerDependencies { + deps: Partial; + core: CoreStart; +} + +interface MockServerTestProviderProps { + children: React.ReactNode; + dependencies?: MockServerDependencies; +} + +/** + * Simple wrapper around the TestProvider that provides dependencies for the mock server. + */ +export const MockServerTestProvider = ({ + children, + dependencies = getMockServerDependencies(), +}: MockServerTestProviderProps) => { + return {children}; +}; + +/** + * Renders a component wrapped in the MockServerTestProvider. + */ +export const renderWrapper = (children: React.ReactNode, dependencies?: MockServerDependencies) => { + return render( + {children} + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx index d677df4258837..ab3173ec8c581 100755 --- a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx +++ b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx @@ -6,23 +6,16 @@ */ import type { AppMountParameters, CoreStart } from '@kbn/core/public'; -import React, { useMemo } from 'react'; +import React from 'react'; import { I18nProvider } from '@kbn/i18n-react'; // eslint-disable-next-line no-restricted-imports import { Router } from 'react-router-dom'; import { Route, Routes } from '@kbn/shared-ux-router'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { coreMock } from '@kbn/core/public/mocks'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; -import { discoverPluginMock } from '@kbn/discover-plugin/public/mocks'; -import { fleetMock } from '@kbn/fleet-plugin/public/mocks'; -import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; -import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; -import { sessionStorageMock } from '@kbn/core-http-server-mocks'; import type { CspClientPluginStartDeps } from '../types'; +import { getMockDependencies } from './fixtures/get_mock_dependencies'; interface CspAppDeps { core: CoreStart; @@ -33,20 +26,17 @@ interface CspAppDeps { export const TestProvider: React.FC> = ({ core = coreMock.createStart(), - deps = { - data: dataPluginMock.createStartContract(), - unifiedSearch: unifiedSearchPluginMock.createStartContract(), - charts: chartPluginMock.createStartContract(), - discover: discoverPluginMock.createStartContract(), - fleet: fleetMock.createStartMock(), - licensing: licensingMock.createStart(), - uiActions: uiActionsPluginMock.createStartContract(), - storage: sessionStorageMock.create(), - }, + deps = getMockDependencies(), params = coreMock.createAppMountParameters(), children, } = {}) => { - const queryClient = useMemo(() => new QueryClient(), []); + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, + }); return ( diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts new file mode 100644 index 0000000000000..ab9d84fbc5b09 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts @@ -0,0 +1,192 @@ +/* + * 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 { http, HttpResponse } from 'msw'; + +export const cspmInstalledHandler = http.get('/internal/cloud_security_posture/benchmarks', () => { + return HttpResponse.json({ + items: [ + { + package_policy: { + id: '630f3e42-659e-4499-9007-61e36adf1d97', + name: 'cspm-1', + namespace: 'default', + description: '', + package: { + name: 'cloud_security_posture', + title: 'Security Posture Management', + version: '1.9.0', + }, + enabled: true, + policy_id: '30cba674-531c-4225-b392-3f7810957511', + inputs: [ + { + type: 'cloudbeat/cis_aws', + policy_template: 'cspm', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + type: 'logs', + dataset: 'cloud_security_posture.findings', + }, + vars: { + access_key_id: { + type: 'text', + }, + secret_access_key: { + type: 'text', + }, + session_token: { + type: 'text', + }, + shared_credential_file: { + type: 'text', + }, + credential_profile_name: { + type: 'text', + }, + role_arn: { + type: 'text', + }, + 'aws.credentials.type': { + type: 'text', + }, + 'aws.account_type': { + value: 'organization-account', + type: 'text', + }, + }, + id: 'cloudbeat/cis_aws-cloud_security_posture.findings-630f3e42-659e-4499-9007-61e36adf1d97', + compiled_stream: { + period: '24h', + config: { + v1: { + type: 'cspm', + deployment: 'aws', + benchmark: 'cis_aws', + aws: { + account_type: 'organization-account', + credentials: { + type: null, + }, + }, + }, + }, + }, + }, + ], + config: { + cloud_formation_template_url: { + value: + 'https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https://elastic-cspm-cft.s3.eu-central-1.amazonaws.com/cloudformation-cspm-ACCOUNT_TYPE-8.14.0.yml&stackName=Elastic-Cloud-Security-Posture-Management¶m_EnrollmentToken=FLEET_ENROLLMENT_TOKEN¶m_FleetUrl=FLEET_URL¶m_ElasticAgentVersion=KIBANA_VERSION¶m_ElasticArtifactServer=https://artifacts.elastic.co/downloads/beats/elastic-agent', + }, + }, + }, + ], + vars: { + posture: { + value: 'cspm', + type: 'text', + }, + deployment: { + value: 'aws', + type: 'text', + }, + }, + revision: 1, + created_at: '2024-06-03T21:06:20.786Z', + created_by: 'system', + updated_at: '2024-06-03T21:06:20.786Z', + updated_by: 'system', + }, + agent_policy: { + id: '30cba674-531c-4225-b392-3f7810957511', + name: 'Agent policy 3', + agents: 0, + }, + rules_count: 55, + }, + ], + total: 1, + page: 1, + perPage: 100, + }); +}); + +export const kspmInstalledHandler = http.get('/internal/cloud_security_posture/benchmarks', () => { + return HttpResponse.json({ + items: [ + { + package_policy: { + id: '6aedf856-bc21-49aa-859a-a0952789f898', + version: 'WzE4ODcxLDE0XQ==', + name: 'kspm-1', + namespace: 'default', + description: '', + package: { + name: 'cloud_security_posture', + title: 'Security Posture Management', + version: '1.9.0', + }, + enabled: true, + policy_id: 'e2f72eea-bf76-4576-bed8-e29d2df102a7', + inputs: [ + { + type: 'cloudbeat/cis_k8s', + policy_template: 'kspm', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + type: 'logs', + dataset: 'cloud_security_posture.findings', + }, + id: 'cloudbeat/cis_k8s-cloud_security_posture.findings-6aedf856-bc21-49aa-859a-a0952789f898', + compiled_stream: { + config: { + v1: { + type: 'kspm', + deployment: 'self_managed', + benchmark: 'cis_k8s', + }, + }, + }, + }, + ], + }, + ], + vars: { + posture: { + value: 'kspm', + type: 'text', + }, + deployment: { + value: 'self_managed', + type: 'text', + }, + }, + revision: 1, + created_at: '2024-06-03T21:23:23.139Z', + created_by: 'system', + updated_at: '2024-06-03T21:23:23.139Z', + updated_by: 'system', + }, + agent_policy: { + id: 'e2f72eea-bf76-4576-bed8-e29d2df102a7', + name: 'Agent policy 1', + agents: 0, + }, + rules_count: 92, + }, + ], + total: 1, + page: 1, + perPage: 100, + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts b/x-pack/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts new file mode 100644 index 0000000000000..0f2b3b9eab640 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts @@ -0,0 +1,251 @@ +/* + * 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 { http, HttpResponse } from 'msw'; + +const STATUS_URL = `/internal/cloud_security_posture/status`; + +export const notInstalledHandler = http.get(STATUS_URL, () => { + return HttpResponse.json({ + cspm: { + status: 'not-installed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + kspm: { + status: 'not-installed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + vuln_mgmt: { + status: 'not-installed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + indicesDetails: [ + { + index: 'logs-cloud_security_posture.findings_latest-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.findings-default*', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.scores-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.vulnerabilities_latest-default', + status: 'empty', + }, + ], + isPluginInitialized: true, + latestPackageVersion: '1.9.0', + }); +}); + +export const notDeployedHandler = http.get(STATUS_URL, () => { + return HttpResponse.json({ + cspm: { + status: 'not-deployed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + kspm: { + status: 'not-deployed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + vuln_mgmt: { + status: 'not-deployed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + indicesDetails: [ + { + index: 'logs-cloud_security_posture.findings_latest-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.findings-default*', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.scores-default', + status: 'not-empty', + }, + { + index: 'logs-cloud_security_posture.vulnerabilities_latest-default', + status: 'empty', + }, + ], + isPluginInitialized: true, + latestPackageVersion: '1.9.0', + installedPackageVersion: '1.9.0', + }); +}); + +export const indexingHandler = http.get(STATUS_URL, () => { + return HttpResponse.json({ + cspm: { + status: 'indexing', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + kspm: { + status: 'indexing', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + vuln_mgmt: { + status: 'indexing', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + indicesDetails: [ + { + index: 'logs-cloud_security_posture.findings_latest-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.findings-default*', + status: 'not-empty', + }, + { + index: 'logs-cloud_security_posture.scores-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.vulnerabilities_latest-default', + status: 'empty', + }, + ], + isPluginInitialized: true, + latestPackageVersion: '1.9.0', + }); +}); + +export const indexTimeoutHandler = http.get(STATUS_URL, () => { + return HttpResponse.json({ + cspm: { + status: 'index-timeout', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + kspm: { + status: 'index-timeout', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + vuln_mgmt: { + status: 'index-timeout', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + indicesDetails: [ + { + index: 'logs-cloud_security_posture.findings_latest-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.findings-default*', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.scores-default', + status: 'empty', + }, + { + index: 'logs-cloud_security_posture.vulnerabilities_latest-default', + status: 'empty', + }, + ], + isPluginInitialized: true, + latestPackageVersion: '1.9.0', + }); +}); + +export const unprivilegedHandler = http.get(STATUS_URL, () => { + return HttpResponse.json({ + cspm: { + status: 'unprivileged', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + kspm: { + status: 'unprivileged', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + vuln_mgmt: { + status: 'unprivileged', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + indicesDetails: [ + { + index: 'logs-cloud_security_posture.findings_latest-default', + status: 'unprivileged', + }, + { + index: 'logs-cloud_security_posture.findings-default*', + status: 'unprivileged', + }, + { + index: 'logs-cloud_security_posture.scores-default', + status: 'unprivileged', + }, + { + index: 'logs-cloud_security_posture.vulnerabilities_latest-default', + status: 'unprivileged', + }, + ], + isPluginInitialized: true, + latestPackageVersion: '1.9.0', + }); +}); + +export const indexedHandler = http.get(STATUS_URL, () => { + return HttpResponse.json({ + cspm: { + status: 'indexed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + kspm: { + status: 'indexed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + vuln_mgmt: { + status: 'indexed', + healthyAgents: 1, + installedPackagePolicies: 1, + }, + indicesDetails: [ + { + index: 'logs-cloud_security_posture.findings_latest-default', + status: 'not-empty', + }, + { + index: 'logs-cloud_security_posture.findings-default*', + status: 'not-empty', + }, + { + index: 'logs-cloud_security_posture.scores-default', + status: 'not-empty', + }, + { + index: 'logs-cloud_security_posture.vulnerabilities_latest-default', + status: 'not-empty', + }, + ], + isPluginInitialized: true, + latestPackageVersion: '1.9.0', + installedPackageVersion: '1.9.0', + }); +}); diff --git a/x-pack/plugins/fleet/common/types/models/package_policy.ts b/x-pack/plugins/fleet/common/types/models/package_policy.ts index c50c06b890ea1..1b8a407ff8dd9 100644 --- a/x-pack/plugins/fleet/common/types/models/package_policy.ts +++ b/x-pack/plugins/fleet/common/types/models/package_policy.ts @@ -99,6 +99,7 @@ export interface UpdatePackagePolicy extends NewPackagePolicy { // SO definition for this type is declared in server/types/interfaces export interface PackagePolicy extends Omit { id: string; + spaceId?: string; inputs: PackagePolicyInput[]; version?: string; agents?: number; diff --git a/x-pack/plugins/fleet/common/types/rest_spec/settings.ts b/x-pack/plugins/fleet/common/types/rest_spec/settings.ts index 33abccbc88e74..73ad6a3a219fc 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/settings.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/settings.ts @@ -34,6 +34,7 @@ export type EnrollmentSettingsFleetServerPolicy = Pick< | 'has_fleet_server' | 'fleet_server_host_id' | 'download_source_id' + | 'space_id' >; export interface GetEnrollmentSettingsResponse { diff --git a/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.test.ts b/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.test.ts index b41debffb3e6b..0a39101db8481 100644 --- a/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.test.ts +++ b/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.test.ts @@ -16,6 +16,9 @@ jest.mock('../../services', () => ({ get: jest.fn(), getByIDs: jest.fn(), }, + appContextService: { + getInternalUserSOClientWithoutSpaceExtension: jest.fn(), + }, downloadSourceService: { list: jest.fn().mockResolvedValue({ items: [ diff --git a/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.ts b/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.ts index 1662fed3fc31b..132777867becb 100644 --- a/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.ts +++ b/x-pack/plugins/fleet/server/routes/settings/enrollment_settings_handler.ts @@ -18,7 +18,7 @@ import type { } from '../../../common/types'; import type { FleetRequestHandler, GetEnrollmentSettingsRequestSchema } from '../../types'; import { defaultFleetErrorHandler } from '../../errors'; -import { agentPolicyService, downloadSourceService } from '../../services'; +import { agentPolicyService, appContextService, downloadSourceService } from '../../services'; import { getFleetServerHostsForAgentPolicy } from '../../services/fleet_server_host'; import { getFleetProxy } from '../../services/fleet_proxies'; import { getFleetServerPolicies, hasFleetServersForPolicies } from '../../services/fleet_server'; @@ -53,8 +53,8 @@ export const getEnrollmentSettingsHandler: FleetRequestHandler< settingsResponse.fleet_server.policies = fleetServerPolicies; settingsResponse.fleet_server.has_active = await hasFleetServersForPolicies( esClient, - soClient, - fleetServerPolicies.map((p) => p.id), + appContextService.getInternalUserSOClientWithoutSpaceExtension(), + fleetServerPolicies, true ); } @@ -115,6 +115,7 @@ export const getFleetServerOrAgentPolicies = async ( has_fleet_server: policy.has_fleet_server, fleet_server_host_id: policy.fleet_server_host_id, download_source_id: policy.download_source_id, + space_id: policy.space_id, }); // If an agent policy is specified, return only that policy @@ -136,7 +137,9 @@ export const getFleetServerOrAgentPolicies = async ( } // If an agent policy is not specified, return all fleet server policies - const fleetServerPolicies = (await getFleetServerPolicies(soClient)).map(mapPolicy); + const fleetServerPolicies = ( + await getFleetServerPolicies(appContextService.getInternalUserSOClientWithoutSpaceExtension()) + ).map(mapPolicy); return { fleetServerPolicies }; }; diff --git a/x-pack/plugins/fleet/server/routes/setup/handlers.ts b/x-pack/plugins/fleet/server/routes/setup/handlers.ts index 58555f233142a..019fb2af5276b 100644 --- a/x-pack/plugins/fleet/server/routes/setup/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/setup/handlers.ts @@ -16,10 +16,9 @@ import { isSecretStorageEnabled } from '../../services/secrets'; export const getFleetStatusHandler: FleetRequestHandler = async (context, request, response) => { const coreContext = await context.core; - const fleetContext = await context.fleet; const esClient = coreContext.elasticsearch.client.asInternalUser; - const soClient = fleetContext.internalSoClient; + const soClient = appContextService.getInternalUserSOClientWithoutSpaceExtension(); try { const isApiKeysEnabled = await appContextService diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index d3d94fa581955..029352e145ca6 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -414,10 +414,20 @@ class AgentPolicyService { public async getByIDs( soClient: SavedObjectsClientContract, - ids: string[], + ids: Array, options: { fields?: string[]; withPackagePolicies?: boolean; ignoreMissing?: boolean } = {} ): Promise { - const objects = ids.map((id) => ({ ...options, id, type: SAVED_OBJECT_TYPE })); + const objects = ids.map((id) => { + if (typeof id === 'string') { + return { ...options, id, type: SAVED_OBJECT_TYPE }; + } + return { + ...options, + id: id.id, + namespaces: id.spaceId ? [id.spaceId] : undefined, + type: SAVED_OBJECT_TYPE, + }; + }); const bulkGetResponse = await soClient.bulkGet(objects); const agentPolicies = await pMap( @@ -432,7 +442,6 @@ class AgentPolicyService { throw new FleetError(agentPolicySO.error.message); } } - const agentPolicy = mapAgentPolicySavedObjectToAgentPolicy(agentPolicySO); if (options.withPackagePolicies) { const agentPolicyWithPackagePolicies = await this.get( diff --git a/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts b/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts index 0a4ce31504383..f00d78cd59ad9 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts @@ -130,6 +130,7 @@ describe('getFleetServerPolicies', () => { version: '1.0.0', }, policy_id: 'fs-policy-1', + policy_ids: ['fs-policy-1'], }, { id: 'package-policy-2', @@ -140,6 +141,7 @@ describe('getFleetServerPolicies', () => { version: '1.0.0', }, policy_id: 'fs-policy-2', + policy_ids: ['fs-policy-2'], }, { id: 'package-policy-3', @@ -150,6 +152,7 @@ describe('getFleetServerPolicies', () => { version: '1.0.0', }, policy_id: 'agent-policy-2', + policy_ids: ['agent-policy-2'], }, ]; const mockFleetServerPolicies = [ @@ -218,7 +221,7 @@ describe('hasActiveFleetServersForPolicies', () => { const hasFs = await hasFleetServersForPolicies( mockEsClient, mockSoClient, - ['policy-1'], + [{ id: 'policy-1' }], true ); expect(hasFs).toBe(true); @@ -241,7 +244,7 @@ describe('hasActiveFleetServersForPolicies', () => { const hasFs = await hasFleetServersForPolicies( mockEsClient, mockSoClient, - ['policy-1'], + [{ id: 'policy-1' }], true ); expect(hasFs).toBe(true); @@ -264,7 +267,7 @@ describe('hasActiveFleetServersForPolicies', () => { const hasFs = await hasFleetServersForPolicies( mockEsClient, mockSoClient, - ['policy-1'], + [{ id: 'policy-1' }], true ); expect(hasFs).toBe(false); @@ -286,7 +289,9 @@ describe('hasActiveFleetServersForPolicies', () => { online: 0, error: 0, }); - const hasFs = await hasFleetServersForPolicies(mockEsClient, mockSoClient, ['policy-1']); + const hasFs = await hasFleetServersForPolicies(mockEsClient, mockSoClient, [ + { id: 'policy-1' }, + ]); expect(hasFs).toBe(true); }); }); diff --git a/x-pack/plugins/fleet/server/services/fleet_server/index.ts b/x-pack/plugins/fleet/server/services/fleet_server/index.ts index 88ba7ccc710d5..004a0deeea7b7 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server/index.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server/index.ts @@ -6,15 +6,15 @@ */ import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; +import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; import semverGte from 'semver/functions/gte'; import semverCoerce from 'semver/functions/coerce'; +import { uniqBy } from 'lodash'; import type { AgentPolicy } from '../../../common/types'; import { PACKAGE_POLICY_SAVED_OBJECT_TYPE, FLEET_SERVER_PACKAGE } from '../../../common/constants'; - import { SO_SEARCH_LIMIT } from '../../constants'; import { getAgentsByKuery, getAgentStatusById } from '../agents'; - import { packagePolicyService } from '../package_policy'; import { agentPolicyService } from '../agent_policy'; import { getAgentStatusForAgentPolicy } from '../agents'; @@ -28,16 +28,20 @@ export const getFleetServerPolicies = async ( ): Promise => { const fleetServerPackagePolicies = await packagePolicyService.list(soClient, { kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:${FLEET_SERVER_PACKAGE}`, + spaceId: '*', }); // Extract associated fleet server agent policy IDs - const fleetServerAgentPolicyIds = [ - ...new Set(fleetServerPackagePolicies.items.flatMap((p) => p.policy_ids)), - ]; + const fleetServerAgentPolicyIds = fleetServerPackagePolicies.items.flatMap((p) => + p.policy_ids?.map((id) => ({ id, spaceId: p.spaceId } ?? [])) + ); // Retrieve associated agent policies const fleetServerAgentPolicies = fleetServerAgentPolicyIds.length - ? await agentPolicyService.getByIDs(soClient, fleetServerAgentPolicyIds) + ? await agentPolicyService.getByIDs( + soClient, + uniqBy(fleetServerAgentPolicyIds, (p) => `${p?.spaceId ?? ''}:${p.id}`) + ) : []; return fleetServerAgentPolicies; @@ -51,15 +55,24 @@ export const getFleetServerPolicies = async ( export const hasFleetServersForPolicies = async ( esClient: ElasticsearchClient, soClient: SavedObjectsClientContract, - agentPolicyIds: string[], + agentPolicies: Array>, activeOnly: boolean = false ): Promise => { - if (agentPolicyIds.length > 0) { + if (agentPolicies.length > 0) { const agentStatusesRes = await getAgentStatusForAgentPolicy( esClient, soClient, undefined, - agentPolicyIds.map((id) => `policy_id:${id}`).join(' or ') + agentPolicies + .map(({ id, space_id: spaceId }) => { + const space = + spaceId && spaceId !== DEFAULT_SPACE_ID + ? `namespaces:"${spaceId}"` + : `not namespaces:* or namespaces:"${DEFAULT_SPACE_ID}"`; + + return `(policy_id:${id} and (${space}))`; + }) + .join(' or ') ); return activeOnly @@ -79,7 +92,7 @@ export async function hasFleetServers( return await hasFleetServersForPolicies( esClient, soClient, - (await getFleetServerPolicies(soClient)).map((policy) => policy.id) + await getFleetServerPolicies(soClient) ); } diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index cae84f2c8f5b1..dd4d26e28ca7e 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -726,7 +726,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { public async list( soClient: SavedObjectsClientContract, - options: ListWithKuery + options: ListWithKuery & { spaceId?: string } ): Promise> { const { page = 1, perPage = 20, sortField = 'updated_at', sortOrder = 'desc', kuery } = options; @@ -737,6 +737,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { page, perPage, filter: kuery ? normalizeKuery(SAVED_OBJECT_TYPE, kuery) : undefined, + namespaces: options.spaceId ? [options.spaceId] : undefined, }); for (const packagePolicy of packagePolicies?.saved_objects ?? []) { @@ -752,6 +753,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { id: packagePolicySO.id, version: packagePolicySO.version, ...packagePolicySO.attributes, + spaceId: packagePolicySO.namespaces?.[0], })), total: packagePolicies?.total, page, diff --git a/x-pack/plugins/fleet/server/services/package_policy_service.ts b/x-pack/plugins/fleet/server/services/package_policy_service.ts index 56e68537afb7e..5f5e775bf910a 100644 --- a/x-pack/plugins/fleet/server/services/package_policy_service.ts +++ b/x-pack/plugins/fleet/server/services/package_policy_service.ts @@ -105,7 +105,7 @@ export interface PackagePolicyClient { list( soClient: SavedObjectsClientContract, - options: ListWithKuery + options: ListWithKuery & { spaceId?: string } ): Promise>; listIds( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts index 6fac2725754d5..4dccc9ad0aae7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts @@ -14,7 +14,7 @@ import { responseActionsClientMock } from '../../../endpoint/services/actions/cl describe('ScheduleNotificationResponseActions', () => { const signalOne = { - agent: { id: 'agent-id-1' }, + agent: { id: 'agent-id-1', type: 'endpoint' }, _id: 'alert-id-1', user: { id: 'S-1-5-20' }, process: { @@ -23,7 +23,7 @@ describe('ScheduleNotificationResponseActions', () => { [ALERT_RULE_UUID]: 'rule-id-1', [ALERT_RULE_NAME]: 'rule-name-1', }; - const signalTwo = { agent: { id: 'agent-id-2' }, _id: 'alert-id-2' }; + const signalTwo = { agent: { id: 'agent-id-2', type: 'endpoint' }, _id: 'alert-id-2' }; const getSignals = () => [signalOne, signalTwo]; const osqueryActionMock = { @@ -210,5 +210,25 @@ describe('ScheduleNotificationResponseActions', () => { } ); }); + + it('should only attempt to send response actions to alerts from endpoint', async () => { + const signals = getSignals(); + signals.push({ agent: { id: '123-432', type: 'filebeat' }, _id: '1' }); + const responseActions: RuleResponseAction[] = [ + { + actionTypeId: ResponseActionTypesEnum['.endpoint'], + params: { + command: 'isolate', + comment: 'test process comment', + }, + }, + ]; + await scheduleNotificationResponseActions({ + signals, + responseActions, + }); + + expect(mockedResponseActionsClient.isolate).toHaveBeenCalledTimes(signals.length - 1); + }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts index d20995291b5f1..2fcf09d6cfbb4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts @@ -37,9 +37,17 @@ export const getScheduleNotificationResponseActionsService = }); } if (responseAction.actionTypeId === ResponseActionTypesEnum['.endpoint']) { - await endpointResponseAction(responseAction, endpointAppContextService, { - alerts, - }); + // We currently support only automated response actions for Elastic Defend. This will + // need to be updated once we introduce support for other EDR systems. + // For an explanation of why this is needed, see this comment here: + // https://github.com/elastic/kibana/issues/180774#issuecomment-2139526239 + const alertsFromElasticDefend = alerts.filter((alert) => alert.agent.type === 'endpoint'); + + if (alertsFromElasticDefend.length > 0) { + await endpointResponseAction(responseAction, endpointAppContextService, { + alerts: alertsFromElasticDefend, + }); + } } }) ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts index d34d2eba9e5ab..e7317acfd7ca1 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts @@ -24,6 +24,7 @@ export type Alert = ParsedTechnicalFields & { export interface AlertAgent { id: string; name: string; + type: string; } export interface AlertWithAgent extends Alert { diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts index cff3d3ddb637b..4b166d040625b 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts @@ -19,6 +19,7 @@ import { GetOneEnrollmentAPIKeyResponse, PostEnrollmentAPIKeyResponse, PostEnrollmentAPIKeyRequest, + GetEnrollmentSettingsResponse, } from '@kbn/fleet-plugin/common/types'; import { GetUninstallTokenResponse, @@ -30,6 +31,15 @@ export class SpaceTestApiClient { private getBaseUrl(spaceId?: string) { return spaceId ? `/s/${spaceId}` : ''; } + async setup(spaceId?: string): Promise { + const { body: res } = await this.supertest + .post(`${this.getBaseUrl(spaceId)}/api/fleet/setup`) + .set('kbn-xsrf', 'xxxx') + .send({}) + .expect(200); + + return res; + } // Agent policies async createAgentPolicy(spaceId?: string): Promise { const { body: res } = await this.supertest @@ -45,6 +55,22 @@ export class SpaceTestApiClient { return res; } + async createFleetServerPolicy(spaceId?: string): Promise { + const { body: res } = await this.supertest + .post(`${this.getBaseUrl(spaceId)}/api/fleet/agent_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: `test ${uuidV4()}`, + description: '', + namespace: 'default', + inactivity_timeout: 24 * 1000, + has_fleet_server: true, + force: true, + }) + .expect(200); + + return res; + } async deleteAgentPolicy(agentPolicyId: string, spaceId?: string) { await this.supertest .post(`${this.getBaseUrl(spaceId)}/api/fleet/agent_policies/delete`) @@ -139,4 +165,12 @@ export class SpaceTestApiClient { return res; } + // Enrollment Settings + async getEnrollmentSettings(spaceId?: string): Promise { + const { body: res } = await this.supertest + .get(`${this.getBaseUrl(spaceId)}/internal/fleet/settings/enrollment`) + .expect(200); + + return res; + } } diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/enrollment_settings.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/enrollment_settings.ts new file mode 100644 index 0000000000000..d5eb41afb2104 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/enrollment_settings.ts @@ -0,0 +1,161 @@ +/* + * 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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; +import { skipIfNoDockerRegistry } from '../../helpers'; +import { SpaceTestApiClient } from './api_helper'; +import { cleanFleetIndices } from './helpers'; +import { setupTestSpaces, TEST_SPACE_1 } from './space_helpers'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + const esClient = getService('es'); + const kibanaServer = getService('kibanaServer'); + const createFleetAgent = async (agentPolicyId: string, spaceId?: string) => { + const agentResponse = await esClient.index({ + index: '.fleet-agents', + refresh: true, + body: { + access_api_key_id: 'api-key-3', + active: true, + policy_id: agentPolicyId, + policy_revision_idx: 1, + last_checkin_status: 'online', + type: 'PERMANENT', + local_metadata: { + host: { hostname: 'host123' }, + elastic: { agent: { version: '8.15.0' } }, + }, + user_provided_metadata: {}, + enrolled_at: new Date().toISOString(), + last_checkin: new Date().toISOString(), + tags: ['tag1'], + namespaces: spaceId ? [spaceId] : undefined, + }, + }); + + return agentResponse._id; + }; + describe('enrollment_settings', async function () { + skipIfNoDockerRegistry(providerContext); + const apiClient = new SpaceTestApiClient(supertest); + + describe('Without Fleet server setup', () => { + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList({ + space: TEST_SPACE_1, + }); + await cleanFleetIndices(esClient); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList({ + space: TEST_SPACE_1, + }); + await cleanFleetIndices(esClient); + }); + + setupTestSpaces(providerContext); + + before(async () => { + await apiClient.setup(); + }); + + describe('GET /enrollments/settings', () => { + it('in default space it should not return an active fleet server', async () => { + const res = await apiClient.getEnrollmentSettings(); + expect(res.fleet_server.has_active).to.be(false); + }); + + it('in a specific spaceit should not return an active fleet server', async () => { + const res = await apiClient.getEnrollmentSettings(TEST_SPACE_1); + expect(res.fleet_server.has_active).to.be(false); + }); + }); + }); + + describe('With Fleet server setup in a specific space', () => { + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList({ + space: TEST_SPACE_1, + }); + await cleanFleetIndices(esClient); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList({ + space: TEST_SPACE_1, + }); + await cleanFleetIndices(esClient); + }); + + setupTestSpaces(providerContext); + + before(async () => { + await apiClient.setup(); + const testSpaceFleetServerPolicy = await apiClient.createFleetServerPolicy(TEST_SPACE_1); + await createFleetAgent(testSpaceFleetServerPolicy.item.id, TEST_SPACE_1); + }); + + describe('GET /enrollments/settings', () => { + it('in default space it should return all policies and active fleet server', async () => { + const res = await apiClient.getEnrollmentSettings(); + expect(res.fleet_server.has_active).to.be(true); + }); + + it('in a specific space it should return all policies and active fleet server', async () => { + const res = await apiClient.getEnrollmentSettings(TEST_SPACE_1); + expect(res.fleet_server.has_active).to.be(true); + }); + }); + }); + + describe('With Fleet server setup in default space', () => { + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList({ + space: TEST_SPACE_1, + }); + await cleanFleetIndices(esClient); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.cleanStandardList({ + space: TEST_SPACE_1, + }); + await cleanFleetIndices(esClient); + }); + + setupTestSpaces(providerContext); + + before(async () => { + await apiClient.setup(); + const defaultFleetServerPolicy = await apiClient.createFleetServerPolicy(); + await createFleetAgent(defaultFleetServerPolicy.item.id); + }); + + describe('GET /enrollments/settings', () => { + it('in default space it should return all policies and active fleet server', async () => { + const res = await apiClient.getEnrollmentSettings(); + expect(res.fleet_server.has_active).to.be(true); + }); + + it('in a specific space it should return all policies and active fleet server', async () => { + const res = await apiClient.getEnrollmentSettings(TEST_SPACE_1); + expect(res.fleet_server.has_active).to.be(true); + }); + }); + }); + }); +} diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/index.js b/x-pack/test/fleet_api_integration/apis/space_awareness/index.js index 4313c329104f2..3a3d9ea907150 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/index.js +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/index.js @@ -11,5 +11,6 @@ export default function loadTests({ loadTestFile }) { loadTestFile(require.resolve('./uninstall_tokens')); loadTestFile(require.resolve('./agent_policies')); loadTestFile(require.resolve('./agents')); + loadTestFile(require.resolve('./enrollment_settings')); }); } diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/backfill_group.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/backfill_group.cy.ts index 1b2cbd9add957..7413b8a8f02c7 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/backfill_group.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/backfill_group.cy.ts @@ -34,7 +34,7 @@ import { describe( 'Backfill groups', { - tags: ['@ess', '@serverless'], + tags: ['@ess', '@serverless', '@skipInServerlessMKI'], env: { ftrConfig: { kbnServerArgs: [ diff --git a/yarn.lock b/yarn.lock index abdb1cfe29213..a5738570ec387 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1431,6 +1431,20 @@ resolved "https://registry.yarnpkg.com/@bufbuild/protobuf/-/protobuf-1.2.1.tgz#f8b1fbbe79726a4eafa9772ddde147b57f85d177" integrity sha512-cwwGvLGqvoaOZmoP5+i4v/rbW+rHkguvTehuZyM2p/xpmaNSdT2h3B7kHw33aiffv35t1XrYHIkdJSEkSEMJuA== +"@bundled-es-modules/cookie@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.0.tgz#c3b82703969a61cf6a46e959a012b2c257f6b164" + integrity sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw== + dependencies: + cookie "^0.5.0" + +"@bundled-es-modules/statuses@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz#761d10f44e51a94902c4da48675b71a76cc98872" + integrity sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg== + dependencies: + statuses "^2.0.1" + "@cbor-extract/cbor-extract-darwin-arm64@2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.0.0.tgz#cf0667e4c22111c9d45e16c29964892b12460a76" @@ -2830,6 +2844,43 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@inquirer/confirm@^3.0.0": + version "3.1.8" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-3.1.8.tgz#db80f23f775d9b980c6de2425dde39f9786bf1d3" + integrity sha512-f3INZ+ca4dQdn+MQiq1yP/mOIR/Oc8BLRYuDh6ciToWd6z4W8yArfzjBCMQ0BPY8PcJKwZxGIt8Z6yNT32eSTw== + dependencies: + "@inquirer/core" "^8.2.1" + "@inquirer/type" "^1.3.2" + +"@inquirer/core@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-8.2.1.tgz#ee92c2bf25f378819f56290f8ed8bfef8c6cc94d" + integrity sha512-TIcuQMn2qrtyYe0j136UpHeYpk7AcR/trKeT/7YY0vRgcS9YSfJuQ2+PudPhSofLLsHNnRYAHScQCcVZrJkMqA== + dependencies: + "@inquirer/figures" "^1.0.2" + "@inquirer/type" "^1.3.2" + "@types/mute-stream" "^0.0.4" + "@types/node" "^20.12.12" + "@types/wrap-ansi" "^3.0.0" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + cli-spinners "^2.9.2" + cli-width "^4.1.0" + mute-stream "^1.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + +"@inquirer/figures@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.2.tgz#a6af5e9f9969efb9ed3469130566315c36506b8a" + integrity sha512-4F1MBwVr3c/m4bAUef6LgkvBfSjzwH+OfldgHqcuacWwSUetFebM2wi58WfG9uk1rR98U6GwLed4asLJbwdV5w== + +"@inquirer/type@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.3.2.tgz#439b0b50c152c89fd369d2a17eff54869b4d79b8" + integrity sha512-5Frickan9c89QbPkSu6I6y8p+9eR6hZkdPahGmNDsTFX8FHLPAozyzCZMKUeW8FyYwnlCKUjqIEqxY+UctARiw== + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -7305,6 +7356,23 @@ resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.2.tgz#0f164b726869f71da3c594171df5ebc1c4b0a407" integrity sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ== +"@mswjs/cookies@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@mswjs/cookies/-/cookies-1.1.0.tgz#1528eb43630caf83a1d75d5332b30e75e9bb1b5b" + integrity sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw== + +"@mswjs/interceptors@^0.29.0": + version "0.29.1" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.29.1.tgz#e77fc58b5188569041d0440b25c9e9ebb1ccd60a" + integrity sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw== + dependencies: + "@open-draft/deferred-promise" "^2.2.0" + "@open-draft/logger" "^0.3.0" + "@open-draft/until" "^2.0.0" + is-node-process "^1.2.0" + outvariant "^1.2.1" + strict-event-emitter "^0.5.1" + "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": version "2.1.8-no-fsevents.3" resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" @@ -7603,6 +7671,24 @@ dependencies: "@octokit/openapi-types" "^18.0.0" +"@open-draft/deferred-promise@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz#4a822d10f6f0e316be4d67b4d4f8c9a124b073bd" + integrity sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA== + +"@open-draft/logger@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@open-draft/logger/-/logger-0.3.0.tgz#2b3ab1242b360aa0adb28b85f5d7da1c133a0954" + integrity sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ== + dependencies: + is-node-process "^1.2.0" + outvariant "^1.4.0" + +"@open-draft/until@^2.0.0", "@open-draft/until@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" + integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== + "@opentelemetry/api-metrics@0.31.0", "@opentelemetry/api-metrics@^0.31.0": version "0.31.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api-metrics/-/api-metrics-0.31.0.tgz#0ed4cf4d7c731f968721c2b303eaf5e9fd42f736" @@ -9783,6 +9869,11 @@ dependencies: "@types/node" "*" +"@types/cookie@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" + integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== + "@types/cookiejar@^2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.5.tgz#14a3e83fa641beb169a2dd8422d91c3c345a9a78" @@ -10474,6 +10565,13 @@ resolved "https://registry.yarnpkg.com/@types/mustache/-/mustache-0.8.31.tgz#7c86cbf74f7733f9e3bdc28817623927eb386616" integrity sha512-72flCZJkEJHPwhmpHgg4a0ZBLssMhg5NB0yltRblRlZMo4py3B/u/d7icevc4EeN9MPQUo/dPtuVOoVy9ih6cQ== +"@types/mute-stream@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" + integrity sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow== + dependencies: + "@types/node" "*" + "@types/nock@^10.0.3": version "10.0.3" resolved "https://registry.yarnpkg.com/@types/nock/-/nock-10.0.3.tgz#dab1d18ffbccfbf2db811dab9584304eeb6e1c4c" @@ -10511,7 +10609,7 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@14 || 16 || 17", "@types/node@20.10.5", "@types/node@>= 8", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@>=18.0.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.0.0", "@types/node@^18.11.18": +"@types/node@*", "@types/node@14 || 16 || 17", "@types/node@20.10.5", "@types/node@>= 8", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@>=18.0.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.0.0", "@types/node@^18.11.18", "@types/node@^20.12.12": version "20.10.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== @@ -10929,6 +11027,11 @@ resolved "https://registry.yarnpkg.com/@types/stats-lite/-/stats-lite-2.2.0.tgz#bc8190bf9dfa1e16b89eaa2b433c99dff0804de9" integrity sha512-YV6SS4QC+pbzqjMIV8qVSTDOOazgKBLTVaN+7PfuxELjz/eyzc20KwDVGPrbHt2OcYMA7K2ezLB45Cp6DpNOSQ== +"@types/statuses@^2.0.4": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@types/statuses/-/statuses-2.0.5.tgz#f61ab46d5352fd73c863a1ea4e1cef3b0b51ae63" + integrity sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A== + "@types/styled-components@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.0.tgz#24d3412ba5395aa06e14fbc93c52f9454cebd0d6" @@ -11139,6 +11242,11 @@ tapable "^2.2.0" webpack "^5" +"@types/wrap-ansi@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" + integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== + "@types/ws@*", "@types/ws@^8.5.1": version "8.5.3" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" @@ -11892,12 +12000,12 @@ ansi-colors@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.0.tgz#a4ce2b33d6b214b7950d8595c212f12ac9cc569d" - integrity sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg== +ansi-escapes@^4.2.1, ansi-escapes@^4.3.0, ansi-escapes@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: - type-fest "^0.8.1" + type-fest "^0.21.3" ansi-escapes@^6.2.0: version "6.2.1" @@ -13922,7 +14030,7 @@ cli-progress@^3.12.0: dependencies: string-width "^4.2.3" -cli-spinners@^2.2.0, cli-spinners@^2.5.0: +cli-spinners@^2.2.0, cli-spinners@^2.5.0, cli-spinners@^2.9.2: version "2.9.2" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== @@ -13957,6 +14065,11 @@ cli-width@^3.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== +cli-width@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" + integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== + client-only@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" @@ -18725,7 +18838,7 @@ graphql-tag@^2.12.6: dependencies: tslib "^2.1.0" -graphql@^16.6.0: +graphql@^16.6.0, graphql@^16.8.1: version "16.8.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== @@ -19081,6 +19194,11 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +headers-polyfill@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/headers-polyfill/-/headers-polyfill-4.0.3.tgz#922a0155de30ecc1f785bcf04be77844ca95ad07" + integrity sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ== + heap@^0.2.6: version "0.2.6" resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" @@ -20083,6 +20201,11 @@ is-nil@^1.0.0: resolved "https://registry.yarnpkg.com/is-nil/-/is-nil-1.0.1.tgz#2daba29e0b585063875e7b539d071f5b15937969" integrity sha1-LauingtYUGOHXntTnQcfWxWTeWk= +is-node-process@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-node-process/-/is-node-process-1.2.0.tgz#ea02a1b90ddb3934a19aea414e88edef7e11d134" + integrity sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw== + is-npm@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-6.0.0.tgz#b59e75e8915543ca5d881ecff864077cba095261" @@ -23336,6 +23459,29 @@ msgpackr@^1.9.9: optionalDependencies: msgpackr-extract "^3.0.2" +msw@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.3.1.tgz#bfc73e256ffc2c74ec4381b604abb258df35f32b" + integrity sha512-ocgvBCLn/5l3jpl1lssIb3cniuACJLoOfZu01e3n5dbJrpA5PeeWn28jCLgQDNt6d7QT8tF2fYRzm9JoEHtiig== + dependencies: + "@bundled-es-modules/cookie" "^2.0.0" + "@bundled-es-modules/statuses" "^1.0.1" + "@inquirer/confirm" "^3.0.0" + "@mswjs/cookies" "^1.1.0" + "@mswjs/interceptors" "^0.29.0" + "@open-draft/until" "^2.1.0" + "@types/cookie" "^0.6.0" + "@types/statuses" "^2.0.4" + chalk "^4.1.2" + graphql "^16.8.1" + headers-polyfill "^4.0.2" + is-node-process "^1.2.0" + outvariant "^1.4.2" + path-to-regexp "^6.2.0" + strict-event-emitter "^0.5.1" + type-fest "^4.9.0" + yargs "^17.7.2" + multicast-dns@^7.2.5: version "7.2.5" resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" @@ -23385,6 +23531,11 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mute-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" + integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== + nan@^2.18.0: version "2.18.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" @@ -24342,6 +24493,11 @@ ospath@^1.2.2: resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" integrity sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs= +outvariant@^1.2.1, outvariant@^1.4.0, outvariant@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.4.2.tgz#f54f19240eeb7f15b28263d5147405752d8e2066" + integrity sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ== + p-all@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-all/-/p-all-2.1.0.tgz#91419be56b7dee8fe4c5db875d55e0da084244a0" @@ -24737,6 +24893,11 @@ path-to-regexp@^2.2.1: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== +path-to-regexp@^6.2.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.2.tgz#324377a83e5049cbecadc5554d6a63a9a4866b36" + integrity sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw== + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -28261,10 +28422,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -signal-exit@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" - integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== +signal-exit@^4.0.1, signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== simple-bin-help@^1.8.0: version "1.8.0" @@ -28938,7 +29099,7 @@ stats-lite@^2.2.0: dependencies: isnumber "~1.0.0" -statuses@2.0.1: +statuses@2.0.1, statuses@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== @@ -29026,6 +29187,11 @@ streamx@^2.12.0, streamx@^2.12.5, streamx@^2.13.0, streamx@^2.13.2, streamx@^2.1 optionalDependencies: bare-events "^2.2.0" +strict-event-emitter@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz#1602ece81c51574ca39c6815e09f1a3e8550bd93" + integrity sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ== + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" @@ -30286,6 +30452,11 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -30306,10 +30477,10 @@ type-fest@^2.13.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== -type-fest@^4.15.0, type-fest@^4.17.0: - version "4.17.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.17.0.tgz#4c1b2c2852d2a40ba8c0236d3afc6fc68229e5bf" - integrity sha512-9flrz1zkfLRH3jO3bLflmTxryzKMxVa7841VeMgBaNQGY6vH4RCcpN/sQLB7mQQYh1GZ5utT2deypMuCy4yicw== +type-fest@^4.15.0, type-fest@^4.17.0, type-fest@^4.9.0: + version "4.18.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.18.3.tgz#5249f96e7c2c3f0f1561625f54050e343f1c8f68" + integrity sha512-Q08/0IrpvM+NMY9PA2rti9Jb+JejTddwmwmVQGskAlhtcrw1wsRzoR6ode6mR+OAabNa75w/dxedSUY2mlphaQ== type-is@~1.6.18: version "1.6.18"