1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "expression": "*/5 * * * *",
12 "expressions": `*/5 * * * *
130 9 * * 1-5
140 0 1 * *
150 0 * * 0
1630 4 * * 1-5`,
17 "batchData": [
18 {
19 "id": "job-alpha",
20 "expression": "*/5 * * * *",
21 "label": "Health Check"
22 },
23 {
24 "id": "job-beta",
25 "expression": "0 9 * * 1-5",
26 "label": "Daily Report"
27 },
28 {
29 "id": "job-gamma",
30 "expression": "0 0 1 * *",
31 "label": "Monthly Archive"
32 }
33 ]
34};
35
36
37const run = await client.actor("perryay/cron-expression-builder-validator").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47