-
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.
fix: better IDs and make code narrower
- Loading branch information
1 parent
836ea08
commit 766838e
Showing
10 changed files
with
54 additions
and
34 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
apify-api/openapi/code_samples/javascript/act_version_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,7 +1,9 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
// Replace apify/my-sample-actor with your Actor's ID or technical name | ||
await apifyClient.actor('apify/my-sample-actor') | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
await apifyClient | ||
.actor('<ACTOR ID>') | ||
.version('0.1') | ||
.delete(); |
8 changes: 5 additions & 3 deletions
8
apify-api/openapi/code_samples/javascript/act_version_envVar_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,8 +1,10 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
// Replace apify/my-sample-actor with your Actor's ID or technical name | ||
await apifyClient.actor('apify/my-sample-actor') | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
await apifyClient | ||
.actor('<ACTOR ID>') | ||
.version('0.1') | ||
.envVar('MY_ENV_VAR') | ||
.delete(); |
8 changes: 5 additions & 3 deletions
8
apify-api/openapi/code_samples/javascript/act_version_envVar_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
10 changes: 6 additions & 4 deletions
10
apify-api/openapi/code_samples/javascript/act_version_envVar_put.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,13 +1,15 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
// Replace apify/my-sample-actor with your Actor's ID or technical name | ||
const updatedEnvVar = await apifyClient.actor('apify/my-sample-actor') | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const updatedEnvVar = await apifyClient | ||
.actor('<ACTOR ID>') | ||
.version('0.1') | ||
.envVar('MY_ENV_VAR') | ||
.update({ | ||
name: 'MY_ENV_VAR', | ||
value: '54321', | ||
value: 'my-new-value', | ||
}); | ||
|
||
console.log(updatedEnvVar); |
8 changes: 5 additions & 3 deletions
8
apify-api/openapi/code_samples/javascript/act_version_envVars_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
10 changes: 6 additions & 4 deletions
10
apify-api/openapi/code_samples/javascript/act_version_envVars_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
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
10 changes: 6 additions & 4 deletions
10
apify-api/openapi/code_samples/javascript/act_version_put.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,11 +1,13 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
// Replace apify/my-sample-actor with your Actor's ID or technical name | ||
const updatedVersion = await apifyClient.actor('apify/my-sample-actor') | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const updatedVersion = await apifyClient | ||
.actor('<ACTOR ID>') | ||
.version('0.1') | ||
.update({ | ||
gitRepoUrl: 'https://github.com/my-github-account/new-actor-repo', | ||
buildTag: 'latest', | ||
}); | ||
|
||
console.log(updatedVersion); |
8 changes: 5 additions & 3 deletions
8
apify-api/openapi/code_samples/javascript/act_versions_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
10 changes: 6 additions & 4 deletions
10
apify-api/openapi/code_samples/javascript/act_versions_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,13 +1,15 @@ | ||
import { ApifyClient } from 'apify-client'; | ||
|
||
const apifyClient = new ApifyClient({ token: 'my-token' }); | ||
// Replace apify/my-sample-actor with your Actor's ID or technical name | ||
const version = await apifyClient.actor('apify/my-sample-actor') | ||
const apifyClient = new ApifyClient({ | ||
token: '<TOKEN>', | ||
}); | ||
const version = await apifyClient | ||
.actor('<ACTOR ID>') | ||
.versions() | ||
.create({ | ||
versionNumber: '0.1', | ||
sourceType: 'GIT_REPO', | ||
gitRepoUrl: 'https://github.com/my-github-account/actor-repo', | ||
gitRepoUrl: 'https://github.com/my/repo', | ||
}); | ||
|
||
console.log(version); |