1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "cover": {
12 "originalContract": "100000.00",
13 "netChanges": "5000.00",
14 "contractToDate": "105000.00",
15 "completedStored": "42000.00",
16 "retainage": "4200.00",
17 "earnedLessRetainage": "37800.00",
18 "previousCertificates": "20000.00",
19 "currentDue": "18000.00",
20 "balanceToFinish": "67200.00"
21 },
22 "lines": [
23 {
24 "id": "MEP-01",
25 "scheduled": "100000.00",
26 "previousWork": "25000.00",
27 "currentWork": "10000.00",
28 "stored": "5000.00",
29 "completedStored": "40000.00",
30 "retainage": "4000.00",
31 "balance": "60000.00"
32 },
33 {
34 "id": "CO-01",
35 "scheduled": "5000.00",
36 "previousWork": "0.00",
37 "currentWork": "2000.00",
38 "stored": "0.00",
39 "completedStored": "2000.00",
40 "retainage": "200.00",
41 "balance": "3000.00"
42 }
43 ],
44 "approvedChanges": [
45 {
46 "id": "CO-01",
47 "amount": "5000.00"
48 }
49 ],
50 "previousCertified": "20000.00"
51};
52
53
54const run = await client.actor("wheresprada/construction-pay-application-check").call(input);
55
56
57console.log('Results from dataset');
58console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
59const { items } = await client.dataset(run.defaultDatasetId).listItems();
60items.forEach((item) => {
61 console.dir(item);
62});
63
64