@vee_stack/cli 6.3.15 → 6.3.16
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/dist/index.js +2 -2
- package/dist/version.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {createRequire}from'module';import v from'chalk';import*as se from'fs';import {existsSync,readFileSync,statSync,writeFileSync}from'fs';import*as Ye from'path';import {resolve,basename,join,dirname}from'path';import {fileURLToPath}from'url';import {Command}from'commander';import {execSync}from'child_process';import*as de from'crypto';import de__default from'crypto';import ni from'ora';import {glob}from'glob';import si from'cli-progress';import*as ct from'os';import {homedir}from'os';import*as L from'fs/promises';import yr from'prompts';import wi from'readline';import {gzipSync}from'zlib';import Ci from'open';import Aa from'omelette';createRequire(import.meta.url); globalThis.CLI_VERSION = "6.3.
|
|
2
|
+
import {createRequire}from'module';import v from'chalk';import*as se from'fs';import {existsSync,readFileSync,statSync,writeFileSync}from'fs';import*as Ye from'path';import {resolve,basename,join,dirname}from'path';import {fileURLToPath}from'url';import {Command}from'commander';import {execSync}from'child_process';import*as de from'crypto';import de__default from'crypto';import ni from'ora';import {glob}from'glob';import si from'cli-progress';import*as ct from'os';import {homedir}from'os';import*as L from'fs/promises';import yr from'prompts';import wi from'readline';import {gzipSync}from'zlib';import Ci from'open';import Aa from'omelette';createRequire(import.meta.url); globalThis.CLI_VERSION = "6.3.16"; globalThis.SNAPSHOT_VERSION = "6.0.0"; globalThis.ENGINE_TARGET = "6.0.0"; globalThis.AUDIT_VERSION = "6.0"; globalThis.SESSION_PAYLOAD_VERSION = "6.0.0"; globalThis.RULES_VERSION = "6.0.0"; globalThis.ANALYSIS_VERSION = "6.0.0"; globalThis.API_VERSION = "v6"; globalThis.MIN_NODE = 20;
|
|
3
3
|
var zr=Object.defineProperty;var Hr=(t,e)=>{for(var n in e)zr(t,n,{get:e[n],enumerable:true});};var Jr=[/^--token[=\s]/i,/^-t[=\s]/i,/^--api-key[=\s]/i,/^--apikey[=\s]/i,/^--key[=\s]/i,/^--auth[=\s]/i,/^--bearer[=\s]/i,/token[=:]\s*[a-zA-Z0-9_-]{10,}/i,/api[_-]?key[=:]\s*[a-zA-Z0-9_-]{10,}/i],Xe=/vs_[a-zA-Z0-9_-]{20,}/i;function Dn(){let t=process.argv.slice(2);for(let e of t){for(let n of Jr)n.test(e)&&(console.error(v.red(`
|
|
4
4
|
\u274C Security Error: Token detected in command line arguments`)),console.error(v.yellow(`
|
|
5
5
|
Passing tokens via CLI arguments is not allowed.`)),console.error(v.yellow("This prevents tokens from being saved in shell history (~/.bash_history, ~/.zsh_history)")),console.error(v.gray(`
|
|
@@ -101,7 +101,7 @@ Tip: Run "veestack scan" first to generate a snapshot.`)),process.exit(1));let i
|
|
|
101
101
|
\u{1F517} View your full report at:`)),console.log(v.underline(ie));}}catch(a){o.fail("Upload failed"),console.error(a),process.exit(1);}}var Ai=process.env.VEESTACK_API_URL||"https://api.veestack.dev";async function Tr(t){t.format==="sarif"?await bi(t):console.log(v.red('\u274C Unsupported format. Currently only "sarif" is supported.'));}async function bi(t){await Ae()||(console.error(v.red("\u274C Authentication required. Please login first.")),process.exit(1));let n=t.reportId;n||(console.error(v.red("\u274C Report ID is required for SARIF export.")),process.exit(1)),console.log(v.blue(`
|
|
102
102
|
\u{1F4CA} Fetching report ${n} for SARIF export...`));try{let r=await fe("GET",`/api/reports/${n}/sarif`),s=await fetch(`${Ai}/api/reports/${n}/sarif`,{headers:r});if(!s.ok){let c=await s.json().catch(()=>({}));throw new Error(c.message||"Failed to fetch SARIF report")}let o=await s.json(),a=t.output||"veestack-results.sarif";await(await import('fs/promises')).writeFile(a,JSON.stringify(o,null,2)),console.log(v.green(`
|
|
103
103
|
\u2705 SARIF report exported to: ${a}`)),console.log(v.gray("You can now upload this to GitHub Security Tab."));}catch(r){console.error(v.red(`
|
|
104
|
-
\u274C Export failed:`),r instanceof Error?r.message:r),process.exit(1);}}var Ni=globalThis,Oi=Ni.CLI_VERSION||"unknown",xr=process.env.SUPABASE_URL||"";process.env.SUPABASE_ANON_KEY||"";var Pi=xr?`${xr}/functions/v1/cli-auth`:null,Di=process.env.VEESTACK_API_URL||"https://api.veestack.dev",ji=Pi||Di,Li=process.env.VEESTACK_WEB_URL||"
|
|
104
|
+
\u274C Export failed:`),r instanceof Error?r.message:r),process.exit(1);}}var Ni=globalThis,Oi=Ni.CLI_VERSION||"unknown",xr=process.env.SUPABASE_URL||"";process.env.SUPABASE_ANON_KEY||"";var Pi=xr?`${xr}/functions/v1/cli-auth`:null,Di=process.env.VEESTACK_API_URL||"https://api.veestack.dev",ji=Pi||Di,Li=process.env.VEESTACK_WEB_URL||"http://localhost:3000";function $i(){let t=process.platform,e=ct.hostname(),n=Oi,r=e||de__default.randomBytes(8).toString("hex"),s=de__default.createHash("sha256").update(`${r}:${t}:${n}`).digest("hex"),o=de__default.randomBytes(12).toString("hex"),a=`${e||"Unknown"} (${t==="win32"?"Windows":t==="darwin"?"macOS":"Linux"})`;return {id:o,name:a,fingerprint:s,os:t,version:n}}function Vi(){return new Promise(t=>{console.log(v.gray(`
|
|
105
105
|
\u{1F4A1} Tip: Right-click to paste, then press Enter
|
|
106
106
|
`));let e=wi.createInterface({input:process.stdin,output:process.stdout});e.question(v.cyan("Enter the code from your browser: "),n=>{e.close(),t(n.trim().toUpperCase());});})}async function Mi(t,e){try{let n=await fetch(`${ji}/api/cli/verify-code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_code:t,device_info:e})});if(n.status===202)return null;if(!n.ok){let r=await n.json().catch(()=>({}));throw console.log(v.red(`
|
|
107
107
|
\u274C Server error: ${r.error||n.statusText}`)),new Error(r.error||`Failed to verify code: ${n.statusText}`)}return await n.json()}catch(n){throw console.log(v.red(`
|
package/dist/version.json
CHANGED