sonar-sweep 0.2.0 → 0.2.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/cli/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getPullRequestReport, i as getPullRequestIssues, n as getPullRequestReview, o as SonarCloudClient, r as getPullRequestCoverage, t as transitionIssue } from "./issue-transition-
|
|
1
|
+
import { a as getPullRequestReport, i as getPullRequestIssues, n as getPullRequestReview, o as SonarCloudClient, r as getPullRequestCoverage, t as transitionIssue } from "./issue-transition-B5r9hQVC.mjs";
|
|
2
2
|
import { hideBin } from "yargs/helpers";
|
|
3
3
|
import yargs from "yargs/yargs";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as getPullRequestReport, i as getPullRequestIssues, n as getPullRequestReview, o as SonarCloudClient, r as getPullRequestCoverage, t as transitionIssue } from "./issue-transition-
|
|
1
|
+
import { a as getPullRequestReport, i as getPullRequestIssues, n as getPullRequestReview, o as SonarCloudClient, r as getPullRequestCoverage, t as transitionIssue } from "./issue-transition-B5r9hQVC.mjs";
|
|
2
2
|
|
|
3
3
|
export { SonarCloudClient, getPullRequestCoverage, getPullRequestIssues, getPullRequestReport, getPullRequestReview, transitionIssue };
|
|
@@ -60,8 +60,8 @@ var SonarCloudClient = class {
|
|
|
60
60
|
method: "GET"
|
|
61
61
|
});
|
|
62
62
|
if (!response.ok) {
|
|
63
|
-
await response.text();
|
|
64
|
-
throw new Error(`Sonar API request failed (${response.status}) for /api/sources/raw:
|
|
63
|
+
const body = await response.text();
|
|
64
|
+
throw new Error(`Sonar API request failed (${response.status}) for /api/sources/raw: ${body}`);
|
|
65
65
|
}
|
|
66
66
|
return response.text();
|
|
67
67
|
}
|
|
@@ -97,8 +97,8 @@ var SonarCloudClient = class {
|
|
|
97
97
|
method: "GET"
|
|
98
98
|
});
|
|
99
99
|
if (!response.ok) {
|
|
100
|
-
await response.text();
|
|
101
|
-
throw new Error(`Sonar API request failed (
|
|
100
|
+
const body = await response.text();
|
|
101
|
+
throw new Error(`Sonar API request failed (${response.status}) for ${path}: ${body}`);
|
|
102
102
|
}
|
|
103
103
|
return await response.json();
|
|
104
104
|
}
|
|
@@ -108,14 +108,14 @@ var SonarCloudClient = class {
|
|
|
108
108
|
const response = await this.fetchImpl(url, {
|
|
109
109
|
body,
|
|
110
110
|
headers: {
|
|
111
|
-
Authorization: `Bearer
|
|
111
|
+
Authorization: `Bearer ${this.token}`,
|
|
112
112
|
"content-type": "application/x-www-form-urlencoded"
|
|
113
113
|
},
|
|
114
114
|
method: "POST"
|
|
115
115
|
});
|
|
116
116
|
if (!response.ok) {
|
|
117
|
-
await response.text();
|
|
118
|
-
throw new Error(`Sonar API request failed (
|
|
117
|
+
const responseBody = await response.text();
|
|
118
|
+
throw new Error(`Sonar API request failed (${response.status}) for ${path}: ${responseBody}`);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
};
|