Skip to content

Commit 766838e

Browse files
committed
fix: better IDs and make code narrower
1 parent 836ea08 commit 766838e

File tree

10 files changed

+54
-34
lines changed

10 files changed

+54
-34
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.delete();
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVar('MY_ENV_VAR')
810
.delete();

apify-api/openapi/code_samples/javascript/act_version_envVar_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const envVar = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const envVar = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVar('MY_ENV_VAR')
810
.get();
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const updatedEnvVar = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const updatedEnvVar = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVar('MY_ENV_VAR')
810
.update({
911
name: 'MY_ENV_VAR',
10-
value: '54321',
12+
value: 'my-new-value',
1113
});
1214

1315
console.log(updatedEnvVar);

apify-api/openapi/code_samples/javascript/act_version_envVars_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const { items } = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const { items } = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVars()
810
.list();

apify-api/openapi/code_samples/javascript/act_version_envVars_post.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const envVar = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const envVar = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVars()
810
.create({
911
name: 'MY_ENV_VAR',
10-
value: '12345',
12+
value: 'my-new-value',
1113
isSecret: true,
1214
});
1315

apify-api/openapi/code_samples/javascript/act_version_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const version = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const version = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.get();
810

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const updatedVersion = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const updatedVersion = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.update({
8-
gitRepoUrl: 'https://github.com/my-github-account/new-actor-repo',
10+
buildTag: 'latest',
911
});
1012

1113
console.log(updatedVersion);

apify-api/openapi/code_samples/javascript/act_versions_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const { items } = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const { items } = await apifyClient
7+
.actor('<ACTOR ID>')
68
.versions()
79
.list();
810

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify/my-sample-actor with your Actor's ID or technical name
5-
const version = await apifyClient.actor('apify/my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const version = await apifyClient
7+
.actor('<ACTOR ID>')
68
.versions()
79
.create({
810
versionNumber: '0.1',
911
sourceType: 'GIT_REPO',
10-
gitRepoUrl: 'https://github.com/my-github-account/actor-repo',
12+
gitRepoUrl: 'https://github.com/my/repo',
1113
});
1214

1315
console.log(version);

0 commit comments

Comments
 (0)