1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "parts": [
12 {
13 "label": "shelf",
14 "length": 600,
15 "width": 400,
16 "quantity": 8
17 },
18 {
19 "label": "side",
20 "length": 1800,
21 "width": 400,
22 "quantity": 2
23 },
24 {
25 "label": "door",
26 "length": 700,
27 "width": 500,
28 "quantity": 4
29 }
30 ],
31 "stockWidth": 1220,
32 "stockLength": 2440,
33 "kerf": 3
34};
35
36
37const run = await client.actor("ponderable_hydrometer/cut-list").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