@zuplo/cli 1.70.0 → 1.72.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 (42) hide show
  1. package/dist/cli.js +8 -3
  2. package/dist/cmds/convert.js +6 -3
  3. package/dist/cmds/delete.js +6 -3
  4. package/dist/cmds/deploy.js +6 -3
  5. package/dist/cmds/dev.js +6 -3
  6. package/dist/cmds/editor.js +6 -3
  7. package/dist/cmds/link.js +6 -3
  8. package/dist/cmds/list.js +6 -3
  9. package/dist/cmds/login.js +6 -3
  10. package/dist/cmds/project/update.js +6 -3
  11. package/dist/cmds/test.js +6 -3
  12. package/dist/cmds/tunnel/create.js +6 -3
  13. package/dist/cmds/tunnel/delete.js +6 -3
  14. package/dist/cmds/tunnel/describe.js +6 -3
  15. package/dist/cmds/tunnel/list.js +6 -3
  16. package/dist/cmds/tunnel/rotate-token.js +6 -3
  17. package/dist/cmds/tunnel/services/describe.js +6 -3
  18. package/dist/cmds/tunnel/services/update.js +6 -3
  19. package/dist/cmds/variable/create.js +6 -3
  20. package/dist/cmds/variable/update.js +6 -3
  21. package/dist/common/analytics/lib.js +57 -0
  22. package/dist/common/constants.js +4 -2
  23. package/dist/common/machine-id/lib.js +68 -0
  24. package/dist/common/middleware/user-identification.js +38 -0
  25. package/dist/common/output.js +10 -2
  26. package/dist/deploy/poll-deployment.js +4 -4
  27. package/dist/dev/handler.js +6 -3
  28. package/dist/editor/handler.js +14 -5
  29. package/dist/editor/server/server.js +4 -3
  30. package/dist/link/handler.js +7 -7
  31. package/dist/list/handler.js +4 -3
  32. package/dist/tunnel/create/handler.js +4 -4
  33. package/dist/tunnel/delete/handler.js +4 -4
  34. package/dist/tunnel/describe/handler.js +4 -4
  35. package/dist/tunnel/list/handler.js +3 -3
  36. package/dist/tunnel/rotate-token/handler.js +4 -4
  37. package/dist/tunnel/services/describe/handler.js +4 -4
  38. package/dist/tunnel/services/update/handler.js +4 -4
  39. package/dist/tunnel/services/update/poll-provisioning-operations.js +8 -4
  40. package/dist/variable/create/handler.js +4 -3
  41. package/dist/variable/update/handler.js +4 -3
  42. package/package.json +5 -4
