@zuplo/cli 1.92.0 → 1.94.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.
@@ -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]="c3015aa9-ba0d-540f-8ea7-2f7bd7e5ad3a")}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]="340e4aed-225d-5578-a3af-822eb8c7f33b")}catch(e){}}();
3
3
  import { captureEvent } from "../common/analytics/lib.js";
4
4
  import { configure } from "../common/middleware/user-configuration.js";
5
5
  import { identify } from "../common/middleware/user-identification.js";
@@ -33,6 +33,10 @@ export default {
33
33
  type: "boolean",
34
34
  describe: "Verify that this Git repository matches the one configured on Zuplo. Use --no-verify-remote to disable.",
35
35
  default: true,
36
+ })
37
+ .option("environment", {
38
+ type: "string",
39
+ describe: "The value to use for environment name, instead of the current branch name",
36
40
  })
37
41
  .demandOption(["api-key"])
38
42
  .boolean("verify-remote")
@@ -47,4 +51,4 @@ export default {
47
51
  },
48
52
  };
49
53
  //# sourceMappingURL=deploy.js.map
50
- //# debugId=c3015aa9-ba0d-540f-8ea7-2f7bd7e5ad3a
54
+ //# debugId=340e4aed-225d-5578-a3af-822eb8c7f33b
@@ -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]="a7cdf682-723c-53b1-b20c-0a26e9a504db")}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]="2b8e3bc1-2016-5443-a600-5394af1e0854")}catch(e){}}();
3
3
  import { captureEvent } from "../../common/analytics/lib.js";
4
4
  import setBlocking from "../../common/output.js";
5
5
  import { ZuploProjectValidator } from "../../common/validators/file-system-validator.js";
@@ -25,8 +25,13 @@ export default {
25
25
  .option("source", {
26
26
  type: "string",
27
27
  describe: "The OpenAPI file to import",
28
+ conflicts: ["source-url"],
29
+ })
30
+ .option("source-url", {
31
+ type: "string",
32
+ describe: "The URL of the OpenAPI file to import",
33
+ conflicts: ["source"],
28
34
  })
29
- .demandOption(["source"])
30
35
  .middleware([setBlocking])
31
36
  .check(async (argv) => {
32
37
  return await new YargsChecker(new ZuploProjectValidator()).check(argv);
@@ -38,4 +43,4 @@ export default {
38
43
  },
39
44
  };
40
45
  //# sourceMappingURL=import-openapi.js.map
41
- //# debugId=a7cdf682-723c-53b1-b20c-0a26e9a504db
46
+ //# debugId=2b8e3bc1-2016-5443-a600-5394af1e0854
@@ -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]="12dff9e0-1a30-5234-8359-f04cfa89a501")}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]="c64e44eb-7f72-5e84-a93d-efdc8dd7eded")}catch(e){}}();
3
3
  import { parse } from "jsonc-parser";
4
4
  import { existsSync } from "node:fs";
5
5
  import { readFile } from "node:fs/promises";
@@ -27,7 +27,7 @@ export async function configure(argv) {
27
27
  }
28
28
  else {
29
29
  logger.trace({ status: whoAmIResponse.status, statusText: whoAmIResponse.statusText }, "Failed to determine who-am-i");
30
- printCriticalFailureToConsoleAndExit("Error: Failed to validate the API key. Check your API key.");
30
+ await printCriticalFailureToConsoleAndExit("Error: Failed to validate the API key. Check your API key.");
31
31
  }
32
32
  }
33
33
  async function processZuploConfigurationFile() {
@@ -48,7 +48,7 @@ async function processZuploConfigurationFile() {
48
48
  const data = parse(fileContents, errors);
49
49
  if (errors.length > 0) {
50
50
  logger.trace(errors[0], "Failed to parse zuplo.jsonc");
51
- printCriticalFailureToConsoleAndExit("Error: Failed to parse the values from zuplo.jsonc. Check your zuplo.jsonc file.");
51
+ await printCriticalFailureToConsoleAndExit("Error: Failed to parse the values from zuplo.jsonc. Check your zuplo.jsonc file.");
52
52
  }
53
53
  return data;
54
54
  }
@@ -59,4 +59,4 @@ const omitNull = (obj) => {
59
59
  return obj;
60
60
  };
61
61
  //# sourceMappingURL=user-configuration.js.map
62
- //# debugId=12dff9e0-1a30-5234-8359-f04cfa89a501
62
+ //# debugId=c64e44eb-7f72-5e84-a93d-efdc8dd7eded
@@ -1,14 +1,14 @@
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]="c9f754b6-4a30-5079-ac77-596791509251")}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]="4e2efea3-a632-569e-9e20-90d1c521898b")}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";
6
6
  export function printDiagnosticsToConsole(message) {
7
7
  console.error(chalk.bold.blue(message));
8
8
  }
9
- export function printCriticalFailureToConsoleAndExit(message) {
9
+ export async function printCriticalFailureToConsoleAndExit(message) {
10
10
  console.error(chalk.bold.red(message));
11
- void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
11
+ await Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
12
12
  process.exit(1);
13
13
  });
