-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73fd227
commit 8b11936
Showing
13 changed files
with
75 additions
and
32 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
apify-api/openapi/code_samples/javascript/actorBuild_abort_post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const abortedBuild = await apifyClient.build('my-build-ID').abort(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const abortedBuild = await apifyClient | ||
.build('<BUILD ID>') | ||
.abort(); | ||
|
||
console.log(abortedBuild); |
6 changes: 4 additions & 2 deletions
6
apify-api/openapi/code_samples/javascript/actorBuild_delete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
await apifyClient.build('my-build-ID').delete(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
await apifyClient.build('<BUILD ID>').delete(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const build = await apifyClient.build('my-build-ID').get(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const build = await apifyClient | ||
.build('<BUILD ID>') | ||
.get(); | ||
|
||
console.log(build); |
7 changes: 5 additions & 2 deletions
7
apify-api/openapi/code_samples/javascript/actorBuild_log_get.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const { items } = await apifyClient.builds().list(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const { items } = await apifyClient | ||
.builds() | ||
.list(); | ||
|
||
console.log(items); |
10 changes: 7 additions & 3 deletions
10
apify-api/openapi/code_samples/javascript/actorRun_abort_post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const run = await apifyClient.run('my-run-ID').abort(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const abortedRun = await apifyClient | ||
.run('<RUN ID>') | ||
.abort(); | ||
|
||
console.log(run); | ||
console.log(abortedRun); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const run = await apifyClient.run('my-run-ID').delete(); | ||
|
||
console.log(run); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
await apifyClient.run('<RUN ID>').delete(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const run = await apifyClient.run('my-run-ID').get(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const run = await apifyClient | ||
.run('<RUN ID>') | ||
.get(); | ||
|
||
console.log(run); |
9 changes: 6 additions & 3 deletions
9
apify-api/openapi/code_samples/javascript/actorRun_metamorph_post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const metamorphedRun = await apifyClient.run('my-run-ID') | ||
.metamorph('target-actor-ID'); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const metamorphedRun = await apifyClient | ||
.run('<RUN ID>') | ||
.metamorph('<ACTOR ID>'); | ||
|
||
console.log(metamorphedRun); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const updatedRun = await apifyClient.run('my-run-ID') | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const updatedRun = await apifyClient | ||
.run('<RUN ID>') | ||
.update({ | ||
statusMessage: 'My status message', | ||
statusMessage: 'Actor has finished', | ||
}); | ||
|
||
console.log(updatedRun); |
8 changes: 6 additions & 2 deletions
8
apify-api/openapi/code_samples/javascript/actorRun_reboot_post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const rebootedRun = await apifyClient.run('my-run-ID').reboot(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const rebootedRun = await apifyClient | ||
.run('<RUN ID>') | ||
.reboot(); | ||
|
||
console.log(rebootedRun); |
10 changes: 7 additions & 3 deletions
10
apify-api/openapi/code_samples/javascript/actorRun_resurrect_post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const run = await apifyClient.run('my-run-ID').resurrect(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const resurrectedRun = await apifyClient | ||
.run('<RUN ID>') | ||
.resurrect(); | ||
|
||
console.log(run); | ||
console.log(resurrectedRun); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
const { items } = await apifyClient.runs().list(); | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const { items } = await apifyClient | ||
.runs() | ||
.list(); | ||
|
||
console.log(items); |