@sonar-autofix/sonar-client 0.0.3 → 0.2.0

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.
Files changed (2) hide show
  1. package/index.js +14 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -45,6 +45,7 @@ class SonarClient {
45
45
  });
46
46
 
47
47
  const openIssues = response.data.issues.filter(data => data.status === 'OPEN');
48
+ console.log(openIssues);
48
49
  return openIssues;
49
50
  } catch (error) {
50
51
  // Provide more detailed error information for debugging
@@ -326,4 +327,17 @@ class SonarClient {
326
327
  }
327
328
  }
328
329
 
330
+ if (require.main === module) {
331
+ const config = {
332
+ sonar: {
333
+ host: 'http://localhost:9000',
334
+ project: 'fundrest_core',
335
+ token: 'squ_bfe66608c517d650380dd5d4f4e6c7e2d929ef71',
336
+ },
337
+ };
338
+
339
+ new SonarClient(config).getIssues(config.sonar.project);
340
+ }
341
+
342
+
329
343
  module.exports = SonarClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonar-autofix/sonar-client",
3
- "version": "0.0.3",
3
+ "version": "0.2.0",
4
4
  "description": "Sonar client for the Sonar Autofix tool",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,4 +17,4 @@
17
17
  "dependencies": {
18
18
  "axios": "^1.19.0"
19
19
  }
20
- }
20
+ }