index.ts 982 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import z from 'zod';
  6. import { IReport } from '@runtime/index';
  7. import { FlowGramAPIDefine } from '@api/type';
  8. import { WorkflowZodSchema } from '@api/schema';
  9. import { FlowGramAPIName, FlowGramAPIMethod, FlowGramAPIModule } from '@api/constant';
  10. export interface TaskReportInput {
  11. taskID: string;
  12. }
  13. export type TaskReportOutput = IReport | undefined;
  14. export const TaskReportDefine: FlowGramAPIDefine = {
  15. name: FlowGramAPIName.TaskReport,
  16. method: FlowGramAPIMethod.GET,
  17. path: '/task/report',
  18. module: FlowGramAPIModule.Task,
  19. schema: {
  20. input: z.object({
  21. taskID: z.string(),
  22. }),
  23. output: z.object({
  24. id: z.string(),
  25. inputs: WorkflowZodSchema.Inputs,
  26. outputs: WorkflowZodSchema.Outputs,
  27. workflowStatus: WorkflowZodSchema.Status,
  28. reports: WorkflowZodSchema.Reports,
  29. messages: WorkflowZodSchema.Messages,
  30. }),
  31. },
  32. };