types.ts 3.0 KB

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