From 13c9292dd39efdb4fadaf7c95cb704ff2fe0bd22 Mon Sep 17 00:00:00 2001 From: Jan Scheffler Date: Fri, 10 Jul 2026 14:53:51 +0200 Subject: [PATCH] fix: drop calls/news commands for removed API endpoints; fix jobs columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apollo removed the nested sub-resource routes these relied on (see apollo-api fix/remove-dead-list-endpoints): - Remove 'news list' (list_account_news is gone; no replacement). - Remove 'calls list' (list_contact_calls is gone); 'calls search' stays. - 'jobs list' now surfaces the organization_job_postings shape returned by the fixed list_account_jobs: columns Title/City/State/URL/Posted (was Location/Department, which the new shape doesn't carry). End-to-end verified against the fixed api: jobs list → 395 postings, calls search → 221, news command removed. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/apollo_cli/app.py | 2 -- src/apollo_cli/commands/calls.py | 21 ++----------------- src/apollo_cli/commands/jobs.py | 4 ++-- src/apollo_cli/commands/news.py | 35 -------------------------------- 4 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 src/apollo_cli/commands/news.py diff --git a/src/apollo_cli/app.py b/src/apollo_cli/app.py index 05f9e36..3ea54a8 100644 --- a/src/apollo_cli/app.py +++ b/src/apollo_cli/app.py @@ -33,7 +33,6 @@ from apollo_cli.commands.enrich import enrich_app # noqa: E402 from apollo_cli.commands.install import install_app # noqa: E402 from apollo_cli.commands.jobs import jobs_app # noqa: E402 -from apollo_cli.commands.news import news_app # noqa: E402 from apollo_cli.commands.notes import notes_app # noqa: E402 from apollo_cli.commands.people import people_app # noqa: E402 from apollo_cli.commands.pipelines import pipelines_app, stages_app # noqa: E402 @@ -55,7 +54,6 @@ conversations_app, custom_fields_app, emails_app, - news_app, jobs_app, usage_app, install_app, diff --git a/src/apollo_cli/commands/calls.py b/src/apollo_cli/commands/calls.py index e7ade9b..6882d22 100644 --- a/src/apollo_cli/commands/calls.py +++ b/src/apollo_cli/commands/calls.py @@ -2,13 +2,11 @@ from __future__ import annotations -from typing import Annotated - -from cyclopts import App, Parameter +from cyclopts import App from apollo_cli.context import ctx from apollo_cli.formatters.generic import list_table -from apollo_cli.output import output_json, output_list, output_markdown +from apollo_cli.output import output_list calls_app = App(name="calls", help="Call activity.") @@ -37,18 +35,3 @@ async def search() -> None: format_fn=lambda items, **kw: list_table(items, CALL_LIST_COLUMNS, title="Calls", **kw), resource_name="Calls", ) - - -@calls_app.command(name="list") -async def list_contact_calls( - contact_id: Annotated[str, Parameter(help="Contact ID")], -) -> None: - """List calls for a specific contact.""" - async with ctx.client() as client: - result = await client.list_contact_calls(contact_id) - - if ctx.json_mode: - output_json(result) - else: - md = list_table(result, CALL_LIST_COLUMNS, title="Contact Calls", total=len(result), page=1) - output_markdown(md) diff --git a/src/apollo_cli/commands/jobs.py b/src/apollo_cli/commands/jobs.py index c78979a..bfb7d1c 100644 --- a/src/apollo_cli/commands/jobs.py +++ b/src/apollo_cli/commands/jobs.py @@ -14,8 +14,8 @@ JOBS_LIST_COLUMNS = [ ("Title", "title"), - ("Location", "location"), - ("Department", "department"), + ("City", "city"), + ("State", "state"), ("URL", "url"), ("Posted", "posted_at"), ] diff --git a/src/apollo_cli/commands/news.py b/src/apollo_cli/commands/news.py deleted file mode 100644 index 07846c2..0000000 --- a/src/apollo_cli/commands/news.py +++ /dev/null @@ -1,35 +0,0 @@ -"""News command group.""" - -from __future__ import annotations - -from typing import Annotated - -from cyclopts import App, Parameter - -from apollo_cli.context import ctx -from apollo_cli.formatters.generic import list_table -from apollo_cli.output import output_json, output_markdown - -news_app = App(name="news", help="Account news.") - -NEWS_LIST_COLUMNS = [ - ("Title", "title"), - ("Category", "category"), - ("Published", "published_at"), - ("URL", "url"), -] - - -@news_app.command(name="list") -async def list_news( - account_id: Annotated[str, Parameter(help="Account ID")], -) -> None: - """List news articles for an account.""" - async with ctx.client() as client: - result = await client.list_account_news(account_id) - - if ctx.json_mode: - output_json(result) - else: - md = list_table(result, NEWS_LIST_COLUMNS, title="Account News", total=len(result), page=1) - output_markdown(md)