@altertable/cli 1.5.1 → 1.6.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 (2) hide show
  1. package/dist/cli.js +63 -24
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7033,7 +7033,7 @@ var require_public_api = __commonJS((exports) => {
7033
7033
  });
7034
7034
 
7035
7035
  // src/version.ts
7036
- var VERSION = "1.5.1";
7036
+ var VERSION = "1.6.0";
7037
7037
  var USER_AGENT = `altertable-cli/${VERSION}`;
7038
7038
 
7039
7039
  // src/lib/transport-defaults.ts
@@ -7358,6 +7358,7 @@ var ENV_SCHEMA = {
7358
7358
  ALTERTABLE_DOCKER_USER: { parse: optional },
7359
7359
  ALTERTABLE_ENV: { parse: optional },
7360
7360
  ALTERTABLE_HTTP_LOG: { parse: optional },
7361
+ ALTERTABLE_IGNORE_SSL_ERRORS: { parse: booleanValue },
7361
7362
  ALTERTABLE_LAKEHOUSE_PASSWORD: { parse: optional, secret: true },
7362
7363
  ALTERTABLE_LAKEHOUSE_USERNAME: { parse: optional },
7363
7364
  ALTERTABLE_MANAGEMENT_API_BASE: { parse: optional },
@@ -8350,6 +8351,9 @@ function mergeGlobalFlagsFromArgs(context, args) {
8350
8351
  if (args["read-timeout"] !== undefined) {
8351
8352
  merged.readTimeoutMs = parseTimeoutSeconds(args["read-timeout"], "--read-timeout");
8352
8353
  }
8354
+ if (args["ignore-ssl-errors"] !== undefined) {
8355
+ merged.ignoreSslErrors = Boolean(args["ignore-ssl-errors"]);
8356
+ }
8353
8357
  return merged;
8354
8358
  }
8355
8359
 
@@ -8634,6 +8638,14 @@ async function delayBeforeHttpRetry(attemptIndex, retryAfterHeader) {
8634
8638
  }
8635
8639
 
8636
8640
  // src/lib/http.ts
8641
+ function createDispatcher(options) {
8642
+ try {
8643
+ const undici = __require("undici");
8644
+ return new undici.Agent(options);
8645
+ } catch {
8646
+ return;
8647
+ }
8648
+ }
8637
8649
  var sharedDispatcher;
8638
8650
  var sharedDispatcherInitialized = false;
8639
8651
  function getSharedDispatcher() {
@@ -8641,17 +8653,51 @@ function getSharedDispatcher() {
8641
8653
  return sharedDispatcher;
8642
8654
  }
8643
8655
  sharedDispatcherInitialized = true;
8644
- try {
8645
- const undici = __require("undici");
8646
- sharedDispatcher = new undici.Agent({
8647
- keepAliveTimeout: 30000,
8648
- keepAliveMaxTimeout: 60000
8649
- });
8650
- } catch {
8651
- sharedDispatcher = undefined;
8652
- }
8656
+ sharedDispatcher = createDispatcher({
8657
+ keepAliveTimeout: 30000,
8658
+ keepAliveMaxTimeout: 60000
8659
+ });
8653
8660
  return sharedDispatcher;
8654
8661
  }
8662
+ var insecureDispatcher;
8663
+ var insecureDispatcherInitialized = false;
8664
+ function getInsecureDispatcher() {
8665
+ if (insecureDispatcherInitialized) {
8666
+ return insecureDispatcher;
8667
+ }
8668
+ insecureDispatcherInitialized = true;
8669
+ insecureDispatcher = createDispatcher({
8670
+ keepAliveTimeout: 30000,
8671
+ keepAliveMaxTimeout: 60000,
8672
+ connect: { rejectUnauthorized: false }
8673
+ });
8674
+ return insecureDispatcher;
8675
+ }
8676
+ function shouldIgnoreSslErrors() {
8677
+ return getCliContext().ignoreSslErrors === true || readEnv("ALTERTABLE_IGNORE_SSL_ERRORS") === true;
8678
+ }
8679
+ var insecureTlsWarned = false;
8680
+ function warnInsecureTlsOnce() {
8681
+ if (insecureTlsWarned) {
8682
+ return;
8683
+ }
8684
+ insecureTlsWarned = true;
8685
+ logWarn("TLS certificate verification is disabled (--ignore-ssl-errors); connections are not protected against interception.");
8686
+ }
8687
+ function buildFetchInit(options, headers, signal) {
8688
+ const ignoreSslErrors = shouldIgnoreSslErrors();
8689
+ if (ignoreSslErrors) {
8690
+ warnInsecureTlsOnce();
8691
+ }
8692
+ return {
8693
+ method: options.method,
8694
+ headers,
8695
+ body: options.body,
8696
+ signal,
8697
+ dispatcher: ignoreSslErrors ? getInsecureDispatcher() : getSharedDispatcher(),
8698
+ ...ignoreSslErrors ? { tls: { rejectUnauthorized: false } } : {}
8699
+ };
8700
+ }
8655
8701
  function resolveConnectTimeoutMs(options) {
8656
8702
  return options.connectTimeoutMs ?? getConnectTimeoutMs();
8657
8703
  }
@@ -8901,13 +8947,7 @@ async function executeLiveRequest(options) {
8901
8947
  ]);
8902
8948
  let response;
8903
8949
  try {
8904
- response = await fetch(options.url, {
8905
- method: options.method,
8906
- headers,
8907
- body: options.body,
8908
- signal,
8909
- dispatcher: getSharedDispatcher()
8910
- });
8950
+ response = await fetch(options.url, buildFetchInit(options, headers, signal));
8911
8951
  } catch (error) {
8912
8952
  throw transportError(options, signal, error);
8913
8953
  }
@@ -8948,13 +8988,7 @@ async function executeLiveStream(options) {
8948
8988
  logDebug(`Request: ${options.method} ${options.url}`);
8949
8989
  let response;
8950
8990
  try {
8951
- response = await fetch(options.url, {
8952
- method: options.method,
8953
- headers,
8954
- body: options.body,
8955
- signal: abortController.signal,
8956
- dispatcher: getSharedDispatcher()
8957
- });
8991
+ response = await fetch(options.url, buildFetchInit(options, headers, abortController.signal));
8958
8992
  clearActiveTimeout();
8959
8993
  } catch (error) {
8960
8994
  clearActiveTimeout();
@@ -22548,6 +22582,11 @@ var ROOT_ARGS = defineArguments({
22548
22582
  type: "string",
22549
22583
  description: "HTTP read timeout in seconds (default 60; 0 = no limit for streams)",
22550
22584
  flagScope: "global"
22585
+ },
22586
+ "ignore-ssl-errors": {
22587
+ type: "boolean",
22588
+ description: "Skip TLS certificate verification for HTTPS requests (for development only, e.g. self-signed local servers)",
22589
+ flagScope: "global"
22551
22590
  }
22552
22591
  });
22553
22592
  function buildMainCommand() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altertable/cli",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
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": {