14
14
  }
@@ -18,15 +18,15 @@ export function printResultToConsole(message) {
18
18
  export function printTableToConsole(table) {
19
19
  console.table(table);
20
20
  }
21
- export function printResultToConsoleAndExitGracefully(message) {
21
+ export async function printResultToConsoleAndExitGracefully(message) {
22
22
  printResultToConsole(message);
23
- void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
23
+ await Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
24
24
  process.exit(0);
25
25
  });
26
26
  }
27
- export function printTableToConsoleAndExitGracefully(table) {
27
+ export async function printTableToConsoleAndExitGracefully(table) {
28
28
  printTableToConsole(table);
29
- void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
29
+ await Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
30
30
  process.exit(0);
31
31
  });
32
32
  }
@@ -51,4 +51,4 @@ export function textOrJson(text) {
51
51
  }
52
52
  }
53
53
  //# sourceMappingURL=output.js.map
54
- //# debugId=c9f754b6-4a30-5079-ac77-596791509251
54
+ //# debugId=4e2efea3-a632-569e-9e20-90d1c521898b
@@ -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]="98ec46cb-efc5-52e5-8f3c-7c9a206b4cf6")}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]="0cfd36e0-6ea6-5449-b680-9d0a8dfa1a9e")}catch(e){}}();
3
3
  import { writeFileSync } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { join, relative } from "node:path";
@@ -32,8 +32,8 @@ export async function convert(argv) {
32
32
  }
33
33
  catch (err) {
34
34
  logger.error(err);
35
- printCriticalFailureToConsoleAndExit(err);
35
+ await printCriticalFailureToConsoleAndExit(err);
36
36
  }
37
37
  }
38
38
  //# sourceMappingURL=handler.js.map
39
- //# debugId=98ec46cb-efc5-52e5-8f3c-7c9a206b4cf6
39
+ //# debugId=0cfd36e0-6ea6-5449-b680-9d0a8dfa1a9e
@@ -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]="c0e12a81-6398-5654-b44c-994a9ced2056")}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]="a50adfc6-66cf-556f-851f-f9f7a464bcb9")}catch(e){}}();
3
3
  import { logger } from "../common/logger.js";
4
4
  import { printCriticalFailureToConsoleAndExit, printResultToConsoleAndExitGracefully, } from "../common/output.js";
5
5
  import settings from "../common/settings.js";
@@ -14,21 +14,21 @@ export async function deleteZup(argv) {
14
14
  const parsedUrl = new URL(url);
15
15
  if (parsedUrl.username || parsedUrl.password) {
16
16
  logger.error(`Extra username and/or password was included in the URL.`);
17
- printCriticalFailureToConsoleAndExit(`Error: Extraneous username and/or password in the URL. Only include the hostname.`);
17
+ await printCriticalFailureToConsoleAndExit(`Error: Extraneous username and/or password in the URL. Only include the hostname.`);
18
18
  }
19
19
  if (parsedUrl.pathname !== "/") {
20
20
  logger.error(`Extra pathname was included in the URL: ${parsedUrl.pathname}`);
21
- printCriticalFailureToConsoleAndExit(`Error: Extraneous pathname in URL: ${parsedUrl.pathname}. Only include the hostname.`);
21
+ await printCriticalFailureToConsoleAndExit(`Error: Extraneous pathname in URL: ${parsedUrl.pathname}. Only include the hostname.`);
22
22
  }
23
23
  if (parsedUrl.search !== "") {
24
24
  logger.error(`Extra search params were included in the URL: ${parsedUrl.search}`);
25
- printCriticalFailureToConsoleAndExit(`Error: Extraneous search params in URL: ${parsedUrl.search}. Only include the hostname.`);
25
+ await printCriticalFailureToConsoleAndExit(`Error: Extraneous search params in URL: ${parsedUrl.search}. Only include the hostname.`);
26
26
  }
27
27
  deploymentName = parsedUrl.hostname.split(".")[0];
28
28
  }
29
29
  catch (err) {
30
30
  logger.error(err, "Failed to parse the URL");
31
- printCriticalFailureToConsoleAndExit(`Error: Failed to parse the URL: ${argv.url}. Ensure you have entered a valid URL.`);
31
+ await printCriticalFailureToConsoleAndExit(`Error: Failed to parse the URL: ${argv.url}. Ensure you have entered a valid URL.`);
32
32
  }
33
33
  const { account, project } = argv;
