1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "packages": [
12 {
13 "ecosystem": "npm",
14 "name": "lodash",
15 "version": "4.17.20"
16 },
17 {
18 "ecosystem": "PyPI",
19 "name": "django",
20 "version": "3.2.0"
21 }
22 ],
23 "manifestText": `django==3.2.0
24requests==2.25.0`,
25 "sbomText": `{
26 "bomFormat": "CycloneDX",
27 "specVersion": "1.5",
28 "components": [
29 {
30 "type": "library",
31 "name": "lodash",
32 "version": "4.17.20",
33 "purl": "pkg:npm/lodash@4.17.20"
34 }
35 ]
36}`
37};
38
39
40const run = await client.actor("fairquery/osv-dependency-vulnerability-check").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