securewithtrace 0.45.0 → 0.45.1
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/dist/index.js +51 -65
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39659,6 +39659,10 @@ var SEVERITY_ORDER = {
|
|
|
39659
39659
|
LOW: 3,
|
|
39660
39660
|
INFORMATIONAL: 4
|
|
39661
39661
|
};
|
|
39662
|
+
function printJson(value) {
|
|
39663
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}
|
|
39664
|
+
`);
|
|
39665
|
+
}
|
|
39662
39666
|
function formatStatus(status) {
|
|
39663
39667
|
return status.toLowerCase().replace(/_/g, " ");
|
|
39664
39668
|
}
|
|
@@ -40366,7 +40370,7 @@ async function runRepositoryListCommand(options) {
|
|
|
40366
40370
|
process.exit(1);
|
|
40367
40371
|
}
|
|
40368
40372
|
if (options.output === "json") {
|
|
40369
|
-
|
|
40373
|
+
printJson(displayedRepositories);
|
|
40370
40374
|
return;
|
|
40371
40375
|
}
|
|
40372
40376
|
if (options.output === "tsv") {
|
|
@@ -40450,7 +40454,7 @@ async function runDependencyFilter(organizationId, options) {
|
|
|
40450
40454
|
process.exit(1);
|
|
40451
40455
|
}
|
|
40452
40456
|
if (options.output === "json") {
|
|
40453
|
-
|
|
40457
|
+
printJson(displayedRepos);
|
|
40454
40458
|
return;
|
|
40455
40459
|
}
|
|
40456
40460
|
if (options.output === "tsv") {
|
|
@@ -40782,7 +40786,7 @@ async function runSetScanningBranchCommand(repoUrl, options) {
|
|
|
40782
40786
|
}
|
|
40783
40787
|
const urlById = new Map(listResult2.body.map((r2) => [r2.repositoryId, r2.repositoryUrl]));
|
|
40784
40788
|
if (options.output === "json") {
|
|
40785
|
-
|
|
40789
|
+
printJson(allResults);
|
|
40786
40790
|
return;
|
|
40787
40791
|
}
|
|
40788
40792
|
console.log("repositoryUrl status relabeledCount error");
|
|
@@ -40964,13 +40968,7 @@ async function runSetScanningInclusionCommand(references, includedInScanning, op
|
|
|
40964
40968
|
process.exit(1);
|
|
40965
40969
|
}
|
|
40966
40970
|
if (options.output === "json") {
|
|
40967
|
-
|
|
40968
|
-
JSON.stringify(
|
|
40969
|
-
{ includedInScanning, updatedCount, notFoundRepositoryIds, repositories: outcomes },
|
|
40970
|
-
null,
|
|
40971
|
-
2
|
|
40972
|
-
)
|
|
40973
|
-
);
|
|
40971
|
+
printJson({ includedInScanning, updatedCount, notFoundRepositoryIds, repositories: outcomes });
|
|
40974
40972
|
return;
|
|
40975
40973
|
}
|
|
40976
40974
|
const notFound = new Set(notFoundRepositoryIds);
|
|
@@ -41326,7 +41324,7 @@ function printApplicationRepositoriesTsv(links) {
|
|
|
41326
41324
|
}
|
|
41327
41325
|
function outputApplication(app, output) {
|
|
41328
41326
|
if (output === "json") {
|
|
41329
|
-
|
|
41327
|
+
printJson(app);
|
|
41330
41328
|
return;
|
|
41331
41329
|
}
|
|
41332
41330
|
if (output === "tsv") {
|
|
@@ -41411,7 +41409,7 @@ async function runList(options) {
|
|
|
41411
41409
|
}
|
|
41412
41410
|
const apps = result.body;
|
|
41413
41411
|
if (output === "json") {
|
|
41414
|
-
|
|
41412
|
+
printJson(apps);
|
|
41415
41413
|
return;
|
|
41416
41414
|
}
|
|
41417
41415
|
if (output === "tsv") {
|
|
@@ -41460,7 +41458,7 @@ async function runRepos(applicationId, options) {
|
|
|
41460
41458
|
}
|
|
41461
41459
|
const links = sortApplicationRepositoryLinks(result.body);
|
|
41462
41460
|
if (output === "json") {
|
|
41463
|
-
|
|
41461
|
+
printJson(links);
|
|
41464
41462
|
return;
|
|
41465
41463
|
}
|
|
41466
41464
|
if (output === "tsv") {
|
|
@@ -43165,7 +43163,7 @@ async function uploadLogo(organizationId, variant, file2) {
|
|
|
43165
43163
|
}
|
|
43166
43164
|
function outputOrganization(org, output, derived) {
|
|
43167
43165
|
if (output === "json") {
|
|
43168
|
-
|
|
43166
|
+
printJson(org);
|
|
43169
43167
|
return;
|
|
43170
43168
|
}
|
|
43171
43169
|
if (output === "tsv") {
|
|
@@ -43697,7 +43695,7 @@ Examples:
|
|
|
43697
43695
|
}
|
|
43698
43696
|
}
|
|
43699
43697
|
if (options.output === "json") {
|
|
43700
|
-
|
|
43698
|
+
printJson(info);
|
|
43701
43699
|
if (!info.loggedIn) {
|
|
43702
43700
|
process.exitCode = 1;
|
|
43703
43701
|
}
|
|
@@ -43836,7 +43834,7 @@ Examples:
|
|
|
43836
43834
|
);
|
|
43837
43835
|
const items = options.limit !== void 0 ? filteredItems.slice(0, options.limit) : filteredItems;
|
|
43838
43836
|
if (options.output === "json") {
|
|
43839
|
-
|
|
43837
|
+
printJson(items);
|
|
43840
43838
|
return;
|
|
43841
43839
|
}
|
|
43842
43840
|
if (options.output === "tsv") {
|
|
@@ -43912,16 +43910,10 @@ Examples:
|
|
|
43912
43910
|
const active = organizationContext.activeOrganization;
|
|
43913
43911
|
const source = organizationContext.selectedOrganizationId === active.organizationId ? "selected" : "default";
|
|
43914
43912
|
if (options.output === "json") {
|
|
43915
|
-
|
|
43916
|
-
|
|
43917
|
-
|
|
43918
|
-
|
|
43919
|
-
source
|
|
43920
|
-
},
|
|
43921
|
-
null,
|
|
43922
|
-
2
|
|
43923
|
-
)
|
|
43924
|
-
);
|
|
43913
|
+
printJson({
|
|
43914
|
+
...active,
|
|
43915
|
+
source
|
|
43916
|
+
});
|
|
43925
43917
|
return;
|
|
43926
43918
|
}
|
|
43927
43919
|
if (options.output === "tsv") {
|
|
@@ -44241,7 +44233,7 @@ Examples:
|
|
|
44241
44233
|
}
|
|
44242
44234
|
const codeSize = result.body;
|
|
44243
44235
|
if (options.output === "json") {
|
|
44244
|
-
|
|
44236
|
+
printJson(codeSize);
|
|
44245
44237
|
return;
|
|
44246
44238
|
}
|
|
44247
44239
|
if (options.output === "tsv") {
|
|
@@ -44894,7 +44886,7 @@ function parseEmailSince(value) {
|
|
|
44894
44886
|
}
|
|
44895
44887
|
function outputInbox(inbox, output) {
|
|
44896
44888
|
if (output === "json") {
|
|
44897
|
-
|
|
44889
|
+
printJson(inbox);
|
|
44898
44890
|
return;
|
|
44899
44891
|
}
|
|
44900
44892
|
if (output === "tsv") {
|
|
@@ -44939,7 +44931,7 @@ async function runList2(options) {
|
|
|
44939
44931
|
}
|
|
44940
44932
|
const { inboxes, quota } = result.body;
|
|
44941
44933
|
if (output === "json") {
|
|
44942
|
-
|
|
44934
|
+
printJson({ inboxes, quota });
|
|
44943
44935
|
return;
|
|
44944
44936
|
}
|
|
44945
44937
|
if (output === "tsv") {
|
|
@@ -45025,7 +45017,7 @@ async function runEmails(label, options) {
|
|
|
45025
45017
|
}
|
|
45026
45018
|
const { address, messages } = result.body;
|
|
45027
45019
|
if (output === "json") {
|
|
45028
|
-
|
|
45020
|
+
printJson(result.body);
|
|
45029
45021
|
return;
|
|
45030
45022
|
}
|
|
45031
45023
|
if (output === "tsv") {
|
|
@@ -45061,7 +45053,7 @@ async function runEmail(label, messageId, options) {
|
|
|
45061
45053
|
failReadOp2("read email", result.status, result.body, label);
|
|
45062
45054
|
}
|
|
45063
45055
|
if (output === "json") {
|
|
45064
|
-
|
|
45056
|
+
printJson(result.body);
|
|
45065
45057
|
return;
|
|
45066
45058
|
}
|
|
45067
45059
|
if (output === "tsv") {
|
|
@@ -45571,7 +45563,7 @@ function buildCredentialsTable(creds) {
|
|
|
45571
45563
|
}
|
|
45572
45564
|
function outputCredential(cred, output) {
|
|
45573
45565
|
if (output === "json") {
|
|
45574
|
-
|
|
45566
|
+
printJson(cred);
|
|
45575
45567
|
return;
|
|
45576
45568
|
}
|
|
45577
45569
|
if (output === "tsv") {
|
|
@@ -45771,7 +45763,7 @@ async function runList3(options) {
|
|
|
45771
45763
|
}
|
|
45772
45764
|
const creds = result.body;
|
|
45773
45765
|
if (output === "json") {
|
|
45774
|
-
|
|
45766
|
+
printJson(creds);
|
|
45775
45767
|
return;
|
|
45776
45768
|
}
|
|
45777
45769
|
if (output === "tsv") {
|
|
@@ -45972,7 +45964,7 @@ async function runMfaCode(credentialId, options) {
|
|
|
45972
45964
|
failMfaOp("generate a code for", result.status, result.body, credentialId);
|
|
45973
45965
|
}
|
|
45974
45966
|
if (output === "json") {
|
|
45975
|
-
|
|
45967
|
+
printJson(result.body);
|
|
45976
45968
|
return;
|
|
45977
45969
|
}
|
|
45978
45970
|
if (output === "tsv") {
|
|
@@ -46355,7 +46347,7 @@ function buildEnvironmentsTable(envs) {
|
|
|
46355
46347
|
}
|
|
46356
46348
|
function outputEnvironment(env2, output) {
|
|
46357
46349
|
if (output === "json") {
|
|
46358
|
-
|
|
46350
|
+
printJson(env2);
|
|
46359
46351
|
return;
|
|
46360
46352
|
}
|
|
46361
46353
|
if (output === "tsv") {
|
|
@@ -46477,7 +46469,7 @@ async function runListAcrossOrganization(output, pager) {
|
|
|
46477
46469
|
createOrgEnvironmentRequests(organizationId)
|
|
46478
46470
|
);
|
|
46479
46471
|
if (output === "json") {
|
|
46480
|
-
|
|
46472
|
+
printJson(envs);
|
|
46481
46473
|
return;
|
|
46482
46474
|
}
|
|
46483
46475
|
if (output === "tsv") {
|
|
@@ -46517,7 +46509,7 @@ async function runList4(options) {
|
|
|
46517
46509
|
}
|
|
46518
46510
|
const envs = result.body;
|
|
46519
46511
|
if (output === "json") {
|
|
46520
|
-
|
|
46512
|
+
printJson(envs);
|
|
46521
46513
|
return;
|
|
46522
46514
|
}
|
|
46523
46515
|
if (output === "tsv") {
|
|
@@ -47011,7 +47003,7 @@ async function runCreateFinding(options) {
|
|
|
47011
47003
|
failCreateFinding(result.status, result.body, options.pentest);
|
|
47012
47004
|
}
|
|
47013
47005
|
if (options.output === "json") {
|
|
47014
|
-
|
|
47006
|
+
printJson(result.body);
|
|
47015
47007
|
return;
|
|
47016
47008
|
}
|
|
47017
47009
|
printCreatedFinding({
|
|
@@ -47323,7 +47315,7 @@ async function runStatusUpdate(options) {
|
|
|
47323
47315
|
failStatusUpdate(result.status, result.body, viaApiKey);
|
|
47324
47316
|
}
|
|
47325
47317
|
if (options.output === "json") {
|
|
47326
|
-
|
|
47318
|
+
printJson(result.body);
|
|
47327
47319
|
return;
|
|
47328
47320
|
}
|
|
47329
47321
|
const displayId = result.body.displayId;
|
|
@@ -47616,7 +47608,7 @@ async function runReportDownload(pentestIdentifier, options) {
|
|
|
47616
47608
|
output
|
|
47617
47609
|
});
|
|
47618
47610
|
if (output === "json") {
|
|
47619
|
-
|
|
47611
|
+
printJson({ report, artifact, path: destination, sizeBytes: bytes });
|
|
47620
47612
|
return;
|
|
47621
47613
|
}
|
|
47622
47614
|
if (output === "tsv") {
|
|
@@ -47720,7 +47712,7 @@ async function runAttestationList(pentestIdentifier, options) {
|
|
|
47720
47712
|
const organizationId = await resolveOrganizationId();
|
|
47721
47713
|
const attestations = await fetchAttestations(organizationId, pentestIdentifier);
|
|
47722
47714
|
if (output === "json") {
|
|
47723
|
-
|
|
47715
|
+
printJson(attestations);
|
|
47724
47716
|
return;
|
|
47725
47717
|
}
|
|
47726
47718
|
if (output === "tsv") {
|
|
@@ -47805,7 +47797,7 @@ async function runAttestationDownload(pentestIdentifier, options) {
|
|
|
47805
47797
|
output
|
|
47806
47798
|
});
|
|
47807
47799
|
if (output === "json") {
|
|
47808
|
-
|
|
47800
|
+
printJson({ attestation, path: destination, sizeBytes: bytes });
|
|
47809
47801
|
return;
|
|
47810
47802
|
}
|
|
47811
47803
|
if (output === "tsv") {
|
|
@@ -47994,7 +47986,7 @@ async function runAttachEvidence(options) {
|
|
|
47994
47986
|
process.exit(1);
|
|
47995
47987
|
}
|
|
47996
47988
|
if (options.output === "json") {
|
|
47997
|
-
|
|
47989
|
+
printJson(attached.body);
|
|
47998
47990
|
return;
|
|
47999
47991
|
}
|
|
48000
47992
|
const visibility = attached.body.customerFacing ? "customer-facing" : "staff-internal";
|
|
@@ -48147,7 +48139,7 @@ async function runGetFinding(options) {
|
|
|
48147
48139
|
failGetFinding(result.status, result.body);
|
|
48148
48140
|
}
|
|
48149
48141
|
if (options.output === "json") {
|
|
48150
|
-
|
|
48142
|
+
printJson(result.body);
|
|
48151
48143
|
return;
|
|
48152
48144
|
}
|
|
48153
48145
|
process.stdout.write(formatFindingMarkdown(result.body));
|
|
@@ -48388,7 +48380,7 @@ Examples:
|
|
|
48388
48380
|
return;
|
|
48389
48381
|
}
|
|
48390
48382
|
if (isJson) {
|
|
48391
|
-
|
|
48383
|
+
printJson(pentests);
|
|
48392
48384
|
return;
|
|
48393
48385
|
}
|
|
48394
48386
|
if (isTsv) {
|
|
@@ -48537,7 +48529,7 @@ Re-run with: tracecli pentest findings list --pentest ${options.pentest} --detai
|
|
|
48537
48529
|
return;
|
|
48538
48530
|
}
|
|
48539
48531
|
if (isJson) {
|
|
48540
|
-
|
|
48532
|
+
printJson(findings);
|
|
48541
48533
|
return;
|
|
48542
48534
|
}
|
|
48543
48535
|
if (isTsv) {
|
|
@@ -48630,7 +48622,7 @@ async function runFindingsDetailPull(organizationId, options) {
|
|
|
48630
48622
|
}
|
|
48631
48623
|
return { findings: result.body.findings, total: result.body.total };
|
|
48632
48624
|
}, options);
|
|
48633
|
-
|
|
48625
|
+
printJson(matching);
|
|
48634
48626
|
}
|
|
48635
48627
|
function renderPentestFindingLines(finding) {
|
|
48636
48628
|
const sev = formatFindingSeverity(finding.severity);
|
|
@@ -48791,7 +48783,7 @@ function printPentestUpdateTsv(pt) {
|
|
|
48791
48783
|
}
|
|
48792
48784
|
function outputPentestUpdate(pt, output) {
|
|
48793
48785
|
if (output === "json") {
|
|
48794
|
-
|
|
48786
|
+
printJson(pt);
|
|
48795
48787
|
return;
|
|
48796
48788
|
}
|
|
48797
48789
|
if (output === "tsv") {
|
|
@@ -50025,7 +50017,7 @@ function printUploadsTsv(uploads) {
|
|
|
50025
50017
|
}
|
|
50026
50018
|
function outputUpload(upload, output) {
|
|
50027
50019
|
if (output === "json") {
|
|
50028
|
-
|
|
50020
|
+
printJson(upload);
|
|
50029
50021
|
return;
|
|
50030
50022
|
}
|
|
50031
50023
|
if (output === "tsv") {
|
|
@@ -50333,7 +50325,7 @@ async function runList5(options) {
|
|
|
50333
50325
|
...applicationId !== void 0 ? { applicationId } : {}
|
|
50334
50326
|
});
|
|
50335
50327
|
if (output === "json") {
|
|
50336
|
-
|
|
50328
|
+
printJson({ uploads });
|
|
50337
50329
|
return;
|
|
50338
50330
|
}
|
|
50339
50331
|
if (output === "tsv") {
|
|
@@ -50397,18 +50389,12 @@ async function runDownload(codeUploadIdArg, options, runtime) {
|
|
|
50397
50389
|
process.exit(1);
|
|
50398
50390
|
}
|
|
50399
50391
|
if (output === "json") {
|
|
50400
|
-
|
|
50401
|
-
|
|
50402
|
-
|
|
50403
|
-
|
|
50404
|
-
|
|
50405
|
-
|
|
50406
|
-
archiveSha256: upload.archiveSha256
|
|
50407
|
-
},
|
|
50408
|
-
null,
|
|
50409
|
-
2
|
|
50410
|
-
)
|
|
50411
|
-
);
|
|
50392
|
+
printJson({
|
|
50393
|
+
upload,
|
|
50394
|
+
path: destination,
|
|
50395
|
+
sizeBytes: upload.sizeBytes,
|
|
50396
|
+
archiveSha256: upload.archiveSha256
|
|
50397
|
+
});
|
|
50412
50398
|
return;
|
|
50413
50399
|
}
|
|
50414
50400
|
if (output === "tsv") {
|
|
@@ -50486,7 +50472,7 @@ async function runLink(options) {
|
|
|
50486
50472
|
failWriteOp5("link", result.status, result.body);
|
|
50487
50473
|
}
|
|
50488
50474
|
if (output === "json") {
|
|
50489
|
-
|
|
50475
|
+
printJson(result.body);
|
|
50490
50476
|
return;
|
|
50491
50477
|
}
|
|
50492
50478
|
if (output === "tsv") {
|
|
@@ -50833,7 +50819,7 @@ Run \`tracecli vulnerabilities list\` to see available vulnerabilities.`
|
|
|
50833
50819
|
process.exit(1);
|
|
50834
50820
|
}
|
|
50835
50821
|
if (options.output === "json") {
|
|
50836
|
-
|
|
50822
|
+
printJson(result.body);
|
|
50837
50823
|
return;
|
|
50838
50824
|
}
|
|
50839
50825
|
if (options.output === "tsv") {
|
|
@@ -50957,7 +50943,7 @@ Examples:
|
|
|
50957
50943
|
return;
|
|
50958
50944
|
}
|
|
50959
50945
|
if (isJson) {
|
|
50960
|
-
|
|
50946
|
+
printJson(items);
|
|
50961
50947
|
} else if (isTsv) {
|
|
50962
50948
|
printVulnerabilitiesTsv(items);
|
|
50963
50949
|
} else {
|