Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
281 changes: 207 additions & 74 deletions oas_docs/output/kibana.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"./oas_docs/output/kibana.yaml": 1238,
"./oas_docs/output/kibana.yaml": 1237,
"./oas_docs/output/kibana.serverless.yaml": 1131
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,6 @@ describe('buildKibanaRequest', () => {
});
});

it('should handle query parameters', () => {
const result = buildKibanaRequest(
'kibana.getCase',
{
caseId: 'test-case-id',
includeComments: true,
},
'cases-space'
);

expect(result.path).toBe('/s/cases-space/api/cases/test-case-id');
expect(result.query).toBeDefined();
expect(result.query).toHaveProperty('includeComments');
});

it('should handle requests with no body', () => {
const result = buildKibanaRequest('kibana.getCase', { caseId: 'test-case' }, 'monitoring');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You must have \`read\` privileges for the **Cases** feature in the **Management*
parameterTypes: {
headerParams: [],
pathParams: ['caseId'],
urlParams: ['includeComments'],
urlParams: [],
bodyParams: [],
},
paramsSchema: z.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,7 @@ export const get_case_default_space_request = z.object({
description: 'The identifier for the case. To retrieve case IDs, use the search cases (`_find)` API. All non-ASCII characters must be URL encoded.'
})
}),
query: z.optional(z.object({
includeComments: z.optional(z.boolean().register(z.globalRegistry, {
description: 'Deprecated in 8.1.0. This parameter is deprecated and will be removed in a future release. It determines whether case comments are returned.'
})).default(true)
}))
query: z.optional((z.never())),
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export const KIBANA_VALID_SAMPLE_STEPS = [
type: 'kibana.getCase',
with: {
caseId: '123',
includeComments: true,
},
},
{
Expand Down Expand Up @@ -221,9 +220,7 @@ export const KIBANA_INVALID_SAMPLE_STEPS = [
step: {
name: 'get_case_without_case_id',
type: 'kibana.getCase',
with: {
includeComments: true,
},
with: {},
},
zodErrorMessage: 'Invalid input: expected string, received undefined',
diagnosticErrorMessage: /Missing property "caseId"/,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,4 @@ steps:
type: kibana.getCase
with:
caseId: \${{variables.case_id}}
includeComments: false
`;
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ export const Settings = z.object({
*/
syncAlerts: z.boolean(),
/**
* Auto extracts observables
*/
* When true, observables (e.g. IPs, hashes, URLs) are automatically extracted from case comments. Optional; defaults to false when omitted.

*/
extractObservables: z.boolean().optional(),
});

Expand Down Expand Up @@ -912,6 +913,78 @@ export const UpdateCaseConfigurationRequest = z.object({
version: z.string(),
});

/**
* Case details returned by the get case API. The comments property is not included in the response. Use the find case comments API to retrieve comments. totalComment reflects the actual number of user comments.

*/
export type CaseResponseGetCase = z.infer<typeof CaseResponseGetCase>;
export const CaseResponseGetCase = z.object({
assignees: Assignees.optional(),
/**
* The case category.
*/
category: z.string().nullable().optional(),
closed_at: z.string().datetime().nullable(),
closed_by: CaseResponseClosedByProperties,
connector: z.discriminatedUnion('type', [
ConnectorPropertiesNone,
ConnectorPropertiesCasesWebhook,
ConnectorPropertiesJira,
ConnectorPropertiesResilient,
ConnectorPropertiesServicenow,
ConnectorPropertiesServicenowSir,
ConnectorPropertiesSwimlane,
]),
created_at: z.string().datetime(),
created_by: CaseResponseCreatedByProperties,
/**
* Custom field values for the case.
*/
customFields: z
.array(
z.object({
/**
* The unique identifier for the custom field. The key value must exist in the case configuration settings.

*/
key: z.string().optional(),
/**
* The custom field type. It must match the type specified in the case configuration settings.

*/
type: z.enum(['text', 'toggle']).optional(),
/**
* The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`.

*/
value: z.union([z.string().min(1).max(160).nullable(), z.boolean()]).optional(),
})
)
.optional(),
description: z.string(),
/**
* The elapsed time from the creation of the case to its closure (in seconds). If the case has not been closed, the duration is set to null. If the case was closed after less than half a second, the duration is rounded down to zero.

*/
duration: z.number().int().nullable(),
external_service: ExternalService,
id: z.string(),
owner: Owner,
settings: Settings,
severity: CaseSeverity,
status: CaseStatus,
tags: z.array(z.string()),
title: z.string(),
totalAlerts: z.number().int(),
/**
* The number of user comments on the case. Use the find case comments API to retrieve comment content.
*/
totalComment: z.number().int(),
updated_at: z.string().datetime().nullable(),
updated_by: CaseResponseUpdatedByProperties,
version: z.string(),
});

export type AlertResponseProperties = z.infer<typeof AlertResponseProperties>;
export const AlertResponseProperties = z.object({
attached_at: z.string().datetime().optional(),
Expand Down Expand Up @@ -1057,6 +1130,26 @@ export const UpdateCaseCommentRequest = z.discriminatedUnion('type', [
UpdateUserCommentRequestProperties,
]);

export type FindCommentsResponse = z.infer<typeof FindCommentsResponse>;
export const FindCommentsResponse = z.object({
/**
* Paginated list of user comments for the case.
*/
comments: z.array(UserCommentResponseProperties),
/**
* The current page index.
*/
page: z.number().int(),
/**
* The number of items per page.
*/
per_page: z.number().int(),
/**
* The total number of comments.
*/
total: z.number().int(),
});

export type Actions = z.infer<typeof Actions>;
export const Actions = z.enum(['add', 'create', 'delete', 'push_to_service', 'update']);
export type ActionsEnum = typeof Actions.enum;
Expand Down
Loading
Loading