dbgov-cli 0.2.13 → 0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbgov-cli",
3
- "version": "0.2.13",
3
+ "version": "0.3.1",
4
4
  "description": "Governed MySQL and PostgreSQL operations CLI for AI agents",
5
5
  "bin": {
6
6
  "dbgov": "bin/dbgov-cli.js",
@@ -33,8 +33,12 @@ function isAllowedRedirectHost(urlStr) {
33
33
  }
34
34
  }
35
35
 
36
+ function envWithDeprecatedAlias(primary, deprecatedName) {
37
+ return process.env[primary] || process.env[deprecatedName] || '';
38
+ }
39
+
36
40
  function applyMirror(canonicalUrl) {
37
- const mirror = process.env.DBGOV_CLI_DOWNLOAD_MIRROR;
41
+ const mirror = envWithDeprecatedAlias('DBGOV_DOWNLOAD_MIRROR', 'DBGOV_CLI_DOWNLOAD_MIRROR');
38
42
  if (!mirror) return canonicalUrl;
39
43
  return mirror.replace(/\/+$/, '') + '/' + canonicalUrl;
40
44
  }
@@ -167,8 +171,8 @@ function parseChecksums(text) {
167
171
  }
168
172
 
169
173
  async function verifyDownloadedBinary(binaryPath, binaryName) {
170
- if (process.env.DBGOV_CLI_SKIP_VERIFY === '1') {
171
- console.log('Verification skipped (DBGOV_CLI_SKIP_VERIFY=1)');
174
+ if (envWithDeprecatedAlias('DBGOV_SKIP_VERIFY', 'DBGOV_CLI_SKIP_VERIFY') === '1') {
175
+ console.log('Verification skipped (DBGOV_SKIP_VERIFY=1)');
172
176
  return;
173
177
  }
174
178
 
@@ -180,14 +184,14 @@ async function verifyDownloadedBinary(binaryPath, binaryName) {
180
184
  } catch (err) {
181
185
  throw new Error(
182
186
  `Could not fetch canonical checksums.txt from ${checksumsUrl}: ${err.message}. ` +
183
- 'Set DBGOV_CLI_SKIP_VERIFY=1 to install without checksum verification.'
187
+ 'Set DBGOV_SKIP_VERIFY=1 to install without checksum verification.'
184
188
  );
185
189
  }
186
190
 
187
191
  if (!checksums[binaryName]) {
188
192
  throw new Error(
189
193
  `No checksum found for ${binaryName}. ` +
190
- 'Set DBGOV_CLI_SKIP_VERIFY=1 to install without checksum verification.'
194
+ 'Set DBGOV_SKIP_VERIFY=1 to install without checksum verification.'
191
195
  );
192
196
  }
193
197