34
34
  const deleteResponse = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${account}/projects/${project}/deployments/${deploymentName}`, {
@@ -42,14 +42,14 @@ export async function deleteZup(argv) {
42
42
  const deleted = await pingDeployment(argv);
43
43
  if (!deleted) {
44
44
  logger.error(`Failed to confirm deletion of zup within alloted time frame.`);
45
- printCriticalFailureToConsoleAndExit(`Error: Failed to confirm deletion of zup within alloted time frame of ${settings.MAX_POLL_RETRIES * settings.POLL_INTERVAL} ms. Your zup is still be available at ${argv.url}.`);
45
+ await printCriticalFailureToConsoleAndExit(`Error: Failed to confirm deletion of zup within alloted time frame of ${settings.MAX_POLL_RETRIES * settings.POLL_INTERVAL} ms. Your zup is still be available at ${argv.url}.`);
46
46
  }
47
47
  else {
48
- printResultToConsoleAndExitGracefully(`Deleted ${argv.url}`);
48
+ await printResultToConsoleAndExitGracefully(`Deleted ${argv.url}`);
49
49
  }
50
50
  }
51
51
  else {
52
- printResultToConsoleAndExitGracefully(`Enqueued deletion of ${argv.url}`);
52
+ await printResultToConsoleAndExitGracefully(`Enqueued deletion of ${argv.url}`);
53
53
  }
54
54
  }
55
55
  else {
@@ -57,8 +57,8 @@ export async function deleteZup(argv) {
57
57
  status: deleteResponse.status,
58
58
  statusText: deleteResponse.statusText,
59
59
  }, "Failed to enqueue the deletion request");
60
- printCriticalFailureToConsoleAndExit("Error: Failed to enqueue the deletion request. Try again later.");
60
+ await printCriticalFailureToConsoleAndExit("Error: Failed to enqueue the deletion request. Try again later.");
61
61
  }
62
62
  }
63
63
  //# sourceMappingURL=handler.js.map
64
- //# debugId=c0e12a81-6398-5654-b44c-994a9ced2056
64
+ //# debugId=a50adfc6-66cf-556f-851f-f9f7a464bcb9
@@ -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]="f72f9cae-79e9-568c-8463-bf22056cdd05")}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]="fc308050-449c-5058-b4ee-4bbfefa6ab93")}catch(e){}}();
3
3
  import ignore from "ignore";
4
4
  import minimatch from "minimatch";
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
@@ -71,11 +71,17 @@ async function prepareDeployerMetadata(argv) {
71
71
  async function generateMetadata(argv) {
72
72
  const dir = argv.dir;
73
73
  const git = simpleGit({ baseDir: dir });
74
- const status = await git.status();
75
- if (!status.current) {
76
- throw new Error("Invalid state: Directory is in detached head state.");
74
+ let branch;
75
+ if (argv.environment) {
76
+ branch = argv.environment;
77
+ }
78
+ else {
79
+ const status = await git.status();
80
+ if (!status.current) {
81
+ throw new Error("Invalid state: Directory is in detached head state.");
82
+ }
83
+ branch = status.current.trim();
77
84
  }
78
- const branch = status.current.trim();
79
85
  const sha = (await git.revparse(["HEAD"])).trim();
80
86
  const repoUrl = (await git.listRemote(["--get-url"])).trim();
81
87
  const verifyRemote = argv["verify-remote"];
@@ -102,4 +108,4 @@ async function writeGeneratedMetadata(dir, metadata) {
102
108
  });
103
109
  }
104
110
  //# sourceMappingURL=archive.js.map
105
- //# debugId=f72f9cae-79e9-568c-8463-bf22056cdd05
111
+ //# debugId=fc308050-449c-5058-b4ee-4bbfefa6ab93
@@ -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]="a8d73cfc-a631-5b55-ba40-3fec95f13f5f")}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]="46771f8e-3893-5428-b081-43f1ce22162f")}catch(e){}}();
3
3
  import { parse } from "node:path";
4
4
  import { logger } from "../common/logger.js";
5
5
  import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../common/output.js";
@@ -25,11 +25,11 @@ export async function deploy(argv) {
25
25
  const fileId = parse(new URL(uploadUrl).pathname).base.replace(ARCHIVE_EXTENSION, "");
26
26
  const { url, steps, buildResult } = await pollDeployment(argv, fileId, account, project);
27
27
  if (url) {
28
- printResultToConsoleAndExitGracefully(`Deployed to ${url}`);
28
+ await printResultToConsoleAndExitGracefully(`Deployed to ${url}`);
29
29
  }
30
30
  else {
31
31
  const diagnostics = buildResult ?? steps;
32
- printCriticalFailureToConsoleAndExit(`Failed to deploy the current branch ${archiveMetadata.metadata.branch} to project ${project} on account ${account}. Here's the diagnostics: ${JSON.stringify(diagnostics, null, 2)}`);
32
+ await printCriticalFailureToConsoleAndExit(`Failed to deploy the current branch ${archiveMetadata.metadata.branch} to project ${project} on account ${account}. Here's the diagnostics: ${JSON.stringify(diagnostics, null, 2)}`);
33
33
  }
34
34
  }
35
35
  else {
@@ -45,8 +45,8 @@ export async function deploy(argv) {
45
45
  status: uploadUrlResponse.status,
46
46
  statusText: uploadUrlResponse.statusText,
47
47
  }, "Failed to retrieve uploadUrl");
48
- printCriticalFailureToConsoleAndExit("Error: Failed to determine where to upload your files. Try again later.");
48
+ await printCriticalFailureToConsoleAndExit("Error: Failed to determine where to upload your files. Try again later.");
49
49
  }
