xtra-cli 1.0.0 → 1.0.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/dist/commands/ci.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/init.js +2 -2
- package/dist/commands/integration.js +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/profile.js +1 -1
- package/dist/commands/project.js +1 -1
- package/dist/lib/config.js +6 -4
- package/dist/lib/profiles.js +2 -2
- package/package.json +1 -1
package/dist/commands/ci.js
CHANGED
|
@@ -63,7 +63,7 @@ const config_1 = require("../lib/config");
|
|
|
63
63
|
// Standalone, no Conf dependency — reads everything from environment variables
|
|
64
64
|
function getCiClient() {
|
|
65
65
|
const token = process.env.XTRA_MACHINE_TOKEN;
|
|
66
|
-
const apiUrl = process.env.XTRA_API_URL || "https://
|
|
66
|
+
const apiUrl = process.env.XTRA_API_URL || "https://www.xtrasecurity.in/api";
|
|
67
67
|
if (!token) {
|
|
68
68
|
ciError("XTRA_MACHINE_TOKEN environment variable is required for CI mode.");
|
|
69
69
|
}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -71,7 +71,7 @@ async function runChecks() {
|
|
|
71
71
|
message: token ? `Set (${token.substring(0, 8)}...)` : "Not set — run 'xtra login'",
|
|
72
72
|
});
|
|
73
73
|
// 3. API URL Configured
|
|
74
|
-
const apiUrl = config.apiUrl || process.env.XTRA_API_URL || "https://
|
|
74
|
+
const apiUrl = config.apiUrl || process.env.XTRA_API_URL || "https://www.xtrasecurity.in/api";
|
|
75
75
|
checks.push({
|
|
76
76
|
name: "API URL",
|
|
77
77
|
status: config.apiUrl || process.env.XTRA_API_URL ? "pass" : "warn",
|
package/dist/commands/init.js
CHANGED
|
@@ -90,7 +90,7 @@ exports.initCommand = new commander_1.Command("init")
|
|
|
90
90
|
// API might return { projects: [...] } or directly an array
|
|
91
91
|
remoteProjects = Array.isArray(result) ? result : result.projects ?? [];
|
|
92
92
|
if (remoteProjects.length === 0) {
|
|
93
|
-
apiSpinner.warn(chalk_1.default.yellow("No projects found in your workspace. Create one at
|
|
93
|
+
apiSpinner.warn(chalk_1.default.yellow("No projects found in your workspace. Create one at www.xtrasecurity.in first."));
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
96
96
|
apiSpinner.succeed(`Found ${remoteProjects.length} project${remoteProjects.length > 1 ? "s" : ""}`);
|
|
@@ -177,7 +177,7 @@ exports.initCommand = new commander_1.Command("init")
|
|
|
177
177
|
project,
|
|
178
178
|
env,
|
|
179
179
|
branch,
|
|
180
|
-
apiUrl: process.env.XTRA_API_URL || "https://
|
|
180
|
+
apiUrl: process.env.XTRA_API_URL || "https://www.xtrasecurity.in/api",
|
|
181
181
|
createdAt: new Date().toISOString(),
|
|
182
182
|
};
|
|
183
183
|
fs.writeFileSync(rcPath, JSON.stringify(rc, null, 2), "utf8");
|
|
@@ -33,7 +33,7 @@ exports.integrationCommand
|
|
|
33
33
|
const status = await api_1.api.getIntegrationStatus("github");
|
|
34
34
|
if (!status.connected) {
|
|
35
35
|
console.log(chalk_1.default.yellow("\nGitHub not connected. Please connect via the web dashboard first."));
|
|
36
|
-
console.log(chalk_1.default.blue("Visit: https://
|
|
36
|
+
console.log(chalk_1.default.blue("Visit: https://www.xtrasecurity.in/integrations\n"));
|
|
37
37
|
process.exit(1);
|
|
38
38
|
}
|
|
39
39
|
console.log(chalk_1.default.green(`\nConnected as: ${status.username}`));
|
package/dist/commands/login.js
CHANGED
|
@@ -188,7 +188,7 @@ async function handleSSOLogin() {
|
|
|
188
188
|
let { apiUrl } = require("../lib/config").getConfig();
|
|
189
189
|
// Hard fallback if getConfig somehow returned the old cached localhost
|
|
190
190
|
if (apiUrl.includes("localhost")) {
|
|
191
|
-
apiUrl = "https://
|
|
191
|
+
apiUrl = "https://www.xtrasecurity.in/api";
|
|
192
192
|
}
|
|
193
193
|
const ssoUrl = `${apiUrl}/auth/cli/sso?callbackUrl=${encodeURIComponent(callbackUrl)}`;
|
|
194
194
|
console.log(chalk_1.default.blue(`Waiting for browser login... (Opening ${ssoUrl})`));
|
package/dist/commands/profile.js
CHANGED
package/dist/commands/project.js
CHANGED
|
@@ -75,7 +75,7 @@ const updateConfigs = (projectId, projectName) => {
|
|
|
75
75
|
if (!rc.env)
|
|
76
76
|
rc.env = "development";
|
|
77
77
|
if (!rc.apiUrl)
|
|
78
|
-
rc.apiUrl = (0, config_1.getConfigValue)("apiUrl") || "https://
|
|
78
|
+
rc.apiUrl = (0, config_1.getConfigValue)("apiUrl") || "https://www.xtrasecurity.in/api";
|
|
79
79
|
try {
|
|
80
80
|
fs.writeFileSync(rcPath, JSON.stringify(rc, null, 2), "utf8");
|
|
81
81
|
console.log(chalk_1.default.gray(` ✔ Updated local .xtrarc (Project context locked to this folder)`));
|
package/dist/lib/config.js
CHANGED
|
@@ -5,18 +5,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getRcConfig = exports.getProjectConfig = exports.getAuthToken = exports.clearConfig = exports.setConfig = exports.getConfigValue = exports.getConfig = void 0;
|
|
7
7
|
const conf_1 = __importDefault(require("conf"));
|
|
8
|
-
const PRODUCTION_API_URL = "https://
|
|
8
|
+
const PRODUCTION_API_URL = "https://www.xtrasecurity.in/api";
|
|
9
9
|
const config = new conf_1.default({
|
|
10
10
|
projectName: "xtra-cli",
|
|
11
11
|
defaults: {
|
|
12
12
|
apiUrl: PRODUCTION_API_URL,
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
// Auto-heal: if an old localhost
|
|
15
|
+
// Auto-heal: if an old localhost or deprecated domain was persisted, clear it so we use production.
|
|
16
16
|
// Users who intentionally want localhost should set XTRA_API_URL env var instead.
|
|
17
17
|
const _storedApiUrl = config.get("apiUrl");
|
|
18
|
-
if (_storedApiUrl &&
|
|
19
|
-
|
|
18
|
+
if (_storedApiUrl && !process.env.XTRA_API_URL) {
|
|
19
|
+
if (_storedApiUrl.includes("localhost") || _storedApiUrl.includes("xtra-security.vercel.app")) {
|
|
20
|
+
config.set("apiUrl", PRODUCTION_API_URL);
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
const getConfig = () => ({
|
|
22
24
|
...config.store,
|
package/dist/lib/profiles.js
CHANGED
|
@@ -27,7 +27,7 @@ const store = new conf_1.default({
|
|
|
27
27
|
activeProfile: "default",
|
|
28
28
|
profiles: {
|
|
29
29
|
default: {
|
|
30
|
-
apiUrl: process.env.XTRA_API_URL || "https://
|
|
30
|
+
apiUrl: process.env.XTRA_API_URL || "https://www.xtrasecurity.in/api",
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -58,7 +58,7 @@ function createProfile(name, data = {}) {
|
|
|
58
58
|
throw new Error(`Profile '${name}' already exists. Use 'xtra profile set' to edit it.`);
|
|
59
59
|
}
|
|
60
60
|
profiles[name] = {
|
|
61
|
-
apiUrl: process.env.XTRA_API_URL || "https://
|
|
61
|
+
apiUrl: process.env.XTRA_API_URL || "https://www.xtrasecurity.in/api",
|
|
62
62
|
...data,
|
|
63
63
|
};
|
|
64
64
|
store.set("profiles", profiles);
|