@vcityio/cli 0.5.0 → 0.5.2
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 +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ Logged in as ${N(x)}.
|
|
|
31
31
|
`),z(W)}async function w$(k,$={}){let D=V($.json),Y=M($.org),Z=U($.data),K=Z&&typeof Z==="object"?{...Z}:{};if($.title!==void 0)K.title=$.title;if($.description!==void 0)K.description=$.description;if($.type!==void 0)K.type=$.type;if($.disabled!==void 0)K.disabled=$.disabled;if(Object.keys(K).length===0)throw Error("rooms update: nothing to update (pass at least one field or --data)");let Q=await B().rooms.update(Y,k,K);if(D==="json"){j(Q);return}process.stdout.write(`Updated room:
|
|
32
32
|
`),z(Q)}async function U$(k,$={}){let D=V($.json),Y=M($.org);if(!$.yes){if(D==="json")throw Error("rooms delete: --yes is required in JSON / non-interactive mode");if(!await F(`Delete room ${k} in org ${Y}? [y/N]`)){process.stdout.write(`Aborted.
|
|
33
33
|
`);return}}let K=await B().rooms.delete(Y,k);if(D==="json"){j(K);return}process.stdout.write(`Deleted room ${k}.
|
|
34
|
-
`)}import{spawn as O$}from"node:child_process";import Bk from"node:path";var Pk={name:"@vcityio/cli",version:"0.5.
|
|
34
|
+
`)}import{spawn as O$}from"node:child_process";import Bk from"node:path";var Pk={name:"@vcityio/cli",version:"0.5.2",type:"module",description:"vcity command-line interface for org owners",main:"./dist/index.js",bin:{vcity:"./dist/index.js"},files:["dist","README.md","LICENSE"],engines:{node:">=20"},publishConfig:{access:"public"},optionalDependencies:{open:">=7"},keywords:["vcity","cli"],author:"Otherwise SAS",license:"MIT",homepage:"https://vcity.io",bugs:{email:"support@owsas.com"}};var L=Pk.version,d=Pk.name;var L$="https://vcity.io/cli/install.sh",P$=1e4,C0=64;function w0(){return typeof process.versions.bun==="string"?"binary":"npm"}async function U0(){let k=`https://registry.npmjs.org/${d}/latest`,$;try{$=await fetch(k,{headers:{accept:"application/json"},signal:AbortSignal.timeout(P$)})}catch(Y){if(Y instanceof Error&&Y.name==="TimeoutError")throw Error(`npm registry did not respond within ${P$/1000}s. Try again later.`,{cause:Y});throw Error("Could not reach the npm registry. Check your internet connection.",{cause:Y})}if(!$.ok)throw Error(`Failed to fetch latest version from npm (HTTP ${$.status})`);let D=await $.json();if(!D.version||typeof D.version!=="string"||D.version.length>C0)throw Error("Latest version response from npm is missing or invalid `version` field");return D.version}function E$(k){let[$,...D]=k.split("-"),[Y,Z,K]=$.split(".").map((W)=>parseInt(W,10));return{major:Number.isFinite(Y)?Y:0,minor:Number.isFinite(Z)?Z:0,patch:Number.isFinite(K)?K:0,prerelease:D.join("-")}}function Ek(k,$){let D=E$(k),Y=E$($);if(D.major!==Y.major)return D.major-Y.major;if(D.minor!==Y.minor)return D.minor-Y.minor;if(D.patch!==Y.patch)return D.patch-Y.patch;if(D.prerelease===Y.prerelease)return 0;if(D.prerelease==="")return 1;if(Y.prerelease==="")return-1;return D.prerelease<Y.prerelease?-1:1}function L0(k,$){return new Promise((D,Y)=>{let Z=O$(k,$,{stdio:"inherit",shell:!1});Z.on("error",Y),Z.on("exit",(K)=>D({exitCode:K??1}))})}function _$(k,$=["--version"]){return new Promise((D)=>{let Y=O$(k,$,{stdio:"ignore",shell:!1});Y.on("error",()=>D(!1)),Y.on("exit",(Z)=>D(Z===0))})}async function P0(){let k=Bk.dirname(process.execPath),$=process.platform==="win32"?[Bk.join(k,"npm.cmd"),Bk.join(k,"npm")]:[Bk.join(k,"npm")];for(let D of $)if(await _$(D))return D;if(await _$("npm"))return"npm";return}function A$(){process.stdout.write(`Download, inspect, then run (recommended):
|
|
35
35
|
`),process.stdout.write(` curl -fsSL ${L$} -o /tmp/vcity-install.sh
|
|
36
36
|
`),process.stdout.write(` less /tmp/vcity-install.sh
|
|
37
37
|
`),process.stdout.write(` bash /tmp/vcity-install.sh
|