@@ -0,0 +1,68 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38fb065f-2318-51e7-9e53-63d35f2d8bc2")}catch(e){}}();
3
+ import { execSync } from "node:child_process";
4
+ import { createHash } from "node:crypto";
5
+ const win32RegBinPath = {
6
+ skipped: "",
7
+ native: "%windir%\\System32",
8
+ mixed: "%windir%\\sysnative\\cmd.exe /c %windir%\\System32",
9
+ };
10
+ const guid = {
11
+ darwin: "ioreg -rd1 -c IOPlatformExpertDevice",
12
+ win32: `${win32RegBinPath[isWindowsProcessMixedOrNativeArchitecture()]}\\REG.exe ` +
13
+ "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography " +
14
+ "/v MachineGuid",
15
+ linux: "( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",
16
+ };
17
+ function isWindowsProcessMixedOrNativeArchitecture() {
18
+ if (process.platform !== "win32") {
19
+ return "skipped";
20
+ }
21
+ if (process.arch === "ia32" && process.env["PROCESSOR_ARCHITEW6432"]) {
22
+ return "mixed";
23
+ }
24
+ return "native";
25
+ }
26
+ function hash(guid) {
27
+ return createHash("sha256").update(guid).digest("hex");
28
+ }
29
+ function expose(result) {
30
+ switch (process.platform) {
31
+ case "darwin":
32
+ return result
33
+ .split("IOPlatformUUID")[1]
34
+ .split("\n")[0]
35
+ .replace(/=|\s+]"/gi, "")
36
+ .toLowerCase();
37
+ case "win32":
38
+ return result
39
+ .toString()
40
+ .split("REG_SZ")[1]
41
+ .replace(/\r+|\n+|\s+/gi, "")
42
+ .toLowerCase();
43
+ case "linux":
44
+ return result
45
+ .toString()
46
+ .replace(/\r+|\n+|\s+/gi, "")
47
+ .toLowerCase();
48
+ case "freebsd":
49
+ return result
50
+ .toString()
51
+ .replace(/\r+|\n+|\s+/gi, "")
52
+ .toLowerCase();
53
+ default:
54
+ throw new Error(`Unsupported platform: ${process.platform}`);
55
+ }
56
+ }
57
+ export function machineId() {
58
+ switch (process.platform) {
59
+ case "darwin":
60
+ case "win32":
61
+ case "linux":
62
+ return hash(expose(execSync(guid[process.platform]).toString()));
63
+ default:
64
+ return "e16fc483-5593-4d71-b485-a6533693da9b";
65
+ }
66
+ }
67
+ //# sourceMappingURL=lib.js.map
68
+ //# debugId=38fb065f-2318-51e7-9e53-63d35f2d8bc2
@@ -0,0 +1,38 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5f9398af-88ba-561c-8582-560e16316697")}catch(e){}}();
3
+ import * as Sentry from "@sentry/node";
4
+ import * as jose from "jose";
5
+ import { readFile } from "node:fs/promises";
6
+ import { join } from "node:path";
7
+ import { ZUPLO_AUTH_FILE_NAME } from "../constants.js";
8
+ import { logger } from "../logger.js";
9
+ import { machineId } from "../machine-id/lib.js";
10
+ import { ZUPLO_XDG_STATE_HOME } from "../xdg/lib.js";
11
+ export async function identify(argv) {
12
+ if (process.env.ZUPLO_DO_NOT_TRACK) {
13
+ logger.trace("Sentry traces will be sent without user identification.");
14
+ }
15
+ else {
16
+ let userId;
17
+ try {
18
+ const rawAuth = await readFile(join(ZUPLO_XDG_STATE_HOME, ZUPLO_AUTH_FILE_NAME), "utf-8");
19
+ const authJson = JSON.parse(rawAuth);
20
+ const decoded = jose.decodeJwt(authJson.access_token);
21
+ userId = decoded.sub;
22
+ }
23
+ catch (e) {
24
+ userId = machineId();
25
+ }
26
+ Sentry.setUser({ id: machineId() });
27
+ Sentry.setTag("user-id", userId);
28
+ if (argv.account && typeof argv.account === "string") {
29
+ Sentry.setTag("account", argv.account);
30
+ }
31
+ if (argv.project && typeof argv.project === "string") {
32
+ Sentry.setTag("project", argv.project);
33
+ }
34
+ argv["zuplo-user-id"] = userId;
35
+ }
36
+ }
37
+ //# sourceMappingURL=user-identification.js.map
38
+ //# debugId=5f9398af-88ba-561c-8582-560e16316697
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="add3c8c1-77f3-5f77-86a6-91bb56fc8924")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="211d2e9e-e3be-5bd3-959a-5cd147654f20")}catch(e){}}();
3
3
  import * as Sentry from "@sentry/node";
4
4
  import chalk from "chalk";
5
5
  import { MAX_WAIT_PENDING_TIME_MS } from "./constants.js";
@@ -42,5 +42,13 @@ export default function setBlocking() {
42
42
  }
43
43
  });
44
44
  }
45
+ export function textOrJson(text) {
46
+ try {
47
+ return JSON.parse(text);
48
+ }
49
+ catch (e) {
50
+ return text;
51
+ }
52
+ }
45
53
  //# sourceMappingURL=output.js.map
46
- //# debugId=add3c8c1-77f3-5f77-86a6-91bb56fc8924
54
+ //# debugId=211d2e9e-e3be-5bd3-959a-5cd147654f20
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c9c54ddd-51be-5f59-85c4-8d438ee05f78")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="be10cb83-f95d-5db4-8bda-0d5797e852d5")}catch(e){}}();
3
3
  import { logger } from "../common/logger.js";