50
50
  }
51
51
  //# sourceMappingURL=handler.js.map
52
- //# debugId=a8d73cfc-a631-5b55-ba40-3fec95f13f5f
52
+ //# debugId=46771f8e-3893-5428-b081-43f1ce22162f
@@ -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]="58dd100d-a3cc-5513-8100-f19039643f55")}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]="f2a83b29-714e-55f4-b001-87f76642259b")}catch(e){}}();
3
3
  import { select } from "@inquirer/prompts";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { join } from "node:path";
@@ -23,7 +23,7 @@ export async function link(argv) {
23
23
  statusText: accountResponse.statusText,
24
24
  response: textOrJson(await accountResponse.text()),
25
25
  }, "Failed to list accounts.");
26
- printCriticalFailureToConsoleAndExit("Error: Failed to list your accounts. Try again later.");
26
+ await printCriticalFailureToConsoleAndExit("Error: Failed to list your accounts. Try again later.");
27
27
  }
28
28
  const accountJson = (await accountResponse.json());
29
29
  let account;
@@ -52,7 +52,7 @@ export async function link(argv) {
52
52
  statusText: projectResponse.statusText,
53
53
  response: textOrJson(await projectResponse.text()),
54
54
  }, "Failed to list projects.");
55
- printCriticalFailureToConsoleAndExit("Error: Failed to list your projects. Try again later.");
55
+ await printCriticalFailureToConsoleAndExit("Error: Failed to list your projects. Try again later.");
56
56
  }
57
57
  const projectJson = (await projectResponse.json());
58
58
  let project;
@@ -75,9 +75,9 @@ export async function link(argv) {
75
75
  account: accountJson.find((acc) => acc.name === account),
76
76
  project: projectJson.data.find((prj) => prj.name === project),
77
77
  });
