Skip to content

fix!: type the Actor run input on ActorClient and RunClient - #1040

Merged
vdusek merged 12 commits into
v3from
fix/actor-input-type
Sep 10, 2026
Merged

fix!: type the Actor run input on ActorClient and RunClient#1040
vdusek merged 12 commits into
v3from
fix/actor-input-type

Conversation

@vdusek

@vdusek vdusek commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

ActorClient.start(), call(), validateInput() and RunClient.metamorph() took input as unknown, so anything compiled, including values the client can't send. They now take ActorInput, an alias for object: a JSON-serializable object or array. A string, a number, a boolean, null and values typed unknown stop compiling. Nothing changes at runtime. metamorph()'s input becomes optional too.

The raw string body that v2 accepted alongside contentType is left out on purpose, as non-JSON Actor input is being sunset. The contentType option itself stays.

The issue asked for Dictionary, the type TaskClient uses. That rejects anything typed by your own interface, which gets no index signature. Task input keeps Dictionary because its overrides merge into the input saved on the task.

The ActorStandby fields from the issue's second comment are already on v3 via #985. apify-sdk-js forwards input?: unknown into this client, so it needs the same retyping before it bumps.

Closes #818

✍️ Drafted by Claude Code

@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Sep 8, 2026
@vdusek vdusek self-assigned this Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ There are broken links in the documentation.

See more at https://github.com/apify/apify-client-js/actions/runs/34450291289#summary-102784316437

@vdusek vdusek changed the title fix!: type the input of ActorClient.start(), call() and validateInput() fix!: type the Actor run input on ActorClient and RunClient Sep 8, 2026
BREAKING CHANGE: `ActorClient.start()`, `call()` and `validateInput()` take `input` as `ActorInput` (`object | string`) instead of `unknown`. A number, a boolean or `null` no longer compiles. Omit the argument or pass `undefined` to run without input.

Closes #818
BREAKING CHANGE: `RunClient.metamorph()` takes `input` as an optional `ActorInput` (`object | string`) instead of a required `unknown`. A number, a boolean or `null` no longer compiles.
@vdusek
vdusek force-pushed the fix/actor-input-type branch from 4c68507 to 6d5c76a Compare September 8, 2026 10:22
@vdusek
vdusek requested a review from janbuchar September 8, 2026 12:16
@vdusek
vdusek marked this pull request as ready for review September 8, 2026 12:16
@vdusek
vdusek requested a review from szaganek as a code owner September 8, 2026 12:16

@janbuchar janbuchar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/resource_clients/actor.ts Outdated
Comment thread test/actors.test.ts Outdated
@vdusek
vdusek merged commit f594236 into v3 Sep 10, 2026
8 checks passed
@vdusek
vdusek deleted the fix/actor-input-type branch September 10, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants