MCPcopy Create free account
hub / github.com/compozy/agh / configApplyHistoryBundle

Function configApplyHistoryBundle

internal/cli/config.go:1344–1378  ·  view source on GitHub ↗
(record SettingsApplyHistoryRecord)

Source from the content-addressed store, hash-verified

1342}
1343
1344func configApplyHistoryBundle(record SettingsApplyHistoryRecord) outputBundle {
1345 rows := make([][]string, 0, len(record.Entries))
1346 for _, entry := range record.Entries {
1347 rows = append(rows, []string{
1348 entry.ID,
1349 string(entry.Status),
1350 string(entry.Lifecycle),
1351 strconv.FormatInt(entry.Generation, 10),
1352 entry.Actor,
1353 string(entry.NextAction),
1354 entry.UpdatedAt.Format(time.RFC3339),
1355 })
1356 }
1357 return outputBundle{
1358 jsonValue: record,
1359 human: func() (string, error) {
1360 return renderHumanTable("Config Apply History", []string{
1361 "ID",
1362 configStatusValue,
1363 "Lifecycle",
1364 "Generation",
1365 "Actor",
1366 cliNextActionValue,
1367 "Updated",
1368 }, rows), nil
1369 },
1370 toon: func() (string, error) {
1371 data, err := json.Marshal(record)
1372 if err != nil {
1373 return "", fmt.Errorf("cli: marshal config apply-history toon payload: %w", err)
1374 }
1375 return renderToonObject("config_apply_history", []string{"entries"}, []string{string(data)}), nil
1376 },
1377 }
1378}
1379
1380func configPathBundle(record configPathRecord) outputBundle {
1381 rows := []keyValue{

Callers 1

Calls 3

appendFunction · 0.85
renderHumanTableFunction · 0.85
renderToonObjectFunction · 0.85

Tested by

no test coverage detected