78
- printResultToConsoleAndExitGracefully(`
78
+ await printResultToConsoleAndExitGracefully(`
79
79
  Successfully linked your local directory to the ${project} project in the ${account} account.
80
80
  .env.zuplo and zuplo.jsonc have been updated with the new values.`);
81
81
  }
82
82
  //# sourceMappingURL=handler.js.map
83
- //# debugId=58dd100d-a3cc-5513-8100-f19039643f55
83
+ //# debugId=f2a83b29-714e-55f4-b001-87f76642259b
@@ -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]="d0ecad85-2c6c-57cf-b9e7-541651faca67")}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]="8cad6ec2-47f2-50b2-be0e-ce65d57fbf27")}catch(e){}}();
3
3
  import { logger } from "../common/logger.js";
4
4
  import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../common/output.js";
5
5
  import settings from "../common/settings.js";
@@ -14,7 +14,7 @@ export async function list(argv) {
14
14
  if (listResponse.ok) {
15
15
  const { data: deployments } = await listResponse.json();
16
16
  const output = deployments.map((deployment) => deployment.url).join("\n");
17
- printResultToConsoleAndExitGracefully(output);
17
+ await printResultToConsoleAndExitGracefully(output);
18
18
  }
19
19
  else {
20
20
  logger.error({
@@ -26,4 +26,4 @@ export async function list(argv) {
26
26
  }
27
27
  }
28
28
  //# sourceMappingURL=handler.js.map
29
- //# debugId=d0ecad85-2c6c-57cf-b9e7-541651faca67
29
+ //# debugId=8cad6ec2-47f2-50b2-be0e-ce65d57fbf27
@@ -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]="9953f515-a669-5828-bb13-a7d715329281")}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]="47613374-a841-57bd-ab35-fca2955e4661")}catch(e){}}();
3
3
  import crypto from "node:crypto";
4
4
  import { existsSync, mkdirSync } from "node:fs";
5
5
  import { writeFile } from "node:fs/promises";
@@ -72,7 +72,7 @@ export async function login(args) {
72
72
  if (args["print-token"]) {
73
73
  printResultToConsole(result.access_token);
74
74
  }
75
- printResultToConsoleAndExitGracefully("Successfully authenticated.");
75
+ await printResultToConsoleAndExitGracefully("Successfully authenticated.");
76
76
  }
77
77
  //# sourceMappingURL=handler.js.map
78
- //# debugId=9953f515-a669-5828-bb13-a7d715329281
78
+ //# debugId=47613374-a841-57bd-ab35-fca2955e4661
@@ -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]="a4c1761e-d022-5f51-95b8-a151c837e0e3")}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]="f50996c1-f4f5-5ef7-8640-a17a2c9555f2")}catch(e){}}();
3
3
  import http from "node:http";
4
4
  import opn from "open";
5
5
  import { printCriticalFailureToConsoleAndExit } from "../common/output.js";
@@ -25,7 +25,7 @@ export async function browserAuth(authorizationUrl) {
25
25
  while (params === undefined) {
26
26
  if (iterations++ > 600) {
27
27
  server.close();
28
- printCriticalFailureToConsoleAndExit("Timed out waiting for login in the browser. Run the zup login command again.");
28
+ await printCriticalFailureToConsoleAndExit("Timed out waiting for login in the browser. Run the zup login command again.");
29
29
  }
30
30
  else {
31
31
  await new Promise((resolve) => setTimeout(resolve, 500));
@@ -35,4 +35,4 @@ export async function browserAuth(authorizationUrl) {
35
35
  return params;
36
36
  }
37
37
  //# sourceMappingURL=server.js.map
38
- //# debugId=a4c1761e-d022-5f51-95b8-a151c837e0e3
38
+ //# debugId=f50996c1-f4f5-5ef7-8640-a17a2c9555f2
@@ -1,10 +1,15 @@
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]="7a8f9c9d-06a4-50e2-963a-5a23166de5eb")}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]="03b26528-a437-52aa-bbe9-e5b6db2de295")}catch(e){}}();
3
3
  import { confirm } from "@inquirer/prompts";
4
- import { existsSync, writeFileSync } from "node:fs";
4
+ import { randomUUID } from "node:crypto";
5
+ import { createWriteStream, existsSync, mkdirSync, writeFileSync, } from "node:fs";
5
6
  import { readFile } from "node:fs/promises";
6
- import { basename, extname, join, relative } from "node:path";
7
+ import { tmpdir } from "node:os";
8
+ import { basename, dirname, extname, join, relative } from "node:path";
9
+ import { Readable } from "node:stream";
10
+ import { finished } from "node:stream/promises";
7
11
  import prettier from "prettier";
12
+ import { logger } from "../../common/logger.js";
8
13
  import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../common/output.js";
9
14
  import { addOperationIdsAsNecessary, generateMergeChangeset, parseOpenApiFile, } from "./utils.js";
10
15
  const BASE_TEMPLATE = `
@@ -19,68 +24,105 @@ const BASE_TEMPLATE = `
19
24
 
20
25
  `;
21
26
  export async function importOpenApi(argv) {
22
- const filePath = argv.source;
23
- const normalizedFilePath = join(relative(process.cwd(), filePath));
24
- if (!existsSync(normalizedFilePath)) {
25
- printCriticalFailureToConsoleAndExit(`The file ${normalizedFilePath} to import does not exist.`);
26
- }
27
- const rawOpenApiSpec = await readFile(normalizedFilePath);
28
- const extName = extname(normalizedFilePath);
29
- const basePath = basename(normalizedFilePath, extName);
30
- const fileContent = rawOpenApiSpec.toString();
31
- const parsedOpenApiSpec = await parseOpenApiFile(extName, fileContent);
32
- const destinationFilePath = join(process.cwd(), "config", `${basePath.replace("oas", "")}.oas.json`);
33
- let originalDocument;
34
- if (!existsSync(destinationFilePath)) {
35
- originalDocument = (await parseOpenApiFile(".json", BASE_TEMPLATE));
27
+ if (!argv.source && !argv["source-url"]) {
28
+ await printCriticalFailureToConsoleAndExit(`Missing required argument: either source or source-url must be provided.`);
36
29
  }
37
30
  else {
38
- const existingOpenApiSpec = await readFile(destinationFilePath);
39
- const existingFileContent = existingOpenApiSpec.toString();
40
- originalDocument = (await parseOpenApiFile(extName, existingFileContent));
41
- }
42
- const { created, merged, retained } = generateMergeChangeset(originalDocument, parsedOpenApiSpec);
43
- printDiagnosticsToConsole("This import will...");
44
- printDiagnosticsToConsole("");
45
- if (created.size > 0) {
46
- printDiagnosticsToConsole(`Create ${created.size} new ${created.size > 1 ? "operations" : "operation"}`);
47
- printDiagnosticsToConsole("");
48
- created.forEach((operation) => {
49
- printDiagnosticsToConsole(operation);
50
- });
51
- printDiagnosticsToConsole("");
52
- }
53
- if (merged.size > 0) {
54
- printDiagnosticsToConsole(`Merge ${merged.size} new ${merged.size > 1 ? "operations" : "operation"}`);
31
+ let normalizedFilePath;
32
+ if (argv.source) {
33
+ const filePath = argv.source;
34
+ normalizedFilePath = join(relative(process.cwd(), filePath));
35
+ if (!existsSync(normalizedFilePath)) {
36
+ await printCriticalFailureToConsoleAndExit(`The file ${normalizedFilePath} to import does not exist.`);
37
+ }
38
+ }
39
+ else {
40
+ const url = argv["source-url"];
41
+ let parsedUrl;
42
+ try {
43
+ parsedUrl = new URL(url);
44
+ const tempDir = tmpdir();
45
+ normalizedFilePath = join(tempDir, randomUUID(), basename(parsedUrl.pathname));
46
+ mkdirSync(dirname(normalizedFilePath), { recursive: true });
47
+ }
48
+ catch (err) {
49
+ logger.error(err);
50
+ await printCriticalFailureToConsoleAndExit(`The url ${url} is not valid and could not be parsed.`);
51
+ throw err;
52
+ }
53
+ try {
54
+ const response = await fetch(url);
55
+ if (!response.ok) {
56
+ throw new Error(`HTTP error! Status: ${response.status}`);
57
+ }
58
+ const fileStream = createWriteStream(normalizedFilePath, {
59
+ flags: "wx",
60
+ });
61
+ await finished(Readable.fromWeb(response.body).pipe(fileStream));
62
+ }
63
+ catch (err) {
64
+ logger.error(err);
65
+ await printCriticalFailureToConsoleAndExit(`Failed to download the remote OpenAPI file.`);
66
+ }
67
+ }
68
+ const rawOpenApiSpec = await readFile(normalizedFilePath);
69
+ const extName = extname(normalizedFilePath);
70
+ const basePath = basename(normalizedFilePath, extName);
71
+ const fileContent = rawOpenApiSpec.toString();
72
+ const parsedOpenApiSpec = await parseOpenApiFile(extName, fileContent);
73
+ const destinationFilePath = join(process.cwd(), "config", `${basePath.replace("oas", "")}.oas.json`);
74
+ let originalDocument;
75
+ if (!existsSync(destinationFilePath)) {
76
+ originalDocument = (await parseOpenApiFile(".json", BASE_TEMPLATE));
77
+ }
78
+ else {
79
+ const existingOpenApiSpec = await readFile(destinationFilePath);
80
+ const existingFileContent = existingOpenApiSpec.toString();
81
+ originalDocument = (await parseOpenApiFile(extName, existingFileContent));
82
+ }
83
+ const { created, merged, retained } = generateMergeChangeset(originalDocument, parsedOpenApiSpec);
84
+ printDiagnosticsToConsole("This import will...");
55
85
  printDiagnosticsToConsole("");
56
- merged.forEach((operation) => {
57
- printDiagnosticsToConsole(operation);
86
+ if (created.size > 0) {
87
+ printDiagnosticsToConsole(`Create ${created.size} new ${created.size > 1 ? "operations" : "operation"}`);
88
+ printDiagnosticsToConsole("");
89
+ created.forEach((operation) => {
90
+ printDiagnosticsToConsole(operation);
91
+ });
92
+ printDiagnosticsToConsole("");
93
+ }
94
+ if (merged.size > 0) {
95
+ printDiagnosticsToConsole(`Merge ${merged.size} new ${merged.size > 1 ? "operations" : "operation"}`);
96
+ printDiagnosticsToConsole("");
97
+ merged.forEach((operation) => {
98
+ printDiagnosticsToConsole(operation);
99
+ });
100
+ printDiagnosticsToConsole("");
101
+ }
102
+ if (retained.size > 0) {
103
+ printDiagnosticsToConsole(`Retain ${retained.size} new ${retained.size > 1 ? "operations" : "operation"}`);
104
+ printDiagnosticsToConsole("");
105
+ retained.forEach((operation) => {
106
+ printDiagnosticsToConsole(operation);
107
+ });
108
+ printDiagnosticsToConsole("");
109
+ }
110
+ if (argv.prompt) {
111
+ printDiagnosticsToConsole("");
112
+ const answer = await confirm({ message: "Proceed?", default: true });
113
+ if (!answer) {
114
+ await printResultToConsoleAndExitGracefully("Import cancelled.");
115
+ }
116
+ }
117
+ addOperationIdsAsNecessary(parsedOpenApiSpec);
118
+ const formattedOpenApi = prettier.format(JSON.stringify(parsedOpenApiSpec), {
119
+ parser: "json-stringify",
58
120
  });
59
- printDiagnosticsToConsole("");
60
- }
61
- if (retained.size > 0) {
62
- printDiagnosticsToConsole(`Retain ${retained.size} new ${retained.size > 1 ? "operations" : "operation"}`);
63
- printDiagnosticsToConsole("");
64
- retained.forEach((operation) => {
65
- printDiagnosticsToConsole(operation);
121
+ writeFileSync(destinationFilePath, formattedOpenApi, {
122
+ flag: "w",
66
123
  });
67
- printDiagnosticsToConsole("");
68
- }
69
- if (argv.prompt) {
70
- printDiagnosticsToConsole("");
71
- const answer = await confirm({ message: "Proceed?", default: true });
72
- if (!answer) {
73
- printResultToConsoleAndExitGracefully("Import cancelled.");
74
- }
124
+ await printResultToConsoleAndExitGracefully(`Import successful. File written to ${destinationFilePath}`);
75
125
  }
76
- addOperationIdsAsNecessary(parsedOpenApiSpec);
77
- const formattedOpenApi = prettier.format(JSON.stringify(parsedOpenApiSpec), {
78
- parser: "json-stringify",
79
- });
80
- writeFileSync(destinationFilePath, formattedOpenApi, {
81
- flag: "w",
82
- });
83
- printResultToConsoleAndExitGracefully(`Import successful. File written to ${destinationFilePath}`);
84
126
  }
85
127
  //# sourceMappingURL=handler.js.map
86
- //# debugId=7a8f9c9d-06a4-50e2-963a-5a23166de5eb
128
+ //# debugId=03b26528-a437-52aa-bbe9-e5b6db2de295
@@ -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]="4ec643f3-3663-54ed-ae6a-1c72fda19548")}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]="1ed6743c-0033-514a-a3f9-7420ec11a90a")}catch(e){}}();
3
3
  import { confirm } from "@inquirer/prompts";
