topic.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import {
  2. Topic,
  3. TopicDetails,
  4. TopicConfig,
  5. TopicCreation,
  6. ConsumerGroup,
  7. TopicColumnsToSort,
  8. TopicMessage,
  9. TopicMessageConsuming,
  10. TopicMessageSchema,
  11. SortOrder,
  12. } from 'generated-sources';
  13. export type TopicName = Topic['name'];
  14. interface TopicConfigParams {
  15. [paramName: string]: TopicConfig;
  16. }
  17. export interface TopicConfigByName {
  18. byName: TopicConfigParams;
  19. }
  20. interface TopicFormCustomParams {
  21. byIndex: TopicConfigParams;
  22. allIndexes: TopicName[];
  23. }
  24. export interface TopicWithDetailedInfo extends Topic, TopicDetails {
  25. config?: TopicConfig[];
  26. consumerGroups?: ConsumerGroup[];
  27. messageSchema?: TopicMessageSchema;
  28. }
  29. export interface TopicsState {
  30. byName: { [topicName: string]: TopicWithDetailedInfo };
  31. allNames: TopicName[];
  32. totalPages: number;
  33. search: string;
  34. orderBy: TopicColumnsToSort | null;
  35. sortOrder: SortOrder;
  36. consumerGroups: ConsumerGroup[];
  37. }
  38. export type TopicFormFormattedParams = TopicCreation['configs'];
  39. export interface TopicFormDataRaw {
  40. name: string;
  41. partitions: number;
  42. replicationFactor: number;
  43. minInSyncReplicas: number;
  44. cleanupPolicy: string;
  45. retentionMs: number;
  46. retentionBytes: number;
  47. maxMessageBytes: number;
  48. customParams: TopicFormCustomParams;
  49. }
  50. export interface TopicFormData {
  51. name: string;
  52. partitions: number;
  53. replicationFactor: number;
  54. minInSyncReplicas: number;
  55. cleanupPolicy: string;
  56. retentionMs: number;
  57. retentionBytes: number;
  58. maxMessageBytes: number;
  59. customParams: {
  60. name: string;
  61. value: string;
  62. }[];
  63. }
  64. export interface TopicMessagesState {
  65. messages: TopicMessage[];
  66. phase?: string;
  67. meta: TopicMessageConsuming;
  68. isFetching: boolean;
  69. }