1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "board": "xsI3UuszZOPdISfiv",
12 "mode": "self-test",
13 "readTool": "notion-query-data-sources",
14 "readToolArgs": {
15 "data": {
16 "mode": "sql",
17 "data_source_urls": [
18 "collection://59fa8c63-e954-4dec-ae68-dcebdbb0922b"
19 ],
20 "query": "SELECT * FROM \"collection://59fa8c63-e954-4dec-ae68-dcebdbb0922b\""
21 }
22 },
23 "updateTool": "notion-update-page",
24 "updateToolExtraArgs": {
25 "command": "update_properties"
26 },
27 "patchWrapperKey": "properties",
28 "idArgName": "page_id",
29 "pendingValue": "Done",
30 "defaultActorId": "0VEcSEmFmyrE4IT4E",
31 "inputMap": {},
32 "staticInput": {
33 "mode": "list-tools",
34 "source": "xsI3UuszZOPdISfiv"
35 },
36 "maxTasks": 4
37};
38
39
40const run = await client.actor("deadwood_data_solutions/connector-task-runner").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50