Skip to content

Commit

Permalink
Abort run: Added gracefully param (apify#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
drobnikj authored Jun 22, 2021
1 parent b57bb01 commit 38dc19c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.2.6 / 2021/06/21
===================
- Added gracefully parameter for abort run function

1.2.5 / 2021/06/15
===================
- Enabled access to actor run storages via `RunClient`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apify-client",
"version": "1.2.5",
"version": "1.2.6",
"description": "Apify API client for JavaScript",
"main": "src/index.js",
"keywords": [
Expand Down
9 changes: 7 additions & 2 deletions src/resource_clients/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ class RunClient extends ResourceClient {

/**
* https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run
* @param {object} [options]
* @param {object} [options.gracefully]
* @return {Promise<Run>}
*/
async abort() {
async abort(options = {}) {
ow(options, ow.object.exactShape({
gracefully: ow.optional.boolean,
}));
const response = await this.httpClient.call({
url: this._url('abort'),
method: 'POST',
params: this._params(),
params: this._params(options),
});

return parseDateFields(pluckData(response.data));
Expand Down

0 comments on commit 38dc19c

Please sign in to comment.