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
61 changes: 0 additions & 61 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94167,65 +94167,6 @@ components:
- update
example: create
type: string
Cases_actions_comment_response_properties:
title: Case response properties for actions comments
type: object
properties:
actions:
type: object
properties:
targets:
items:
type: object
properties:
endpointId:
example: 1
type: string
hostname:
example: host-01
type: string
type: array
type:
example: isolate
type: string
comment:
example: Isolating the host from the case UI.
type: string
created_at:
example: '2022-05-13T09:16:17.416Z'
format: date-time
type: string
created_by:
$ref: '#/components/schemas/Cases_case_response_created_by_properties'
id:
example: 8af6ac20-74f6-11ea-b83a-553aecdb28b6
type: string
owner:
$ref: '#/components/schemas/Cases_owner'
pushed_at:
example: null
format: date-time
nullable: true
type: string
pushed_by:
$ref: '#/components/schemas/Cases_case_response_pushed_by_properties'
type:
enum:
- actions
example: actions
type: string
updated_at:
example: null
format: date-time
nullable: true
type: string
updated_by:
$ref: '#/components/schemas/Cases_case_response_updated_by_properties'
version:
example: WzIwNDMxLDFd
type: string
required:
- type
Cases_add_alert_comment_request_properties:
description: Defines properties for case comment requests when type is alert.
type: object
Expand Down Expand Up @@ -94782,13 +94723,11 @@ components:
items:
discriminator:
mapping:
actions: '#/components/schemas/Cases_actions_comment_response_properties'
alert: '#/components/schemas/Cases_alert_comment_response_properties'
event: '#/components/schemas/Cases_event_comment_response_properties'
user: '#/components/schemas/Cases_user_comment_response_properties'
propertyName: type
oneOf:
- $ref: '#/components/schemas/Cases_actions_comment_response_properties'
- $ref: '#/components/schemas/Cases_alert_comment_response_properties'
- $ref: '#/components/schemas/Cases_event_comment_response_properties'
- $ref: '#/components/schemas/Cases_user_comment_response_properties'
Expand Down
99 changes: 34 additions & 65 deletions x-pack/platform/plugins/shared/cases/common/bundled-types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,70 +409,6 @@ export const CaseResponseClosedByProperties = lazySchema(() =>
);
export type CaseResponseClosedByProperties = z.infer<typeof CaseResponseClosedByProperties>;

export const CaseResponseCreatedByProperties = lazySchema(() =>
z.object({
email: z.string().nullable(),
full_name: z.string().nullable(),
username: z.string().nullable(),
profile_uid: z.string().optional(),
})
);
export type CaseResponseCreatedByProperties = z.infer<typeof CaseResponseCreatedByProperties>;

export const CaseResponsePushedByProperties = lazySchema(() =>
z
.object({
email: z.string().nullable(),
full_name: z.string().nullable(),
username: z.string().nullable(),
profile_uid: z.string().optional(),
})
.nullable()
);
export type CaseResponsePushedByProperties = z.infer<typeof CaseResponsePushedByProperties>;

export const CaseResponseUpdatedByProperties = lazySchema(() =>
z
.object({
email: z.string().nullable(),
full_name: z.string().nullable(),
username: z.string().nullable(),
profile_uid: z.string().optional(),
})
.nullable()
);
export type CaseResponseUpdatedByProperties = z.infer<typeof CaseResponseUpdatedByProperties>;

export const ActionsCommentResponseProperties = lazySchema(() =>
z.object({
actions: z
.object({
targets: z
.array(
z.object({
endpointId: z.string().optional(),
hostname: z.string().optional(),
})
)
.optional(),
type: z.string().optional(),
})
.optional(),
comment: z.string().optional(),
created_at: z.string().datetime().optional(),
created_by: CaseResponseCreatedByProperties.optional(),
id: z.string().optional(),
owner: Owner.optional(),
pushed_at: z.string().datetime().nullable().optional(),
pushed_by: CaseResponsePushedByProperties.optional(),
type: z.literal('actions'),
updated_at: z.string().datetime().nullable().optional(),
updated_by: CaseResponseUpdatedByProperties.optional(),
version: z.string().optional(),
})
);
export type ActionsCommentResponseProperties = z.infer<typeof ActionsCommentResponseProperties>;

export const AlertCommentResponseProperties = lazySchema(() =>
z.object({
alertId: z.array(z.string()).optional(),
Expand Down Expand Up @@ -526,6 +462,40 @@ export const AlertCommentResponseProperties = lazySchema(() =>
);
export type AlertCommentResponseProperties = z.infer<typeof AlertCommentResponseProperties>;

export const CaseResponseCreatedByProperties = lazySchema(() =>
z.object({
email: z.string().nullable(),
full_name: z.string().nullable(),
username: z.string().nullable(),
profile_uid: z.string().optional(),
})
);
export type CaseResponseCreatedByProperties = z.infer<typeof CaseResponseCreatedByProperties>;

export const CaseResponsePushedByProperties = lazySchema(() =>
z
.object({
email: z.string().nullable(),
full_name: z.string().nullable(),
username: z.string().nullable(),
profile_uid: z.string().optional(),
})
.nullable()
);
export type CaseResponsePushedByProperties = z.infer<typeof CaseResponsePushedByProperties>;

export const CaseResponseUpdatedByProperties = lazySchema(() =>
z
.object({
email: z.string().nullable(),
full_name: z.string().nullable(),
username: z.string().nullable(),
profile_uid: z.string().optional(),
})
.nullable()
);
export type CaseResponseUpdatedByProperties = z.infer<typeof CaseResponseUpdatedByProperties>;

export const EventCommentResponseProperties = lazySchema(() =>
z.object({
created_at: z.string().datetime().optional(),
Expand Down Expand Up @@ -640,7 +610,6 @@ export const CaseResponseProperties = lazySchema(() =>
comments: z
.array(
z.discriminatedUnion('type', [
ActionsCommentResponseProperties,
AlertCommentResponseProperties,
EventCommentResponseProperties,
UserCommentResponseProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { z } from '@kbn/zod/v4';
import { StepCategory } from '@kbn/workflows';
import type { CommonStepDefinition } from '@kbn/workflows-extensions/common';
import {
ActionsCommentResponseProperties,
AlertCommentResponseProperties,
EventCommentResponseProperties,
UserCommentResponseProperties,
Expand All @@ -20,8 +19,9 @@ import { CasesStepCaseIdSchema } from './shared';

export const GetAllAttachmentsStepTypeId = 'cases.getAllAttachments';

// The workflow step parses this schema with a safeParse fallback
// so unsupported variants flow through untouched instead of throwing.
const AttachmentSchema = z.discriminatedUnion('type', [
ActionsCommentResponseProperties,
AlertCommentResponseProperties,
EventCommentResponseProperties,
UserCommentResponseProperties,
Expand Down
Loading
Loading