Skip to content
Merged
Changes from 2 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
14 changes: 12 additions & 2 deletions x-pack/plugins/case/common/api/cases/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NumberFromString } from '../saved_object';
import { UserRT } from '../user';
import { CommentResponseRt } from './comment';
import { CasesStatusResponseRt } from './status';
import { CaseConnectorRt, ESCaseConnector } from '../connectors';
import { CaseConnectorRt, ESCaseConnector, ConnectorFieldsRt } from '../connectors';

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
export { ActionTypeExecutorResult } from '../../../../actions/server/types';
Expand Down Expand Up @@ -133,7 +133,7 @@ export const ServiceConnectorCommentParamsRt = rt.type({
updatedBy: rt.union([ServiceConnectorUserParams, rt.null]),
});

export const ServiceConnectorCaseParamsRt = rt.type({
export const ServiceConnectorBasicCaseParamsRt = rt.type({
comments: rt.union([rt.array(ServiceConnectorCommentParamsRt), rt.null]),
createdAt: rt.string,
createdBy: ServiceConnectorUserParams,
Expand All @@ -145,6 +145,16 @@ export const ServiceConnectorCaseParamsRt = rt.type({
updatedBy: rt.union([ServiceConnectorUserParams, rt.null]),
});

export const ServiceConnectorCaseParamsWithFieldsRt = rt.intersection([
ServiceConnectorBasicCaseParamsRt,
ConnectorFieldsRt,
]);

export const ServiceConnectorCaseParamsRt = rt.union([
ServiceConnectorBasicCaseParamsRt,
ServiceConnectorCaseParamsWithFieldsRt,
]);

export const ServiceConnectorCaseResponseRt = rt.intersection([
rt.type({
title: rt.string,
Expand Down