viagen 0.2.6 → 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/dist/cli.js +16 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -21038,7 +21038,12 @@ async function sync() {
|
|
|
21038
21038
|
console.log("You can now launch sandboxes from the web platform.");
|
|
21039
21039
|
}
|
|
21040
21040
|
async function pull() {
|
|
21041
|
-
const
|
|
21041
|
+
const creds = await loadCredentials();
|
|
21042
|
+
if (!creds) {
|
|
21043
|
+
console.error("Not logged in. Run `viagen login` first.");
|
|
21044
|
+
process.exit(1);
|
|
21045
|
+
}
|
|
21046
|
+
const client = createViagen2({ baseUrl: creds.baseUrl, token: creds.token, orgId: creds.orgId });
|
|
21042
21047
|
const cwd = process.cwd();
|
|
21043
21048
|
const env = loadDotenv(cwd);
|
|
21044
21049
|
console.log("viagen pull");
|
|
@@ -21081,7 +21086,16 @@ async function pull() {
|
|
|
21081
21086
|
}
|
|
21082
21087
|
let secrets;
|
|
21083
21088
|
try {
|
|
21084
|
-
|
|
21089
|
+
const res = await fetch(
|
|
21090
|
+
`${creds.baseUrl}/api/environments/${environmentId}/pull`,
|
|
21091
|
+
{ headers: { Authorization: `Bearer ${creds.token}`, "Content-Type": "application/json" } }
|
|
21092
|
+
);
|
|
21093
|
+
if (!res.ok) {
|
|
21094
|
+
const body = await res.json().catch(() => ({}));
|
|
21095
|
+
throw new Error(body.error ?? `HTTP ${res.status}`);
|
|
21096
|
+
}
|
|
21097
|
+
const data = await res.json();
|
|
21098
|
+
secrets = data.secrets;
|
|
21085
21099
|
} catch (err) {
|
|
21086
21100
|
console.error("Failed to fetch secrets from the platform.");
|
|
21087
21101
|
if (err instanceof Error) console.error(err.message);
|
package/dist/index.js
CHANGED
|
@@ -111,7 +111,7 @@ function registerHealthRoutes(server, env, errorRef) {
|
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
|
-
const currentVersion = true ? "0.2.
|
|
114
|
+
const currentVersion = true ? "0.2.7" : "0.0.0";
|
|
115
115
|
debug("health", `version resolved: ${currentVersion}`);
|
|
116
116
|
let versionCache = null;
|
|
117
117
|
server.middlewares.use("/via/version", (_req, res) => {
|