1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "schemaVersion": "1.1",
12 "rows": [
13 {
14 "signalId": "signal-001",
15 "normalizedScore": 96
16 },
17 {
18 "signalId": "signal-002",
19 "normalizedScore": 82
20 },
21 {
22 "signalId": "signal-003",
23 "normalizedScore": 61
24 },
25 {
26 "signalId": "signal-004",
27 "normalizedScore": 39
28 }
29 ],
30 "policies": [
31 {
32 "policyId": "balanced",
33 "reviewThreshold": 50,
34 "acceptThreshold": 80,
35 "thresholdOrder": "review_lt_accept"
36 },
37 {
38 "policyId": "strict",
39 "reviewThreshold": 70,
40 "acceptThreshold": 90,
41 "thresholdOrder": "review_lt_accept"
42 },
43 {
44 "policyId": "broad",
45 "reviewThreshold": 30,
46 "acceptThreshold": 70,
47 "thresholdOrder": "review_lt_accept"
48 }
49 ]
50};
51
52
53const run = await client.actor("zinin/us-brand-signal-policy-simulator").call(input);
54
55
56console.log('Results from dataset');
57console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
58const { items } = await client.dataset(run.defaultDatasetId).listItems();
59items.forEach((item) => {
60 console.dir(item);
61});
62
63