4
4
  import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../common/output.js";
5
5
  import { PackageJsonUpgrader } from "../../common/upgraders/package-json-upgrader.js";
@@ -22,8 +22,8 @@ export async function update(argv) {
22
22
  }
23
23
  else {
24
24
  }
25
- printResultToConsoleAndExitGracefully("Update completed");
25
+ await printResultToConsoleAndExitGracefully("Update completed");
26
26
  }
27
27
  }
28
28
  //# sourceMappingURL=handler.js.map
29
- //# debugId=4ec643f3-3663-54ed-ae6a-1c72fda19548
29
+ //# debugId=1ed6743c-0033-514a-a3f9-7420ec11a90a
@@ -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]="d9fada0f-c7c3-56a6-bce9-cab68dcf53e4")}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]="a1debcef-6c59-5009-8642-ccd01cc75ff9")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
4
  import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
@@ -15,7 +15,7 @@ export async function create(argv) {
15
15
  });
16
16
  if (createResponse.ok) {
17
17
  const tunnel = await createResponse.json();
18
- printTableToConsoleAndExitGracefully(tunnel);
18
+ await printTableToConsoleAndExitGracefully(tunnel);
19
19
  }
20
20
  else {
21
21
  logger.error({
@@ -27,4 +27,4 @@ export async function create(argv) {
27
27
  }
28
28
  }
29
29
  //# sourceMappingURL=handler.js.map
30
- //# debugId=d9fada0f-c7c3-56a6-bce9-cab68dcf53e4
30
+ //# debugId=a1debcef-6c59-5009-8642-ccd01cc75ff9
@@ -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]="aca65d67-321d-5925-a1f9-4d8bb8db8267")}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]="efff74cf-9dfa-573b-99aa-3d0e86247285")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
4
  import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
