diff --git a/apify-api/openapi/code_samples/javascript/requestQueue_request_put.js b/apify-api/openapi/code_samples/javascript/requestQueue_request_put.js index 4856645387..62b3e86fa2 100644 --- a/apify-api/openapi/code_samples/javascript/requestQueue_request_put.js +++ b/apify-api/openapi/code_samples/javascript/requestQueue_request_put.js @@ -7,6 +7,7 @@ const result = await apifyClient .requestQueue('') .updateRequest({ id: '', + uniqueKey: 'http://example.com', url: 'http://example.com', }); diff --git a/apify-api/openapi/code_samples/javascript/webhookDispatch_get.js b/apify-api/openapi/code_samples/javascript/webhookDispatch_get.js new file mode 100644 index 0000000000..e09873dd9c --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhookDispatch_get.js @@ -0,0 +1,10 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const dispatch = await apifyClient + .webhookDispatch('') + .get(); + +console.log(dispatch); diff --git a/apify-api/openapi/code_samples/javascript/webhookDispatches_get.js b/apify-api/openapi/code_samples/javascript/webhookDispatches_get.js new file mode 100644 index 0000000000..b7b03ace00 --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhookDispatches_get.js @@ -0,0 +1,10 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const { items } = await apifyClient + .webhookDispatches() + .list(); + +console.log(items); diff --git a/apify-api/openapi/code_samples/javascript/webhook_delete.js b/apify-api/openapi/code_samples/javascript/webhook_delete.js new file mode 100644 index 0000000000..d37ec999a0 --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhook_delete.js @@ -0,0 +1,8 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +await apifyClient + .webhook('') + .delete(); diff --git a/apify-api/openapi/code_samples/javascript/webhook_dispatches_get.js b/apify-api/openapi/code_samples/javascript/webhook_dispatches_get.js new file mode 100644 index 0000000000..a8f925a18f --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhook_dispatches_get.js @@ -0,0 +1,11 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const { items } = await apifyClient + .webhook('') + .dispatches() + .list(); + +console.log(items); diff --git a/apify-api/openapi/code_samples/javascript/webhook_get.js b/apify-api/openapi/code_samples/javascript/webhook_get.js new file mode 100644 index 0000000000..e143b8567e --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhook_get.js @@ -0,0 +1,10 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const webhook = await apifyClient + .webhook('') + .get(); + +console.log(webhook); diff --git a/apify-api/openapi/code_samples/javascript/webhook_put.js b/apify-api/openapi/code_samples/javascript/webhook_put.js new file mode 100644 index 0000000000..ebe131497f --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhook_put.js @@ -0,0 +1,12 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const updatedWebhook = await apifyClient + .webhook('') + .update({ + eventTypes: ['ACTOR.RUN.FAILED'], + }); + +console.log(updatedWebhook); diff --git a/apify-api/openapi/code_samples/javascript/webhook_test_post.js b/apify-api/openapi/code_samples/javascript/webhook_test_post.js new file mode 100644 index 0000000000..524ac5a93d --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhook_test_post.js @@ -0,0 +1,10 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const result = await apifyClient + .webhook('') + .test(); + +console.log(result); diff --git a/apify-api/openapi/code_samples/javascript/webhooks_get.js b/apify-api/openapi/code_samples/javascript/webhooks_get.js new file mode 100644 index 0000000000..2ea019de4e --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhooks_get.js @@ -0,0 +1,10 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const { items } = await apifyClient + .webhooks() + .list(); + +console.log(items); diff --git a/apify-api/openapi/code_samples/javascript/webhooks_post.js b/apify-api/openapi/code_samples/javascript/webhooks_post.js new file mode 100644 index 0000000000..b9e486fad5 --- /dev/null +++ b/apify-api/openapi/code_samples/javascript/webhooks_post.js @@ -0,0 +1,16 @@ +import { ApifyClient } from 'apify-client'; + +const apifyClient = new ApifyClient({ + token: '', +}); +const webhook = await apifyClient + .webhooks() + .create({ + eventTypes: ['ACTOR.RUN.SUCCEEDED'], + condition: { + actorId: '', + }, + requestUrl: 'http://example.com/', + }); + +console.log(webhook);