@altertable/cli 1.5.0 → 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 +66 -38
  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.0";
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();
@@ -12296,7 +12330,6 @@ async function sendHttpStream(request, context) {
12296
12330
  }
12297
12331
 
12298
12332
  // src/lib/lakehouse/query.ts
12299
- var LAKEHOUSE_COMPUTE_SIZES = ["XS", "S", "M", "L", "XL", "AUTO"];
12300
12333
  function buildQueryPayload(input) {
12301
12334
  const payload = { statement: input.statement };
12302
12335
  if (input.queryId)
@@ -16504,10 +16537,9 @@ var queryPagerArgs = defineArguments({
16504
16537
  });
16505
16538
  var queryRequestArgs = defineArguments({
16506
16539
  "compute-size": {
16507
- type: "enum",
16540
+ type: "string",
16508
16541
  description: "Compute size for the query",
16509
- default: "AUTO",
16510
- options: [...LAKEHOUSE_COMPUTE_SIZES]
16542
+ default: "AUTO"
16511
16543
  },
16512
16544
  dialect: {
16513
16545
  type: "string",
@@ -16591,15 +16623,6 @@ function optionalTrimmedString(args, name) {
16591
16623
  const trimmed = value.trim();
16592
16624
  return trimmed === "" ? undefined : trimmed;
16593
16625
  }
16594
- function isLakehouseComputeSize(value) {
16595
- return LAKEHOUSE_COMPUTE_SIZES.includes(value);
16596
- }
16597
- function parseLakehouseComputeSize(value) {
16598
- if (!isLakehouseComputeSize(value)) {
16599
- throw new CliError(`--compute-size must be one of ${LAKEHOUSE_COMPUTE_SIZES.join(", ")}.`);
16600
- }
16601
- return value;
16602
- }
16603
16626
  function resolveQueryComputeSize(options) {
16604
16627
  const computeSize = options.computeSizeArg ?? "AUTO";
16605
16628
  if (options.sessionId && !options.computeSizeExplicit)
@@ -16613,7 +16636,7 @@ function parseQueryOutputOptions(args, options) {
16613
16636
  const sessionId = optionalTrimmedString(args, "session-id");
16614
16637
  const computeSize = resolveQueryComputeSize({
16615
16638
  sessionId,
16616
- computeSizeArg: args["compute-size"] === undefined ? undefined : parseLakehouseComputeSize(asCliArgString(args["compute-size"])),
16639
+ computeSizeArg: args["compute-size"] === undefined ? undefined : asCliArgString(args["compute-size"]),
16617
16640
  computeSizeExplicit: hasArgvFlag(options.rawArgs, "--compute-size")
16618
16641
  });
16619
16642
  return {
@@ -22559,6 +22582,11 @@ var ROOT_ARGS = defineArguments({
22559
22582
  type: "string",
22560
22583
  description: "HTTP read timeout in seconds (default 60; 0 = no limit for streams)",
22561
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"
22562
22590
  }
22563
22591
  });
22564
22592
  function buildMainCommand() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altertable/cli",
3
- "version": "1.5.0",
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": {