1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "spec": {
12 "title": "Galley kitchen",
13 "room": {
14 "width": 4.2,
15 "depth": 3.6,
16 "height": 2.7
17 },
18 "style": {
19 "counter": "white_quartz"
20 },
21 "windows": [
22 {
23 "wall": "north",
24 "u0": 1.75,
25 "u1": 2.85,
26 "z0": 1.05,
27 "z1": 2
28 }
29 ],
30 "openings": [
31 {
32 "wall": "south",
33 "u0": 0.4,
34 "u1": 1.3
35 }
36 ],
37 "cabinet_runs": [
38 {
39 "wall": "north",
40 "start": 0,
41 "end": 4.2,
42 "uppers": true,
43 "appliances": [
44 {
45 "type": "fridge",
46 "at": 0,
47 "width": 0.9
48 },
49 {
50 "type": "sink",
51 "at": 1.9,
52 "width": 0.8
53 },
54 {
55 "type": "dishwasher",
56 "at": 2.7,
57 "width": 0.6
58 },
59 {
60 "type": "range",
61 "at": 3.3,
62 "width": 0.76
63 }
64 ]
65 }
66 ],
67 "island": {
68 "x": 2.1,
69 "y": 1.5,
70 "width": 2,
71 "depth": 0.9,
72 "pendants": 2,
73 "stools": 3
74 }
75 }
76};
77
78
79const run = await client.actor("perchpermits/kitchen-floor-plan-takeoff").call(input);
80
81
82console.log('Results from dataset');
83console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
84const { items } = await client.dataset(run.defaultDatasetId).listItems();
85items.forEach((item) => {
86 console.dir(item);
87});
88
89