diff --git a/CHANGELOG.md b/CHANGELOG.md index 1536f48..ad2febd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.7.2 (2026-11-19) + +- SDK/CLI: `ContactsRunEventsParams.tail` (`discolike contacts run events --tail`) returns the newest page of a run's events instead of reading from `after`, so a finished or long run shows what happened last. Poll on with `after=next_cursor`. Omitted unless set; it needs an API release that knows the parameter. + ## 0.7.1 (2026-11-19) - SDK: `ContactsRunRequest.timezone` (an IANA zone such as `America/New_York`, omitted unless set) names the run's saved list in that zone instead of UTC. It needs an API release that knows the field. diff --git a/packages/discolike-cli/pyproject.toml b/packages/discolike-cli/pyproject.toml index ef5f037..437c420 100644 --- a/packages/discolike-cli/pyproject.toml +++ b/packages/discolike-cli/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "discolike-cli" -version = "0.7.1" +version = "0.7.2" description = "Official CLI for the DiscoLike API" readme = "README.md" license = "MIT" @@ -12,7 +12,7 @@ license-files = ["LICENSE"] requires-python = ">=3.11" authors = [{ name = "DiscoLike", email = "support@discolike.com" }] dependencies = [ - "discolike==0.7.1", + "discolike==0.7.2", "typer>=0.26.1,<0.28", "rich>=13.0", ] diff --git a/packages/discolike-cli/src/discolike_cli/contacts_run.py b/packages/discolike-cli/src/discolike_cli/contacts_run.py index 530ae54..9bdcefd 100644 --- a/packages/discolike-cli/src/discolike_cli/contacts_run.py +++ b/packages/discolike-cli/src/discolike_cli/contacts_run.py @@ -145,9 +145,10 @@ def events_command( run_id: str = typer.Argument(..., help="Run ID."), after: int | None = typer.Option(None, help="Return events after this cursor."), limit: int | None = typer.Option(None, help="Events per page (default 100, maximum 500)."), + tail: bool = typer.Option(False, "--tail", help="Return the newest page instead of reading from --after."), ) -> None: """Read company progress events and the next cursor.""" from discolike_cli.main import get_client - params = build_request(ContactsRunEventsParams, _merge_params(None, after=after, limit=limit)) + params = build_request(ContactsRunEventsParams, _merge_params(None, after=after, limit=limit, tail=tail or None)) emit(get_client(ctx).contacts_run.events(run_id, params)) diff --git a/packages/discolike-cli/tests/test_contacts_run_cli.py b/packages/discolike-cli/tests/test_contacts_run_cli.py index b6176b8..510fe58 100644 --- a/packages/discolike-cli/tests/test_contacts_run_cli.py +++ b/packages/discolike-cli/tests/test_contacts_run_cli.py @@ -129,6 +129,17 @@ def handler(request: httpx2.Request) -> httpx2.Response: assert json.loads(result.stdout)["next_cursor"] == 5 +def test_run_events_tail(install_build_client: Callable[[Handler], None]) -> None: + def handler(request: httpx2.Request) -> httpx2.Response: + assert dict(request.url.params) == {"tail": "true", "limit": "20"} + return httpx2.Response(200, json={"events": [], "next_cursor": 9}) + + install_build_client(handler) + result = runner.invoke(app, ["contacts", "run", "events", RUN_ID, "--tail", "--limit", "20"]) + assert result.exit_code == 0, result.output + assert json.loads(result.stdout)["next_cursor"] == 9 + + @pytest.mark.parametrize("flag", ["--follow", "--email-cap-usd"]) def test_removed_wait_flags(flag: str) -> None: assert runner.invoke(app, ["contacts", "run", "wait", RUN_ID, flag]).exit_code == 2 diff --git a/packages/discolike/pyproject.toml b/packages/discolike/pyproject.toml index acee0b8..11ba4e2 100644 --- a/packages/discolike/pyproject.toml +++ b/packages/discolike/pyproject.toml @@ -34,7 +34,7 @@ classifiers = [ ] [project.optional-dependencies] -cli = ["discolike-cli==0.7.1"] +cli = ["discolike-cli==0.7.2"] [project.urls] Homepage = "https://www.discolike.com" diff --git a/packages/discolike/src/discolike/_contacts_run_requests.py b/packages/discolike/src/discolike/_contacts_run_requests.py index e328b7a..daed92b 100644 --- a/packages/discolike/src/discolike/_contacts_run_requests.py +++ b/packages/discolike/src/discolike/_contacts_run_requests.py @@ -251,6 +251,7 @@ class ContactsRunRequest(DiscolikeRequest): class ContactsRunEventsParams(DiscolikeRequest): after: int = Field(default=0, ge=0) limit: int = Field(default=100, ge=1, le=500) + tail: bool = False class ContactsRunListParams(DiscolikeRequest): diff --git a/packages/discolike/src/discolike/_generated/requests.py b/packages/discolike/src/discolike/_generated/requests.py index 41667d0..695d780 100644 --- a/packages/discolike/src/discolike/_generated/requests.py +++ b/packages/discolike/src/discolike/_generated/requests.py @@ -1264,6 +1264,7 @@ class ContinueRunRequest(DiscolikeRequest): class ContactsRunEventsParams(DiscolikeRequest): after: Annotated[int | None, Field(ge=0, title="After")] = 0 limit: Annotated[int | None, Field(ge=1, le=500, title="Limit")] = 100 + tail: Annotated[bool | None, Field(title="Tail")] = False class DiscoGenProcessRequest(DiscolikeRequest): @@ -3304,7 +3305,7 @@ class PromptCompanies(DiscolikeRequest): icp_text: Annotated[ str | None, Field( - description="Plain-language description of the companies you want.", + description="Describe the companies you want. Omit company criteria to search all companies by the titles in people.fit.", min_length=3, title="Icp Text", ), @@ -3331,7 +3332,7 @@ class ContactsRunRequest(DiscolikeRequest): max_companies: Annotated[ int | None, Field( - description="Target companies delivering at least one validated contact.", + description="Target companies delivering at least one validated contact, or LinkedIn contact when include_linkedin_only is set.", ge=1, le=10000, title="Max Companies", @@ -3340,12 +3341,19 @@ class ContactsRunRequest(DiscolikeRequest): per_company: Annotated[ int | None, Field( - description="Maximum validated contacts per company.", + description="Maximum validated contacts per company, LinkedIn contacts included when include_linkedin_only is set.", ge=1, le=50, title="Per Company", ), ] = 10 + include_linkedin_only: Annotated[ + bool | None, + Field( + description="Also deliver people whose email could not be verified, without an email and with their LinkedIn profile, at 1 record each. They count toward max_companies and per_company.", + title="Include Linkedin Only", + ), + ] = False email_cap_usd: Annotated[ EmailCapUsd | str | None, Field(description="Maximum delivery spend in USD.", title="Email Cap Usd"), @@ -3356,3 +3364,11 @@ class ContactsRunRequest(DiscolikeRequest): str | None, Field(description="Idempotency key for starting a run.", title="Create Key"), ] = None + timezone: Annotated[ + str | None, + Field( + description="IANA time zone, such as America/New_York, for the time in the run's default saved-list name. UTC when omitted.", + max_length=64, + title="Timezone", + ), + ] = None diff --git a/packages/discolike/src/discolike/_version.py b/packages/discolike/src/discolike/_version.py index a5f830a..bc8c296 100644 --- a/packages/discolike/src/discolike/_version.py +++ b/packages/discolike/src/discolike/_version.py @@ -1 +1 @@ -__version__ = "0.7.1" +__version__ = "0.7.2" diff --git a/packages/discolike/tests/test_package.py b/packages/discolike/tests/test_package.py index 2451fd2..7da4dfd 100644 --- a/packages/discolike/tests/test_package.py +++ b/packages/discolike/tests/test_package.py @@ -2,4 +2,4 @@ def test_version() -> None: - assert discolike.__version__ == "0.7.1" + assert discolike.__version__ == "0.7.2" diff --git a/uv.lock b/uv.lock index e229030..3d0712d 100644 --- a/uv.lock +++ b/uv.lock @@ -343,7 +343,7 @@ dev = [ [[package]] name = "discolike-cli" -version = "0.7.1" +version = "0.7.2" source = { editable = "packages/discolike-cli" } dependencies = [ { name = "discolike" },