@@ -21,11 +21,11 @@ export async function deleteTunnel(argv) {
21
21
  teardownOperationId: teardownOperation.id,
22
22
  });
23
23
  if (polledTearDownOperation.status === "success") {
24
- printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} deleted successfully.`);
24
+ await printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} deleted successfully.`);
25
25
  }
26
26
  else {
27
27
  printDiagnosticsToConsole(polledTearDownOperation.details);
28
- printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to delete. Here's the error: ${polledTearDownOperation.message}`);
28
+ await printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to delete. Here's the error: ${polledTearDownOperation.message}`);
29
29
  }
30
30
  }
31
31
  else {
@@ -38,4 +38,4 @@ export async function deleteTunnel(argv) {
38
38
  }
39
39
  }
40
40
  //# sourceMappingURL=handler.js.map
41
- //# debugId=aca65d67-321d-5925-a1f9-4d8bb8db8267
41
+ //# debugId=efff74cf-9dfa-573b-99aa-3d0e86247285
@@ -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]="d8e69d19-9af3-5a6d-aea1-cd87b110be3c")}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]="5ec931dd-6ed8-5cc9-bf88-2cdad7f506af")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
4
  import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
@@ -13,7 +13,7 @@ export async function describe(argv) {
13
13
  });
14
14
  if (describeResponse.ok) {
15
15
  const tunnel = await describeResponse.json();
16
- printTableToConsoleAndExitGracefully(tunnel);
16
+ await printTableToConsoleAndExitGracefully(tunnel);
17
17
  }
18
18
  else {
19
19
  logger.error({
@@ -25,4 +25,4 @@ export async function describe(argv) {
25
25
  }
26
26
  }
27
27
  //# sourceMappingURL=handler.js.map
28
- //# debugId=d8e69d19-9af3-5a6d-aea1-cd87b110be3c
28
+ //# debugId=5ec931dd-6ed8-5cc9-bf88-2cdad7f506af
@@ -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]="990fb347-877a-523a-a03b-d91459bf7dcc")}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]="70127469-fbba-5a95-9262-0499d2ea0b41")}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";
@@ -15,13 +15,13 @@ export async function list(argv) {
15
15
  const tunnels = await listResponse.json();
16
16
  if (tunnels.data.length === 0) {
17
17
  const output = "No tunnels found";
18
- printResultToConsoleAndExitGracefully(output);
18
+ await printResultToConsoleAndExitGracefully(output);
19
19
  }
20
20
  else {
21
21
  const table = tunnels.data.map((tunnel) => {
22
22
  return { "tunnel-id": tunnel.id, name: tunnel.name };
23
23
  });
24
- printTableToConsoleAndExitGracefully(table);
24
+ await printTableToConsoleAndExitGracefully(table);
25
25
  }
26
26
  }
