@soos-io/soos-scm-audit 0.3.12 → 0.4.2
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/bin/index.js +38 -46
- package/package.json +11 -8
package/bin/index.js
CHANGED
|
@@ -9,52 +9,44 @@ const utilities_1 = require("@soos-io/api-client/dist/utilities");
|
|
|
9
9
|
const ContributorAuditArgumentParser_1 = tslib_1.__importDefault(require("./services/ContributorAuditArgumentParser"));
|
|
10
10
|
const ContributorAuditService_1 = tslib_1.__importDefault(require("./services/ContributorAuditService/ContributorAuditService"));
|
|
11
11
|
const enums_1 = require("./enums");
|
|
12
|
-
|
|
13
|
-
args;
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const runAudit = async (args) => {
|
|
13
|
+
const contributingDeveloperService = ContributorAuditService_1.default.create(args.apiKey, args.apiURL, args.scmType);
|
|
14
|
+
let auditParams;
|
|
15
|
+
if (args.scmType === enums_1.ScmType.GitHub) {
|
|
16
|
+
const githubArgs = args;
|
|
17
|
+
auditParams = {
|
|
18
|
+
days: args.days,
|
|
19
|
+
scriptVersion: package_json_1.version,
|
|
20
|
+
organizationName: githubArgs.organizationName,
|
|
21
|
+
secret: args.secret,
|
|
22
|
+
};
|
|
16
23
|
}
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
secret: this.args.secret,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const bitbucketCloudArgs = this.args;
|
|
31
|
-
auditParams = {
|
|
32
|
-
days: this.args.days,
|
|
33
|
-
scriptVersion: package_json_1.version,
|
|
34
|
-
secret: this.args.secret,
|
|
35
|
-
username: bitbucketCloudArgs.username,
|
|
36
|
-
workspace: bitbucketCloudArgs.workspace,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
api_client_1.soosLogger.info(`Running Contributing Developer audit for ${this.args.scmType}`);
|
|
40
|
-
const contributingDevelopers = await contributingDeveloperService.audit(auditParams);
|
|
41
|
-
await contributingDeveloperService.uploadContributorAudits(this.args.clientId, contributingDevelopers);
|
|
42
|
-
contributingDeveloperService.saveResults(contributingDevelopers, this.args.resultsFormat);
|
|
24
|
+
else {
|
|
25
|
+
const bitbucketCloudArgs = args;
|
|
26
|
+
auditParams = {
|
|
27
|
+
days: args.days,
|
|
28
|
+
scriptVersion: package_json_1.version,
|
|
29
|
+
secret: args.secret,
|
|
30
|
+
username: bitbucketCloudArgs.username,
|
|
31
|
+
workspace: bitbucketCloudArgs.workspace,
|
|
32
|
+
};
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
34
|
+
api_client_1.soosLogger.info(`Running Contributing Developer audit for ${args.scmType}`);
|
|
35
|
+
const contributingDevelopers = await contributingDeveloperService.audit(auditParams);
|
|
36
|
+
await contributingDeveloperService.uploadContributorAudits(args.clientId, contributingDevelopers);
|
|
37
|
+
contributingDeveloperService.saveResults(contributingDevelopers, args.resultsFormat);
|
|
38
|
+
};
|
|
39
|
+
(async () => {
|
|
40
|
+
try {
|
|
41
|
+
const contributorAuditArgumentParser = ContributorAuditArgumentParser_1.default.create();
|
|
42
|
+
const args = contributorAuditArgumentParser.parseArguments();
|
|
43
|
+
api_client_1.soosLogger.setMinLogLevel(args.logLevel);
|
|
44
|
+
api_client_1.soosLogger.always("Starting SOOS SCM Contributor Audit");
|
|
45
|
+
api_client_1.soosLogger.debug(JSON.stringify((0, utilities_1.obfuscateProperties)(args, ["apiKey", "secret"]), null, 2));
|
|
46
|
+
await runAudit(args);
|
|
58
47
|
}
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
catch (error) {
|
|
49
|
+
api_client_1.soosLogger.error(error);
|
|
50
|
+
(0, process_1.exit)(1);
|
|
51
|
+
}
|
|
52
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soos-io/soos-scm-audit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "SOOS SCM Audit CLI",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,19 +32,22 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/soos-io/soos-scm-audit#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@soos-io/api-client": "1.10.
|
|
35
|
+
"@soos-io/api-client": "1.10.4",
|
|
36
36
|
"axios": "^1.8.3",
|
|
37
37
|
"tslib": "^2.6.2"
|
|
38
38
|
},
|
|
39
|
+
"overrides": {
|
|
40
|
+
"minimatch": "^10.2.4"
|
|
41
|
+
},
|
|
39
42
|
"devDependencies": {
|
|
40
|
-
"@eslint/js": "^9.
|
|
41
|
-
"@types/node": "^24.
|
|
42
|
-
"eslint": "^9.
|
|
43
|
-
"globals": "^17.
|
|
44
|
-
"knip": "^5.
|
|
43
|
+
"@eslint/js": "^9.39.3",
|
|
44
|
+
"@types/node": "^24.11.0",
|
|
45
|
+
"eslint": "^9.39.3",
|
|
46
|
+
"globals": "^17.4.0",
|
|
47
|
+
"knip": "^5.85.0",
|
|
45
48
|
"prettier": "^3.2.5",
|
|
46
49
|
"typescript": "^5.8.3",
|
|
47
|
-
"typescript-eslint": "^8.
|
|
50
|
+
"typescript-eslint": "^8.56.1"
|
|
48
51
|
},
|
|
49
52
|
"bin": {
|
|
50
53
|
"soos-scm-audit": "bin/index.js"
|