Skip to content

Commit

Permalink
feat: run.update() for generic run PUT requests (apify#259)
Browse files Browse the repository at this point in the history
* feat: statusMessage method using the new API endpoint

* dont set undefined message

* feat: run.update for generic run PUT requests

* version bump to avoid crawlee problems
  • Loading branch information
barjin authored Jul 5, 2022
1 parent 2fbf802 commit 56b701e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2.6.0 / 2022/07/XX
==================
- Add `setStatusMessage` method for setting custom status messages on runs.
- Add `run.update()` method for setting fields on runs.

2.5.2 / 2022/06/27
===================
Expand Down
11 changes: 7 additions & 4 deletions src/resource_clients/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export class RunClient extends ResourceClient {
return cast(parseDateFields(pluckData(response.data)));
}

async setStatusMessage(message: string) : Promise<ActorRun> {
return this._update({
statusMessage: message,
});
async update(newFields: RunUpdateOptions) : Promise<ActorRun> {
ow(newFields, ow.object);

return this._update(newFields);
}

/**
Expand Down Expand Up @@ -198,6 +198,9 @@ export interface RunMetamorphOptions {
contentType?: string;
build?: string;
}
export interface RunUpdateOptions {
statusMessage?: string;
}

export interface RunResurrectOptions {
build?: string;
Expand Down

0 comments on commit 56b701e

Please sign in to comment.