@sylphx/cli 0.1.4 → 0.1.6

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/dist/index.js +12 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var import_commander16 = require("commander");
30
30
  // package.json
31
31
  var package_default = {
32
32
  name: "@sylphx/cli",
33
- version: "0.1.4",
33
+ version: "0.1.6",
34
34
  description: "Sylphx Platform CLI \u2014 deploy, manage logs, env vars, and more",
35
35
  type: "commonjs",
36
36
  bin: {
@@ -228,9 +228,14 @@ var api = {
228
228
  },
229
229
  /** List env vars for a project environment */
230
230
  async listEnvVars(projectId, envType) {
231
- return request("GET", `/projects/${projectId}/env-vars`, {
232
- query: { envType }
233
- });
231
+ const res = await request(
232
+ "GET",
233
+ `/projects/${projectId}/env-vars`,
234
+ {
235
+ query: { envType }
236
+ }
237
+ );
238
+ return Array.isArray(res) ? res : res.data ?? [];
234
239
  },
235
240
  /** Set an env var (or batch of vars) for a project environment */
236
241
  async setEnvVar(projectId, key, value, envType, secret) {
@@ -346,7 +351,7 @@ var api = {
346
351
  }
347
352
  };
348
353
  function createLogStream(projectId, envType) {
349
- const params = new URLSearchParams({ envType, tail: "100" });
354
+ const params = new URLSearchParams({ envType, stream: "true", limit: "200" });
350
355
  return {
351
356
  url: `${API_BASE}/projects/${projectId}/logs?${params.toString()}`,
352
357
  token: config.getToken()
@@ -543,7 +548,7 @@ function formatLogEntry(raw) {
543
548
  } catch {
544
549
  return ` ${import_chalk2.default.white(raw)}`;
545
550
  }
546
- const message = entry.message ?? entry.msg ?? raw;
551
+ const message = entry.content ?? entry.message ?? entry.msg ?? raw;
547
552
  const level = (entry.level ?? "info").toLowerCase();
548
553
  const timestamp = entry.timestamp ?? entry.ts;
549
554
  const prefix = timestamp ? `${import_chalk2.default.dim(`[${new Date(timestamp).toLocaleTimeString()}]`)} ` : "";
@@ -1450,7 +1455,7 @@ var projectsListCommand = new import_commander11.Command("list").description("Li
1450
1455
  );
1451
1456
  console.log(import_chalk12.default.dim(` ${"\u2500".repeat(colSlug + colName + 30)}`));
1452
1457
  for (const p of projects) {
1453
- const envNames = p.environments && p.environments.length > 0 ? p.environments.map((e) => e.slug).join(", ") : import_chalk12.default.dim("\u2014");
1458
+ const envNames = p.environments && p.environments.length > 0 ? p.environments.map((e) => e.name || e.envType || e.id).join(", ") : import_chalk12.default.dim("\u2014");
1454
1459
  console.log(
1455
1460
  ` ${import_chalk12.default.cyan(p.slug.padEnd(colSlug))} ${p.name.padEnd(colName)} ${envNames}`
1456
1461
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Sylphx Platform CLI — deploy, manage logs, env vars, and more",
5
5
  "type": "commonjs",
6
6
  "bin": {