@hypequery/cli 1.3.0 → 1.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"generate-datasets.d.ts","sourceRoot":"","sources":["../../src/commands/generate-datasets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD,wBAAsB,uBAAuB,CAAC,OAAO,GAAE,uBAA4B,iBAwFlF"}
1
+ {"version":3,"file":"generate-datasets.d.ts","sourceRoot":"","sources":["../../src/commands/generate-datasets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD,wBAAsB,uBAAuB,CAAC,OAAO,GAAE,uBAA4B,iBA0FlF"}
@@ -9,6 +9,7 @@ import ora from 'ora';
9
9
  import { logger } from '../utils/logger.js';
10
10
  import { getTableCount } from '../utils/detect-database.js';
11
11
  import { generateDatasets } from '../generators/dataset-generator.js';
12
+ import { redactConnectionUrl } from '../utils/redact-connection-url.js';
12
13
  function parseTableList(value) {
13
14
  const parsed = value
14
15
  ?.split(',')
@@ -79,7 +80,7 @@ export async function generateDatasetsCommand(options = {}) {
79
80
  logger.indent('• Firewall blocking connection');
80
81
  logger.newline();
81
82
  logger.info('Check your configuration:');
82
- logger.indent('CLICKHOUSE_URL=' + (process.env.CLICKHOUSE_URL || process.env.CLICKHOUSE_HOST || 'not set'));
83
+ logger.indent('CLICKHOUSE_URL=' + redactConnectionUrl(process.env.CLICKHOUSE_URL || process.env.CLICKHOUSE_HOST));
83
84
  }
84
85
  else if (error.message.includes('No tables found')) {
85
86
  logger.newline();
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiC,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,eAAe,CAAC,OAAO,GAAE,eAAoB,iBA0HlE"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiC,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAI/F,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,eAAe,CAAC,OAAO,GAAE,eAAoB,iBA4HlE"}
@@ -4,6 +4,7 @@ import { logger } from '../utils/logger.js';
4
4
  import { findSchemaFile } from '../utils/find-files.js';
5
5
  import { detectDatabase, getTableCount } from '../utils/detect-database.js';
6
6
  import { getTypeGenerator } from '../generators/index.js';
7
+ import { redactConnectionUrl } from '../utils/redact-connection-url.js';
7
8
  export async function generateCommand(options = {}) {
8
9
  // Determine output path
9
10
  let outputPath;
@@ -67,7 +68,7 @@ export async function generateCommand(options = {}) {
67
68
  logger.indent('• Firewall blocking connection');
68
69
  logger.newline();
69
70
  logger.info('Check your configuration:');
70
- logger.indent('CLICKHOUSE_URL=' + (process.env.CLICKHOUSE_URL || process.env.CLICKHOUSE_HOST || 'not set'));
71
+ logger.indent('CLICKHOUSE_URL=' + redactConnectionUrl(process.env.CLICKHOUSE_URL || process.env.CLICKHOUSE_HOST));
71
72
  logger.newline();
72
73
  logger.info('Docs: https://hypequery.com/docs/troubleshooting#connection-errors');
73
74
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns enough endpoint information for diagnostics without exposing URL
3
+ * userinfo, query parameters, or fragments that may contain credentials.
4
+ */
5
+ export declare function redactConnectionUrl(value: string | undefined): string;
6
+ //# sourceMappingURL=redact-connection-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact-connection-url.d.ts","sourceRoot":"","sources":["../../src/utils/redact-connection-url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAarE"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Returns enough endpoint information for diagnostics without exposing URL
3
+ * userinfo, query parameters, or fragments that may contain credentials.
4
+ */
5
+ export function redactConnectionUrl(value) {
6
+ if (!value)
7
+ return 'not set';
8
+ const trimmed = value.trim();
9
+ const hasScheme = /^[a-z][a-z\d+.-]*:\/\//i.test(trimmed);
10
+ try {
11
+ const url = new URL(hasScheme ? trimmed : `http://${trimmed}`);
12
+ const pathname = url.pathname === '/' ? '' : url.pathname;
13
+ return `${hasScheme ? `${url.protocol}//` : ''}${url.host}${pathname}`;
14
+ }
15
+ catch {
16
+ return '[configured connection URL]';
17
+ }
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypequery/cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Command-line interface for hypequery",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -35,8 +35,8 @@
35
35
  "@vitest/coverage-v8": "^3.2.6",
36
36
  "typescript": "^5.7.3",
37
37
  "vitest": "^3.2.6",
38
- "@hypequery/clickhouse": "2.1.2",
39
- "@hypequery/serve": "0.6.0"
38
+ "@hypequery/clickhouse": "2.1.3",
39
+ "@hypequery/serve": "0.8.1"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",