@zuplo/cli 1.33.0 → 1.35.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.
@@ -8,6 +8,12 @@ class Settings {
8
8
  get POLL_INTERVAL() {
9
9
  return parseInt(process.env.POLL_INTERVAL ?? "1000");
10
10
  }
11
+ get MAX_PROVISIONING_RETRIES() {
12
+ return parseInt(process.env.MAX_PROVISIONING_RETRIES ?? "60");
13
+ }
14
+ get PROVISIONING_POLL_INTERVAL() {
15
+ return parseInt(process.env.PROVISIONING_INTERVAL ?? "15000");
16
+ }
11
17
  }
12
18
  const settings = new Settings();
13
19
  export default settings;
@@ -1,14 +1,14 @@
1
1
  import { logger } from "../../common/logger.js";
2
2
  import { printDiagnosticsToConsole } from "../../common/output.js";
3
3
  import settings from "../../common/settings.js";
4
- function wait(duration = settings.POLL_INTERVAL) {
4
+ function wait(duration = settings.PROVISIONING_POLL_INTERVAL) {
5
5
  return new Promise((resolve) => setTimeout(resolve, duration));
6
6
  }
7
7
  export async function pollTeardownOperation(args) {
8
8
  const apiKey = args.argv["api-key"];
9
9
  const tunnelId = args.argv["tunnel-id"];
10
- for (let pollRetry = 0; pollRetry < settings.MAX_POLL_RETRIES; pollRetry++) {
11
- printDiagnosticsToConsole(`Polling for teardown operation status... (${pollRetry}/${settings.MAX_POLL_RETRIES})`);
10
+ for (let pollRetry = 0; pollRetry < settings.MAX_PROVISIONING_RETRIES; pollRetry++) {
11
+ printDiagnosticsToConsole(`Polling for teardown operation status... (${pollRetry}/${settings.MAX_PROVISIONING_RETRIES})`);
12
12
  const response = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${args.account}/tunnels/${tunnelId}/teardown-operations/${args.teardownOperationId}`, {
13
13
  method: "GET",
14
14
  headers: {
@@ -29,7 +29,7 @@ export async function updateServices(argv) {
29
29
  });
30
30
  if (deleteResponse.ok) {
31
31
  const provisioningOperation = await deleteResponse.json();
32
- printDiagnosticsToConsole(`Deleting tunnel ${argv["tunnel-id"]} on account ${account}...`);
32
+ printDiagnosticsToConsole(`Updating services on tunnel ${argv["tunnel-id"]} on account ${account}...`);
33
33
  const polledProvisioningOperation = await pollProvisioningOperation({
34
34
  argv,
35
35
  account,
@@ -1,14 +1,14 @@
1
1
  import { logger } from "../../../common/logger.js";
2
2
  import { printDiagnosticsToConsole } from "../../../common/output.js";
3
3
  import settings from "../../../common/settings.js";
4
- function wait(duration = settings.POLL_INTERVAL) {
4
+ function wait(duration = settings.PROVISIONING_POLL_INTERVAL) {
5
5
  return new Promise((resolve) => setTimeout(resolve, duration));
6
6
  }
7
7
  export async function pollProvisioningOperation(args) {
8
8
  const apiKey = args.argv["api-key"];
9
9
  const tunnelId = args.argv["tunnel-id"];
10
- for (let pollRetry = 0; pollRetry < settings.MAX_POLL_RETRIES; pollRetry++) {
11
- printDiagnosticsToConsole(`Polling for provisioning operation status... (${pollRetry}/${settings.MAX_POLL_RETRIES})`);
10
+ for (let pollRetry = 0; pollRetry < settings.MAX_PROVISIONING_RETRIES; pollRetry++) {
11
+ printDiagnosticsToConsole(`Polling for provisioning operation status... (${pollRetry}/${settings.MAX_PROVISIONING_RETRIES})`);
12
12
  const response = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${args.account}/tunnels/${tunnelId}/provisioning-operations/${args.provisioningOperationId}`, {
13
13
  method: "GET",
14
14
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.33.0",
3
+ "version": "1.35.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "author": "Zuplo, Inc.",