1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "requests": [
12 "2 bathrooms, kitchen sink, dishwasher, clothes washer, 2 hose bibbs",
13 "water supply for 2.5 baths, kitchen sink, dishwasher, clothes washer, PEX, 60 psi, 20 ft elevation, 120 ft developed length",
14 "drainage for 3 bathroom groups, kitchen sink, clothes washer, laundry tray, floor drain, 1/8 in per ft",
15 "public restroom water supply: 4 water closets with flush valves, 3 urinals, 4 lavatories, drinking fountain, 55 psi, meter loss 6 psi, length 150 ft",
16 "12 gpm through 3/4 in PEX, 80 ft",
17 {
18 "type": "drain",
19 "dfu": 120,
20 "slope": "1/4"
21 }
22 ]
23};
24
25
26const run = await client.actor("jumblemog/plumbing-calculator").call(input);
27
28
29console.log('Results from dataset');
30console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
31const { items } = await client.dataset(run.defaultDatasetId).listItems();
32items.forEach((item) => {
33 console.dir(item);
34});
35
36