@capraconsulting/cals-cli 2.25.11 → 2.25.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cals-cli.js +9 -173
- package/lib/cals-cli.js.map +1 -1
- package/lib/index.es.js +4 -1
- package/lib/index.es.js.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
- package/lib/cli/commands/detectify/report.d.ts +0 -3
- package/lib/cli/commands/detectify/set-token.d.ts +0 -3
- package/lib/cli/commands/detectify.d.ts +0 -3
- package/lib/detectify/service.d.ts +0 -21
- package/lib/detectify/token.d.ts +0 -11
- package/lib/detectify/types.d.ts +0 -21
package/lib/cals-cli.js
CHANGED
|
@@ -47,7 +47,7 @@ var read__default = /*#__PURE__*/_interopDefaultLegacy(read);
|
|
|
47
47
|
var findUp__default = /*#__PURE__*/_interopDefaultLegacy(findUp);
|
|
48
48
|
var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);
|
|
49
49
|
|
|
50
|
-
var version = "2.25.
|
|
50
|
+
var version = "2.25.12";
|
|
51
51
|
var engines = {
|
|
52
52
|
node: ">=12.0.0"
|
|
53
53
|
};
|
|
@@ -1576,7 +1576,7 @@ async function dumpSetup(config, reporter, github, snyk, outfile, definitionFile
|
|
|
1576
1576
|
reporter.info(`Saved to ${outfile}`);
|
|
1577
1577
|
reporter.info(`Number of GitHub requests: ${github.requestCount}`);
|
|
1578
1578
|
}
|
|
1579
|
-
const command$
|
|
1579
|
+
const command$h = {
|
|
1580
1580
|
command: "dump-setup",
|
|
1581
1581
|
describe: "Dump active setup as YAML. Will be formated same as the definition file.",
|
|
1582
1582
|
builder: (yargs) => yargs
|
|
@@ -1597,7 +1597,7 @@ const command$k = {
|
|
|
1597
1597
|
},
|
|
1598
1598
|
};
|
|
1599
1599
|
|
|
1600
|
-
const command$
|
|
1600
|
+
const command$g = {
|
|
1601
1601
|
command: "validate",
|
|
1602
1602
|
describe: "Validate definition file.",
|
|
1603
1603
|
builder: (yargs) => yargs.option(definitionFileOptionName, definitionFileOptionValue),
|
|
@@ -1608,12 +1608,12 @@ const command$j = {
|
|
|
1608
1608
|
},
|
|
1609
1609
|
};
|
|
1610
1610
|
|
|
1611
|
-
const command$
|
|
1611
|
+
const command$f = {
|
|
1612
1612
|
command: "definition",
|
|
1613
1613
|
describe: "CALS definition file management",
|
|
1614
1614
|
builder: (yargs) => yargs
|
|
1615
|
-
.command(command$
|
|
1616
|
-
.command(command$
|
|
1615
|
+
.command(command$h)
|
|
1616
|
+
.command(command$g)
|
|
1617
1617
|
.demandCommand()
|
|
1618
1618
|
.usage(`cals definition`),
|
|
1619
1619
|
handler: () => {
|
|
@@ -1621,7 +1621,7 @@ const command$i = {
|
|
|
1621
1621
|
},
|
|
1622
1622
|
};
|
|
1623
1623
|
|
|
1624
|
-
const command$
|
|
1624
|
+
const command$e = {
|
|
1625
1625
|
command: "delete-cache",
|
|
1626
1626
|
describe: "Delete cached data",
|
|
1627
1627
|
handler: (argv) => {
|
|
@@ -1633,169 +1633,6 @@ const command$h = {
|
|
|
1633
1633
|
},
|
|
1634
1634
|
};
|
|
1635
1635
|
|
|
1636
|
-
class DetectifyTokenCliProvider {
|
|
1637
|
-
constructor() {
|
|
1638
|
-
this.keyringService = "cals";
|
|
1639
|
-
this.keyringAccount = "detectify-token";
|
|
1640
|
-
}
|
|
1641
|
-
async getToken() {
|
|
1642
|
-
if (process.env.CALS_DETECTIFY_TOKEN) {
|
|
1643
|
-
return process.env.CALS_DETECTIFY_TOKEN;
|
|
1644
|
-
}
|
|
1645
|
-
const result = await keytar__default["default"].getPassword(this.keyringService, this.keyringAccount);
|
|
1646
|
-
if (result == null) {
|
|
1647
|
-
process.stderr.write("No token found. Register using `cals detectify set-token`\n");
|
|
1648
|
-
return undefined;
|
|
1649
|
-
}
|
|
1650
|
-
return result;
|
|
1651
|
-
}
|
|
1652
|
-
async markInvalid() {
|
|
1653
|
-
await keytar__default["default"].deletePassword(this.keyringService, this.keyringAccount);
|
|
1654
|
-
}
|
|
1655
|
-
async setToken(value) {
|
|
1656
|
-
await keytar__default["default"].setPassword(this.keyringService, this.keyringAccount, value);
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
function requireOk(response) {
|
|
1661
|
-
if (!("ok" in response)) {
|
|
1662
|
-
throw new Error(`Response: ${response.error}`);
|
|
1663
|
-
}
|
|
1664
|
-
return response.ok;
|
|
1665
|
-
}
|
|
1666
|
-
class DetectifyService {
|
|
1667
|
-
constructor(props) {
|
|
1668
|
-
this.config = props.config;
|
|
1669
|
-
this.tokenProvider = props.tokenProvider;
|
|
1670
|
-
}
|
|
1671
|
-
async getRequest(url) {
|
|
1672
|
-
const token = await this.tokenProvider.getToken();
|
|
1673
|
-
if (token === undefined) {
|
|
1674
|
-
throw new Error("Missing token for Detectify");
|
|
1675
|
-
}
|
|
1676
|
-
const response = await fetch__default["default"](url, {
|
|
1677
|
-
method: "GET",
|
|
1678
|
-
headers: {
|
|
1679
|
-
Accept: "application/json",
|
|
1680
|
-
"X-Detectify-Key": `${token}`,
|
|
1681
|
-
},
|
|
1682
|
-
agent: this.config.agent,
|
|
1683
|
-
});
|
|
1684
|
-
if (response.status === 401) {
|
|
1685
|
-
process.stderr.write("Unauthorized - removing token\n");
|
|
1686
|
-
await this.tokenProvider.markInvalid();
|
|
1687
|
-
}
|
|
1688
|
-
if (response.status === 404) {
|
|
1689
|
-
return {
|
|
1690
|
-
error: "not-found",
|
|
1691
|
-
};
|
|
1692
|
-
}
|
|
1693
|
-
if (!response.ok) {
|
|
1694
|
-
throw new Error(`Response from Detectify not OK (${response.status}): ${JSON.stringify(response)}`);
|
|
1695
|
-
}
|
|
1696
|
-
return {
|
|
1697
|
-
ok: (await response.json()),
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
|
-
async getScanProfiles() {
|
|
1701
|
-
return requireOk(await this.getRequest("https://api.detectify.com/rest/v2/profiles/"));
|
|
1702
|
-
}
|
|
1703
|
-
async getScanReportLatest(scanProfileToken) {
|
|
1704
|
-
const response = await this.getRequest(`https://api.detectify.com/rest/v2/reports/${encodeURIComponent(scanProfileToken)}/latest/`);
|
|
1705
|
-
if ("ok" in response) {
|
|
1706
|
-
return response.ok;
|
|
1707
|
-
}
|
|
1708
|
-
else if (response.error === "not-found") {
|
|
1709
|
-
return null;
|
|
1710
|
-
}
|
|
1711
|
-
else {
|
|
1712
|
-
throw new Error(`Unknown response: ${JSON.stringify(response)}`);
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
function createDetectifyService(props) {
|
|
1717
|
-
var _a;
|
|
1718
|
-
return new DetectifyService({
|
|
1719
|
-
config: props.config,
|
|
1720
|
-
tokenProvider: (_a = props.tokenProvider) !== null && _a !== void 0 ? _a : new DetectifyTokenCliProvider(),
|
|
1721
|
-
});
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
async function report$1({ reporter, detectify, }) {
|
|
1725
|
-
reporter.info("Listing Detectify profiles with latest report");
|
|
1726
|
-
const profiles = await detectify.getScanProfiles();
|
|
1727
|
-
for (const profile of profiles) {
|
|
1728
|
-
reporter.info("");
|
|
1729
|
-
reporter.info(sprintfJs.sprintf("Project: %s", profile.name));
|
|
1730
|
-
reporter.info(sprintfJs.sprintf("Endpoint: %s", profile.endpoint));
|
|
1731
|
-
const report = await detectify.getScanReportLatest(profile.token);
|
|
1732
|
-
if (report !== null) {
|
|
1733
|
-
reporter.info(sprintfJs.sprintf("Score: %g", report.cvss));
|
|
1734
|
-
}
|
|
1735
|
-
else {
|
|
1736
|
-
reporter.warn("No report present");
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
const command$g = {
|
|
1741
|
-
command: "report",
|
|
1742
|
-
describe: "Report Detectify status",
|
|
1743
|
-
handler: async (argv) => report$1({
|
|
1744
|
-
reporter: createReporter(argv),
|
|
1745
|
-
detectify: createDetectifyService({ config: createConfig() }),
|
|
1746
|
-
}),
|
|
1747
|
-
};
|
|
1748
|
-
|
|
1749
|
-
async function setToken$2({ reporter, token, tokenProvider, }) {
|
|
1750
|
-
if (token === undefined) {
|
|
1751
|
-
reporter.info("Need API token to talk to Detectify");
|
|
1752
|
-
reporter.info("See API keys under https://detectify.com/dashboard/team");
|
|
1753
|
-
token = await new Promise((resolve, reject) => {
|
|
1754
|
-
read__default["default"]({
|
|
1755
|
-
prompt: "Enter new Detectify API token: ",
|
|
1756
|
-
silent: true,
|
|
1757
|
-
}, (err, answer) => {
|
|
1758
|
-
if (err) {
|
|
1759
|
-
reject(err);
|
|
1760
|
-
}
|
|
1761
|
-
resolve(answer);
|
|
1762
|
-
});
|
|
1763
|
-
});
|
|
1764
|
-
}
|
|
1765
|
-
await tokenProvider.setToken(token);
|
|
1766
|
-
reporter.info("Token saved");
|
|
1767
|
-
}
|
|
1768
|
-
const command$f = {
|
|
1769
|
-
command: "set-token",
|
|
1770
|
-
describe: "Set Detectify token for API calls",
|
|
1771
|
-
builder: (yargs) => yargs.positional("token", {
|
|
1772
|
-
describe: "Token. If not provided it will be requested as input",
|
|
1773
|
-
}),
|
|
1774
|
-
handler: async (argv) => {
|
|
1775
|
-
return setToken$2({
|
|
1776
|
-
reporter: createReporter(argv),
|
|
1777
|
-
token: argv.token,
|
|
1778
|
-
tokenProvider: new DetectifyTokenCliProvider(),
|
|
1779
|
-
});
|
|
1780
|
-
},
|
|
1781
|
-
};
|
|
1782
|
-
|
|
1783
|
-
const command$e = {
|
|
1784
|
-
command: "detectify",
|
|
1785
|
-
describe: "Integration with Detectify",
|
|
1786
|
-
builder: (yargs) => yargs.command(command$f).command(command$g).demandCommand()
|
|
1787
|
-
.usage(`cals detectify
|
|
1788
|
-
|
|
1789
|
-
Notes:
|
|
1790
|
-
Before doing anything against Detectify you need to configure a token
|
|
1791
|
-
used for authentication. The following command will ask for a token
|
|
1792
|
-
and provide a link to generate one:
|
|
1793
|
-
$ cals detectify set-token`),
|
|
1794
|
-
handler: () => {
|
|
1795
|
-
yargs__default["default"].showHelp();
|
|
1796
|
-
},
|
|
1797
|
-
};
|
|
1798
|
-
|
|
1799
1636
|
const command$d = {
|
|
1800
1637
|
command: "getting-started",
|
|
1801
1638
|
describe: "Getting started",
|
|
@@ -3494,7 +3331,7 @@ async function main() {
|
|
|
3494
3331
|
/ /___/ ___ |/ /______/ /
|
|
3495
3332
|
\\____/_/ |_/_____/____/
|
|
3496
3333
|
cli ${version}
|
|
3497
|
-
built ${"2023-
|
|
3334
|
+
built ${"2023-05-04T11:03:32+0000"}
|
|
3498
3335
|
|
|
3499
3336
|
https://github.com/capralifecycle/cals-cli/
|
|
3500
3337
|
|
|
@@ -3504,9 +3341,8 @@ Usage: cals <command>`;
|
|
|
3504
3341
|
.scriptName("cals")
|
|
3505
3342
|
.locale("en")
|
|
3506
3343
|
.help("help")
|
|
3507
|
-
.command(command$h)
|
|
3508
|
-
.command(command$i)
|
|
3509
3344
|
.command(command$e)
|
|
3345
|
+
.command(command$f)
|
|
3510
3346
|
.command(command$4)
|
|
3511
3347
|
.command(command$d)
|
|
3512
3348
|
.command(command)
|
package/lib/cals-cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cals-cli.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cals-cli.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/index.es.js
CHANGED
|
@@ -22,7 +22,7 @@ import execa from 'execa';
|
|
|
22
22
|
import { performance } from 'perf_hooks';
|
|
23
23
|
import { Transform } from 'stream';
|
|
24
24
|
|
|
25
|
-
var version = "2.25.
|
|
25
|
+
var version = "2.25.12";
|
|
26
26
|
|
|
27
27
|
class CacheProvider {
|
|
28
28
|
constructor(config) {
|
|
@@ -1963,6 +1963,9 @@ async function startContainer({ executor, network, imageId, alias, env, dockerAr
|
|
|
1963
1963
|
process.catch(() => {
|
|
1964
1964
|
failed = true;
|
|
1965
1965
|
});
|
|
1966
|
+
if (!process.pid) {
|
|
1967
|
+
throw new Error("No process identifier (PID) was returned for the process that was started when running trying to run Docker container");
|
|
1968
|
+
}
|
|
1966
1969
|
const id = await getContainerId({
|
|
1967
1970
|
executor,
|
|
1968
1971
|
name: containerName,
|
package/lib/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var keytar__default = /*#__PURE__*/_interopDefaultLegacy(keytar);
|
|
|
44
44
|
var read__default = /*#__PURE__*/_interopDefaultLegacy(read);
|
|
45
45
|
var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);
|
|
46
46
|
|
|
47
|
-
var version = "2.25.
|
|
47
|
+
var version = "2.25.12";
|
|
48
48
|
|
|
49
49
|
class CacheProvider {
|
|
50
50
|
constructor(config) {
|
|
@@ -1985,6 +1985,9 @@ async function startContainer({ executor, network, imageId, alias, env, dockerAr
|
|
|
1985
1985
|
process.catch(() => {
|
|
1986
1986
|
failed = true;
|
|
1987
1987
|
});
|
|
1988
|
+
if (!process.pid) {
|
|
1989
|
+
throw new Error("No process identifier (PID) was returned for the process that was started when running trying to run Docker container");
|
|
1990
|
+
}
|
|
1988
1991
|
const id = await getContainerId({
|
|
1989
1992
|
executor,
|
|
1990
1993
|
name: containerName,
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capraconsulting/cals-cli",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.12",
|
|
4
4
|
"description": "CLI for repeatable tasks in CALS",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepare": "node scripts/create-definition-schema.js && husky install",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/jest": "27.5.2",
|
|
52
52
|
"@types/js-yaml": "4.0.5",
|
|
53
53
|
"@types/lodash": "4.14.191",
|
|
54
|
-
"@types/node": "
|
|
54
|
+
"@types/node": "18.16.3",
|
|
55
55
|
"@types/node-fetch": "2.6.2",
|
|
56
56
|
"@types/read": "0.0.29",
|
|
57
57
|
"@types/rimraf": "3.0.2",
|
|
@@ -70,13 +70,12 @@
|
|
|
70
70
|
"prettier": "2.8.4",
|
|
71
71
|
"rollup": "2.79.1",
|
|
72
72
|
"rollup-plugin-typescript2": "0.34.1",
|
|
73
|
-
"semantic-release": "
|
|
73
|
+
"semantic-release": "20.0.1",
|
|
74
74
|
"tempy": "1.0.1",
|
|
75
75
|
"ts-jest": "27.1.5",
|
|
76
76
|
"typescript": "4.9.5",
|
|
77
77
|
"typescript-json-schema": "0.54.0"
|
|
78
78
|
},
|
|
79
|
-
"peerDependencies": {},
|
|
80
79
|
"files": [
|
|
81
80
|
"lib/**/*"
|
|
82
81
|
],
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Config } from "../config";
|
|
2
|
-
import { DetectifyTokenProvider } from "./token";
|
|
3
|
-
import { DetectifyScanProfile, DetectifyScanReport } from "./types";
|
|
4
|
-
interface DetectifyServiceProps {
|
|
5
|
-
config: Config;
|
|
6
|
-
tokenProvider: DetectifyTokenProvider;
|
|
7
|
-
}
|
|
8
|
-
export declare class DetectifyService {
|
|
9
|
-
private config;
|
|
10
|
-
private tokenProvider;
|
|
11
|
-
constructor(props: DetectifyServiceProps);
|
|
12
|
-
private getRequest;
|
|
13
|
-
getScanProfiles(): Promise<DetectifyScanProfile[]>;
|
|
14
|
-
getScanReportLatest(scanProfileToken: string): Promise<DetectifyScanReport | null>;
|
|
15
|
-
}
|
|
16
|
-
interface CreateDetectifyServiceProps {
|
|
17
|
-
config: Config;
|
|
18
|
-
tokenProvider?: DetectifyTokenProvider;
|
|
19
|
-
}
|
|
20
|
-
export declare function createDetectifyService(props: CreateDetectifyServiceProps): DetectifyService;
|
|
21
|
-
export {};
|
package/lib/detectify/token.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface DetectifyTokenProvider {
|
|
2
|
-
getToken(): Promise<string | undefined>;
|
|
3
|
-
markInvalid(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare class DetectifyTokenCliProvider implements DetectifyTokenProvider {
|
|
6
|
-
private keyringService;
|
|
7
|
-
private keyringAccount;
|
|
8
|
-
getToken(): Promise<string | undefined>;
|
|
9
|
-
markInvalid(): Promise<void>;
|
|
10
|
-
setToken(value: string): Promise<void>;
|
|
11
|
-
}
|
package/lib/detectify/types.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface DetectifyScanProfile {
|
|
2
|
-
name: string;
|
|
3
|
-
endpoint: string;
|
|
4
|
-
status: "verified" | "unverified" | "unable_to_resolve" | "unable_to_complete";
|
|
5
|
-
created: string;
|
|
6
|
-
token: string;
|
|
7
|
-
}
|
|
8
|
-
export interface DetectifyScanReport {
|
|
9
|
-
token: string;
|
|
10
|
-
scan_profile_token: string;
|
|
11
|
-
scan_profile_name: string;
|
|
12
|
-
created: string;
|
|
13
|
-
started: string;
|
|
14
|
-
stopped: string;
|
|
15
|
-
url: string;
|
|
16
|
-
cvss: number;
|
|
17
|
-
high_level_findings: number;
|
|
18
|
-
medium_level_findings: number;
|
|
19
|
-
low_level_findings: number;
|
|
20
|
-
information_findings: number;
|
|
21
|
-
}
|