4
- import { printDiagnosticsToConsole } from "../common/output.js";
4
+ import { printDiagnosticsToConsole, textOrJson } from "../common/output.js";
5
5
  import settings from "../common/settings.js";
6
6
  function wait(duration = settings.POLL_INTERVAL) {
7
7
  return new Promise((resolve) => setTimeout(resolve, duration));
@@ -56,11 +56,11 @@ export async function pollDeployment(argv, fileId, account, project) {
56
56
  continue;
57
57
  }
58
58
  else {
59
- logger.error(`Unexpected error from server while polling for deployment: ${response.status} ${response.statusText} ${await response.text()}`);
59
+ logger.error(`Unexpected error from server while polling for deployment: ${response.status} ${response.statusText} ${textOrJson(await response.text())}`);
60
60
  throw new Error(`Unexpected response from server while polling for deployment: ${response.status} ${response.statusText}`);
61
61
  }
62
62
  }
63
63
  return {};
64
64
  }
65
65
  //# sourceMappingURL=poll-deployment.js.map
66
- //# debugId=c9c54ddd-51be-5f59-85c4-8d438ee05f78
66
+ //# debugId=be10cb83-f95d-5db4-8bda-0d5797e852d5
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="97d04605-0372-5102-93a4-54073b5dc1ef")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fe20d450-f9b0-547f-8255-96a0edc7e86b")}catch(e){}}();
3
3
  import * as dotenv from "dotenv";
4
4
  import { cpSync, existsSync } from "node:fs";
5
5
  import { readFile } from "node:fs/promises";
@@ -23,7 +23,7 @@ export async function dev(argv) {
23
23
  }
24
24
  const core = await import("@zuplo/core");
25
25
  const port = argv.port ?? 9000;
26
- await core.default.startDevServer({
26
+ const serverProcess = await core.default.startDevServer({
27
27
  sourceDirectory,
28
28
  port,
29
29
  generateSourceMaps: true,
@@ -32,6 +32,9 @@ export async function dev(argv) {
32
32
  disableIntegratedDevPortalBuild: false,
33
33
  },
34
34
  });
35
+ return new Promise((resolve) => {
36
+ serverProcess.on("exit", resolve);
37
+ });
35
38
  }
36
39
  //# sourceMappingURL=handler.js.map
37
- //# debugId=97d04605-0372-5102-93a4-54073b5dc1ef
40
+ //# debugId=fe20d450-f9b0-547f-8255-96a0edc7e86b
@@ -1,12 +1,21 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d6f4d4f6-ecc1-5d01-8753-da4a088d3ee1")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7eb1c399-ebb2-5b8a-a80f-f827c9bac32d")}catch(e){}}();
3
+ import { logger } from "../common/logger.js";
3
4
  import { ApiServer } from "./server/server.js";
4
5
  export async function editor(argv) {
5
6
  const workingDir = argv.dir || null;
6
7
  const server = new ApiServer(workingDir);
7
- process.on("SIGTERM", server.close);
8
- process.on("SIGINT", server.close);
9
- server.start().catch(console.error);
8
+ server.start().catch(logger.error);
9
+ return new Promise((resolve) => {
10
+ process.on("SIGTERM", async () => {
11
+ await server.close();
12
+ resolve();
13
+ });
14
+ process.on("SIGINT", async () => {
15
+ await server.close();
16
+ resolve();
17
+ });
18
+ });
10
19
  }
11
20
  //# sourceMappingURL=handler.js.map
12
- //# debugId=d6f4d4f6-ecc1-5d01-8753-da4a088d3ee1
21
+ //# debugId=7eb1c399-ebb2-5b8a-a80f-f827c9bac32d
@@ -1,10 +1,11 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8451c49d-bb15-57d5-93e4-22bef812d72b")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3afd227e-e101-5e6c-8791-6878f235a58c")}catch(e){}}();
3
3
  import fastifyStatic from "@fastify/static";
4
4
  import Fastify from "fastify";
5
5
  import fs, { readdir } from "node:fs/promises";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
+ import { logger } from "../../common/logger.js";
8
9
  import { corsPlugin } from "./cors-plugin.js";
9
10
  import { dirExists, fileExists } from "./xfs.js";