27
27
  else {
@@ -34,4 +34,4 @@ export async function list(argv) {
34
34
  }
35
35
  }
36
36
  //# sourceMappingURL=handler.js.map
37
- //# debugId=990fb347-877a-523a-a03b-d91459bf7dcc
37
+ //# debugId=70127469-fbba-5a95-9262-0499d2ea0b41
@@ -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]="2760f758-b825-53b4-ae0c-479e3191c5b5")}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]="273075ea-56f9-5051-9538-963f47162f95")}catch(e){}}();
3
3
  import { logger } from "../../common/logger.js";
4
4
  import { printDiagnosticsToConsole, printTableToConsoleAndExitGracefully, textOrJson, } from "../../common/output.js";
5
5
  import settings from "../../common/settings.js";
@@ -13,7 +13,7 @@ export async function rotateToken(argv) {
13
13
  });
14
14
  if (rotateResponse.ok) {
15
15
  const tunnel = await rotateResponse.json();
16
- printTableToConsoleAndExitGracefully(tunnel);
16
+ await printTableToConsoleAndExitGracefully(tunnel);
17
17
  }
18
18
  else {
19
19
  logger.error({
@@ -25,4 +25,4 @@ export async function rotateToken(argv) {
25
25
  }
26
26
  }
27
27
  //# sourceMappingURL=handler.js.map
28
- //# debugId=2760f758-b825-53b4-ae0c-479e3191c5b5
28
+ //# debugId=273075ea-56f9-5051-9538-963f47162f95
@@ -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]="ac3d5242-b625-5ed3-99a5-fc49939536d7")}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]="94799b1a-7f6d-5dfd-8ef9-e8fbff787249")}catch(e){}}();
3
3
  import { logger } from "../../../common/logger.js";
4
4
  import { printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../../../common/output.js";
5
5
  import settings from "../../../common/settings.js";
@@ -13,7 +13,7 @@ export async function describe(argv) {
13
13
  });
14
14
  if (describeResponse.ok) {
15
15
  const tunnel = await describeResponse.json();
16
- printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));
16
+ await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));
17
17
  }
18
18
  else {
19
19
  logger.error({
@@ -25,4 +25,4 @@ export async function describe(argv) {
25
25
  }
26
26
  }
27
27
  //# sourceMappingURL=handler.js.map
28
- //# debugId=ac3d5242-b625-5ed3-99a5-fc49939536d7
28
+ //# debugId=94799b1a-7f6d-5dfd-8ef9-e8fbff787249
@@ -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]="07ec52bc-313d-5695-a620-9b116ff2e761")}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]="bb15dcbc-5d6f-57fb-bf35-3dca54d0d707")}catch(e){}}();
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { logger } from "../../../common/logger.js";
5
5
  import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, textOrJson, } from "../../../common/output.js";
@@ -11,7 +11,7 @@ export async function updateServices(argv) {
11
11
  contents = await readFile(argv["configuration-file"], "utf-8");
12
12
  }
13
13
  catch (err) {
14
- printCriticalFailureToConsoleAndExit(`Error reading the configuration file at ${argv["configuration-file"]}: ${err.message}}`);
14
+ await printCriticalFailureToConsoleAndExit(`Error reading the configuration file at ${argv["configuration-file"]}: ${err.message}}`);
15
15
  }
16
16
  const { account } = argv;
17
17
  const deleteResponse = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/services-configuration`, {
@@ -31,11 +31,11 @@ export async function updateServices(argv) {
31
31
  provisioningOperationId: provisioningOperation.id,
32
32
  });
33
33
  if (polledProvisioningOperation.status === "success") {
34
- printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} updated successfully.`);
34
+ await printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} updated successfully.`);
35
35
  }
36
36
  else {
37
37
  printDiagnosticsToConsole(polledProvisioningOperation.details);
38
- printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`);
38
+ await printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`);
39
39
  }
40
40
  }
41
41
  else {
@@ -48,4 +48,4 @@ export async function updateServices(argv) {
48
48
  }
49
49
  }
50
50
  //# sourceMappingURL=handler.js.map
51
- //# debugId=07ec52bc-313d-5695-a620-9b116ff2e761
51
+ //# debugId=bb15dcbc-5d6f-57fb-bf35-3dca54d0d707
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.92.0",
3
+ "version": "1.94.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "description": "The command-line interface for Zuplo",
@@ -61,9 +61,9 @@
61
61
  "@inquirer/prompts": "^3.0.4",
62
62
  "@sentry/node": "7.69.0",
63
63
  "@swc/core": "1.3.78",
64
- "@zuplo/core": "5.1552.0",
64
+ "@zuplo/core": "5.1569.0",
65
65
  "@zuplo/pino-pretty-configurations": "^1.5.0",
66
- "@zuplo/runtime": "5.1552.0",
66
+ "@zuplo/runtime": "5.1569.0 ",
67
67
  "chalk": "^5.1.2",
68
68
  "chokidar": "^3.5.3",
69
69
  "deno-bin": "1.37.1",