types.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. import type { RawRecord } from "@/lib/api/types";
  2. export type CountMap = Record<string, number>;
  3. export type ScoreItem = {
  4. label: string;
  5. score?: number | null;
  6. scoreLabel: string;
  7. detail?: string;
  8. weight?: number | null;
  9. group?: string;
  10. status?: string;
  11. };
  12. export type ScoreThresholds = {
  13. pool_total?: number;
  14. pool_query?: number;
  15. review_total?: number;
  16. review_query?: number;
  17. walk_query?: number;
  18. walk_platform?: number;
  19. walk_total?: number;
  20. };
  21. export type TechnicalRetryAttempt = {
  22. attempt?: number | null;
  23. status: string;
  24. durationSeconds?: number | null;
  25. failureType: string;
  26. exceptionType: string;
  27. httpStatusCode?: number | null;
  28. };
  29. export type TechnicalRetryDetail = {
  30. briefReason: string;
  31. stage: string;
  32. stageLabel: string;
  33. failureType: string;
  34. failureLabel: string;
  35. exceptionType: string;
  36. httpStatusCode?: number | null;
  37. errorMessage: string;
  38. retryCount?: number | null;
  39. videoSource: string;
  40. timings: Record<string, number | null>;
  41. sizes: Record<string, number | null>;
  42. attempts: TechnicalRetryAttempt[];
  43. oss: RawRecord;
  44. };
  45. export type VideoRef = {
  46. id: string;
  47. contentDiscoveryId: string;
  48. platformContentId: string;
  49. title: string;
  50. author: string;
  51. platform: string;
  52. platformLabel: string;
  53. url?: string | null;
  54. ossUrl?: string | null;
  55. mediaStatus: string;
  56. mediaStatusLabel: string;
  57. mediaFailureReason?: string;
  58. tags: string[];
  59. statistics: CountMap;
  60. decisionAction: string;
  61. decisionLabel: string;
  62. decisionReason: string;
  63. decisionReasonLabel: string;
  64. walkOutCount: number;
  65. score?: string;
  66. scoreItems: ScoreItem[];
  67. scoreThresholds?: ScoreThresholds | null;
  68. raw: RawRecord;
  69. decision?: RawRecord;
  70. gemini?: RawRecord;
  71. technicalRetryDetail?: TechnicalRetryDetail | null;
  72. };
  73. export type SourceSummary = {
  74. sourceKind: string;
  75. evidenceLabel: string;
  76. sourceRef: string;
  77. terms: string[];
  78. details: string[];
  79. raw?: RawRecord;
  80. };
  81. export type QuerySummary = {
  82. id: string;
  83. text: string;
  84. method: string;
  85. sourceTerms: string[];
  86. effectStatus: string;
  87. raw: RawRecord;
  88. clue?: RawRecord;
  89. };
  90. export type RuleSummary = {
  91. total: number;
  92. passCount: number;
  93. reviewCount: number;
  94. technicalRetryCount: number;
  95. rejectCount: number;
  96. unknownCount: number;
  97. primaryReason: string;
  98. primaryReasonLabel: string;
  99. scoreLabel: string;
  100. scoreItems: ScoreItem[];
  101. decisions: RawRecord[];
  102. headline?: string;
  103. };
  104. export type WalkSummary = {
  105. total: number;
  106. expansionCount: number;
  107. maxDepth: number;
  108. edgeCounts: CountMap;
  109. statusCounts: CountMap;
  110. stopReasons: CountMap;
  111. actions: RawRecord[];
  112. };
  113. export type AssetSummary = {
  114. assetCount: number;
  115. finalCount: number;
  116. pathCount: number;
  117. paths: RawRecord[];
  118. reviewCount?: number;
  119. technicalRetryCount?: number;
  120. rejectCount?: number;
  121. headline?: string;
  122. };
  123. export type DemandSummary = {
  124. id: string;
  125. name: string;
  126. description: string;
  127. reason: string;
  128. source: string;
  129. score?: string;
  130. date: string;
  131. type: string;
  132. itemsetIds: string[];
  133. seedTerms: string[];
  134. sourcePostId: string;
  135. support?: string;
  136. patternExecutionId: string;
  137. miningConfigId: string;
  138. categoryPaths: string[];
  139. extractedPoints: string[];
  140. categoryLeafTerms: string[];
  141. };
  142. export type FlowLedgerRow = {
  143. id: string;
  144. source: SourceSummary;
  145. query: QuerySummary;
  146. firstRoundVideos: VideoRef[];
  147. firstRoundVideoTotal: number;
  148. videoStats: CountMap;
  149. duplicateCount: number;
  150. ruleSummary: RuleSummary;
  151. walkSummary: WalkSummary;
  152. finalAssets: AssetSummary;
  153. };
  154. export type FlowLedger = {
  155. runId: string;
  156. dataOrigin: string;
  157. dataOriginLabel: string;
  158. summary: RawRecord;
  159. demandSummary?: DemandSummary;
  160. extensionQueries: RawRecord[];
  161. rows: FlowLedgerRow[];
  162. raw: {
  163. queries: RawRecord[];
  164. contentItems: RawRecord[];
  165. decisions: RawRecord[];
  166. walkActions: RawRecord[];
  167. sourcePaths: RawRecord[];
  168. };
  169. };