dashnex 0.5.69 → 0.5.71

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
- import o from"./version.js";import{LoginCommand as e}from"./login.js";import{LogoutCommand as i}from"./logout.js";import{WhoamiCommand as n}from"./whoami.js";import{DevCommand as s}from"./dev.js";import{CheckCommand as r}from"./check.js";import{InstallCommand as p}from"./install.js";import t from"./app/index.js";var a=[{name:"version",description:"Display the version of the CLI",handler:new o,options:[]},{name:"login",description:"Log in to your DashNex account",handler:new e,options:[{flags:"--email <email>",description:"Email address (skip prompt)"},{flags:"--password <password>",description:"Password (skip prompt)"},{flags:"--code <code>",description:"2FA code (skip prompt)"},{flags:"--business <id>",description:"Business ID to select (skip prompt)"}]},{name:"logout",description:"Log out and remove local credentials",handler:new i,options:[]},{name:"whoami",description:"Show current logged-in business and user",handler:new n,options:[]},{name:"dev",description:"Run the development server (run in DashNex application folder)",handler:new s,options:[{flags:"--https",description:"Run dev server with HTTPS"}]},{name:"check",description:"Run build-time validations (run in DashNex application folder)",handler:new r,options:[]},{name:"install",description:"Install dependencies using pnpm or npm (run in DashNex application folder)",handler:new p,options:[]},t];export{a as default};
1
+ import e from"./version.js";import{LoginCommand as o}from"./login.js";import{LogoutCommand as i}from"./logout.js";import{WhoamiCommand as n}from"./whoami.js";import{DevCommand as s}from"./dev.js";import{CheckCommand as r}from"./check.js";import{InstallCommand as t}from"./install.js";import p from"./app/index.js";import a from"./secrets/index.js";var d=[{name:"version",description:"Display the version of the CLI",handler:new e,options:[]},{name:"login",description:"Log in to your DashNex account",handler:new o,options:[{flags:"--email <email>",description:"Email address (skip prompt)"},{flags:"--password <password>",description:"Password (skip prompt)"},{flags:"--code <code>",description:"2FA code (skip prompt)"},{flags:"--business <id>",description:"Business ID to select (skip prompt)"}]},{name:"logout",description:"Log out and remove local credentials",handler:new i,options:[]},{name:"whoami",description:"Show current logged-in business and user",handler:new n,options:[]},{name:"dev",description:"Run the development server (run in DashNex application folder)",handler:new s,options:[{flags:"--https",description:"Run dev server with HTTPS"}]},{name:"check",description:"Run build-time validations (run in DashNex application folder)",handler:new r,options:[]},{name:"install",description:"Install dependencies using pnpm or npm (run in DashNex application folder)",handler:new t,options:[]},p,a];export{d as default};
@@ -1 +1 @@
1
- import{debug as e,debugError as o}from"../lib/debug.js";import{createSpinner as r}from"../lib/spinner.js";import s from"chalk";import n from"fs-extra";import t from"path";import{spawn as i}from"child_process";var c=async e=>new Promise(o=>{const r=i(`${e} --version`,{stdio:"ignore",shell:!0});r.on("error",()=>{o(!1)}),r.on("close",e=>{o(0===e)})}),a=async r=>{const s=await(async()=>await c("pnpm")?"pnpm":await c("npm")?"npm":null)();if(!s)throw new Error("Neither pnpm nor npm is available. Please install pnpm (recommended) or npm to continue.");const n=`${s} ${["install","--ignore-scripts"].join(" ")}`;return e(`Using package manager: ${s}`),e(`Executing: ${n} in ${r}`),new Promise((e,s)=>{const t=[],c=[],a=i(n,{stdio:["ignore","pipe","pipe"],cwd:r,shell:!0,env:{...process.env,NPM_CONFIG_LOGLEVEL:"error"}});a.stdout&&a.stdout.on("data",e=>t.push(e)),a.stderr&&a.stderr.on("data",e=>c.push(e)),a.on("error",e=>{o(e),s(e)}),a.on("close",o=>{const r=null===o?0:o;0!==r&&(t.length&&process.stdout.write(Buffer.concat(t)),c.length&&process.stderr.write(Buffer.concat(c))),e(r)})})},l=class{async execute(){e("Install flow started");const c=t.join(process.cwd(),"dashnex.json");await n.pathExists(c)||(console.error(s.red("Run this command in a DashNex Web application folder.")),process.exit(1));const l=process.cwd(),p=r();p.start("Installing dependencies...");try{const r=await a(l);0!==r&&(p.stop(),process.exit(r)),p.text("Building module registry...");const n=await(async r=>new Promise((s,n)=>{e(`Running: npx dashnex build --with-config in ${r}`);const t=i("npx dashnex build --with-config",{stdio:"ignore",cwd:r,shell:!0});t.on("error",e=>{o(e),n(e)}),t.on("close",e=>{s(null===e?1:e)})}))(l);p.stop(),0!==n&&(o(/* @__PURE__ */new Error(`dashnex build --with-config exited with code ${n}`)),console.error(s.red("Install completed but module registry build failed.")),process.exit(1)),process.exit(0)}catch(d){p.stop(),o(d),d instanceof Error?console.error(s.red(d.message)):console.error(s.red("Failed to run install")),process.exit(1)}}};export{l as InstallCommand,a as runInstallInDir};
1
+ import{debug as e,debugError as o}from"../lib/debug.js";import{createSpinner as r}from"../lib/spinner.js";import s from"chalk";import n from"fs-extra";import t from"path";import{spawn as i}from"child_process";var a=async e=>new Promise(o=>{const r=i(`${e} --version`,{stdio:"ignore",shell:!0});r.on("error",()=>{o(!1)}),r.on("close",e=>{o(0===e)})}),c=async r=>{const s=await(async()=>await a("pnpm")?"pnpm":await a("npm")?"npm":null)();if(!s)throw new Error("Neither pnpm nor npm is available. Please install pnpm (recommended) or npm to continue.");const n=`${s} ${["install"].join(" ")}`;return e(`Using package manager: ${s}`),e(`Executing: ${n} in ${r}`),new Promise((e,s)=>{const t=[],a=[],c=i(n,{stdio:["ignore","pipe","pipe"],cwd:r,shell:!0,env:{...process.env,NPM_CONFIG_LOGLEVEL:"error"}});c.stdout&&c.stdout.on("data",e=>t.push(e)),c.stderr&&c.stderr.on("data",e=>a.push(e)),c.on("error",e=>{o(e),s(e)}),c.on("close",o=>{const r=null===o?0:o;0!==r&&(t.length&&process.stdout.write(Buffer.concat(t)),a.length&&process.stderr.write(Buffer.concat(a))),e(r)})})},p=class{async execute(){e("Install flow started");const i=t.join(process.cwd(),"dashnex.json");await n.pathExists(i)||(console.error(s.red("Run this command in a DashNex Web application folder.")),process.exit(1));const a=process.cwd(),p=r();p.start("Installing dependencies...");try{const e=await c(a);p.stop(),0!==e&&process.exit(e),process.exit(0)}catch(l){p.stop(),o(l),l instanceof Error?console.error(s.red(l.message)):console.error(s.red("Failed to run install")),process.exit(1)}}};export{p as InstallCommand,c as runInstallInDir};
@@ -0,0 +1 @@
1
+ import{INTERRUPTED_MESSAGE as e,isUserInterrupt as t}from"../../lib/errors.js";import{debug as r,debugError as o}from"../../lib/debug.js";import{getBusinessApiBase as s}from"../../lib/api.js";import{ensureLoggedIn as a}from"../../services/auth.js";import{createSpinner as i}from"../../lib/spinner.js";import n from"chalk";import c from"inquirer";var l=class{async execute(l={}){r("Secrets delete flow started");let{name:m}=l;m||(m=(await c.prompt([{type:"input",name:"name",message:"Secret name:",validate:e=>""!==e.trim()||"Name is required"}])).name.trim());const d=await a();if(!d)return;const u=`${s()}/business/v1/cli/secrets/${encodeURIComponent(m)}`;r(`DELETE ${u}`);const p=i();p.start(`Deleting secret '${m}'...`);try{const e=await fetch(u,{method:"DELETE",headers:{Authorization:`Bearer ${d.token}`}});if(p.stop(),r(`Response: ${e.status}`),!e.ok){let t="Failed to delete secret.";401===e.status||403===e.status?t="Please run 'dashnex login' to authenticate.":404===e.status?t=`Secret '${m}' not found.`:502===e.status&&(t="Error deleting secret. Make sure your application is deployed."),console.error(n.red(t)),process.exit(1)}r(`Secret '${m}' deleted successfully`),console.log(n.green(`Secret '${m}' deleted.`))}catch(f){if(p.stop(),o(f),f instanceof Error&&f.message.startsWith("EXIT:"))throw f;if(t(f))return void console.log(n.yellow(e));console.error(n.red("Could not reach DashNex API. Check your connection and try again.")),process.exit(1)}}};export{l as DeleteSecretCommand};
@@ -0,0 +1 @@
1
+ import{ListSecretsCommand as e}from"./list.js";import{SetSecretCommand as t}from"./set.js";import{DeleteSecretCommand as s}from"./delete.js";var a={name:"secrets",description:"Manage DashNex secrets",handler:{execute:async()=>{}},options:[],subcommands:[{name:"list",description:"List all secret names bound to the worker",handler:new e,options:[]},{name:"set",description:"Create or update a secret",handler:new t,options:[{flags:"--name <name>",description:"Secret name"},{flags:"--value <value>",description:"Secret value"}]},{name:"delete",description:"Delete a secret",handler:new s,options:[{flags:"--name <name>",description:"Secret name"}]}]};export{a as default};
@@ -0,0 +1 @@
1
+ import{INTERRUPTED_MESSAGE as e,isUserInterrupt as s}from"../../lib/errors.js";import{debug as o,debugError as t}from"../../lib/debug.js";import{getBusinessApiBase as r}from"../../lib/api.js";import{ensureLoggedIn as n}from"../../services/auth.js";import{createSpinner as a}from"../../lib/spinner.js";import i from"chalk";var c=class{async execute(){o("Secrets list flow started");const c=await n();if(!c)return;const l=`${r()}/business/v1/cli/secrets`;o(`GET ${l}`);const h=a();h.start("Fetching secrets...");try{const e=await fetch(l,{headers:{Authorization:`Bearer ${c.token}`}});if(h.stop(),o(`Response: ${e.status}`),!e.ok){let s="Failed to fetch secrets.";401===e.status||403===e.status?s="Please run 'dashnex login' to authenticate.":404===e.status?s="Business has no application.":502===e.status&&(s="Error fetching secrets. Make sure your application is deployed."),console.error(i.red(s)),process.exit(1)}const s=(await e.json()).secrets??[];if(0===s.length)return void console.log(i.yellow("No secrets set."));console.log(i.bold(`\nSecrets (${s.length}):\n`)),s.forEach(({name:e})=>{console.log(` ${i.cyan(e)}`)}),console.log("")}catch(u){if(h.stop(),t(u),u instanceof Error&&u.message.startsWith("EXIT:"))throw u;if(s(u))return void console.log(i.yellow(e));console.error(i.red("Could not reach DashNex API. Check your connection and try again.")),process.exit(1)}}};export{c as ListSecretsCommand};
@@ -0,0 +1 @@
1
+ import{INTERRUPTED_MESSAGE as e,isUserInterrupt as t}from"../../lib/errors.js";import{debug as s,debugError as r}from"../../lib/debug.js";import{getBusinessApiBase as a}from"../../lib/api.js";import{ensureLoggedIn as o}from"../../services/auth.js";import{createSpinner as i}from"../../lib/spinner.js";import n from"chalk";import c from"inquirer";var l=class{async execute(l={}){s("Secrets set flow started");let{name:u,value:m}=l;u||(u=(await c.prompt([{type:"input",name:"name",message:"Secret name:",validate:e=>""!==e.trim()||"Name is required"}])).name.trim()),m||(m=(await c.prompt([{type:"password",name:"value",message:`Enter value for ${u}:`,mask:"*",validate:e=>""!==e||"Value is required"}])).value);const p=await o();if(!p)return;const d=`${a()}/business/v1/cli/secrets`;s(`PUT ${d}`);const f=i();f.start(`Setting secret '${u}'...`);try{const e=await fetch(d,{method:"PUT",headers:{Authorization:`Bearer ${p.token}`,"Content-Type":"application/json"},body:JSON.stringify({name:u,value:m})});if(f.stop(),s(`Response: ${e.status}`),!e.ok){let t="Failed to set secret.";401===e.status||403===e.status?t="Please run 'dashnex login' to authenticate.":400===e.status?t="Missing or empty name / value.":404===e.status?t="Business has no application.":502===e.status&&(t="Error setting secret. Make sure your application is deployed."),console.error(n.red(t)),process.exit(1)}s(`Secret '${u}' set successfully`),console.log(n.green(`Secret '${u}' set successfully.`))}catch(h){if(f.stop(),r(h),h instanceof Error&&h.message.startsWith("EXIT:"))throw h;if(t(h))return void console.log(n.yellow(e));console.error(n.red("Could not reach DashNex API. Check your connection and try again.")),process.exit(1)}}};export{l as SetSecretCommand};
package/dist/package.js CHANGED
@@ -1 +1 @@
1
- var e={$schema:"https://json.schemastore.org/package",name:"@dashnex/cli",version:"0.5.69",description:"Command-line interface for DashNex framework",homepage:"https://dashnex.io",type:"module",bin:{dashnex:"bin/dashnex"},exports:{".":{types:"./dist/server.d.ts",default:"./dist/server.js"},"./client":{types:"./dist/client.d.ts",default:"./dist/client.js"}},scripts:{build:"vite build",dev:"vite build --watch --mode development",test:"vitest run"},keywords:["dashnex","cli"],author:"Dashnex Team",license:"UNLICENSED",dependencies:{"adm-zip":"^0.5.17",chalk:"^5.6.2",commander:"^14.0.3",dotenv:"^17.4.1","fs-extra":"^11.3.4",ignore:"^7.0.5",inquirer:"^13.4.1"},devDependencies:{"@dashnex/types":"^1.0.2","@types/adm-zip":"^0.5.8","@types/fs-extra":"^11.0.4","@types/inquirer":"^9.0.9","@types/node":"^25.6.0",eslint:"^9.39.4","rollup-plugin-preserve-directives":"^0.4.0",terser:"^5.46.1",typescript:"^5.9.3",vite:"^8.0.8","vite-plugin-dts":"5.0.0-beta.6",vitest:"^4.1.4"},publishConfig:{registry:"https://npm.dashnex.com/"},files:["dist","bin"]};export{e as default};
1
+ var e={$schema:"https://json.schemastore.org/package",name:"@dashnex/cli",version:"0.5.71",description:"Command-line interface for DashNex framework",homepage:"https://dashnex.io",type:"module",bin:{dashnex:"bin/dashnex"},exports:{".":{types:"./dist/server.d.ts",default:"./dist/server.js"},"./client":{types:"./dist/client.d.ts",default:"./dist/client.js"}},scripts:{build:"vite build",dev:"vite build --watch --mode development",test:"vitest run"},keywords:["dashnex","cli"],author:"Dashnex Team",license:"UNLICENSED",dependencies:{"adm-zip":"^0.5.17",chalk:"^5.6.2",commander:"^14.0.3",dotenv:"^17.4.2","fs-extra":"^11.3.4",ignore:"^7.0.5",inquirer:"^13.4.1"},devDependencies:{"@dashnex/types":"^1.0.2","@types/adm-zip":"^0.5.8","@types/fs-extra":"^11.0.4","@types/inquirer":"^9.0.9","@types/node":"^25.6.0",eslint:"^9.39.4","rollup-plugin-preserve-directives":"^0.4.0",terser:"^5.46.1",typescript:"^5.9.3",vite:"^8.0.8","vite-plugin-dts":"5.0.0-beta.6",vitest:"^4.1.4"},publishConfig:{registry:"https://npm.dashnex.com/"},files:["dist","bin"]};export{e as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "dashnex",
4
- "version": "0.5.69",
4
+ "version": "0.5.71",
5
5
  "description": "Command-line interface for DashNex framework",
6
6
  "homepage": "https://dashnex.io",
7
7
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "adm-zip": "^0.5.17",
29
29
  "chalk": "^5.6.2",
30
30
  "commander": "^14.0.3",
31
- "dotenv": "^17.4.1",
31
+ "dotenv": "^17.4.2",
32
32
  "fs-extra": "^11.3.4",
33
33
  "ignore": "^7.0.5",
34
34
  "inquirer": "^13.4.1"