10
11
  export class ApiServer {
@@ -17,7 +18,7 @@ export class ApiServer {
17
18
  this.listenerPort = 5500;
18
19
  this.listenerHost = "localhost";
19
20
  this.fastify = Fastify({
20
- logger: true,
21
+ logger: logger,
21
22
  trustProxy: true,
22
23
  disableRequestLogging: true,
23
24
  });
@@ -131,4 +132,4 @@ export class ApiServer {
131
132
  };
132
133
  }
133
134
  //# sourceMappingURL=server.js.map
134
- //# debugId=8451c49d-bb15-57d5-93e4-22bef812d72b
135
+ //# debugId=3afd227e-e101-5e6c-8791-6878f235a58c
@@ -1,11 +1,11 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="63524d19-c032-5440-9afe-279fb317a27c")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ebabd7dc-5b6b-51bd-bf6f-d8997a9bad4f")}catch(e){}}();
3
3
  import { select } from "@inquirer/prompts";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { join } from "node:path";
6
6
  import { ZUPLO_AUTH_FILE_NAME } from "../common/constants.js";
7
7
  import { logger } from "../common/logger.js";
8
- import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../common/output.js";
8
+ import { printCriticalFailureToConsoleAndExit, printResultToConsoleAndExitGracefully, textOrJson, } from "../common/output.js";
9
9
  import settings from "../common/settings.js";
10
10
  import { ZUPLO_XDG_STATE_HOME } from "../common/xdg/lib.js";
11
11
  import { pullSystemConfig, safeMergeConfig } from "./populate.js";
@@ -21,9 +21,9 @@ export async function link(argv) {
21
21
  logger.error({
22
22
  status: accountResponse.status,
23
23
  statusText: accountResponse.statusText,
24
- response: await accountResponse.text(),
24
+ response: textOrJson(await accountResponse.text()),
25
25
  }, "Failed to list accounts.");
26
- printDiagnosticsToConsole("Error: Failed to list your accounts. Try again later.");
26
+ printCriticalFailureToConsoleAndExit("Error: Failed to list your accounts. Try again later.");
27
27
  }
28
28
  const accountJson = (await accountResponse.json());
29
29
  let account;
@@ -50,9 +50,9 @@ export async function link(argv) {
50
50
  logger.error({
51
51
  status: projectResponse.status,
52
52
  statusText: projectResponse.statusText,
53
- response: await projectResponse.text(),
53
+ response: textOrJson(await projectResponse.text()),
54
54
  }, "Failed to list projects.");
55
- printDiagnosticsToConsole("Error: Failed to list your projects. Try again later.");
55
+ printCriticalFailureToConsoleAndExit("Error: Failed to list your projects. Try again later.");
56
56
  }
57
57
  const projectJson = (await projectResponse.json());
58
58
  let project;
