@tng-sh/js 0.2.5 → 0.2.7
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/tng.js +1 -1
- package/binaries/go-ui-darwin-amd64 +0 -0
- package/binaries/go-ui-darwin-arm64 +0 -0
- package/binaries/go-ui-linux-amd64 +0 -0
- package/binaries/go-ui-linux-arm64 +0 -0
- package/lib/generateTestsUi.js +12 -7
- package/package.json +1 -1
- package/tng_sh_js.linux-arm64-gnu.node +0 -0
- package/tng_sh_js.linux-x64-gnu.node +0 -0
- package/.idea/js-pie.iml +0 -11
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
package/bin/tng.js
CHANGED
|
@@ -29,7 +29,7 @@ process.on('uncaughtException', (err) => {
|
|
|
29
29
|
program
|
|
30
30
|
.name('tng')
|
|
31
31
|
.description('TNG - Advanced Code Audit, Test Generation, Visualization, Clone Detection, and Dead Code Analysis for JavaScript/TypeScript')
|
|
32
|
-
.version('0.2.
|
|
32
|
+
.version('0.2.7');
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Copy text to system clipboard
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/generateTestsUi.js
CHANGED
|
@@ -18,7 +18,6 @@ class GenerateTestsUI {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
async show() {
|
|
21
|
-
// Check for API key before showing menu
|
|
22
21
|
const config = loadConfig();
|
|
23
22
|
if (!config.API_KEY) {
|
|
24
23
|
this._showConfigMissing();
|
|
@@ -95,20 +94,26 @@ class GenerateTestsUI {
|
|
|
95
94
|
|
|
96
95
|
async _pingApi() {
|
|
97
96
|
const config = loadConfig();
|
|
98
|
-
if (!config.API_KEY) {
|
|
97
|
+
if (!config || !config.API_KEY) {
|
|
99
98
|
console.log(chalk.red('\nNo API key configured. Run: tng init\n'));
|
|
100
|
-
return;
|
|
99
|
+
return false;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
|
|
102
|
+
if (!config.API_URL) {
|
|
103
|
+
console.log(chalk.red('\nNo API URL configured in tng.config.js.\n'));
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const result = await this.goUiSession.showSpinner('Pinging TNG API...', async () => {
|
|
104
108
|
try {
|
|
105
|
-
const
|
|
106
|
-
return { success: true, message: `API Response: ${
|
|
109
|
+
const res = ping(config.API_URL, config.API_KEY);
|
|
110
|
+
return { success: true, message: `API Response: ${res}` };
|
|
107
111
|
} catch (e) {
|
|
108
112
|
return { success: false, message: e.message };
|
|
109
113
|
}
|
|
110
114
|
});
|
|
111
|
-
|
|
115
|
+
|
|
116
|
+
return result || false;
|
|
112
117
|
}
|
|
113
118
|
|
|
114
119
|
async _showFileSelection(isAudit = false, isXray = false, isTrace = false, isImpact = false) {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/.idea/js-pie.iml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
|
3
|
-
<component name="ModuleRunConfigurationManager">
|
|
4
|
-
<shared />
|
|
5
|
-
</component>
|
|
6
|
-
<component name="NewModuleRootManager">
|
|
7
|
-
<content url="file://$MODULE_DIR$" />
|
|
8
|
-
<orderEntry type="inheritedJdk" />
|
|
9
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
-
</component>
|
|
11
|
-
</module>
|
package/.idea/modules.xml
DELETED