|
| 1 | +package twinformat |
| 2 | + |
| 3 | +// DocFieldsConfig contains the documentation fields for JSON output files. |
| 4 | +// Every JSON file in the twin format output must have these fields. |
| 5 | +type DocFieldsConfig struct { |
| 6 | + Comment string |
| 7 | + Purpose string |
| 8 | + UpdateFrequency string |
| 9 | + Security string |
| 10 | + Retention string |
| 11 | +} |
| 12 | + |
| 13 | +// DefaultDocFields returns the default documentation fields configuration. |
| 14 | +func DefaultDocFields() *DocFieldsConfig { |
| 15 | + return &DocFieldsConfig{ |
| 16 | + UpdateFrequency: "Every sync", |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +// BucketsIndexDocFields returns documentation fields for buckets/index.json. |
| 21 | +func BucketsIndexDocFields() *DocFieldsConfig { |
| 22 | + return &DocFieldsConfig{ |
| 23 | + Comment: "GENERATION: GET /v2/storage/buckets - aggregate all buckets", |
| 24 | + Purpose: "Catalog of all buckets for fast lookup without scanning directories", |
| 25 | + UpdateFrequency: "Every sync", |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +// TableMetadataDocFields returns documentation fields for table metadata.json files. |
| 30 | +func TableMetadataDocFields(source string) *DocFieldsConfig { |
| 31 | + return &DocFieldsConfig{ |
| 32 | + Comment: "GENERATION: GET /v2/storage/tables/{table_id}?include=columns,metadata + computed dependencies", |
| 33 | + Purpose: "Table metadata for " + source, |
| 34 | + UpdateFrequency: "On table structure changes", |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +// TransformationsIndexDocFields returns documentation fields for transformations/index.json. |
| 39 | +func TransformationsIndexDocFields() *DocFieldsConfig { |
| 40 | + return &DocFieldsConfig{ |
| 41 | + Comment: "GENERATION: Scan transformation configs + group by platform", |
| 42 | + Purpose: "Catalog of all transformations grouped by platform", |
| 43 | + UpdateFrequency: "Every sync", |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +// TransformationMetadataDocFields returns documentation fields for transformation metadata.json files. |
| 48 | +func TransformationMetadataDocFields() *DocFieldsConfig { |
| 49 | + return &DocFieldsConfig{ |
| 50 | + Comment: "GENERATION: From transformation config + platform detection + computed dependencies + job queue status", |
| 51 | + Purpose: "Complete transformation configuration and data flow dependencies", |
| 52 | + UpdateFrequency: "On transformation config changes and job completion", |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +// JobsIndexDocFields returns documentation fields for jobs/index.json. |
| 57 | +func JobsIndexDocFields() *DocFieldsConfig { |
| 58 | + return &DocFieldsConfig{ |
| 59 | + Comment: "GENERATION: GET /search/jobs + aggregate statistics", |
| 60 | + Purpose: "Job execution statistics and summary", |
| 61 | + UpdateFrequency: "Every hour or on job completion", |
| 62 | + } |
| 63 | +} |
| 64 | + |
| 65 | +// JobMetadataDocFields returns documentation fields for individual job files. |
| 66 | +func JobMetadataDocFields() *DocFieldsConfig { |
| 67 | + return &DocFieldsConfig{ |
| 68 | + Comment: "GENERATION: GET /search/jobs/{job_id}", |
| 69 | + Purpose: "Individual job execution details", |
| 70 | + UpdateFrequency: "On job completion", |
| 71 | + } |
| 72 | +} |
| 73 | + |
| 74 | +// ManifestExtendedDocFields returns documentation fields for manifest-extended.json. |
| 75 | +func ManifestExtendedDocFields() *DocFieldsConfig { |
| 76 | + return &DocFieldsConfig{ |
| 77 | + Comment: "GENERATION: GET /v2/storage/tokens/verify + computed statistics", |
| 78 | + Purpose: "Complete project overview in one file for fast AI analysis", |
| 79 | + UpdateFrequency: "Every sync", |
| 80 | + } |
| 81 | +} |
| 82 | + |
| 83 | +// SourcesIndexDocFields returns documentation fields for indices/sources.json. |
| 84 | +func SourcesIndexDocFields() *DocFieldsConfig { |
| 85 | + return &DocFieldsConfig{ |
| 86 | + Comment: "GENERATION: Inferred from bucket names + GET /v2/storage components", |
| 87 | + Purpose: "Registry of data sources with bucket and table counts", |
| 88 | + UpdateFrequency: "Every sync", |
| 89 | + } |
| 90 | +} |
| 91 | + |
| 92 | +// ComponentsIndexDocFields returns documentation fields for components/index.json. |
| 93 | +func ComponentsIndexDocFields() *DocFieldsConfig { |
| 94 | + return &DocFieldsConfig{ |
| 95 | + Comment: "GENERATION: Scan component configs + group by type", |
| 96 | + Purpose: "Catalog of all components grouped by type", |
| 97 | + UpdateFrequency: "Every sync", |
| 98 | + } |
| 99 | +} |
| 100 | + |
| 101 | +// ComponentMetadataDocFields returns documentation fields for component metadata.json files. |
| 102 | +func ComponentMetadataDocFields() *DocFieldsConfig { |
| 103 | + return &DocFieldsConfig{ |
| 104 | + Comment: "GENERATION: From component config + job queue status", |
| 105 | + Purpose: "Complete component configuration and execution status", |
| 106 | + UpdateFrequency: "On component config changes and job completion", |
| 107 | + } |
| 108 | +} |
0 commit comments