@@ -80,4 +80,4 @@ Successfully linked your local directory to the ${project} project in the ${acco
80
80
  .env.zuplo and zuplo.jsonc have been updated with the new values.`);
81
81
  }
82
82
  //# sourceMappingURL=handler.js.map
83
- //# debugId=63524d19-c032-5440-9afe-279fb317a27c
83
+ //# debugId=ebabd7dc-5b6b-51bd-bf6f-d8997a9bad4f
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fdfd24e0-3e32-58bd-b655-a720aeaf96f1")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b92cf828-73b6-5f1c-9a8a-1545e96cc93e")}catch(e){}}();
3
3
  import { logger } from "../common/logger.js";
4
- import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../common/output.js";
4
+ import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../common/output.js";
5
5
  import settings from "../common/settings.js";
6
6
  export async function list(argv) {
7
7
  const { account, project } = argv;
@@ -20,9 +20,10 @@ export async function list(argv) {
20
20
  logger.error({
21
21
  status: listResponse.status,
22
22
  statusText: listResponse.statusText,
23
+ response: textOrJson(await listResponse.text()),
23
24
  }, "Failed to list deployed zups");
24
25
  printDiagnosticsToConsole("Error: Failed to list deployed zups. Try again later.");
25
26
  }
26
27
  }
27
28
  //# sourceMappingURL=handler.js.map
28
- //# debugId=fdfd24e0-3e32-58bd-b655-a720aeaf96f1
29
+ //# debugId=b92cf828-73b6-5f1c-9a8a-1545e96cc93e
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="db490b85-f57d-50ba-8f3a-00fa84724d9f")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2c727de1-d0e0-517c-9b8d-63612d480be0")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
- import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, } from "../../common/output.js";
4
+ import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
6
6
  export async function create(argv) {
7
7
  const { account } = argv;
@@ -21,10 +21,10 @@ export async function create(argv) {
21
21
  logger.error({
22
22
  status: createResponse.status,
23
23
  statusText: createResponse.statusText,
24
- response: await createResponse.text(),
24
+ response: textOrJson(await createResponse.text()),
25
25
  }, "Failed to create tunnel for account");
26
26
  printDiagnosticsToConsole("Error: Failed to create tunnel for your account. Check the arguments.");
27
27
  }
28
28
  }
29
29
  //# sourceMappingURL=handler.js.map
30
- //# debugId=db490b85-f57d-50ba-8f3a-00fa84724d9f
30
+ //# debugId=2c727de1-d0e0-517c-9b8d-63612d480be0
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3dbfae8e-75c2-56e5-9f02-34053a6aa35d")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b4d4a60a-f5a8-5bb4-a1a8-1afcb9c6f3e8")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
- import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../common/output.js";
4
+ import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
6
6
  import { pollTeardownOperation } from "./poll-teardown-operation.js";
7
7
  export async function deleteTunnel(argv) {
@@ -32,10 +32,10 @@ export async function deleteTunnel(argv) {
32
32
  logger.error({
33
33
  status: deleteResponse.status,
34
34
  statusText: deleteResponse.statusText,
35
- response: await deleteResponse.text(),
35
+ response: textOrJson(await deleteResponse.text()),
36
36
  }, "Failed to delete tunnel for account");
37
37
  printDiagnosticsToConsole("Error: Failed to delete the tunnel for your account. Check the arguments.");
38
38
  }
39
39
  }
40
40
  //# sourceMappingURL=handler.js.map
41
- //# debugId=3dbfae8e-75c2-56e5-9f02-34053a6aa35d
41
+ //# debugId=b4d4a60a-f5a8-5bb4-a1a8-1afcb9c6f3e8
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d64d8573-9cc3-5b7e-bac6-d6fa4f2c2b01")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="653458ca-187f-5bbc-8553-788deb7155bd")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
- import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, } from "../../common/output.js";
4
+ import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
6
6
  export async function describe(argv) {
7
7
  const { account } = argv;
@@ -19,10 +19,10 @@ export async function describe(argv) {
19
19
  logger.error({
20
20
  status: describeResponse.status,
21
21
  statusText: describeResponse.statusText,
22
- response: await describeResponse.text(),
22
+ response: textOrJson(await describeResponse.text()),
23
23
  }, "Failed to describe tunnel for account");
24
24
  printDiagnosticsToConsole("Error: Failed to describe tunnel for your account. Check the arguments.");
25
25
  }
26
26
  }
27
27
  //# sourceMappingURL=handler.js.map
28
- //# debugId=d64d8573-9cc3-5b7e-bac6-d6fa4f2c2b01
28
+ //# debugId=653458ca-187f-5bbc-8553-788deb7155bd
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d265e30b-ff1a-53f0-99eb-d375cad4154b")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="25e1eea1-68c6-522e-bb2c-bfbd57517091")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
4
  import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, printTableToConsoleAndExitGracefully, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
@@ -28,10 +28,10 @@ export async function list(argv) {
28
28
  logger.error({
29
29
  status: listResponse.status,
30
30
  statusText: listResponse.statusText,
31
- response: await listResponse.text(),
31
+ response: await listResponse.json(),
32
32
  }, "Failed to list tunnels for account");
33
33
  printDiagnosticsToConsole("Error: Failed to list tunnels for your account. Try again later.");
34
34
  }
35
35
  }
36
36
  //# sourceMappingURL=handler.js.map
37
- //# debugId=d265e30b-ff1a-53f0-99eb-d375cad4154b
37
+ //# debugId=25e1eea1-68c6-522e-bb2c-bfbd57517091
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9c6e4b9e-4128-5fe9-a57e-56c8f9ddd3e1")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="127b1934-09f2-505c-a8ad-28c355e9109c")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
- import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, } from "../../common/output.js";
4
+ import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
6
6
  export async function rotateToken(argv) {
7
7
  const { account } = argv;
@@ -19,10 +19,10 @@ export async function rotateToken(argv) {
19
19
  logger.error({
20
20
  status: rotateResponse.status,
21
21
  statusText: rotateResponse.statusText,
22
- response: await rotateResponse.text(),
22
+ response: textOrJson(await rotateResponse.text()),
23
23
  }, "Failed to rotate token for tunnel");
24
24
  printDiagnosticsToConsole("Error: Failed to rotate token for tunnel. Check the arguments.");
25
25
  }
26
26
  }
27
27
  //# sourceMappingURL=handler.js.map
28
- //# debugId=9c6e4b9e-4128-5fe9-a57e-56c8f9ddd3e1
28
+ //# debugId=127b1934-09f2-505c-a8ad-28c355e9109c
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d0b6aa19-5aae-5f66-acfb-c8014cfd09fc")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="51788ca8-ed69-5b21-8faf-ae8aaa026e95")}catch(e){}}();
3
3
  import { logger } from "../../../common/logger.js";
4
- import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../../common/output.js";
4
+ import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../../../common/output.js";
5
5
  import settings from "../../../common/settings.js";
6
6
  export async function describe(argv) {
7
7
  const { account } = argv;
@@ -19,10 +19,10 @@ export async function describe(argv) {
19
19
  logger.error({
20
20
  status: describeResponse.status,
21
21
  statusText: describeResponse.statusText,
22
- response: await describeResponse.text(),
22
+ response: textOrJson(await describeResponse.text()),
23
23
  }, "Failed to describe services for tunnel");
24
24
  printDiagnosticsToConsole("Error: Failed to describe the services for your tunnel. Check the arguments.");
25
25
  }
26
26
  }
27
27
  //# sourceMappingURL=handler.js.map
28
- //# debugId=d0b6aa19-5aae-5f66-acfb-c8014cfd09fc
28
+ //# debugId=51788ca8-ed69-5b21-8faf-ae8aaa026e95
@@ -1,8 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0b6d1f82-ab90-5eb2-abcc-1379cf64a8bb")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0e1f9e61-8829-5ae3-b4cd-c1a79dc2191b")}catch(e){}}();
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { logger } from "../../../common/logger.js";
5
- import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../../common/output.js";
5
+ import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../../../common/output.js";
6
6
  import settings from "../../../common/settings.js";
7
7
  import { pollProvisioningOperation } from "./poll-provisioning-operations.js";
8
8
  export async function updateServices(argv) {
@@ -42,10 +42,10 @@ export async function updateServices(argv) {
42
42
  logger.error({
43
43
  status: deleteResponse.status,
44
44
  statusText: deleteResponse.statusText,
45
- response: await deleteResponse.text(),
45
+ response: textOrJson(await deleteResponse.text()),
46
46
  }, "Failed to update tunnel for account");
47
47
  printDiagnosticsToConsole("Error: Failed to update the tunnel for your account. Check the arguments.");
48
48
  }
49
49
  }
50
50
  //# sourceMappingURL=handler.js.map
51
- //# debugId=0b6d1f82-ab90-5eb2-abcc-1379cf64a8bb
51
+ //# debugId=0e1f9e61-8829-5ae3-b4cd-c1a79dc2191b
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="14b2f25a-e446-54be-bf80-42ecd48bb1ba")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="79be439d-42a8-5591-9774-6d9603f9d845")}catch(e){}}();
3
3
  import { logger } from "../../../common/logger.js";
4
- import { printDiagnosticsToConsole } from "../../../common/output.js";
4
+ import { printDiagnosticsToConsole, textOrJson, } from "../../../common/output.js";
5
5
  import settings from "../../../common/settings.js";
6
6
  function wait(duration = settings.PROVISIONING_POLL_INTERVAL) {
7
7
  return new Promise((resolve) => setTimeout(resolve, duration));
@@ -30,11 +30,15 @@ export async function pollProvisioningOperation(args) {
30
30
  }
31
31
  }
32
32
  else {
33
- logger.error(`Unexpected error from server while polling for provisioning operation status: ${response.status} ${response.statusText} ${await response.json()}`);
33
+ logger.error({
34
+ status: response.status,
35
+ statusText: response.statusText,
36
+ response: textOrJson(await response.text()),
37
+ }, "Unexpected error from server while polling for provisioning operation status");
34
38
  throw new Error(`Unexpected response from server while polling for provisioning operation status: ${response.status} ${response.statusText}`);
35
39
  }
36
40
  }
37
41
  throw new Error("Unexpected error while polling for provisioning operation status");
38
42
  }
39
43
  //# sourceMappingURL=poll-provisioning-operations.js.map
40
- //# debugId=14b2f25a-e446-54be-bf80-42ecd48bb1ba
44
+ //# debugId=79be439d-42a8-5591-9774-6d9603f9d845
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b91c903f-cfdb-5b4c-9ce3-fe6824de0155")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bf9a9d71-d13d-5770-b18d-a33e79514601")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
- import { printDiagnosticsToConsole, printResultToConsole, } from "../../common/output.js";
4
+ import { printDiagnosticsToConsole, printResultToConsole, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
6
6
  export async function create(argv) {
7
7
  const { account, project } = argv;
@@ -25,9 +25,10 @@ export async function create(argv) {
25
25
  logger.error({
26
26
  status: createResponse.status,
27
27
  statusText: createResponse.statusText,
28
+ response: textOrJson(await createResponse.text()),
28
29
  }, "Failed to create variable");
29
30
  printDiagnosticsToConsole("Error: Failed to create variable. Check the arguments.");
30
31
  }
31
32
  }
32
33
  //# sourceMappingURL=handler.js.map
33
- //# debugId=b91c903f-cfdb-5b4c-9ce3-fe6824de0155
34
+ //# debugId=bf9a9d71-d13d-5770-b18d-a33e79514601
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="43d578e3-bb26-5129-a6f9-f07fc8cbc895")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e2ce8efc-1641-5b90-9475-8e36ca9c534c")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
- import { printDiagnosticsToConsole, printResultToConsole, } from "../../common/output.js";
4
+ import { printDiagnosticsToConsole, printResultToConsole, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
6
6
  export async function update(argv) {
7
7
  const { account, project } = argv;
@@ -23,9 +23,10 @@ export async function update(argv) {
23
23
  logger.error({
24
24
  status: updateResponse.status,
25
25
  statusText: updateResponse.statusText,
26
+ response: textOrJson(await updateResponse.text()),
26
27
  }, "Failed to update variable");
27
28
  printDiagnosticsToConsole("Error: Failed to update variable. Check the arguments.");
28
29
  }
29
30
  }
30
31
  //# sourceMappingURL=handler.js.map
31
- //# debugId=43d578e3-bb26-5129-a6f9-f07fc8cbc895
32
+ //# debugId=e2ce8efc-1641-5b90-9475-8e36ca9c534c
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.70.0",
3
+ "version": "1.72.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "description": "The command-line interface for Zuplo",
@@ -56,11 +56,11 @@
56
56
  "@fastify/cors": "^8.3.0",
57
57
  "@fastify/static": "^6.10.2",
58
58
  "@inquirer/prompts": "^3.0.4",
59
- "@sentry/node": "^7.69.0",
59
+ "@sentry/node": "7.69.0",
60
60
  "@swc/core": "1.3.78",
61
- "@zuplo/core": "5.1284.0",
61
+ "@zuplo/core": "5.1290.0",
62
62
  "@zuplo/pino-pretty-configurations": "^1.4.0",
63
- "@zuplo/runtime": "5.1284.0",
63
+ "@zuplo/runtime": "5.1290.0",
64
64
  "chalk": "^5.1.2",
65
65
  "deno-bin": "1.31.1",
66
66
  "dotenv": "^16.3.1",
@@ -75,6 +75,7 @@
75
75
  "open": "^9.1.0",
76
76
  "pino": "^8.11.0",
77
77
  "pino-pretty": "^9.4.0",
78
+ "posthog-node": "3.1.2",
78
79
  "prettier": "^2.8.7",
79
80
  "rimraf": "^3.0.2",
80
81
  "rollup-plugin-node-polyfills": "^0.2.1",