@commercelayer/cli-ux 1.1.0 → 2.0.0-beta.10

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.
Files changed (3) hide show
  1. package/lib/index.js +17 -17
  2. package/lib/index.mjs +17 -17
  3. package/package.json +34 -28
package/lib/index.js CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";var It=Object.create;var P=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var Rt=(s,e,t)=>e in s?P(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var tt=(s,e)=>{for(var t in e)P(s,t,{get:e[t],enumerable:!0})},et=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Et(e))!Ft.call(s,n)&&n!==t&&P(s,n,{get:()=>e[n],enumerable:!(r=At(e,n))||r.enumerable});return s};var g=(s,e,t)=>(t=s!=null?It(Lt(s)):{},et(e||!s||!s.__esModule?P(t,"default",{value:s,enumerable:!0}):t,s)),qt=s=>et(P({},"__esModule",{value:!0}),s);var c=(s,e,t)=>Rt(s,typeof e!="symbol"?e+"":e,t);var Se={};tt(Se,{ActionBase:()=>b,Config:()=>A,ExitError:()=>W,Table:()=>S,action:()=>ee,annotation:()=>re,anykey:()=>se,colorize:()=>Ct,config:()=>y,confirm:()=>ne,debug:()=>ie,done:()=>oe,error:()=>ke,exit:()=>Te,flush:()=>ae,hyperlink:()=>ce,info:()=>ue,log:()=>le,logToStderr:()=>de,progress:()=>pe,prompt:()=>fe,styledHeader:()=>me,styledJSON:()=>ge,styledObject:()=>he,table:()=>ye,trace:()=>ve,tree:()=>be,url:()=>xe,ux:()=>O,wait:()=>we,warn:()=>_e,write:()=>T});module.exports=qt(Se);var $=g(require("chalk")),E=require("util");var dt=g(require("@oclif/core/lib/cache"));var K=require("util");function N(s){return s===void 0?[]:Array.isArray(s)?s:[s]}function H(s,e){return s.reduce((t,r)=>t+e(r),0)}function rt(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}var b=class{constructor(){c(this,"std","stderr");c(this,"stdmocks");c(this,"type");c(this,"stdmockOrigs",{stderr:process.stderr.write,stdout:process.stdout.write})}get output(){return this.globals.output}set output(e){this.globals.output=e}get running(){return!!this.task}get status(){return this.task?this.task.status:void 0}set status(e){let{task:t}=this;t&&t.status!==e&&(this._updateStatus(e,t.status),t.status=e)}get task(){return this.globals.action.task}set task(e){this.globals.action.task=e}async pause(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=e();return r&&n&&this._resume(),o}async pauseAsync(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=await e();return r&&n&&this._resume(),o}start(e,t,r={}){this.std=r.stdout?"stdout":"stderr";let n={action:e,active:!!this.task?.active,status:t};this.task=n,this._start(r),n.active=!0,this._stdout(!0)}stop(e="done"){let{task:t}=this;t&&(this._stop(e),t.active=!1,this.task=void 0,this._stdout(!1))}_flushStdout(){try{let e="",t;for(;this.stdmocks&&this.stdmocks.length>0;){let r=this.stdmocks.shift();t=r[0],this._write(t,r[1]),e+=r[1][0].toString("utf8")}e&&t&&e.at(-1)!==`
1
+ "use strict";var Lt=Object.create;var B=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var jt=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var Wt=(s,e,t)=>e in s?B(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var rt=(s,e)=>{for(var t in e)B(s,t,{get:e[t],enumerable:!0})},st=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rt(e))!Mt.call(s,n)&&n!==t&&B(s,n,{get:()=>e[n],enumerable:!(r=Ft(e,n))||r.enumerable});return s};var g=(s,e,t)=>(t=s!=null?Lt(jt(s)):{},st(e||!s||!s.__esModule?B(t,"default",{value:s,enumerable:!0}):t,s)),$t=s=>st(B({},"__esModule",{value:!0}),s);var c=(s,e,t)=>Wt(s,typeof e!="symbol"?e+"":e,t);var Be={};rt(Be,{ActionBase:()=>b,Config:()=>A,ExitError:()=>H,Table:()=>O,action:()=>ne,annotation:()=>ie,anykey:()=>oe,colorize:()=>Ot,config:()=>y,confirm:()=>ae,debug:()=>ce,done:()=>ue,error:()=>Se,exit:()=>Ce,flush:()=>le,hyperlink:()=>de,info:()=>pe,log:()=>fe,logToStderr:()=>me,progress:()=>ge,prompt:()=>he,styledHeader:()=>ye,styledJSON:()=>ve,styledObject:()=>be,table:()=>xe,trace:()=>we,tree:()=>ke,url:()=>Te,ux:()=>P,wait:()=>_e,warn:()=>Oe,write:()=>_});module.exports=$t(Be);var N=g(require("chalk")),L=require("util");var D=require("util");function K(s){return s===void 0?[]:Array.isArray(s)?s:[s]}function Y(s,e){return s.reduce((t,r)=>t+e(r),0)}function nt(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}var b=class{constructor(){c(this,"std","stderr");c(this,"stdmocks");c(this,"type");c(this,"stdmockOrigs",{stderr:process.stderr.write,stdout:process.stdout.write})}get output(){return this.globals.output}set output(e){this.globals.output=e}get running(){return!!this.task}get status(){return this.task?this.task.status:void 0}set status(e){let{task:t}=this;t&&t.status!==e&&(this._updateStatus(e,t.status),t.status=e)}get task(){return this.globals.action.task}set task(e){this.globals.action.task=e}async pause(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=e();return r&&n&&this._resume(),o}async pauseAsync(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=await e();return r&&n&&this._resume(),o}start(e,t,r={}){this.std=r.stdout?"stdout":"stderr";let n={action:e,active:!!this.task?.active,status:t};this.task=n,this._start(r),n.active=!0,this._stdout(!0)}stop(e="done"){let{task:t}=this;t&&(this._stop(e),t.active=!1,this.task=void 0,this._stdout(!1))}_flushStdout(){try{let e="",t;for(;this.stdmocks&&this.stdmocks.length>0;){let r=this.stdmocks.shift();t=r[0],this._write(t,r[1]),e+=r[1][0].toString("utf8")}e&&t&&e.at(-1)!==`
2
2
  `&&this._write(t,`
3
- `)}catch(e){this._write("stderr",(0,K.inspect)(e))}}_pause(e){throw new Error("not implemented")}_resume(){this.task&&this.start(this.task.action,this.task.status)}_start(e){throw new Error("not implemented")}_stdout(e){try{if(e){if(this.stdmocks)return;this.stdmockOrigs={stderr:process.stderr.write,stdout:process.stdout.write},this.stdmocks=[],process.stdout.write=(...t)=>(this.stdmocks.push(["stdout",t]),!0),process.stderr.write=(...t)=>(this.stdmocks.push(["stderr",t]),!0)}else{if(!this.stdmocks)return;delete this.stdmocks,process.stdout.write=this.stdmockOrigs.stdout,process.stderr.write=this.stdmockOrigs.stderr}}catch(t){this._write("stderr",(0,K.inspect)(t))}}_stop(e){throw new Error("not implemented")}_updateStatus(e,t){}_write(e,t){switch(e){case"stdout":{this.stdmockOrigs.stdout.apply(process.stdout,N(t));break}case"stderr":{this.stdmockOrigs.stderr.apply(process.stderr,N(t));break}default:throw new Error(`invalid std: ${e}`)}}get globals(){global.ux=global.ux||{};let e=global.ux;return e.action=e.action||{},e}};var B=class extends b{constructor(){super(...arguments);c(this,"type","simple")}_flush(){this._write(this.std,`
4
- `),this._flushStdout()}_pause(t){t?this._updateStatus(t):this._flush()}_render(t,r){this.task&&(this.task.active&&this._flush(),this._write(this.std,r?`${t}... ${r}`:`${t}...`))}_resume(){}_start(){this.task&&this._render(this.task.action,this.task.status)}_stop(t){this.task&&this._updateStatus(t,this.task.status,!0)}_updateStatus(t,r,n=!1){this.task&&(this.task.active&&!r?this._write(this.std,` ${t}`):this._write(this.std,`${this.task.action}... ${t}`),(n||!r)&&this._flush())}};var at=g(require("ansi-styles")),ct=g(require("chalk")),ut=g(require("strip-ansi")),F=g(require("supports-color"));function st(s){if(!s.isTTY)return 80;let e=s.getWindowSize()[0];return e<1?80:e<40?40:e}var nt=Number.parseInt(process.env.OCLIF_COLUMNS,10),it=nt||st(process.stdout),ot=nt||st(process.stderr);var Y={arc:{frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"],interval:100},arrow:{frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"],interval:100},arrow2:{frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "],interval:80},arrow3:{frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"],interval:120},balloon:{frames:[" ",".","o","O","@","*"," "],interval:140},balloon2:{frames:[".","o","O","\xB0","O","o","."],interval:120},bounce:{frames:["\u2801","\u2802","\u2804","\u2802"],interval:120},bouncingBall:{frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"],interval:80},bouncingBar:{frames:["[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"],interval:80},boxBounce:{frames:["\u2596","\u2598","\u259D","\u2597"],interval:120},boxBounce2:{frames:["\u258C","\u2580","\u2590","\u2584"],interval:100},circle:{frames:["\u25E1","\u2299","\u25E0"],interval:120},circleHalves:{frames:["\u25D0","\u25D3","\u25D1","\u25D2"],interval:50},circleQuarters:{frames:["\u25F4","\u25F7","\u25F6","\u25F5"],interval:120},clock:{frames:["\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "],interval:100},dots:{frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],interval:80},dots2:{frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"],interval:80},dots3:{frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"],interval:80},dots4:{frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"],interval:80},dots5:{frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"],interval:80},dots6:{frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"],interval:80},dots7:{frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"],interval:80},dots8:{frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"],interval:80},dots9:{frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"],interval:80},dots10:{frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"],interval:80},dots11:{frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"],interval:100},earth:{frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "],interval:180},flip:{frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"],interval:70},growHorizontal:{frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"],interval:120},growVertical:{frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"],interval:120},hamburger:{frames:["\u2631","\u2632","\u2634"],interval:100},hearts:{frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "],interval:100},hexagon:{frames:["\u2B21","\u2B22"],interval:400},line:{frames:["-","\\","|","/"],interval:130},line2:{frames:["\u2802","-","\u2013","\u2014","\u2013","-"],interval:100},monkey:{frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "],interval:300},moon:{frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "],interval:80},noise:{frames:["\u2593","\u2592","\u2591"],interval:100},pipe:{frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"],interval:100},pong:{frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"],interval:80},runner:{frames:["\u{1F6B6} ","\u{1F3C3} "],interval:140},simpleDots:{frames:[". ",".. ","..."," "],interval:400},simpleDotsScrolling:{frames:[". ",".. ","..."," .."," ."," "],interval:200},smiley:{frames:["\u{1F604} ","\u{1F61D} "],interval:200},squareCorners:{frames:["\u25F0","\u25F3","\u25F2","\u25F1"],interval:180},squish:{frames:["\u256B","\u256A"],interval:100},star:{frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"],interval:70},star2:{frames:["+","x","*"],interval:80},toggle:{frames:["\u22B6","\u22B7"],interval:250},toggle2:{frames:["\u25AB","\u25AA"],interval:80},toggle3:{frames:["\u25A1","\u25A0"],interval:120},toggle4:{frames:["\u25A0","\u25A1","\u25AA","\u25AB"],interval:100},toggle5:{frames:["\u25AE","\u25AF"],interval:100},toggle6:{frames:["\u101D","\u1040"],interval:300},toggle7:{frames:["\u29BE","\u29BF"],interval:80},toggle8:{frames:["\u25CD","\u25CC"],interval:100},toggle9:{frames:["\u25C9","\u25CE"],interval:100},toggle10:{frames:["\u3282","\u3280","\u3281"],interval:100},toggle11:{frames:["\u29C7","\u29C6"],interval:50},toggle12:{frames:["\u2617","\u2616"],interval:120},toggle13:{frames:["=","*","-"],interval:80},triangle:{frames:["\u25E2","\u25E3","\u25E4","\u25E5"],interval:50}};var D=require("ansi-escapes");function jt(s){return F?(F.stdout?F.stdout.has256:(process.env.TERM||"").includes("256"))?`\x1B[38;5;104m${s}${at.default.reset.open}`:ct.default.magenta(s):s}var I=class extends b{constructor(){super();c(this,"frameIndex");c(this,"frames");c(this,"spinner");c(this,"type","spinner");this.frames=this.getFrames(),this.frameIndex=0}_frame(){let t=this.frames[this.frameIndex];return this.frameIndex=++this.frameIndex%this.frames.length,jt(t)}_lines(t){return(0,ut.default)(t).split(`
5
- `).map(r=>Math.ceil(r.length/ot)).reduce((r,n)=>r+n,0)}_pause(t){this.spinner&&clearInterval(this.spinner),this._reset(),t&&this._render(` ${t}`),this.output=void 0}_render(t){if(!this.task)return;this._reset(),this._flushStdout();let r=t==="spinner"?` ${this._frame()}`:t||"",n=this.task.status?` ${this.task.status}`:"";this.output=`${this.task.action}...${r}${n}
6
- `,this._write(this.std,this.output)}_reset(){if(!this.output)return;let t=this._lines(this.output);this._write(this.std,D.cursorLeft+D.cursorUp(t)+D.eraseDown),this.output=void 0}_start(t){t.style&&(this.frames=this.getFrames(t)),this._reset(),this.spinner&&clearInterval(this.spinner),this._render(),this.spinner=setInterval(n=>{this._render.bind(this)(n)},process.platform==="win32"?500:100,"spinner"),this.spinner.unref()}_stop(t){this.task&&(this.task.status=t),this.spinner&&clearInterval(this.spinner),this._render(),this.output=void 0}getFrames(t){return t?.style?Y[t.style].frames:Y[process.platform==="win32"?"line":"dots2"].frames}};var lt=global,x=lt.ux||(lt.ux={}),Mt=!!process.stderr.isTTY&&!process.env.CI&&!["dumb","emacs-color"].includes(process.env.TERM)&&"spinner"||"simple",Wt=Mt==="spinner"?I:B,A=class{constructor(){c(this,"action",new Wt);c(this,"errorsHandled",!1);c(this,"outputLevel","info");c(this,"showStackTrace",!0)}get context(){return x.context||{}}set context(e){x.context=e}get debug(){return x.debug||process.env.DEBUG==="*"}set debug(e){x.debug=e}};function $t(){let e=dt.default.getInstance().get("@oclif/core")?.version.split(".")[0]||"unknown";return x[e]||(x[e]=new A),x[e]}var y=$t();var pt=require("@oclif/core/lib/errors");async function Nt(s,e){async function t(r,n=!1){return new Promise(o=>{let i=setTimeout(()=>{o(null)},r);n&&i.unref()})}return Promise.race([s,t(e,!0).then(()=>(0,pt.error)("timed out"))])}async function Ht(){let s=new Promise(t=>{process.stdout.once("drain",()=>{t(null)})});if(!process.stdout.write(""))return s}async function ft(s=1e4){await Nt(Ht(),s)}var C=g(require("chalk"));var J=require("@oclif/core");async function V(s,e=100){if(e<0)throw new Error("no input");return new Promise((t,r)=>{let n;s.timeout&&(n=setTimeout(()=>{process.stdin.pause(),r(new Error("Prompt timeout"))},s.timeout),n.unref()),process.stdin.setEncoding("utf8"),process.stderr.write(s.prompt),process.stdin.resume(),process.stdin.once("data",o=>{n&&clearTimeout(n),process.stdin.pause();let i=(typeof o=="string"?o:o.toString()).trim();!s.default&&s.required&&i===""?t(V(s,e-1)):t(i||s.default)})})}function mt(s,e,t){let r="> ";return t&&e==="hide"&&(t="*".repeat(t.length)),s&&t?r=s+" "+C.default.yellow("["+t+"]")+": ":s&&(r=`${s}: `),r}async function Kt(s){let e=process.stdin.isRaw;process.stdin.setRawMode&&process.stdin.setRawMode(!0),s.required=s.required??!1;let t=await V(s);return process.stdin.setRawMode&&process.stdin.setRawMode(!!e),t}function Yt(s){let e=require("ansi-escapes");process.stderr.write(e.cursorHide+e.cursorUp(1)+e.cursorLeft+s+e.cursorDown(1)+e.cursorLeft+e.cursorShow)}async function gt(s,e={}){let t=mt(s,e.type,e.default),r={default:"",isTTY:!!(process.env.TERM!=="dumb"&&process.stdin.isTTY),name:s,prompt:t,required:!0,type:"normal",...e},n=require("password-prompt");switch(r.type){case"normal":return V(r);case"single":return Kt(r);case"mask":return n(r.prompt,{default:r.default,method:r.type,required:r.required}).then(o=>(Yt(mt(s,"hide",e.default)),o));case"hide":return n(r.prompt,{default:r.default,method:r.type,required:r.required});default:throw new Error(`unexpected type ${r.type}`)}}async function z(s,e={}){return y.action.pauseAsync(async()=>gt(s,e),C.default.cyan("?"))}async function ht(s){return y.action.pauseAsync(async()=>{let e=async()=>{let r=(await gt(s)).toLowerCase();return["n","no"].includes(r)?!1:["y","yes"].includes(r)?!0:e()};return e()},C.default.cyan("?"))}async function yt(s){let e=!!process.stdin.setRawMode;s||(s=e?`Press any key to continue or ${C.default.yellow("q")} to exit`:`Press enter to continue or ${C.default.yellow("q")} to exit`);let t=await z(s,{required:!1,type:"single"});return e&&process.stderr.write(`
7
- `),t==="q"&&J.Errors.error("quit"),t===""&&J.Errors.error("ctrl-c"),t}var vt=g(require("chalk")),U=require("util");function R(s,e){let t=[],r=Object.keys(s).map(a=>a.toString().length),n=Math.max(...r)+2;function o(a){return typeof a=="string"||typeof a=="number"?a:typeof a=="object"?Object.keys(a).map(u=>u+": "+(0,U.inspect)(a[u])).join(", "):(0,U.inspect)(a)}let i=(a,u)=>`${vt.default.blue(a)}:`+" ".repeat(n-a.length-1)+o(u);for(let a of e||Object.keys(s).sort()){let u=s[a];if(Array.isArray(u)){if(u.length>0){t.push(i(a,u[0]));for(let d of u.slice(1))t.push(" ".repeat(n)+o(d))}}else u!=null&&t.push(i(a,u))}return t.join(`
8
- `)}var bt=require("cli-progress");function q(s={}){return new bt.SingleBar({noTTYOutput:process.env.TERM==="dumb"||!process.stdin.isTTY,...s})}var S={};tt(S,{table:()=>j});var Z=g(require("chalk")),xt=require("js-yaml"),wt=require("natural-orderby"),kt=require("util"),Tt=g(require("slice-ansi")),w=g(require("string-width"));var Jt=s=>{process.stdout.write(s)},Vt=s=>{process.stderr.write(s)},T={stderr:Vt,stdout:Jt};var v=require("@oclif/core");var G=class{constructor(e,t,r={}){this.data=e;c(this,"columns");c(this,"options");this.columns=Object.keys(t).map(p=>{let m=t[p],_=m.extended??!1,L=m.get??(Bt=>Bt[p]??""),h=typeof m.header=="string"?m.header:rt(p.replaceAll("_"," ")),Pt=Math.max(m.minWidth??0,(0,w.default)(h)+1);return{extended:_,get:L,header:h,key:p,minWidth:Pt}});let{columns:n,csv:o,extended:i,filter:a,output:u,printLine:d,sort:k,title:l}=r;this.options={columns:n,extended:i,filter:a,"no-header":r["no-header"]??!1,"no-truncate":r["no-truncate"]??!1,output:o?"csv":u,printLine:d??(p=>{T.stdout(p+`
9
- `)}),rowStart:" ",sort:k,title:l}}display(){let e=this.data.map(t=>{let r={};for(let n of this.columns){let o=n.get(t);typeof o!="string"&&(o=(0,kt.inspect)(o,{breakLength:Number.POSITIVE_INFINITY})),r[n.key]=o}return r});if(this.options.filter){let[t,r]=this.options.filter.split("="),n=t[0]==="-";n&&(t=t.slice(1));let o=this.findColumnFromHeader(t);if(!o||!r)throw new Error("Filter flag has an invalid value");e=e.filter(i=>{let a=new RegExp(r),d=i[o.key].match(a);return n?!d:d})}if(this.options.sort){let t=this.options.sort.split(","),r=t.map(i=>i[0]==="-"?i.slice(1):i),n=this.filterColumnsFromHeaders(r).map(i=>a=>a[i.key]),o=t.map(i=>i[0]==="-"?"desc":"asc");e=(0,wt.orderBy)(e,n,o)}if(this.options.columns){let t=this.options.columns.split(",");this.columns=this.filterColumnsFromHeaders(t)}else this.options.extended||(this.columns=this.columns.filter(t=>!t.extended));switch(this.data=e,this.options.output){case"csv":{this.outputCSV();break}case"json":{this.outputJSON();break}case"yaml":{this.outputYAML();break}default:this.outputTable()}}filterColumnsFromHeaders(e){e=[...new Set(e)];let t=[];for(let r of e){let n=this.columns.find(o=>o.header.toLowerCase()===r.toLowerCase());n&&t.push(n)}return t}findColumnFromHeader(e){return this.columns.find(t=>t.header.toLowerCase()===e.toLowerCase())}getCSVRow(e){let t=this.columns.map(n=>e[n.key]||""),r=t.find(n=>n.includes('"')||n.includes(`
3
+ `)}catch(e){this._write("stderr",(0,D.inspect)(e))}}_pause(e){throw new Error("not implemented")}_resume(){this.task&&this.start(this.task.action,this.task.status)}_start(e){throw new Error("not implemented")}_stdout(e){try{if(e){if(this.stdmocks)return;this.stdmockOrigs={stderr:process.stderr.write,stdout:process.stdout.write},this.stdmocks=[],process.stdout.write=(...t)=>(this.stdmocks.push(["stdout",t]),!0),process.stderr.write=(...t)=>(this.stdmocks.push(["stderr",t]),!0)}else{if(!this.stdmocks)return;delete this.stdmocks,process.stdout.write=this.stdmockOrigs.stdout,process.stderr.write=this.stdmockOrigs.stderr}}catch(t){this._write("stderr",(0,D.inspect)(t))}}_stop(e){throw new Error("not implemented")}_updateStatus(e,t){}_write(e,t){switch(e){case"stdout":{this.stdmockOrigs.stdout.apply(process.stdout,K(t));break}case"stderr":{this.stdmockOrigs.stderr.apply(process.stderr,K(t));break}default:throw new Error(`invalid std: ${e}`)}}get globals(){global.ux=global.ux||{};let e=global.ux;return e.action=e.action||{},e}};var I=class extends b{constructor(){super(...arguments);c(this,"type","simple")}_flush(){this._write(this.std,`
4
+ `),this._flushStdout()}_pause(t){t?this._updateStatus(t):this._flush()}_render(t,r){this.task&&(this.task.active&&this._flush(),this._write(this.std,r?`${t}... ${r}`:`${t}...`))}_resume(){}_start(){this.task&&this._render(this.task.action,this.task.status)}_stop(t){this.task&&this._updateStatus(t,this.task.status,!0)}_updateStatus(t,r,n=!1){this.task&&(this.task.active&&!r?this._write(this.std,` ${t}`):this._write(this.std,`${this.task.action}... ${t}`),(n||!r)&&this._flush())}};var ut=g(require("ansi-styles")),lt=g(require("chalk")),dt=g(require("strip-ansi")),R=g(require("supports-color"));function it(s){if(!s.isTTY)return 80;let e=s.getWindowSize()[0];return e<1?80:e<40?40:e}var ot=Number.parseInt(process.env.OCLIF_COLUMNS,10),at=ot||it(process.stdout),ct=ot||it(process.stderr);var J={arc:{frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"],interval:100},arrow:{frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"],interval:100},arrow2:{frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "],interval:80},arrow3:{frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"],interval:120},balloon:{frames:[" ",".","o","O","@","*"," "],interval:140},balloon2:{frames:[".","o","O","\xB0","O","o","."],interval:120},bounce:{frames:["\u2801","\u2802","\u2804","\u2802"],interval:120},bouncingBall:{frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"],interval:80},bouncingBar:{frames:["[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"],interval:80},boxBounce:{frames:["\u2596","\u2598","\u259D","\u2597"],interval:120},boxBounce2:{frames:["\u258C","\u2580","\u2590","\u2584"],interval:100},circle:{frames:["\u25E1","\u2299","\u25E0"],interval:120},circleHalves:{frames:["\u25D0","\u25D3","\u25D1","\u25D2"],interval:50},circleQuarters:{frames:["\u25F4","\u25F7","\u25F6","\u25F5"],interval:120},clock:{frames:["\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "],interval:100},dots:{frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],interval:80},dots2:{frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"],interval:80},dots3:{frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"],interval:80},dots4:{frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"],interval:80},dots5:{frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"],interval:80},dots6:{frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"],interval:80},dots7:{frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"],interval:80},dots8:{frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"],interval:80},dots9:{frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"],interval:80},dots10:{frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"],interval:80},dots11:{frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"],interval:100},earth:{frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "],interval:180},flip:{frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"],interval:70},growHorizontal:{frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"],interval:120},growVertical:{frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"],interval:120},hamburger:{frames:["\u2631","\u2632","\u2634"],interval:100},hearts:{frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "],interval:100},hexagon:{frames:["\u2B21","\u2B22"],interval:400},line:{frames:["-","\\","|","/"],interval:130},line2:{frames:["\u2802","-","\u2013","\u2014","\u2013","-"],interval:100},monkey:{frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "],interval:300},moon:{frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "],interval:80},noise:{frames:["\u2593","\u2592","\u2591"],interval:100},pipe:{frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"],interval:100},pong:{frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"],interval:80},runner:{frames:["\u{1F6B6} ","\u{1F3C3} "],interval:140},simpleDots:{frames:[". ",".. ","..."," "],interval:400},simpleDotsScrolling:{frames:[". ",".. ","..."," .."," ."," "],interval:200},smiley:{frames:["\u{1F604} ","\u{1F61D} "],interval:200},squareCorners:{frames:["\u25F0","\u25F3","\u25F2","\u25F1"],interval:180},squish:{frames:["\u256B","\u256A"],interval:100},star:{frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"],interval:70},star2:{frames:["+","x","*"],interval:80},toggle:{frames:["\u22B6","\u22B7"],interval:250},toggle2:{frames:["\u25AB","\u25AA"],interval:80},toggle3:{frames:["\u25A1","\u25A0"],interval:120},toggle4:{frames:["\u25A0","\u25A1","\u25AA","\u25AB"],interval:100},toggle5:{frames:["\u25AE","\u25AF"],interval:100},toggle6:{frames:["\u101D","\u1040"],interval:300},toggle7:{frames:["\u29BE","\u29BF"],interval:80},toggle8:{frames:["\u25CD","\u25CC"],interval:100},toggle9:{frames:["\u25C9","\u25CE"],interval:100},toggle10:{frames:["\u3282","\u3280","\u3281"],interval:100},toggle11:{frames:["\u29C7","\u29C6"],interval:50},toggle12:{frames:["\u2617","\u2616"],interval:120},toggle13:{frames:["=","*","-"],interval:80},triangle:{frames:["\u25E2","\u25E3","\u25E4","\u25E5"],interval:50}};var j=g(require("ansi-escapes"));function qt(s){return R.default?(R.default.stdout?R.default.stdout.has256:(process.env.TERM||"").includes("256"))?`\x1B[38;5;104m${s}${ut.default.reset.open}`:lt.default.magenta(s):s}var E=class extends b{constructor(){super();c(this,"frameIndex");c(this,"frames");c(this,"spinner");c(this,"type","spinner");this.frames=this.getFrames(),this.frameIndex=0}_frame(){let t=this.frames[this.frameIndex];return this.frameIndex=++this.frameIndex%this.frames.length,qt(t)}_lines(t){return(0,dt.default)(t).split(`
5
+ `).map(r=>Math.ceil(r.length/ct)).reduce((r,n)=>r+n,0)}_pause(t){this.spinner&&clearInterval(this.spinner),this._reset(),t&&this._render(` ${t}`),this.output=void 0}_render(t){if(!this.task)return;this._reset(),this._flushStdout();let r=t==="spinner"?` ${this._frame()}`:t||"",n=this.task.status?` ${this.task.status}`:"";this.output=`${this.task.action}...${r}${n}
6
+ `,this._write(this.std,this.output)}_reset(){if(!this.output)return;let t=this._lines(this.output);this._write(this.std,j.default.cursorLeft+j.default.cursorUp(t)+j.default.eraseDown),this.output=void 0}_start(t){t.style&&(this.frames=this.getFrames(t)),this._reset(),this.spinner&&clearInterval(this.spinner),this._render(),this.spinner=setInterval(n=>{this._render.bind(this)(n)},process.platform==="win32"?500:100,"spinner"),this.spinner.unref()}_stop(t){this.task&&(this.task.status=t),this.spinner&&clearInterval(this.spinner),this._render(),this.output=void 0}getFrames(t){return t?.style?J[t.style].frames:J[process.platform==="win32"?"line":"dots2"].frames}};var pt=global,k=pt.ux||(pt.ux={}),Ht=!!process.stderr.isTTY&&!process.env.CI&&!["dumb","emacs-color"].includes(process.env.TERM)&&"spinner"||"simple",Nt=Ht==="spinner"?E:I,A=class{constructor(){c(this,"action",new Nt);c(this,"errorsHandled",!1);c(this,"outputLevel","info");c(this,"showStackTrace",!0)}get context(){return k.context||{}}set context(e){k.context=e}get debug(){return k.debug||process.env.DEBUG==="*"}set debug(e){k.debug=e}};function Kt(){return k.config||(k.config=new A),k.config}var y=Kt();var ft=require("@oclif/core");async function Yt(s,e){async function t(r,n=!1){return new Promise(o=>{let i=setTimeout(()=>{o(null)},r);n&&i.unref()})}return Promise.race([s,t(e,!0).then(()=>ft.Errors.error("timed out"))])}async function Dt(){let s=new Promise(t=>{process.stdout.once("drain",()=>{t(null)})});if(!process.stdout.write(""))return s}async function mt(s=1e4){await Yt(Dt(),s)}var C=g(require("chalk"));var V=require("@oclif/core"),T=g(require("ansi-escapes"));async function z(s,e=100){if(e<0)throw new Error("no input");return new Promise((t,r)=>{let n;s.timeout&&(n=setTimeout(()=>{process.stdin.pause(),r(new Error("Prompt timeout"))},s.timeout),n.unref()),process.stdin.setEncoding("utf8"),process.stderr.write(s.prompt),process.stdin.resume(),process.stdin.once("data",o=>{n&&clearTimeout(n),process.stdin.pause();let i=(typeof o=="string"?o:o.toString()).trim();!s.default&&s.required&&i===""?t(z(s,e-1)):t(i||s.default)})})}function gt(s,e,t){let r="> ";return t&&e==="hide"&&(t="*".repeat(t.length)),s&&t?r=s+" "+C.default.yellow("["+t+"]")+": ":s&&(r=`${s}: `),r}async function Jt(s){let e=process.stdin.isRaw;process.stdin.setRawMode&&process.stdin.setRawMode(!0),s.required=s.required??!1;let t=await z(s);return process.stdin.setRawMode&&process.stdin.setRawMode(!!e),t}function Vt(s){process.stderr.write(T.default.cursorHide+T.default.cursorUp(1)+T.default.cursorLeft+s+T.default.cursorDown(1)+T.default.cursorLeft+T.default.cursorShow)}async function ht(s,e={}){let t=gt(s,e.type,e.default),r={default:"",isTTY:!!(process.env.TERM!=="dumb"&&process.stdin.isTTY),name:s,prompt:t,required:!0,type:"normal",...e},n=require("password-prompt");switch(r.type){case"normal":return z(r);case"single":return Jt(r);case"mask":return n(r.prompt,{default:r.default,method:r.type,required:r.required}).then(o=>(Vt(gt(s,"hide",e.default)),o));case"hide":return n(r.prompt,{default:r.default,method:r.type,required:r.required});default:throw new Error(`unexpected type ${r.type}`)}}async function U(s,e={}){return y.action.pauseAsync(async()=>ht(s,e),C.default.cyan("?"))}async function yt(s){return y.action.pauseAsync(async()=>{let e=async()=>{let r=(await ht(s)).toLowerCase();return["n","no"].includes(r)?!1:["y","yes"].includes(r)?!0:e()};return e()},C.default.cyan("?"))}async function vt(s){let e=!!process.stdin.setRawMode;s||(s=e?`Press any key to continue or ${C.default.yellow("q")} to exit`:`Press enter to continue or ${C.default.yellow("q")} to exit`);let t=await U(s,{required:!1,type:"single"});return e&&process.stderr.write(`
7
+ `),t==="q"&&V.Errors.error("quit"),t===""&&V.Errors.error("ctrl-c"),t}var bt=g(require("chalk")),Z=require("util");function M(s,e){let t=[],r=Object.keys(s).map(a=>a.toString().length),n=Math.max(...r)+2;function o(a){return typeof a=="string"||typeof a=="number"?a:typeof a=="object"?Object.keys(a).map(u=>u+": "+(0,Z.inspect)(a[u])).join(", "):(0,Z.inspect)(a)}let i=(a,u)=>`${bt.default.blue(a)}:`+" ".repeat(n-a.length-1)+o(u);for(let a of e||Object.keys(s).sort()){let u=s[a];if(Array.isArray(u)){if(u.length>0){t.push(i(a,u[0]));for(let d of u.slice(1))t.push(" ".repeat(n)+o(d))}}else u!=null&&t.push(i(a,u))}return t.join(`
8
+ `)}var xt=require("cli-progress");function W(s={}){return new xt.SingleBar({noTTYOutput:process.env.TERM==="dumb"||!process.stdin.isTTY,...s})}var O={};rt(O,{table:()=>$});var G=g(require("chalk")),wt=require("js-yaml"),kt=require("natural-orderby"),Tt=require("util"),_t=g(require("slice-ansi")),x=g(require("string-width"));var Ut=s=>{process.stdout.write(s)},Zt=s=>{process.stderr.write(s)},_={stderr:Zt,stdout:Ut};var v=require("@oclif/core");var X=class{constructor(e,t,r={}){this.data=e;c(this,"columns");c(this,"options");this.columns=Object.keys(t).map(p=>{let m=t[p],S=m.extended??!1,F=m.get??(At=>At[p]??""),h=typeof m.header=="string"?m.header:nt(p.replaceAll("_"," ")),Et=Math.max(m.minWidth??0,(0,x.default)(h)+1);return{extended:S,get:F,header:h,key:p,minWidth:Et}});let{columns:n,csv:o,extended:i,filter:a,output:u,printLine:d,sort:w,title:l}=r;this.options={columns:n,extended:i,filter:a,"no-header":r["no-header"]??!1,"no-truncate":r["no-truncate"]??!1,output:o?"csv":u,printLine:d??(p=>{_.stdout(p+`
9
+ `)}),rowStart:" ",sort:w,title:l}}display(){let e=this.data.map(t=>{let r={};for(let n of this.columns){let o=n.get(t);typeof o!="string"&&(o=(0,Tt.inspect)(o,{breakLength:Number.POSITIVE_INFINITY})),r[n.key]=o}return r});if(this.options.filter){let[t,r]=this.options.filter.split("="),n=t[0]==="-";n&&(t=t.slice(1));let o=this.findColumnFromHeader(t);if(!o||!r)throw new Error("Filter flag has an invalid value");e=e.filter(i=>{let a=new RegExp(r),d=i[o.key].match(a);return n?!d:d})}if(this.options.sort){let t=this.options.sort.split(","),r=t.map(i=>i[0]==="-"?i.slice(1):i),n=this.filterColumnsFromHeaders(r).map(i=>a=>a[i.key]),o=t.map(i=>i[0]==="-"?"desc":"asc");e=(0,kt.orderBy)(e,n,o)}if(this.options.columns){let t=this.options.columns.split(",");this.columns=this.filterColumnsFromHeaders(t)}else this.options.extended||(this.columns=this.columns.filter(t=>!t.extended));switch(this.data=e,this.options.output){case"csv":{this.outputCSV();break}case"json":{this.outputJSON();break}case"yaml":{this.outputYAML();break}default:this.outputTable()}}filterColumnsFromHeaders(e){e=[...new Set(e)];let t=[];for(let r of e){let n=this.columns.find(o=>o.header.toLowerCase()===r.toLowerCase());n&&t.push(n)}return t}findColumnFromHeader(e){return this.columns.find(t=>t.header.toLowerCase()===e.toLowerCase())}getCSVRow(e){let t=this.columns.map(n=>e[n.key]||""),r=t.find(n=>n.includes('"')||n.includes(`
10
10
  `)||n.includes(`\r
11
- `)||n.includes("\r")||n.includes(","));return t.map(n=>r?`"${n.replaceAll('"','""')}"`:n)}outputCSV(){let{columns:e,data:t,options:r}=this;r["no-header"]||r.printLine(e.map(n=>n.header).join(","));for(let n of t){let o=this.getCSVRow(n);r.printLine(o.join(","))}}outputJSON(){this.options.printLine(JSON.stringify(this.resolveColumnsToObjectArray(),void 0,2))}outputTable(){let{data:e,options:t}=this,r=this.columns.map(i=>{let a=Math.max((0,w.default)(".".padEnd(i.minWidth-1)),(0,w.default)(i.header),zt(e,i.key))+1;return{...i,maxWidth:a,width:a}}),n=it-2;if((()=>{if(t["no-truncate"]||!process.stdout.isTTY&&!process.env.CLI_UX_SKIP_TTY_CHECK||H(r,l=>l.width)-n<=0)return;for(let l of r)l.width=l.minWidth;let u=H(r,l=>l.minWidth);if(u>=n)return;let d=n-u,k=r.map(l=>({key:l.key,needs:l.maxWidth-l.width})).sort((l,p)=>l.needs-p.needs);for(let{key:l,needs:p}of k){if(!p)continue;let m=r.find(_=>l===_.key);m&&(d>p?(m.width=m.width+p,d-=p):d&&(m.width=m.width+d,d=0))}})(),t.title&&(t.printLine(t.title),t.printLine("".padEnd(r.reduce((i,a)=>i+a.width,1),"=")),t.rowStart="| "),!t["no-header"]){let i=t.rowStart;for(let u of r){let d=u.header;i+=d.padEnd(u.width)}t.printLine(Z.default.bold(i));let a=t.rowStart;for(let u of r){let d="".padEnd(u.width-1,"\u2500")+" ";a+=d.padEnd(u.width)}t.printLine(Z.default.bold(a))}for(let i of e){let a=1;for(let d of r){let l=i[d.key].split(`
12
- `).length;l>a&&(a=l)}let u=[...new Array(a).keys()];for(let d of u){let k=t.rowStart;for(let l of r){let p=l.width,m=i[l.key];m=m.split(`
13
- `)[d]||"";let _=(0,w.default)(m),L=m.length-_,h=m.padEnd(p+L);(h.length-L>p||_===p)&&(h=(0,Tt.default)(h,0,p-2)+"\u2026 ",h+=" ".repeat(p-(0,w.default)(h))),k+=h}t.printLine(k)}}}outputYAML(){this.options.printLine((0,xt.safeDump)(this.resolveColumnsToObjectArray()))}resolveColumnsToObjectArray(){let{columns:e,data:t}=this;return t.map(r=>Object.fromEntries(e.map(n=>[n.key,r[n.key]??""])))}};function j(s,e,t={}){new G(s,e,t).display()}(t=>{t.Flags={columns:v.Flags.string({description:"only show provided columns (comma-separated)",exclusive:["extended"]}),csv:v.Flags.boolean({description:"output is csv format [alias: --output=csv]",exclusive:["no-truncate"]}),extended:v.Flags.boolean({char:"x",description:"show extra columns",exclusive:["columns"]}),filter:v.Flags.string({description:"filter property by partial string matching, ex: name=foo"}),"no-header":v.Flags.boolean({description:"hide table header from output",exclusive:["csv"]}),"no-truncate":v.Flags.boolean({description:"do not truncate output to fit screen",exclusive:["csv"]}),output:v.Flags.string({description:"output in a more machine friendly format",exclusive:["no-truncate","csv"],options:["csv","json","yaml"]}),sort:v.Flags.string({description:"property to sort by (prepend '-' for descending)"})};function e(r){if(r){let n={},o=(r.only&&typeof r.only=="string"?[r.only]:r.only)||Object.keys(t.Flags),i=(r.except&&typeof r.except=="string"?[r.except]:r.except)||[];for(let a of o)i.includes(a)||(n[a]=t.Flags[a]);return n}return t.Flags}t.flags=e})(j||(j={}));var zt=(s,e)=>s.reduce((t,r)=>{let n=r[e],o=n.split(`
14
- `);return Math.max(t,o.length>1?Math.max(...o.map(i=>(0,w.default)(i))):(0,w.default)(n))},0);var Ut=require("object-treeify"),X=class s{constructor(){c(this,"nodes",{})}display(e=console.log){let t=function(n){let o={};for(let i of Object.keys(n))o[i]=t(n[i].nodes);return o},r=t(this.nodes);e(Ut(r))}insert(e,t=new s){return this.nodes[e]=t,this}search(e){for(let t of Object.keys(this.nodes)){if(t===e)return this.nodes[t];let r=this.nodes[t].search(e);if(r)return r}}};function M(){return new X}var _t=async(s=1e3)=>new Promise(e=>{setTimeout(e,s)});var St=require("@oclif/core");var W=class extends Error{constructor(t,r){let n="EEXIT";super(r?r.message:`${n}: ${t}`);c(this,"code");c(this,"error");c(this,"ux");this.error=r,this.ux={exit:t},this.code=n}};var Q=g(require("chalk")),Gt=g(require("color")),Xt=["white","black","blue","yellow","green","red","magenta","cyan","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","bold","underline","dim","italic","strikethrough"];function Qt(s){return Xt.includes(s)}function Ct(s,e){return Qt(s)?Q.default[s](e):s?Q.default.hex(s)(e):e}var te=require("hyperlinker"),O=class{static get action(){return y.action}static annotation(e,t){require("supports-hyperlinks").stdout?this.log(`\x1B]1337;AddAnnotation=${e.length}|${t}\x07${e}`):this.log(e)}static get anykey(){return yt}static get confirm(){return ht}static debug(e,...t){["debug","trace"].includes(this.config.outputLevel)&&this.info((0,E.format)(e,...t)+`
15
- `)}static async done(){y.action.stop()}static async flush(e=1e4){await ft(e)}static info(e,...t){T.stdout((0,E.format)(e,...t)+`
16
- `)}static log(e,...t){this.info(e||"",...t)}static logToStderr(e,...t){T.stderr((0,E.format)(e,...t)+`
17
- `)}static get progress(){return q}static get prompt(){return z}static styledHeader(e){this.info($.default.dim("=== ")+$.default.bold(e)+`
18
- `)}static styledJSON(e){let t=JSON.stringify(e,null,2);if(!$.default.level){this.info(t);return}let r=require("cardinal"),n=require("cardinal/themes/jq");this.info(r.highlight(t,{json:!0,theme:n}))}static styledObject(e,t){this.info(R(e,t))}static get table(){return S.table}static trace(e,...t){this.config.outputLevel==="trace"&&this.info((0,E.format)(e,...t)+`
19
- `)}static get tree(){return M}static url(e,t,r={}){this.log(this.hyperlink(e,t,r))}static hyperlink(e,t,r={}){return require("supports-hyperlinks").stdout?te(e,t,r):t}static get wait(){return _t}};c(O,"config",y);var{action:ee,annotation:re,anykey:se,confirm:ne,debug:ie,done:oe,flush:ae,hyperlink:ce,info:ue,log:le,logToStderr:de,progress:pe,prompt:fe,styledHeader:me,styledJSON:ge,styledObject:he,table:ye,trace:ve,tree:be,url:xe,wait:we}=O,{error:ke,exit:Te,warn:_e}=St.Errors;var Ot=async()=>{try{await O.done()}catch(s){console.error(s),process.exitCode=1}},Ce=process.listeners("exit").find(s=>s.name===Ot.name);Ce||process.once("exit",Ot);0&&(module.exports={ActionBase,Config,ExitError,Table,action,annotation,anykey,colorize,config,confirm,debug,done,error,exit,flush,hyperlink,info,log,logToStderr,progress,prompt,styledHeader,styledJSON,styledObject,table,trace,tree,url,ux,wait,warn,write});
11
+ `)||n.includes("\r")||n.includes(","));return t.map(n=>r?`"${n.replaceAll('"','""')}"`:n)}outputCSV(){let{columns:e,data:t,options:r}=this;r["no-header"]||r.printLine(e.map(n=>n.header).join(","));for(let n of t){let o=this.getCSVRow(n);r.printLine(o.join(","))}}outputJSON(){this.options.printLine(JSON.stringify(this.resolveColumnsToObjectArray(),void 0,2))}outputTable(){let{data:e,options:t}=this,r=this.columns.map(i=>{let a=Math.max((0,x.default)(".".padEnd(i.minWidth-1)),(0,x.default)(i.header),Gt(e,i.key))+1;return{...i,maxWidth:a,width:a}}),n=at-2;if((()=>{if(t["no-truncate"]||!process.stdout.isTTY&&!process.env.CLI_UX_SKIP_TTY_CHECK||Y(r,l=>l.width)-n<=0)return;for(let l of r)l.width=l.minWidth;let u=Y(r,l=>l.minWidth);if(u>=n)return;let d=n-u,w=r.map(l=>({key:l.key,needs:l.maxWidth-l.width})).sort((l,p)=>l.needs-p.needs);for(let{key:l,needs:p}of w){if(!p)continue;let m=r.find(S=>l===S.key);m&&(d>p?(m.width=m.width+p,d-=p):d&&(m.width=m.width+d,d=0))}})(),t.title&&(t.printLine(t.title),t.printLine("".padEnd(r.reduce((i,a)=>i+a.width,1),"=")),t.rowStart="| "),!t["no-header"]){let i=t.rowStart;for(let u of r){let d=u.header;i+=d.padEnd(u.width)}t.printLine(G.default.bold(i));let a=t.rowStart;for(let u of r){let d="".padEnd(u.width-1,"\u2500")+" ";a+=d.padEnd(u.width)}t.printLine(G.default.bold(a))}for(let i of e){let a=1;for(let d of r){let l=i[d.key].split(`
12
+ `).length;l>a&&(a=l)}let u=[...new Array(a).keys()];for(let d of u){let w=t.rowStart;for(let l of r){let p=l.width,m=i[l.key];m=m.split(`
13
+ `)[d]||"";let S=(0,x.default)(m),F=m.length-S,h=m.padEnd(p+F);(h.length-F>p||S===p)&&(h=(0,_t.default)(h,0,p-2)+"\u2026 ",h+=" ".repeat(p-(0,x.default)(h))),w+=h}t.printLine(w)}}}outputYAML(){this.options.printLine((0,wt.dump)(this.resolveColumnsToObjectArray()))}resolveColumnsToObjectArray(){let{columns:e,data:t}=this;return t.map(r=>Object.fromEntries(e.map(n=>[n.key,r[n.key]??""])))}};function $(s,e,t={}){new X(s,e,t).display()}(t=>{t.Flags={columns:v.Flags.string({description:"only show provided columns (comma-separated)",exclusive:["extended"]}),csv:v.Flags.boolean({description:"output is csv format [alias: --output=csv]",exclusive:["no-truncate"]}),extended:v.Flags.boolean({char:"x",description:"show extra columns",exclusive:["columns"]}),filter:v.Flags.string({description:"filter property by partial string matching, ex: name=foo"}),"no-header":v.Flags.boolean({description:"hide table header from output",exclusive:["csv"]}),"no-truncate":v.Flags.boolean({description:"do not truncate output to fit screen",exclusive:["csv"]}),output:v.Flags.string({description:"output in a more machine friendly format",exclusive:["no-truncate","csv"],options:["csv","json","yaml"]}),sort:v.Flags.string({description:"property to sort by (prepend '-' for descending)"})};function e(r){if(r){let n={},o=(r.only&&typeof r.only=="string"?[r.only]:r.only)||Object.keys(t.Flags),i=(r.except&&typeof r.except=="string"?[r.except]:r.except)||[];for(let a of o)i.includes(a)||(n[a]=t.Flags[a]);return n}return t.Flags}t.flags=e})($||($={}));var Gt=(s,e)=>s.reduce((t,r)=>{let n=r[e],o=n.split(`
14
+ `);return Math.max(t,o.length>1?Math.max(...o.map(i=>(0,x.default)(i))):(0,x.default)(n))},0);var St=g(require("object-treeify"));var Q=class s{constructor(){c(this,"nodes",{})}display(e=console.log){let t=function(n){let o={};for(let i of Object.keys(n))o[i]=t(n[i].nodes);return o},r=t(this.nodes);e((0,St.default)(r))}insert(e,t=new s){return this.nodes[e]=t,this}search(e){for(let t of Object.keys(this.nodes)){if(t===e)return this.nodes[t];let r=this.nodes[t].search(e);if(r)return r}}};function q(){return new Q}var Ct=async(s=1e3)=>new Promise(e=>{setTimeout(e,s)});var Pt=require("@oclif/core"),Bt=g(require("hyperlinker")),et=g(require("supports-hyperlinks"));var H=class extends Error{constructor(t,r){let n="EEXIT";super(r?r.message:`${n}: ${t}`);c(this,"code");c(this,"error");c(this,"ux");this.error=r,this.ux={exit:t},this.code=n}};var tt=g(require("chalk")),Qt=g(require("color")),te=["white","black","blue","yellow","green","red","magenta","cyan","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","bold","underline","dim","italic","strikethrough"];function ee(s){return te.includes(s)}function Ot(s,e){return ee(s)?tt.default[s](e):s?tt.default.hex(s)(e):e}var re=require("cardinal"),se=require("cardinal/themes/jq"),P=class{static get action(){return y.action}static annotation(e,t){et.default.stdout?this.log(`\x1B]1337;AddAnnotation=${e.length}|${t}\x07${e}`):this.log(e)}static get anykey(){return vt}static get confirm(){return yt}static debug(e,...t){["debug","trace"].includes(this.config.outputLevel)&&this.info((0,L.format)(e,...t)+`
15
+ `)}static async done(){y.action.stop()}static async flush(e=1e4){await mt(e)}static info(e,...t){_.stdout((0,L.format)(e,...t)+`
16
+ `)}static log(e,...t){this.info(e||"",...t)}static logToStderr(e,...t){_.stderr((0,L.format)(e,...t)+`
17
+ `)}static get progress(){return W}static get prompt(){return U}static styledHeader(e){this.info(N.default.dim("=== ")+N.default.bold(e)+`
18
+ `)}static styledJSON(e){let t=JSON.stringify(e,null,2);if(!N.default.level){this.info(t);return}this.info(re.highlight(t,{json:!0,theme:se}))}static styledObject(e,t){this.info(M(e,t))}static get table(){return O.table}static trace(e,...t){this.config.outputLevel==="trace"&&this.info((0,L.format)(e,...t)+`
19
+ `)}static get tree(){return q}static url(e,t,r={}){this.log(this.hyperlink(e,t,r))}static hyperlink(e,t,r={}){return et.default.stdout?(0,Bt.default)(e,t,r):t}static get wait(){return Ct}};c(P,"config",y);var{action:ne,annotation:ie,anykey:oe,confirm:ae,debug:ce,done:ue,flush:le,hyperlink:de,info:pe,log:fe,logToStderr:me,progress:ge,prompt:he,styledHeader:ye,styledJSON:ve,styledObject:be,table:xe,trace:we,tree:ke,url:Te,wait:_e}=P,{error:Se,exit:Ce,warn:Oe}=Pt.Errors;var It=async()=>{try{await P.done()}catch(s){console.error(s),process.exitCode=1}},Pe=process.listeners("exit").find(s=>s.name===It.name);Pe||process.once("exit",It);0&&(module.exports={ActionBase,Config,ExitError,Table,action,annotation,anykey,colorize,config,confirm,debug,done,error,exit,flush,hyperlink,info,log,logToStderr,progress,prompt,styledHeader,styledJSON,styledObject,table,trace,tree,url,ux,wait,warn,write});
package/lib/index.mjs CHANGED
@@ -1,19 +1,19 @@
1
- var U=Object.defineProperty;var ht=(s,e,t)=>e in s?U(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var y=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var yt=(s,e)=>{for(var t in e)U(s,t,{get:e[t],enumerable:!0})};var c=(s,e,t)=>ht(s,typeof e!="symbol"?e+"":e,t);import z from"chalk";import{format as M}from"util";import kt from"@oclif/core/lib/cache";import{inspect as G}from"util";function W(s){return s===void 0?[]:Array.isArray(s)?s:[s]}function $(s,e){return s.reduce((t,r)=>t+e(r),0)}function Z(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}var k=class{constructor(){c(this,"std","stderr");c(this,"stdmocks");c(this,"type");c(this,"stdmockOrigs",{stderr:process.stderr.write,stdout:process.stdout.write})}get output(){return this.globals.output}set output(e){this.globals.output=e}get running(){return!!this.task}get status(){return this.task?this.task.status:void 0}set status(e){let{task:t}=this;t&&t.status!==e&&(this._updateStatus(e,t.status),t.status=e)}get task(){return this.globals.action.task}set task(e){this.globals.action.task=e}async pause(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=e();return r&&n&&this._resume(),o}async pauseAsync(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=await e();return r&&n&&this._resume(),o}start(e,t,r={}){this.std=r.stdout?"stdout":"stderr";let n={action:e,active:!!this.task?.active,status:t};this.task=n,this._start(r),n.active=!0,this._stdout(!0)}stop(e="done"){let{task:t}=this;t&&(this._stop(e),t.active=!1,this.task=void 0,this._stdout(!1))}_flushStdout(){try{let e="",t;for(;this.stdmocks&&this.stdmocks.length>0;){let r=this.stdmocks.shift();t=r[0],this._write(t,r[1]),e+=r[1][0].toString("utf8")}e&&t&&e.at(-1)!==`
1
+ var Z=Object.defineProperty;var vt=(s,e,t)=>e in s?Z(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var W=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var bt=(s,e)=>{for(var t in e)Z(s,t,{get:e[t],enumerable:!0})};var c=(s,e,t)=>vt(s,typeof e!="symbol"?e+"":e,t);import U from"chalk";import{format as M}from"util";import{inspect as X}from"util";function $(s){return s===void 0?[]:Array.isArray(s)?s:[s]}function q(s,e){return s.reduce((t,r)=>t+e(r),0)}function G(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}var x=class{constructor(){c(this,"std","stderr");c(this,"stdmocks");c(this,"type");c(this,"stdmockOrigs",{stderr:process.stderr.write,stdout:process.stdout.write})}get output(){return this.globals.output}set output(e){this.globals.output=e}get running(){return!!this.task}get status(){return this.task?this.task.status:void 0}set status(e){let{task:t}=this;t&&t.status!==e&&(this._updateStatus(e,t.status),t.status=e)}get task(){return this.globals.action.task}set task(e){this.globals.action.task=e}async pause(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=e();return r&&n&&this._resume(),o}async pauseAsync(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=await e();return r&&n&&this._resume(),o}start(e,t,r={}){this.std=r.stdout?"stdout":"stderr";let n={action:e,active:!!this.task?.active,status:t};this.task=n,this._start(r),n.active=!0,this._stdout(!0)}stop(e="done"){let{task:t}=this;t&&(this._stop(e),t.active=!1,this.task=void 0,this._stdout(!1))}_flushStdout(){try{let e="",t;for(;this.stdmocks&&this.stdmocks.length>0;){let r=this.stdmocks.shift();t=r[0],this._write(t,r[1]),e+=r[1][0].toString("utf8")}e&&t&&e.at(-1)!==`
2
2
  `&&this._write(t,`
3
- `)}catch(e){this._write("stderr",G(e))}}_pause(e){throw new Error("not implemented")}_resume(){this.task&&this.start(this.task.action,this.task.status)}_start(e){throw new Error("not implemented")}_stdout(e){try{if(e){if(this.stdmocks)return;this.stdmockOrigs={stderr:process.stderr.write,stdout:process.stdout.write},this.stdmocks=[],process.stdout.write=(...t)=>(this.stdmocks.push(["stdout",t]),!0),process.stderr.write=(...t)=>(this.stdmocks.push(["stderr",t]),!0)}else{if(!this.stdmocks)return;delete this.stdmocks,process.stdout.write=this.stdmockOrigs.stdout,process.stderr.write=this.stdmockOrigs.stderr}}catch(t){this._write("stderr",G(t))}}_stop(e){throw new Error("not implemented")}_updateStatus(e,t){}_write(e,t){switch(e){case"stdout":{this.stdmockOrigs.stdout.apply(process.stdout,W(t));break}case"stderr":{this.stdmockOrigs.stderr.apply(process.stderr,W(t));break}default:throw new Error(`invalid std: ${e}`)}}get globals(){global.ux=global.ux||{};let e=global.ux;return e.action=e.action||{},e}};var S=class extends k{constructor(){super(...arguments);c(this,"type","simple")}_flush(){this._write(this.std,`
4
- `),this._flushStdout()}_pause(t){t?this._updateStatus(t):this._flush()}_render(t,r){this.task&&(this.task.active&&this._flush(),this._write(this.std,r?`${t}... ${r}`:`${t}...`))}_resume(){}_start(){this.task&&this._render(this.task.action,this.task.status)}_stop(t){this.task&&this._updateStatus(t,this.task.status,!0)}_updateStatus(t,r,n=!1){this.task&&(this.task.active&&!r?this._write(this.std,` ${t}`):this._write(this.std,`${this.task.action}... ${t}`),(n||!r)&&this._flush())}};import vt from"ansi-styles";import bt from"chalk";import xt from"strip-ansi";import*as E from"supports-color";function X(s){if(!s.isTTY)return 80;let e=s.getWindowSize()[0];return e<1?80:e<40?40:e}var Q=Number.parseInt(process.env.OCLIF_COLUMNS,10),tt=Q||X(process.stdout),et=Q||X(process.stderr);var N={arc:{frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"],interval:100},arrow:{frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"],interval:100},arrow2:{frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "],interval:80},arrow3:{frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"],interval:120},balloon:{frames:[" ",".","o","O","@","*"," "],interval:140},balloon2:{frames:[".","o","O","\xB0","O","o","."],interval:120},bounce:{frames:["\u2801","\u2802","\u2804","\u2802"],interval:120},bouncingBall:{frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"],interval:80},bouncingBar:{frames:["[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"],interval:80},boxBounce:{frames:["\u2596","\u2598","\u259D","\u2597"],interval:120},boxBounce2:{frames:["\u258C","\u2580","\u2590","\u2584"],interval:100},circle:{frames:["\u25E1","\u2299","\u25E0"],interval:120},circleHalves:{frames:["\u25D0","\u25D3","\u25D1","\u25D2"],interval:50},circleQuarters:{frames:["\u25F4","\u25F7","\u25F6","\u25F5"],interval:120},clock:{frames:["\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "],interval:100},dots:{frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],interval:80},dots2:{frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"],interval:80},dots3:{frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"],interval:80},dots4:{frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"],interval:80},dots5:{frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"],interval:80},dots6:{frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"],interval:80},dots7:{frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"],interval:80},dots8:{frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"],interval:80},dots9:{frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"],interval:80},dots10:{frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"],interval:80},dots11:{frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"],interval:100},earth:{frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "],interval:180},flip:{frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"],interval:70},growHorizontal:{frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"],interval:120},growVertical:{frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"],interval:120},hamburger:{frames:["\u2631","\u2632","\u2634"],interval:100},hearts:{frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "],interval:100},hexagon:{frames:["\u2B21","\u2B22"],interval:400},line:{frames:["-","\\","|","/"],interval:130},line2:{frames:["\u2802","-","\u2013","\u2014","\u2013","-"],interval:100},monkey:{frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "],interval:300},moon:{frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "],interval:80},noise:{frames:["\u2593","\u2592","\u2591"],interval:100},pipe:{frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"],interval:100},pong:{frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"],interval:80},runner:{frames:["\u{1F6B6} ","\u{1F3C3} "],interval:140},simpleDots:{frames:[". ",".. ","..."," "],interval:400},simpleDotsScrolling:{frames:[". ",".. ","..."," .."," ."," "],interval:200},smiley:{frames:["\u{1F604} ","\u{1F61D} "],interval:200},squareCorners:{frames:["\u25F0","\u25F3","\u25F2","\u25F1"],interval:180},squish:{frames:["\u256B","\u256A"],interval:100},star:{frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"],interval:70},star2:{frames:["+","x","*"],interval:80},toggle:{frames:["\u22B6","\u22B7"],interval:250},toggle2:{frames:["\u25AB","\u25AA"],interval:80},toggle3:{frames:["\u25A1","\u25A0"],interval:120},toggle4:{frames:["\u25A0","\u25A1","\u25AA","\u25AB"],interval:100},toggle5:{frames:["\u25AE","\u25AF"],interval:100},toggle6:{frames:["\u101D","\u1040"],interval:300},toggle7:{frames:["\u29BE","\u29BF"],interval:80},toggle8:{frames:["\u25CD","\u25CC"],interval:100},toggle9:{frames:["\u25C9","\u25CE"],interval:100},toggle10:{frames:["\u3282","\u3280","\u3281"],interval:100},toggle11:{frames:["\u29C7","\u29C6"],interval:50},toggle12:{frames:["\u2617","\u2616"],interval:120},toggle13:{frames:["=","*","-"],interval:80},triangle:{frames:["\u25E2","\u25E3","\u25E4","\u25E5"],interval:50}};var H=y("ansi-escapes");function wt(s){return E?(E.stdout?E.stdout.has256:(process.env.TERM||"").includes("256"))?`\x1B[38;5;104m${s}${vt.reset.open}`:bt.magenta(s):s}var O=class extends k{constructor(){super();c(this,"frameIndex");c(this,"frames");c(this,"spinner");c(this,"type","spinner");this.frames=this.getFrames(),this.frameIndex=0}_frame(){let t=this.frames[this.frameIndex];return this.frameIndex=++this.frameIndex%this.frames.length,wt(t)}_lines(t){return xt(t).split(`
5
- `).map(r=>Math.ceil(r.length/et)).reduce((r,n)=>r+n,0)}_pause(t){this.spinner&&clearInterval(this.spinner),this._reset(),t&&this._render(` ${t}`),this.output=void 0}_render(t){if(!this.task)return;this._reset(),this._flushStdout();let r=t==="spinner"?` ${this._frame()}`:t||"",n=this.task.status?` ${this.task.status}`:"";this.output=`${this.task.action}...${r}${n}
6
- `,this._write(this.std,this.output)}_reset(){if(!this.output)return;let t=this._lines(this.output);this._write(this.std,H.cursorLeft+H.cursorUp(t)+H.eraseDown),this.output=void 0}_start(t){t.style&&(this.frames=this.getFrames(t)),this._reset(),this.spinner&&clearInterval(this.spinner),this._render(),this.spinner=setInterval(n=>{this._render.bind(this)(n)},process.platform==="win32"?500:100,"spinner"),this.spinner.unref()}_stop(t){this.task&&(this.task.status=t),this.spinner&&clearInterval(this.spinner),this._render(),this.output=void 0}getFrames(t){return t?.style?N[t.style].frames:N[process.platform==="win32"?"line":"dots2"].frames}};var rt=global,v=rt.ux||(rt.ux={}),Tt=!!process.stderr.isTTY&&!process.env.CI&&!["dumb","emacs-color"].includes(process.env.TERM)&&"spinner"||"simple",_t=Tt==="spinner"?O:S,L=class{constructor(){c(this,"action",new _t);c(this,"errorsHandled",!1);c(this,"outputLevel","info");c(this,"showStackTrace",!0)}get context(){return v.context||{}}set context(e){v.context=e}get debug(){return v.debug||process.env.DEBUG==="*"}set debug(e){v.debug=e}};function Ct(){let e=kt.getInstance().get("@oclif/core")?.version.split(".")[0]||"unknown";return v[e]||(v[e]=new L),v[e]}var b=Ct();import{error as St}from"@oclif/core/lib/errors";async function Ot(s,e){async function t(r,n=!1){return new Promise(o=>{let i=setTimeout(()=>{o(null)},r);n&&i.unref()})}return Promise.race([s,t(e,!0).then(()=>St("timed out"))])}async function Pt(){let s=new Promise(t=>{process.stdout.once("drain",()=>{t(null)})});if(!process.stdout.write(""))return s}async function st(s=1e4){await Ot(Pt(),s)}import P from"chalk";import{Errors as nt}from"@oclif/core";async function K(s,e=100){if(e<0)throw new Error("no input");return new Promise((t,r)=>{let n;s.timeout&&(n=setTimeout(()=>{process.stdin.pause(),r(new Error("Prompt timeout"))},s.timeout),n.unref()),process.stdin.setEncoding("utf8"),process.stderr.write(s.prompt),process.stdin.resume(),process.stdin.once("data",o=>{n&&clearTimeout(n),process.stdin.pause();let i=(typeof o=="string"?o:o.toString()).trim();!s.default&&s.required&&i===""?t(K(s,e-1)):t(i||s.default)})})}function it(s,e,t){let r="> ";return t&&e==="hide"&&(t="*".repeat(t.length)),s&&t?r=s+" "+P.yellow("["+t+"]")+": ":s&&(r=`${s}: `),r}async function Bt(s){let e=process.stdin.isRaw;process.stdin.setRawMode&&process.stdin.setRawMode(!0),s.required=s.required??!1;let t=await K(s);return process.stdin.setRawMode&&process.stdin.setRawMode(!!e),t}function It(s){let e=y("ansi-escapes");process.stderr.write(e.cursorHide+e.cursorUp(1)+e.cursorLeft+s+e.cursorDown(1)+e.cursorLeft+e.cursorShow)}async function ot(s,e={}){let t=it(s,e.type,e.default),r={default:"",isTTY:!!(process.env.TERM!=="dumb"&&process.stdin.isTTY),name:s,prompt:t,required:!0,type:"normal",...e},n=y("password-prompt");switch(r.type){case"normal":return K(r);case"single":return Bt(r);case"mask":return n(r.prompt,{default:r.default,method:r.type,required:r.required}).then(o=>(It(it(s,"hide",e.default)),o));case"hide":return n(r.prompt,{default:r.default,method:r.type,required:r.required});default:throw new Error(`unexpected type ${r.type}`)}}async function Y(s,e={}){return b.action.pauseAsync(async()=>ot(s,e),P.cyan("?"))}async function at(s){return b.action.pauseAsync(async()=>{let e=async()=>{let r=(await ot(s)).toLowerCase();return["n","no"].includes(r)?!1:["y","yes"].includes(r)?!0:e()};return e()},P.cyan("?"))}async function ct(s){let e=!!process.stdin.setRawMode;s||(s=e?`Press any key to continue or ${P.yellow("q")} to exit`:`Press enter to continue or ${P.yellow("q")} to exit`);let t=await Y(s,{required:!1,type:"single"});return e&&process.stderr.write(`
7
- `),t==="q"&&nt.error("quit"),t===""&&nt.error("ctrl-c"),t}import Et from"chalk";import{inspect as ut}from"util";function F(s,e){let t=[],r=Object.keys(s).map(a=>a.toString().length),n=Math.max(...r)+2;function o(a){return typeof a=="string"||typeof a=="number"?a:typeof a=="object"?Object.keys(a).map(u=>u+": "+ut(a[u])).join(", "):ut(a)}let i=(a,u)=>`${Et.blue(a)}:`+" ".repeat(n-a.length-1)+o(u);for(let a of e||Object.keys(s).sort()){let u=s[a];if(Array.isArray(u)){if(u.length>0){t.push(i(a,u[0]));for(let d of u.slice(1))t.push(" ".repeat(n)+o(d))}}else u!=null&&t.push(i(a,u))}return t.join(`
8
- `)}import{SingleBar as Lt}from"cli-progress";function R(s={}){return new Lt({noTTYOutput:process.env.TERM==="dumb"||!process.stdin.isTTY,...s})}var B={};yt(B,{table:()=>q});import lt from"chalk";import{safeDump as qt}from"js-yaml";import{orderBy as jt}from"natural-orderby";import{inspect as Mt}from"util";import Wt from"slice-ansi";import T from"string-width";var Ft=s=>{process.stdout.write(s)},Rt=s=>{process.stderr.write(s)},C={stderr:Rt,stdout:Ft};import{Flags as x}from"@oclif/core";var D=class{constructor(e,t,r={}){this.data=e;c(this,"columns");c(this,"options");this.columns=Object.keys(t).map(p=>{let g=t[p],_=g.extended??!1,A=g.get??(gt=>gt[p]??""),h=typeof g.header=="string"?g.header:Z(p.replaceAll("_"," ")),mt=Math.max(g.minWidth??0,T(h)+1);return{extended:_,get:A,header:h,key:p,minWidth:mt}});let{columns:n,csv:o,extended:i,filter:a,output:u,printLine:d,sort:w,title:l}=r;this.options={columns:n,extended:i,filter:a,"no-header":r["no-header"]??!1,"no-truncate":r["no-truncate"]??!1,output:o?"csv":u,printLine:d??(p=>{C.stdout(p+`
9
- `)}),rowStart:" ",sort:w,title:l}}display(){let e=this.data.map(t=>{let r={};for(let n of this.columns){let o=n.get(t);typeof o!="string"&&(o=Mt(o,{breakLength:Number.POSITIVE_INFINITY})),r[n.key]=o}return r});if(this.options.filter){let[t,r]=this.options.filter.split("="),n=t[0]==="-";n&&(t=t.slice(1));let o=this.findColumnFromHeader(t);if(!o||!r)throw new Error("Filter flag has an invalid value");e=e.filter(i=>{let a=new RegExp(r),d=i[o.key].match(a);return n?!d:d})}if(this.options.sort){let t=this.options.sort.split(","),r=t.map(i=>i[0]==="-"?i.slice(1):i),n=this.filterColumnsFromHeaders(r).map(i=>a=>a[i.key]),o=t.map(i=>i[0]==="-"?"desc":"asc");e=jt(e,n,o)}if(this.options.columns){let t=this.options.columns.split(",");this.columns=this.filterColumnsFromHeaders(t)}else this.options.extended||(this.columns=this.columns.filter(t=>!t.extended));switch(this.data=e,this.options.output){case"csv":{this.outputCSV();break}case"json":{this.outputJSON();break}case"yaml":{this.outputYAML();break}default:this.outputTable()}}filterColumnsFromHeaders(e){e=[...new Set(e)];let t=[];for(let r of e){let n=this.columns.find(o=>o.header.toLowerCase()===r.toLowerCase());n&&t.push(n)}return t}findColumnFromHeader(e){return this.columns.find(t=>t.header.toLowerCase()===e.toLowerCase())}getCSVRow(e){let t=this.columns.map(n=>e[n.key]||""),r=t.find(n=>n.includes('"')||n.includes(`
3
+ `)}catch(e){this._write("stderr",X(e))}}_pause(e){throw new Error("not implemented")}_resume(){this.task&&this.start(this.task.action,this.task.status)}_start(e){throw new Error("not implemented")}_stdout(e){try{if(e){if(this.stdmocks)return;this.stdmockOrigs={stderr:process.stderr.write,stdout:process.stdout.write},this.stdmocks=[],process.stdout.write=(...t)=>(this.stdmocks.push(["stdout",t]),!0),process.stderr.write=(...t)=>(this.stdmocks.push(["stderr",t]),!0)}else{if(!this.stdmocks)return;delete this.stdmocks,process.stdout.write=this.stdmockOrigs.stdout,process.stderr.write=this.stdmockOrigs.stderr}}catch(t){this._write("stderr",X(t))}}_stop(e){throw new Error("not implemented")}_updateStatus(e,t){}_write(e,t){switch(e){case"stdout":{this.stdmockOrigs.stdout.apply(process.stdout,$(t));break}case"stderr":{this.stdmockOrigs.stderr.apply(process.stderr,$(t));break}default:throw new Error(`invalid std: ${e}`)}}get globals(){global.ux=global.ux||{};let e=global.ux;return e.action=e.action||{},e}};var C=class extends x{constructor(){super(...arguments);c(this,"type","simple")}_flush(){this._write(this.std,`
4
+ `),this._flushStdout()}_pause(t){t?this._updateStatus(t):this._flush()}_render(t,r){this.task&&(this.task.active&&this._flush(),this._write(this.std,r?`${t}... ${r}`:`${t}...`))}_resume(){}_start(){this.task&&this._render(this.task.action,this.task.status)}_stop(t){this.task&&this._updateStatus(t,this.task.status,!0)}_updateStatus(t,r,n=!1){this.task&&(this.task.active&&!r?this._write(this.std,` ${t}`):this._write(this.std,`${this.task.action}... ${t}`),(n||!r)&&this._flush())}};import xt from"ansi-styles";import wt from"chalk";import kt from"strip-ansi";import N from"supports-color";function Q(s){if(!s.isTTY)return 80;let e=s.getWindowSize()[0];return e<1?80:e<40?40:e}var tt=Number.parseInt(process.env.OCLIF_COLUMNS,10),et=tt||Q(process.stdout),rt=tt||Q(process.stderr);var H={arc:{frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"],interval:100},arrow:{frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"],interval:100},arrow2:{frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "],interval:80},arrow3:{frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"],interval:120},balloon:{frames:[" ",".","o","O","@","*"," "],interval:140},balloon2:{frames:[".","o","O","\xB0","O","o","."],interval:120},bounce:{frames:["\u2801","\u2802","\u2804","\u2802"],interval:120},bouncingBall:{frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"],interval:80},bouncingBar:{frames:["[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"],interval:80},boxBounce:{frames:["\u2596","\u2598","\u259D","\u2597"],interval:120},boxBounce2:{frames:["\u258C","\u2580","\u2590","\u2584"],interval:100},circle:{frames:["\u25E1","\u2299","\u25E0"],interval:120},circleHalves:{frames:["\u25D0","\u25D3","\u25D1","\u25D2"],interval:50},circleQuarters:{frames:["\u25F4","\u25F7","\u25F6","\u25F5"],interval:120},clock:{frames:["\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "],interval:100},dots:{frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],interval:80},dots2:{frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"],interval:80},dots3:{frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"],interval:80},dots4:{frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"],interval:80},dots5:{frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"],interval:80},dots6:{frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"],interval:80},dots7:{frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"],interval:80},dots8:{frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"],interval:80},dots9:{frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"],interval:80},dots10:{frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"],interval:80},dots11:{frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"],interval:100},earth:{frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "],interval:180},flip:{frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"],interval:70},growHorizontal:{frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"],interval:120},growVertical:{frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"],interval:120},hamburger:{frames:["\u2631","\u2632","\u2634"],interval:100},hearts:{frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "],interval:100},hexagon:{frames:["\u2B21","\u2B22"],interval:400},line:{frames:["-","\\","|","/"],interval:130},line2:{frames:["\u2802","-","\u2013","\u2014","\u2013","-"],interval:100},monkey:{frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "],interval:300},moon:{frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "],interval:80},noise:{frames:["\u2593","\u2592","\u2591"],interval:100},pipe:{frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"],interval:100},pong:{frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"],interval:80},runner:{frames:["\u{1F6B6} ","\u{1F3C3} "],interval:140},simpleDots:{frames:[". ",".. ","..."," "],interval:400},simpleDotsScrolling:{frames:[". ",".. ","..."," .."," ."," "],interval:200},smiley:{frames:["\u{1F604} ","\u{1F61D} "],interval:200},squareCorners:{frames:["\u25F0","\u25F3","\u25F2","\u25F1"],interval:180},squish:{frames:["\u256B","\u256A"],interval:100},star:{frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"],interval:70},star2:{frames:["+","x","*"],interval:80},toggle:{frames:["\u22B6","\u22B7"],interval:250},toggle2:{frames:["\u25AB","\u25AA"],interval:80},toggle3:{frames:["\u25A1","\u25A0"],interval:120},toggle4:{frames:["\u25A0","\u25A1","\u25AA","\u25AB"],interval:100},toggle5:{frames:["\u25AE","\u25AF"],interval:100},toggle6:{frames:["\u101D","\u1040"],interval:300},toggle7:{frames:["\u29BE","\u29BF"],interval:80},toggle8:{frames:["\u25CD","\u25CC"],interval:100},toggle9:{frames:["\u25C9","\u25CE"],interval:100},toggle10:{frames:["\u3282","\u3280","\u3281"],interval:100},toggle11:{frames:["\u29C7","\u29C6"],interval:50},toggle12:{frames:["\u2617","\u2616"],interval:120},toggle13:{frames:["=","*","-"],interval:80},triangle:{frames:["\u25E2","\u25E3","\u25E4","\u25E5"],interval:50}};import K from"ansi-escapes";function Tt(s){return N?(N.stdout?N.stdout.has256:(process.env.TERM||"").includes("256"))?`\x1B[38;5;104m${s}${xt.reset.open}`:wt.magenta(s):s}var O=class extends x{constructor(){super();c(this,"frameIndex");c(this,"frames");c(this,"spinner");c(this,"type","spinner");this.frames=this.getFrames(),this.frameIndex=0}_frame(){let t=this.frames[this.frameIndex];return this.frameIndex=++this.frameIndex%this.frames.length,Tt(t)}_lines(t){return kt(t).split(`
5
+ `).map(r=>Math.ceil(r.length/rt)).reduce((r,n)=>r+n,0)}_pause(t){this.spinner&&clearInterval(this.spinner),this._reset(),t&&this._render(` ${t}`),this.output=void 0}_render(t){if(!this.task)return;this._reset(),this._flushStdout();let r=t==="spinner"?` ${this._frame()}`:t||"",n=this.task.status?` ${this.task.status}`:"";this.output=`${this.task.action}...${r}${n}
6
+ `,this._write(this.std,this.output)}_reset(){if(!this.output)return;let t=this._lines(this.output);this._write(this.std,K.cursorLeft+K.cursorUp(t)+K.eraseDown),this.output=void 0}_start(t){t.style&&(this.frames=this.getFrames(t)),this._reset(),this.spinner&&clearInterval(this.spinner),this._render(),this.spinner=setInterval(n=>{this._render.bind(this)(n)},process.platform==="win32"?500:100,"spinner"),this.spinner.unref()}_stop(t){this.task&&(this.task.status=t),this.spinner&&clearInterval(this.spinner),this._render(),this.output=void 0}getFrames(t){return t?.style?H[t.style].frames:H[process.platform==="win32"?"line":"dots2"].frames}};var st=global,w=st.ux||(st.ux={}),_t=!!process.stderr.isTTY&&!process.env.CI&&!["dumb","emacs-color"].includes(process.env.TERM)&&"spinner"||"simple",St=_t==="spinner"?O:C,A=class{constructor(){c(this,"action",new St);c(this,"errorsHandled",!1);c(this,"outputLevel","info");c(this,"showStackTrace",!0)}get context(){return w.context||{}}set context(e){w.context=e}get debug(){return w.debug||process.env.DEBUG==="*"}set debug(e){w.debug=e}};function Ct(){return w.config||(w.config=new A),w.config}var y=Ct();import{Errors as Ot}from"@oclif/core";async function Pt(s,e){async function t(r,n=!1){return new Promise(o=>{let i=setTimeout(()=>{o(null)},r);n&&i.unref()})}return Promise.race([s,t(e,!0).then(()=>Ot.error("timed out"))])}async function Bt(){let s=new Promise(t=>{process.stdout.once("drain",()=>{t(null)})});if(!process.stdout.write(""))return s}async function nt(s=1e4){await Pt(Bt(),s)}import P from"chalk";import{Errors as it}from"@oclif/core";import _ from"ansi-escapes";async function Y(s,e=100){if(e<0)throw new Error("no input");return new Promise((t,r)=>{let n;s.timeout&&(n=setTimeout(()=>{process.stdin.pause(),r(new Error("Prompt timeout"))},s.timeout),n.unref()),process.stdin.setEncoding("utf8"),process.stderr.write(s.prompt),process.stdin.resume(),process.stdin.once("data",o=>{n&&clearTimeout(n),process.stdin.pause();let i=(typeof o=="string"?o:o.toString()).trim();!s.default&&s.required&&i===""?t(Y(s,e-1)):t(i||s.default)})})}function ot(s,e,t){let r="> ";return t&&e==="hide"&&(t="*".repeat(t.length)),s&&t?r=s+" "+P.yellow("["+t+"]")+": ":s&&(r=`${s}: `),r}async function It(s){let e=process.stdin.isRaw;process.stdin.setRawMode&&process.stdin.setRawMode(!0),s.required=s.required??!1;let t=await Y(s);return process.stdin.setRawMode&&process.stdin.setRawMode(!!e),t}function Et(s){process.stderr.write(_.cursorHide+_.cursorUp(1)+_.cursorLeft+s+_.cursorDown(1)+_.cursorLeft+_.cursorShow)}async function at(s,e={}){let t=ot(s,e.type,e.default),r={default:"",isTTY:!!(process.env.TERM!=="dumb"&&process.stdin.isTTY),name:s,prompt:t,required:!0,type:"normal",...e},n=W("password-prompt");switch(r.type){case"normal":return Y(r);case"single":return It(r);case"mask":return n(r.prompt,{default:r.default,method:r.type,required:r.required}).then(o=>(Et(ot(s,"hide",e.default)),o));case"hide":return n(r.prompt,{default:r.default,method:r.type,required:r.required});default:throw new Error(`unexpected type ${r.type}`)}}async function D(s,e={}){return y.action.pauseAsync(async()=>at(s,e),P.cyan("?"))}async function ct(s){return y.action.pauseAsync(async()=>{let e=async()=>{let r=(await at(s)).toLowerCase();return["n","no"].includes(r)?!1:["y","yes"].includes(r)?!0:e()};return e()},P.cyan("?"))}async function ut(s){let e=!!process.stdin.setRawMode;s||(s=e?`Press any key to continue or ${P.yellow("q")} to exit`:`Press enter to continue or ${P.yellow("q")} to exit`);let t=await D(s,{required:!1,type:"single"});return e&&process.stderr.write(`
7
+ `),t==="q"&&it.error("quit"),t===""&&it.error("ctrl-c"),t}import Lt from"chalk";import{inspect as lt}from"util";function L(s,e){let t=[],r=Object.keys(s).map(a=>a.toString().length),n=Math.max(...r)+2;function o(a){return typeof a=="string"||typeof a=="number"?a:typeof a=="object"?Object.keys(a).map(u=>u+": "+lt(a[u])).join(", "):lt(a)}let i=(a,u)=>`${Lt.blue(a)}:`+" ".repeat(n-a.length-1)+o(u);for(let a of e||Object.keys(s).sort()){let u=s[a];if(Array.isArray(u)){if(u.length>0){t.push(i(a,u[0]));for(let d of u.slice(1))t.push(" ".repeat(n)+o(d))}}else u!=null&&t.push(i(a,u))}return t.join(`
8
+ `)}import{SingleBar as Ft}from"cli-progress";function F(s={}){return new Ft({noTTYOutput:process.env.TERM==="dumb"||!process.stdin.isTTY,...s})}var B={};bt(B,{table:()=>R});import dt from"chalk";import{dump as Mt}from"js-yaml";import{orderBy as Wt}from"natural-orderby";import{inspect as $t}from"util";import qt from"slice-ansi";import k from"string-width";var Rt=s=>{process.stdout.write(s)},jt=s=>{process.stderr.write(s)},S={stderr:jt,stdout:Rt};import{Flags as v}from"@oclif/core";var J=class{constructor(e,t,r={}){this.data=e;c(this,"columns");c(this,"options");this.columns=Object.keys(t).map(p=>{let g=t[p],T=g.extended??!1,E=g.get??(yt=>yt[p]??""),h=typeof g.header=="string"?g.header:G(p.replaceAll("_"," ")),ht=Math.max(g.minWidth??0,k(h)+1);return{extended:T,get:E,header:h,key:p,minWidth:ht}});let{columns:n,csv:o,extended:i,filter:a,output:u,printLine:d,sort:b,title:l}=r;this.options={columns:n,extended:i,filter:a,"no-header":r["no-header"]??!1,"no-truncate":r["no-truncate"]??!1,output:o?"csv":u,printLine:d??(p=>{S.stdout(p+`
9
+ `)}),rowStart:" ",sort:b,title:l}}display(){let e=this.data.map(t=>{let r={};for(let n of this.columns){let o=n.get(t);typeof o!="string"&&(o=$t(o,{breakLength:Number.POSITIVE_INFINITY})),r[n.key]=o}return r});if(this.options.filter){let[t,r]=this.options.filter.split("="),n=t[0]==="-";n&&(t=t.slice(1));let o=this.findColumnFromHeader(t);if(!o||!r)throw new Error("Filter flag has an invalid value");e=e.filter(i=>{let a=new RegExp(r),d=i[o.key].match(a);return n?!d:d})}if(this.options.sort){let t=this.options.sort.split(","),r=t.map(i=>i[0]==="-"?i.slice(1):i),n=this.filterColumnsFromHeaders(r).map(i=>a=>a[i.key]),o=t.map(i=>i[0]==="-"?"desc":"asc");e=Wt(e,n,o)}if(this.options.columns){let t=this.options.columns.split(",");this.columns=this.filterColumnsFromHeaders(t)}else this.options.extended||(this.columns=this.columns.filter(t=>!t.extended));switch(this.data=e,this.options.output){case"csv":{this.outputCSV();break}case"json":{this.outputJSON();break}case"yaml":{this.outputYAML();break}default:this.outputTable()}}filterColumnsFromHeaders(e){e=[...new Set(e)];let t=[];for(let r of e){let n=this.columns.find(o=>o.header.toLowerCase()===r.toLowerCase());n&&t.push(n)}return t}findColumnFromHeader(e){return this.columns.find(t=>t.header.toLowerCase()===e.toLowerCase())}getCSVRow(e){let t=this.columns.map(n=>e[n.key]||""),r=t.find(n=>n.includes('"')||n.includes(`
10
10
  `)||n.includes(`\r
11
- `)||n.includes("\r")||n.includes(","));return t.map(n=>r?`"${n.replaceAll('"','""')}"`:n)}outputCSV(){let{columns:e,data:t,options:r}=this;r["no-header"]||r.printLine(e.map(n=>n.header).join(","));for(let n of t){let o=this.getCSVRow(n);r.printLine(o.join(","))}}outputJSON(){this.options.printLine(JSON.stringify(this.resolveColumnsToObjectArray(),void 0,2))}outputTable(){let{data:e,options:t}=this,r=this.columns.map(i=>{let a=Math.max(T(".".padEnd(i.minWidth-1)),T(i.header),$t(e,i.key))+1;return{...i,maxWidth:a,width:a}}),n=tt-2;if((()=>{if(t["no-truncate"]||!process.stdout.isTTY&&!process.env.CLI_UX_SKIP_TTY_CHECK||$(r,l=>l.width)-n<=0)return;for(let l of r)l.width=l.minWidth;let u=$(r,l=>l.minWidth);if(u>=n)return;let d=n-u,w=r.map(l=>({key:l.key,needs:l.maxWidth-l.width})).sort((l,p)=>l.needs-p.needs);for(let{key:l,needs:p}of w){if(!p)continue;let g=r.find(_=>l===_.key);g&&(d>p?(g.width=g.width+p,d-=p):d&&(g.width=g.width+d,d=0))}})(),t.title&&(t.printLine(t.title),t.printLine("".padEnd(r.reduce((i,a)=>i+a.width,1),"=")),t.rowStart="| "),!t["no-header"]){let i=t.rowStart;for(let u of r){let d=u.header;i+=d.padEnd(u.width)}t.printLine(lt.bold(i));let a=t.rowStart;for(let u of r){let d="".padEnd(u.width-1,"\u2500")+" ";a+=d.padEnd(u.width)}t.printLine(lt.bold(a))}for(let i of e){let a=1;for(let d of r){let l=i[d.key].split(`
12
- `).length;l>a&&(a=l)}let u=[...new Array(a).keys()];for(let d of u){let w=t.rowStart;for(let l of r){let p=l.width,g=i[l.key];g=g.split(`
13
- `)[d]||"";let _=T(g),A=g.length-_,h=g.padEnd(p+A);(h.length-A>p||_===p)&&(h=Wt(h,0,p-2)+"\u2026 ",h+=" ".repeat(p-T(h))),w+=h}t.printLine(w)}}}outputYAML(){this.options.printLine(qt(this.resolveColumnsToObjectArray()))}resolveColumnsToObjectArray(){let{columns:e,data:t}=this;return t.map(r=>Object.fromEntries(e.map(n=>[n.key,r[n.key]??""])))}};function q(s,e,t={}){new D(s,e,t).display()}(t=>{t.Flags={columns:x.string({description:"only show provided columns (comma-separated)",exclusive:["extended"]}),csv:x.boolean({description:"output is csv format [alias: --output=csv]",exclusive:["no-truncate"]}),extended:x.boolean({char:"x",description:"show extra columns",exclusive:["columns"]}),filter:x.string({description:"filter property by partial string matching, ex: name=foo"}),"no-header":x.boolean({description:"hide table header from output",exclusive:["csv"]}),"no-truncate":x.boolean({description:"do not truncate output to fit screen",exclusive:["csv"]}),output:x.string({description:"output in a more machine friendly format",exclusive:["no-truncate","csv"],options:["csv","json","yaml"]}),sort:x.string({description:"property to sort by (prepend '-' for descending)"})};function e(r){if(r){let n={},o=(r.only&&typeof r.only=="string"?[r.only]:r.only)||Object.keys(t.Flags),i=(r.except&&typeof r.except=="string"?[r.except]:r.except)||[];for(let a of o)i.includes(a)||(n[a]=t.Flags[a]);return n}return t.Flags}t.flags=e})(q||(q={}));var $t=(s,e)=>s.reduce((t,r)=>{let n=r[e],o=n.split(`
14
- `);return Math.max(t,o.length>1?Math.max(...o.map(i=>T(i))):T(n))},0);var Nt=y("object-treeify"),J=class s{constructor(){c(this,"nodes",{})}display(e=console.log){let t=function(n){let o={};for(let i of Object.keys(n))o[i]=t(n[i].nodes);return o},r=t(this.nodes);e(Nt(r))}insert(e,t=new s){return this.nodes[e]=t,this}search(e){for(let t of Object.keys(this.nodes)){if(t===e)return this.nodes[t];let r=this.nodes[t].search(e);if(r)return r}}};function j(){return new J}var dt=async(s=1e3)=>new Promise(e=>{setTimeout(e,s)});import{Errors as Vt}from"@oclif/core";var V=class extends Error{constructor(t,r){let n="EEXIT";super(r?r.message:`${n}: ${t}`);c(this,"code");c(this,"error");c(this,"ux");this.error=r,this.ux={exit:t},this.code=n}};import pt from"chalk";import*as Kt from"color";var Yt=["white","black","blue","yellow","green","red","magenta","cyan","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","bold","underline","dim","italic","strikethrough"];function Dt(s){return Yt.includes(s)}function Jt(s,e){return Dt(s)?pt[s](e):s?pt.hex(s)(e):e}var zt=y("hyperlinker"),I=class{static get action(){return b.action}static annotation(e,t){y("supports-hyperlinks").stdout?this.log(`\x1B]1337;AddAnnotation=${e.length}|${t}\x07${e}`):this.log(e)}static get anykey(){return ct}static get confirm(){return at}static debug(e,...t){["debug","trace"].includes(this.config.outputLevel)&&this.info(M(e,...t)+`
15
- `)}static async done(){b.action.stop()}static async flush(e=1e4){await st(e)}static info(e,...t){C.stdout(M(e,...t)+`
16
- `)}static log(e,...t){this.info(e||"",...t)}static logToStderr(e,...t){C.stderr(M(e,...t)+`
17
- `)}static get progress(){return R}static get prompt(){return Y}static styledHeader(e){this.info(z.dim("=== ")+z.bold(e)+`
18
- `)}static styledJSON(e){let t=JSON.stringify(e,null,2);if(!z.level){this.info(t);return}let r=y("cardinal"),n=y("cardinal/themes/jq");this.info(r.highlight(t,{json:!0,theme:n}))}static styledObject(e,t){this.info(F(e,t))}static get table(){return B.table}static trace(e,...t){this.config.outputLevel==="trace"&&this.info(M(e,...t)+`
19
- `)}static get tree(){return j}static url(e,t,r={}){this.log(this.hyperlink(e,t,r))}static hyperlink(e,t,r={}){return y("supports-hyperlinks").stdout?zt(e,t,r):t}static get wait(){return dt}};c(I,"config",b);var{action:Tr,annotation:_r,anykey:Cr,confirm:Sr,debug:Or,done:Pr,flush:Br,hyperlink:Ir,info:Ar,log:Er,logToStderr:Lr,progress:Fr,prompt:Rr,styledHeader:qr,styledJSON:jr,styledObject:Mr,table:Wr,trace:$r,tree:Nr,url:Hr,wait:Kr}=I,{error:Yr,exit:Dr,warn:Jr}=Vt;var ft=async()=>{try{await I.done()}catch(s){console.error(s),process.exitCode=1}},Ut=process.listeners("exit").find(s=>s.name===ft.name);Ut||process.once("exit",ft);export{k as ActionBase,L as Config,V as ExitError,B as Table,Tr as action,_r as annotation,Cr as anykey,Jt as colorize,b as config,Sr as confirm,Or as debug,Pr as done,Yr as error,Dr as exit,Br as flush,Ir as hyperlink,Ar as info,Er as log,Lr as logToStderr,Fr as progress,Rr as prompt,qr as styledHeader,jr as styledJSON,Mr as styledObject,Wr as table,$r as trace,Nr as tree,Hr as url,I as ux,Kr as wait,Jr as warn,C as write};
11
+ `)||n.includes("\r")||n.includes(","));return t.map(n=>r?`"${n.replaceAll('"','""')}"`:n)}outputCSV(){let{columns:e,data:t,options:r}=this;r["no-header"]||r.printLine(e.map(n=>n.header).join(","));for(let n of t){let o=this.getCSVRow(n);r.printLine(o.join(","))}}outputJSON(){this.options.printLine(JSON.stringify(this.resolveColumnsToObjectArray(),void 0,2))}outputTable(){let{data:e,options:t}=this,r=this.columns.map(i=>{let a=Math.max(k(".".padEnd(i.minWidth-1)),k(i.header),Ht(e,i.key))+1;return{...i,maxWidth:a,width:a}}),n=et-2;if((()=>{if(t["no-truncate"]||!process.stdout.isTTY&&!process.env.CLI_UX_SKIP_TTY_CHECK||q(r,l=>l.width)-n<=0)return;for(let l of r)l.width=l.minWidth;let u=q(r,l=>l.minWidth);if(u>=n)return;let d=n-u,b=r.map(l=>({key:l.key,needs:l.maxWidth-l.width})).sort((l,p)=>l.needs-p.needs);for(let{key:l,needs:p}of b){if(!p)continue;let g=r.find(T=>l===T.key);g&&(d>p?(g.width=g.width+p,d-=p):d&&(g.width=g.width+d,d=0))}})(),t.title&&(t.printLine(t.title),t.printLine("".padEnd(r.reduce((i,a)=>i+a.width,1),"=")),t.rowStart="| "),!t["no-header"]){let i=t.rowStart;for(let u of r){let d=u.header;i+=d.padEnd(u.width)}t.printLine(dt.bold(i));let a=t.rowStart;for(let u of r){let d="".padEnd(u.width-1,"\u2500")+" ";a+=d.padEnd(u.width)}t.printLine(dt.bold(a))}for(let i of e){let a=1;for(let d of r){let l=i[d.key].split(`
12
+ `).length;l>a&&(a=l)}let u=[...new Array(a).keys()];for(let d of u){let b=t.rowStart;for(let l of r){let p=l.width,g=i[l.key];g=g.split(`
13
+ `)[d]||"";let T=k(g),E=g.length-T,h=g.padEnd(p+E);(h.length-E>p||T===p)&&(h=qt(h,0,p-2)+"\u2026 ",h+=" ".repeat(p-k(h))),b+=h}t.printLine(b)}}}outputYAML(){this.options.printLine(Mt(this.resolveColumnsToObjectArray()))}resolveColumnsToObjectArray(){let{columns:e,data:t}=this;return t.map(r=>Object.fromEntries(e.map(n=>[n.key,r[n.key]??""])))}};function R(s,e,t={}){new J(s,e,t).display()}(t=>{t.Flags={columns:v.string({description:"only show provided columns (comma-separated)",exclusive:["extended"]}),csv:v.boolean({description:"output is csv format [alias: --output=csv]",exclusive:["no-truncate"]}),extended:v.boolean({char:"x",description:"show extra columns",exclusive:["columns"]}),filter:v.string({description:"filter property by partial string matching, ex: name=foo"}),"no-header":v.boolean({description:"hide table header from output",exclusive:["csv"]}),"no-truncate":v.boolean({description:"do not truncate output to fit screen",exclusive:["csv"]}),output:v.string({description:"output in a more machine friendly format",exclusive:["no-truncate","csv"],options:["csv","json","yaml"]}),sort:v.string({description:"property to sort by (prepend '-' for descending)"})};function e(r){if(r){let n={},o=(r.only&&typeof r.only=="string"?[r.only]:r.only)||Object.keys(t.Flags),i=(r.except&&typeof r.except=="string"?[r.except]:r.except)||[];for(let a of o)i.includes(a)||(n[a]=t.Flags[a]);return n}return t.Flags}t.flags=e})(R||(R={}));var Ht=(s,e)=>s.reduce((t,r)=>{let n=r[e],o=n.split(`
14
+ `);return Math.max(t,o.length>1?Math.max(...o.map(i=>k(i))):k(n))},0);import Nt from"object-treeify";var V=class s{constructor(){c(this,"nodes",{})}display(e=console.log){let t=function(n){let o={};for(let i of Object.keys(n))o[i]=t(n[i].nodes);return o},r=t(this.nodes);e(Nt(r))}insert(e,t=new s){return this.nodes[e]=t,this}search(e){for(let t of Object.keys(this.nodes)){if(t===e)return this.nodes[t];let r=this.nodes[t].search(e);if(r)return r}}};function j(){return new V}var pt=async(s=1e3)=>new Promise(e=>{setTimeout(e,s)});import{Errors as zt}from"@oclif/core";import Ut from"hyperlinker";import mt from"supports-hyperlinks";var z=class extends Error{constructor(t,r){let n="EEXIT";super(r?r.message:`${n}: ${t}`);c(this,"code");c(this,"error");c(this,"ux");this.error=r,this.ux={exit:t},this.code=n}};import ft from"chalk";import*as Yt from"color";var Dt=["white","black","blue","yellow","green","red","magenta","cyan","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","bold","underline","dim","italic","strikethrough"];function Jt(s){return Dt.includes(s)}function Vt(s,e){return Jt(s)?ft[s](e):s?ft.hex(s)(e):e}var Zt=W("cardinal"),Gt=W("cardinal/themes/jq"),I=class{static get action(){return y.action}static annotation(e,t){mt.stdout?this.log(`\x1B]1337;AddAnnotation=${e.length}|${t}\x07${e}`):this.log(e)}static get anykey(){return ut}static get confirm(){return ct}static debug(e,...t){["debug","trace"].includes(this.config.outputLevel)&&this.info(M(e,...t)+`
15
+ `)}static async done(){y.action.stop()}static async flush(e=1e4){await nt(e)}static info(e,...t){S.stdout(M(e,...t)+`
16
+ `)}static log(e,...t){this.info(e||"",...t)}static logToStderr(e,...t){S.stderr(M(e,...t)+`
17
+ `)}static get progress(){return F}static get prompt(){return D}static styledHeader(e){this.info(U.dim("=== ")+U.bold(e)+`
18
+ `)}static styledJSON(e){let t=JSON.stringify(e,null,2);if(!U.level){this.info(t);return}this.info(Zt.highlight(t,{json:!0,theme:Gt}))}static styledObject(e,t){this.info(L(e,t))}static get table(){return B.table}static trace(e,...t){this.config.outputLevel==="trace"&&this.info(M(e,...t)+`
19
+ `)}static get tree(){return j}static url(e,t,r={}){this.log(this.hyperlink(e,t,r))}static hyperlink(e,t,r={}){return mt.stdout?Ut(e,t,r):t}static get wait(){return pt}};c(I,"config",y);var{action:Er,annotation:Ar,anykey:Lr,confirm:Fr,debug:Rr,done:jr,flush:Mr,hyperlink:Wr,info:$r,log:qr,logToStderr:Hr,progress:Nr,prompt:Kr,styledHeader:Yr,styledJSON:Dr,styledObject:Jr,table:Vr,trace:zr,tree:Ur,url:Zr,wait:Gr}=I,{error:Xr,exit:Qr,warn:ts}=zt;var gt=async()=>{try{await I.done()}catch(s){console.error(s),process.exitCode=1}},Xt=process.listeners("exit").find(s=>s.name===gt.name);Xt||process.once("exit",gt);export{x as ActionBase,A as Config,z as ExitError,B as Table,Er as action,Ar as annotation,Lr as anykey,Vt as colorize,y as config,Fr as confirm,Rr as debug,jr as done,Xr as error,Qr as exit,Mr as flush,Wr as hyperlink,$r as info,qr as log,Hr as logToStderr,Nr as progress,Kr as prompt,Yr as styledHeader,Dr as styledJSON,Jr as styledObject,Vr as table,zr as trace,Ur as tree,Zr as url,I as ux,Gr as wait,ts as warn,S as write};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/cli-ux",
3
- "version": "1.1.0",
3
+ "version": "2.0.0-beta.10",
4
4
  "author": "Pierluigi Viti <pierluigi@commercelayer.io>",
5
5
  "license": "MIT",
6
6
  "description": "Commerce Layer Javascript CLI ux lib",
@@ -8,9 +8,16 @@
8
8
  "types": "lib/index.d.ts",
9
9
  "module": "lib/index.mjs",
10
10
  "exports": {
11
- "types": "./lib/index.d.ts",
12
- "require": "./lib/index.js",
13
- "import": "./lib/index.mjs"
11
+ ".": {
12
+ "import": {
13
+ "types": "./lib/index.d.mts",
14
+ "default": "./lib/index.mjs"
15
+ },
16
+ "require": {
17
+ "types": "./lib/index.d.ts",
18
+ "default": "./lib/index.js"
19
+ }
20
+ }
14
21
  },
15
22
  "scripts": {
16
23
  "lint": "eslint ./src --ext .ts",
@@ -20,7 +27,8 @@
20
27
  "start": "tsx src/index.ts",
21
28
  "test": "jest --passWithNoTests",
22
29
  "test-local": "tsx test/spot.ts",
23
- "coverage": "jest --coverage"
30
+ "coverage": "jest --coverage",
31
+ "release": "pnpm upgrade && pnpm lint && pnpm build"
24
32
  },
25
33
  "keywords": [
26
34
  "ecommerce",
@@ -35,48 +43,46 @@
35
43
  "devDependencies": {
36
44
  "@babel/preset-env": "^7.29.2",
37
45
  "@babel/preset-typescript": "^7.28.5",
38
- "@commercelayer/eslint-config-ts": "^1.4.5",
39
- "@oclif/core": "^3.27.0",
46
+ "@commercelayer/eslint-config-ts": "^2.6.0",
47
+ "@oclif/core": "^4.9.0",
40
48
  "@semantic-release/changelog": "^6.0.3",
41
49
  "@semantic-release/git": "^10.0.1",
42
50
  "@types/cli-progress": "^3.11.6",
43
- "@types/color": "^3.0.7",
44
- "@types/jest": "^29.5.14",
45
- "@types/js-yaml": "^3.12.10",
46
- "@types/node": "^22.19.15",
47
- "@types/slice-ansi": "^4.0.0",
48
- "@types/supports-color": "^8.1.3",
51
+ "@types/color": "^4.2.1",
52
+ "@types/jest": "^30.0.0",
53
+ "@types/js-yaml": "^4.0.9",
54
+ "@types/node": "^25.5.0",
49
55
  "@types/wordwrap": "^1.0.3",
50
56
  "@typescript-eslint/eslint-plugin": "^7.18.0",
51
57
  "eslint": "^8.57.1",
52
- "jest": "^29.7.0",
58
+ "jest": "^30.3.0",
53
59
  "oclif": "^4.22.92",
54
- "semantic-release": "^24.2.9",
60
+ "semantic-release": "^25.0.3",
55
61
  "tsup": "^8.5.1",
56
62
  "tsx": "^4.21.0",
57
63
  "typescript": "^5.9.3"
58
64
  },
59
65
  "dependencies": {
60
- "ansi-escapes": "^4.3.2",
61
- "ansi-styles": "^4.3.0",
66
+ "ansi-escapes": "^7.3.0",
67
+ "ansi-styles": "^6.2.3",
62
68
  "cardinal": "^2.1.1",
63
- "chalk": "^4.1.2",
69
+ "chalk": "^5.6.2",
64
70
  "cli-progress": "^3.12.0",
65
- "color": "^4.2.3",
71
+ "color": "^5.0.3",
66
72
  "hyperlinker": "^1.0.0",
67
- "js-yaml": "^3.14.2",
68
- "natural-orderby": "^2.0.3",
69
- "object-treeify": "^1.1.33",
73
+ "js-yaml": "^4.1.1",
74
+ "natural-orderby": "^5.0.0",
75
+ "object-treeify": "^5.0.1",
70
76
  "password-prompt": "^1.1.3",
71
- "slice-ansi": "^4.0.0",
72
- "string-width": "^4.2.3",
73
- "strip-ansi": "^6.0.1",
74
- "supports-color": "^8.1.1",
75
- "supports-hyperlinks": "^2.3.0",
77
+ "slice-ansi": "^8.0.0",
78
+ "string-width": "^8.2.0",
79
+ "strip-ansi": "^7.2.0",
80
+ "supports-color": "^10.2.2",
81
+ "supports-hyperlinks": "^4.4.0",
76
82
  "wordwrap": "^1.0.0"
77
83
  },
78
84
  "peerDependencies": {
79
- "@oclif/core": "3.27.0"
85
+ "@oclif/core": "^4.9.0"
80
86
  },
81
87
  "repository": "github:commercelayer/commercelayer-cli-ux",
82
88
  "publishConfig": {