types.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. export type DataOrigin = "production_db" | "runtime_export" | "mixed_with_runtime_export";
  2. export type RawRecord = Record<string, unknown>;
  3. export type RunListItem = {
  4. run_id: string;
  5. policy_run_id?: string | null;
  6. status?: string | null;
  7. current_step?: string | null;
  8. platform?: string | null;
  9. platform_mode?: string | null;
  10. content_format?: string | null;
  11. strategy_version?: string | null;
  12. demand_content_id?: number | null;
  13. demand_name?: string | null;
  14. demand_desc?: string | null;
  15. validation_status?: string | null;
  16. error_code?: string | null;
  17. started_at?: string | null;
  18. completed_at?: string | null;
  19. };
  20. export type RunListResponse = {
  21. items: RunListItem[];
  22. page: number;
  23. page_size: number;
  24. total: number;
  25. data_origin: DataOrigin;
  26. };
  27. export type RuntimeFileResponse = {
  28. run_id: string;
  29. filename: string;
  30. data_origin: DataOrigin;
  31. data?: RawRecord;
  32. records?: RawRecord[];
  33. offset?: number;
  34. limit?: number;
  35. total?: number;
  36. };
  37. export type DashboardResponse = {
  38. run_id: string;
  39. summary: RawRecord;
  40. counts: Record<string, number>;
  41. files: Record<string, boolean>;
  42. validation: RawRecord;
  43. final_output_summary: RawRecord;
  44. business_summary?: RawRecord;
  45. data_origin: DataOrigin;
  46. links?: Record<string, string>;
  47. };
  48. export type QueryListResponse = {
  49. run_id: string;
  50. items: RawRecord[];
  51. total: number;
  52. data_origin: DataOrigin;
  53. };
  54. export type ContentItemsResponse = {
  55. run_id: string;
  56. items: RawRecord[];
  57. total: number;
  58. data_origin: DataOrigin;
  59. };
  60. export type TimelineItem = {
  61. source: string;
  62. stage?: string | null;
  63. event_type?: string | null;
  64. status?: string | null;
  65. timestamp?: string | null;
  66. error_code?: string | null;
  67. walk_action_id?: string | null;
  68. record: RawRecord;
  69. };
  70. export type TimelineResponse = {
  71. run_id: string;
  72. items: TimelineItem[];
  73. total: number;
  74. data_origin: DataOrigin;
  75. summary: RawRecord;
  76. };
  77. export type FlowInput = {
  78. dashboard: DashboardResponse;
  79. queries: QueryListResponse;
  80. contentItems: ContentItemsResponse;
  81. timeline: TimelineResponse;
  82. searchQueries: RawRecord[];
  83. searchClues: RawRecord[];
  84. ruleDecisions: RawRecord[];
  85. walkActions: RawRecord[];
  86. sourcePathRecords: RawRecord[];
  87. };
  88. export type FlowLedgerApiResponse = {
  89. run_id: string;
  90. data_origin: DataOrigin;
  91. data_origin_label: string;
  92. summary: RawRecord;
  93. demand_summary?: RawRecord | null;
  94. rows: RawRecord[];
  95. extension_queries: RawRecord[];
  96. debug?: RawRecord | null;
  97. };
  98. export type FlowLedgerVideosResponse = {
  99. run_id: string;
  100. query?: RawRecord | null;
  101. videos: RawRecord[];
  102. summary: RawRecord;
  103. data_origin: DataOrigin;
  104. data_origin_label: string;
  105. };
  106. export type FlowLedgerWalkResponse = {
  107. run_id: string;
  108. query?: RawRecord | null;
  109. actions: RawRecord[];
  110. lanes: Record<string, RawRecord[]>;
  111. extension_queries: RawRecord[];
  112. summary: RawRecord;
  113. data_origin: DataOrigin;
  114. data_origin_label: string;
  115. };
  116. export type FlowLedgerVideoResponse = {
  117. run_id: string;
  118. video?: RawRecord | null;
  119. source_paths: RawRecord[];
  120. decision?: RawRecord | null;
  121. data_origin: DataOrigin;
  122. data_origin_label: string;
  123. };
  124. export type FlowLedgerVideoWalkResponse = {
  125. run_id: string;
  126. root_video?: RawRecord | null;
  127. actions: RawRecord[];
  128. summary: RawRecord;
  129. data_origin: DataOrigin;
  130. data_origin_label: string;
  131. };