@altertable/cli 1.15.0 → 1.15.1

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/cli.js +33 -9
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9179,7 +9179,7 @@ function redactResponseBodyForDebug(body) {
9179
9179
  }
9180
9180
 
9181
9181
  // src/version.ts
9182
- var VERSION = "1.15.0";
9182
+ var VERSION = "1.15.1";
9183
9183
  var USER_AGENT = `altertable-cli/${VERSION}`;
9184
9184
 
9185
9185
  // src/lib/http.ts
@@ -23771,7 +23771,8 @@ var UpdaterConfig = {
23771
23771
  sources: UpdaterSourceConfig,
23772
23772
  timeoutsMs: {
23773
23773
  automatic: 900,
23774
- manual: 1e4
23774
+ manual: 1e4,
23775
+ download: 300000
23775
23776
  },
23776
23777
  intervalsMs: UpdaterIntervalsMs,
23777
23778
  automaticCheckSkipCommands: ["completion", "doctor", "update", "upgrade"],
@@ -24050,9 +24051,33 @@ async function fetchText(url, timeoutMs, fetchImpl) {
24050
24051
  const response = await fetchResponse(url, timeoutMs, fetchImpl);
24051
24052
  return await response.text();
24052
24053
  }
24053
- async function fetchBytes(url, timeoutMs, fetchImpl) {
24054
- const response = await fetchResponse(url, timeoutMs, fetchImpl);
24055
- return new Uint8Array(await response.arrayBuffer());
24054
+ function isTimeoutAbort(error) {
24055
+ return error instanceof Error && (error.name === "TimeoutError" || error.name === "AbortError");
24056
+ }
24057
+ function errorMessage(error) {
24058
+ return error instanceof Error ? error.message : String(error);
24059
+ }
24060
+ function downloadError(label, timeoutMs, error) {
24061
+ if (isTimeoutAbort(error)) {
24062
+ return new TimeoutError(`Timed out downloading ${label} after ${timeoutMs / 1000}s.`, { cause: error });
24063
+ }
24064
+ return new NetworkError(`Unable to download ${label}: ${errorMessage(error)}`, { cause: error });
24065
+ }
24066
+ async function fetchBytes(url, label, timeoutMs, fetchImpl) {
24067
+ let response;
24068
+ try {
24069
+ response = await fetchResponse(url, timeoutMs, fetchImpl);
24070
+ } catch (error) {
24071
+ if (error instanceof NetworkError) {
24072
+ throw downloadError(label, timeoutMs, error.cause);
24073
+ }
24074
+ throw error;
24075
+ }
24076
+ try {
24077
+ return new Uint8Array(await response.arrayBuffer());
24078
+ } catch (error) {
24079
+ throw downloadError(label, timeoutMs, error);
24080
+ }
24056
24081
  }
24057
24082
  function readStringProperty(data, key) {
24058
24083
  if (typeof data !== "object" || data === null || !(key in data)) {
@@ -24326,7 +24351,7 @@ function resolveGitHubBinaryTarget(options) {
24326
24351
  async function writeVerifiedGitHubBinaryDownload(options) {
24327
24352
  const tempPath = tempSiblingPath2(options.targetPath, "download");
24328
24353
  try {
24329
- const bytes = await fetchBytes(options.release.assetDownloadUrl, options.timeoutMs, options.fetchImpl);
24354
+ const bytes = await fetchBytes(options.release.assetDownloadUrl, options.release.assetName, options.downloadTimeoutMs, options.fetchImpl);
24330
24355
  writeFileSync3(tempPath, bytes, { mode: 493 });
24331
24356
  const checksumsText = await fetchText(options.release.checksumsDownloadUrl, options.timeoutMs, options.fetchImpl);
24332
24357
  const expectedHash = parseChecksums(checksumsText).get(options.release.assetName);
@@ -24343,9 +24368,7 @@ async function writeVerifiedGitHubBinaryDownload(options) {
24343
24368
  if (error instanceof CliError) {
24344
24369
  throw error;
24345
24370
  }
24346
- throw new CliError("Unable to install GitHub release binary.", {
24347
- cause: error
24348
- });
24371
+ throw new CliError(`Unable to install GitHub release binary: ${errorMessage(error)}`, { cause: error });
24349
24372
  }
24350
24373
  }
24351
24374
  async function installGitHubBinaryRelease(version, options = {}) {
@@ -24362,6 +24385,7 @@ async function installGitHubBinaryRelease(version, options = {}) {
24362
24385
  release,
24363
24386
  targetPath,
24364
24387
  timeoutMs,
24388
+ downloadTimeoutMs: options.downloadTimeoutMs ?? UpdaterConfig.timeoutsMs.download,
24365
24389
  fetchImpl
24366
24390
  });
24367
24391
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altertable/cli",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Altertable CLI — query and manage your data platform",
5
5
  "homepage": "https://github.com/altertable-ai/altertable-cli#readme",
6
6
  "bugs": {