@capgo/cli 7.84.0 → 7.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/dist/src/sdk.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycl
|
|
|
24
24
|
`),this.outputHelp({error:!0});let X=D||{},J=X.exitCode||1,Y=X.code||"commander.error";this._exit(J,Y,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in B$.env){let D=$.attributeName();if(this.getOptionValue(D)===void 0||["default","config","env"].includes(this.getOptionValueSource(D)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,B$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new St(this.options),D=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&D(X.attributeName())&&$.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((J)=>!D(J)).forEach((J)=>{this.setOptionValueWithSource(J,X.implied[J],"implied")})})}missingArgument($){let D=`error: missing required argument '${$}'`;this.error(D,{code:"commander.missingArgument"})}optionMissingArgument($){let D=`error: option '${$.flags}' argument missing`;this.error(D,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let D=`error: required option '${$.flags}' not specified`;this.error(D,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,D){let X=(Q)=>{let G=Q.attributeName(),W=this.getOptionValue(G),B=this.options.find((U)=>U.negate&&G===U.attributeName()),H=this.options.find((U)=>!U.negate&&G===U.attributeName());if(B&&(B.presetArg===void 0&&W===!1||B.presetArg!==void 0&&W===B.presetArg))return B;return H||Q},J=(Q)=>{let G=X(Q),W=G.attributeName();if(this.getOptionValueSource(W)==="env")return`environment variable '${G.envVar}'`;return`option '${G.flags}'`},Y=`error: ${J($)} cannot be used with ${J(D)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let D="";if($.startsWith("--")&&this._showSuggestionAfterError){let J=[],Y=this;do{let Q=Y.createHelp().visibleOptions(Y).filter((G)=>G.long).map((G)=>G.long);J=J.concat(Q),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);D=wE($,J)}let X=`error: unknown option '${$}'${D}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let D=this.registeredArguments.length,X=D===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${D} argument${X} but got ${$.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],D="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(J.push(Y.name()),Y.alias())J.push(Y.alias())}),D=wE($,J)}let X=`error: unknown command '${$}'${D}`;this.error(X,{code:"commander.unknownCommand"})}version($,D,X){if($===void 0)return this._version;this._version=$,D=D||"-V, --version",X=X||"output the version number";let J=this.createOption(D,X);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${$}
|
|
25
25
|
`),this._exit(0,"commander.version",$)}),this}description($,D){if($===void 0&&D===void 0)return this._description;if(this._description=$,D)this._argsDescription=D;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let D=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)D=this.commands[this.commands.length-1];if($===D._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand($);if(X){let J=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${J}'`)}return D._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((D)=>this.alias(D)),this}usage($){if($===void 0){if(this._usage)return this._usage;let D=this.registeredArguments.map((X)=>{return jt(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?D:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=l6.basename($,l6.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let D=this.createHelp(),X=this._getOutputContext($);D.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let J=D.formatHelp(this,D);if(X.hasColors)return J;return this._outputConfiguration.stripColor(J)}_getOutputContext($){$=$||{};let D=!!$.error,X,J,Y;if(D)X=(G)=>this._outputConfiguration.writeErr(G),J=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else X=(G)=>this._outputConfiguration.writeOut(G),J=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:D,write:(G)=>{if(!J)G=this._outputConfiguration.stripColor(G);return X(G)},hasColors:J,helpWidth:Y}}outputHelp($){let D;if(typeof $==="function")D=$,$=void 0;let X=this._getOutputContext($),J={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",J)),this.emit("beforeHelp",J);let Y=this.helpInformation({error:X.error});if(D){if(Y=D(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",J),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",J))}helpOption($,D){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",D??"display help for command"),$||D)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let D=Number(B$.exitCode??0);if(D===0&&$&&typeof $!=="function"&&$.error)D=1;this._exit(D,"commander.help","(outputHelp)")}addHelpText($,D){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${X.join("', '")}'`);let J=`${$}Help`;return this.on(J,(Y)=>{let Q;if(typeof D==="function")Q=D({error:Y.error,command:Y.command});else Q=D;if(Q)Y.write(`${Q}
|
|
27
|
-
`)}),this}_outputHelpIfRequested($){let D=this._getHelpOption();if(D&&$.find((J)=>D.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function NE($){return $.map((D)=>{if(!D.startsWith("--inspect"))return D;let X,J="127.0.0.1",Y="9229",Q;if((Q=D.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))Y=Q[3];else J=Q[3];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],Y=Q[4];if(X&&Y!=="0")return`${X}=${J}:${parseInt(Y)+1}`;return D})}function zK(){if(B$.env.NO_COLOR||B$.env.FORCE_COLOR==="0"||B$.env.FORCE_COLOR==="false")return!1;if(B$.env.FORCE_COLOR||B$.env.CLICOLOR_FORCE!==void 0)return!0;return}Pt.Command=wK;Pt.useColor=zK});var AE=I((kt)=>{var{Argument:LE}=vQ(),{Command:NK}=OE(),{CommanderError:_t,InvalidArgumentError:ZE}=k7(),{Help:xt}=FK(),{Option:ME}=KK();kt.program=new NK;kt.createCommand=($)=>new NK($);kt.createOption=($,D)=>new ME($,D);kt.createArgument=($,D)=>new LE($,D);kt.Command=NK;kt.Option=ME;kt.Argument=LE;kt.Help=xt;kt.CommanderError=_t;kt.InvalidArgumentError=ZE;kt.InvalidOptionArgumentError=ZE});var _1;var T8=l(()=>{_1={name:"@capgo/cli",type:"module",version:"7.84.
|
|
27
|
+
`)}),this}_outputHelpIfRequested($){let D=this._getHelpOption();if(D&&$.find((J)=>D.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function NE($){return $.map((D)=>{if(!D.startsWith("--inspect"))return D;let X,J="127.0.0.1",Y="9229",Q;if((Q=D.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))Y=Q[3];else J=Q[3];else if((Q=D.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],Y=Q[4];if(X&&Y!=="0")return`${X}=${J}:${parseInt(Y)+1}`;return D})}function zK(){if(B$.env.NO_COLOR||B$.env.FORCE_COLOR==="0"||B$.env.FORCE_COLOR==="false")return!1;if(B$.env.FORCE_COLOR||B$.env.CLICOLOR_FORCE!==void 0)return!0;return}Pt.Command=wK;Pt.useColor=zK});var AE=I((kt)=>{var{Argument:LE}=vQ(),{Command:NK}=OE(),{CommanderError:_t,InvalidArgumentError:ZE}=k7(),{Help:xt}=FK(),{Option:ME}=KK();kt.program=new NK;kt.createCommand=($)=>new NK($);kt.createOption=($,D)=>new ME($,D);kt.createArgument=($,D)=>new LE($,D);kt.Command=NK;kt.Option=ME;kt.Argument=LE;kt.Help=xt;kt.CommanderError=_t;kt.InvalidArgumentError=ZE;kt.InvalidOptionArgumentError=ZE});var _1;var T8=l(()=>{_1={name:"@capgo/cli",type:"module",version:"7.84.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});var LK=I(($I0,OK)=>{var kQ=process||{},EE=kQ.argv||[],xQ=kQ.env||{},pt=!(!!xQ.NO_COLOR||EE.includes("--no-color"))&&(!!xQ.FORCE_COLOR||EE.includes("--color")||kQ.platform==="win32"||(kQ.stdout||{}).isTTY&&xQ.TERM!=="dumb"||!!xQ.CI),rt=($,D,X=$)=>(J)=>{let Y=""+J,Q=Y.indexOf(D,$.length);return~Q?$+at(Y,D,X,Q)+D:$+Y+D},at=($,D,X,J)=>{let Y="",Q=0;do Y+=$.substring(Q,J)+X,Q=J+D.length,J=$.indexOf(D,Q);while(~J);return Y+$.substring(Q)},jE=($=pt)=>{let D=$?rt:()=>String;return{isColorSupported:$,reset:D("\x1B[0m","\x1B[0m"),bold:D("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:D("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:D("\x1B[3m","\x1B[23m"),underline:D("\x1B[4m","\x1B[24m"),inverse:D("\x1B[7m","\x1B[27m"),hidden:D("\x1B[8m","\x1B[28m"),strikethrough:D("\x1B[9m","\x1B[29m"),black:D("\x1B[30m","\x1B[39m"),red:D("\x1B[31m","\x1B[39m"),green:D("\x1B[32m","\x1B[39m"),yellow:D("\x1B[33m","\x1B[39m"),blue:D("\x1B[34m","\x1B[39m"),magenta:D("\x1B[35m","\x1B[39m"),cyan:D("\x1B[36m","\x1B[39m"),white:D("\x1B[37m","\x1B[39m"),gray:D("\x1B[90m","\x1B[39m"),bgBlack:D("\x1B[40m","\x1B[49m"),bgRed:D("\x1B[41m","\x1B[49m"),bgGreen:D("\x1B[42m","\x1B[49m"),bgYellow:D("\x1B[43m","\x1B[49m"),bgBlue:D("\x1B[44m","\x1B[49m"),bgMagenta:D("\x1B[45m","\x1B[49m"),bgCyan:D("\x1B[46m","\x1B[49m"),bgWhite:D("\x1B[47m","\x1B[49m"),blackBright:D("\x1B[90m","\x1B[39m"),redBright:D("\x1B[91m","\x1B[39m"),greenBright:D("\x1B[92m","\x1B[39m"),yellowBright:D("\x1B[93m","\x1B[39m"),blueBright:D("\x1B[94m","\x1B[39m"),magentaBright:D("\x1B[95m","\x1B[39m"),cyanBright:D("\x1B[96m","\x1B[39m"),whiteBright:D("\x1B[97m","\x1B[39m"),bgBlackBright:D("\x1B[100m","\x1B[49m"),bgRedBright:D("\x1B[101m","\x1B[49m"),bgGreenBright:D("\x1B[102m","\x1B[49m"),bgYellowBright:D("\x1B[103m","\x1B[49m"),bgBlueBright:D("\x1B[104m","\x1B[49m"),bgMagentaBright:D("\x1B[105m","\x1B[49m"),bgCyanBright:D("\x1B[106m","\x1B[49m"),bgWhiteBright:D("\x1B[107m","\x1B[49m")}};OK.exports=jE();OK.exports.createColors=jE});var MK=I((DI0,TE)=>{var ZK={to($,D){if(!D)return`\x1B[${$+1}G`;return`\x1B[${D+1};${$+1}H`},move($,D){let X="";if($<0)X+=`\x1B[${-$}D`;else if($>0)X+=`\x1B[${$}C`;if(D<0)X+=`\x1B[${-D}A`;else if(D>0)X+=`\x1B[${D}B`;return X},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},ot={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},tt={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let D="";for(let X=0;X<$;X++)D+=this.line+(X<$-1?ZK.up():"");if($)D+=ZK.left;return D}};TE.exports={cursor:ZK,scroll:ot,erase:tt,beep:"\x07"}});import{stdout as IK,stdin as CE}from"node:process";import*as R4 from"node:readline";import st from"node:readline";import{ReadStream as IE}from"node:tty";function c9($,D,X){if(!X.some((G)=>!G.disabled))return $;let J=$+D,Y=Math.max(X.length-1,0),Q=J<0?Y:J>Y?0:J;return X[Q].disabled?c9(Q,D<0?-1:1,X):Q}function jK($,D,X){return String($).normalize().replaceAll(`\r
|
|
28
28
|
`,`
|
|
29
29
|
`).split(`
|
|
30
30
|
`).map((J)=>Us(J,D,X)).join(`
|
package/dist/package.json
CHANGED
package/dist/src/sdk.js
CHANGED
|
@@ -127,7 +127,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
127
127
|
`)}),$.__defineSetter__("stack",function(X){return[X].concat($.stack).join(`
|
|
128
128
|
|
|
129
129
|
`)}),$}});var Fx=T((gyD,Qx)=>{var c6=i("constants"),tYD=process.cwd,ZY=null,sYD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!ZY)ZY=tYD.call(process);return ZY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(GY=process.chdir,process.chdir=function(D){ZY=null,GY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,GY)}var GY;Qx.exports=eYD;function eYD(D){if(c6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)X(D);if(D.chown=Q(D.chown),D.fchown=Q(D.fchown),D.lchown=Q(D.lchown),D.chmod=Y(D.chmod),D.fchmod=Y(D.fchmod),D.lchmod=Y(D.lchmod),D.chownSync=F(D.chownSync),D.fchownSync=F(D.fchownSync),D.lchownSync=F(D.lchownSync),D.chmodSync=J(D.chmodSync),D.fchmodSync=J(D.fchmodSync),D.lchmodSync=J(D.lchmodSync),D.stat=w(D.stat),D.fstat=w(D.fstat),D.lstat=w(D.lstat),D.statSync=Z(D.statSync),D.fstatSync=Z(D.fstatSync),D.lstatSync=Z(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(U,O,z){if(z)process.nextTick(z)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(U,O,z,q){if(q)process.nextTick(q)},D.lchownSync=function(){};if(sYD==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(U){function O(z,q,B){var K=Date.now(),L=0;U(z,q,function M(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-K<60000){if(setTimeout(function(){D.stat(q,function(W,N){if(W&&W.code==="ENOENT")U(z,q,M);else B(I)})},L),L<100)L+=10;return}if(B)B(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(O,U);return O}(D.rename);D.read=typeof D.read!=="function"?D.read:function(U){function O(z,q,B,K,L,M){var I;if(M&&typeof M==="function"){var W=0;I=function(N,V,R){if(N&&N.code==="EAGAIN"&&W<10)return W++,U.call(D,z,q,B,K,L,I);M.apply(this,arguments)}}return U.call(D,z,q,B,K,L,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(O,U);return O}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(U){return function(O,z,q,B,K){var L=0;while(!0)try{return U.call(D,O,z,q,B,K)}catch(M){if(M.code==="EAGAIN"&&L<10){L++;continue}throw M}}}(D.readSync);function $(U){U.lchmod=function(O,z,q){U.open(O,c6.O_WRONLY|c6.O_SYMLINK,z,function(B,K){if(B){if(q)q(B);return}U.fchmod(K,z,function(L){U.close(K,function(M){if(q)q(L||M)})})})},U.lchmodSync=function(O,z){var q=U.openSync(O,c6.O_WRONLY|c6.O_SYMLINK,z),B=!0,K;try{K=U.fchmodSync(q,z),B=!1}finally{if(B)try{U.closeSync(q)}catch(L){}else U.closeSync(q)}return K}}function X(U){if(c6.hasOwnProperty("O_SYMLINK")&&U.futimes)U.lutimes=function(O,z,q,B){U.open(O,c6.O_SYMLINK,function(K,L){if(K){if(B)B(K);return}U.futimes(L,z,q,function(M){U.close(L,function(I){if(B)B(M||I)})})})},U.lutimesSync=function(O,z,q){var B=U.openSync(O,c6.O_SYMLINK),K,L=!0;try{K=U.futimesSync(B,z,q),L=!1}finally{if(L)try{U.closeSync(B)}catch(M){}else U.closeSync(B)}return K};else if(U.futimes)U.lutimes=function(O,z,q,B){if(B)process.nextTick(B)},U.lutimesSync=function(){}}function Y(U){if(!U)return U;return function(O,z,q){return U.call(D,O,z,function(B){if(G(B))B=null;if(q)q.apply(this,arguments)})}}function J(U){if(!U)return U;return function(O,z){try{return U.call(D,O,z)}catch(q){if(!G(q))throw q}}}function Q(U){if(!U)return U;return function(O,z,q,B){return U.call(D,O,z,q,function(K){if(G(K))K=null;if(B)B.apply(this,arguments)})}}function F(U){if(!U)return U;return function(O,z,q){try{return U.call(D,O,z,q)}catch(B){if(!G(B))throw B}}}function w(U){if(!U)return U;return function(O,z,q){if(typeof z==="function")q=z,z=null;function B(K,L){if(L){if(L.uid<0)L.uid+=4294967296;if(L.gid<0)L.gid+=4294967296}if(q)q.apply(this,arguments)}return z?U.call(D,O,z,B):U.call(D,O,B)}}function Z(U){if(!U)return U;return function(O,z){var q=z?U.call(D,O,z):U.call(D,O);if(q){if(q.uid<0)q.uid+=4294967296;if(q.gid<0)q.gid+=4294967296}return q}}function G(U){if(!U)return!0;if(U.code==="ENOSYS")return!0;var O=!process.getuid||process.getuid()!==0;if(O){if(U.code==="EINVAL"||U.code==="EPERM")return!0}return!1}}});var Gx=T((myD,Zx)=>{var wx=i("stream").Stream;Zx.exports=DQD;function DQD(D){return{ReadStream:$,WriteStream:X};function $(Y,J){if(!(this instanceof $))return new $(Y,J);wx.call(this);var Q=this;this.path=Y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var F=Object.keys(J);for(var w=0,Z=F.length;w<Z;w++){var G=F[w];this[G]=J[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Q._read()});return}D.open(this.path,this.flags,this.mode,function(U,O){if(U){Q.emit("error",U),Q.readable=!1;return}Q.fd=O,Q.emit("open",O),Q._read()})}function X(Y,J){if(!(this instanceof X))return new X(Y,J);wx.call(this),this.path=Y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var Q=Object.keys(J);for(var F=0,w=Q.length;F<w;F++){var Z=Q[F];this[Z]=J[Z]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var Ox=T((dyD,Ux)=>{Ux.exports=XQD;var $QD=Object.getPrototypeOf||function(D){return D.__proto__};function XQD(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:$QD(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var S0=T((cyD,BO)=>{var M0=i("fs"),JQD=Fx(),YQD=Gx(),QQD=Ox(),UY=i("util"),o0,qY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")o0=Symbol.for("graceful-fs.queue"),qY=Symbol.for("graceful-fs.previous");else o0="___graceful-fs.queue",qY="___graceful-fs.previous";function FQD(){}function zx(D,$){Object.defineProperty(D,o0,{get:function(){return $}})}var $8=FQD;if(UY.debuglog)$8=UY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))$8=function(){var D=UY.format.apply(UY,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
130
|
-
GFS4: `),console.error(D)};if(!M0[o0]){if(OO=global[o0]||[],zx(M0,OO),M0.close=function(D){function $(X,Y){return D.call(M0,X,function(J){if(!J)qx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,qY,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),qx()}return Object.defineProperty($,qY,{value:D}),$}(M0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(M0[o0]),i("assert").equal(M0[o0].length,0)})}var OO;if(!global[o0])zx(global,M0[o0]);BO.exports=qO(QQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)BO.exports=qO(M0),M0.__patched=!0;function qO(D){JQD(D),D.gracefulify=qO,D.createReadStream=V,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,v,S){if(typeof v==="function")S=v,v=null;return h(_,v,S);function h(b,l,f,j){return $(b,l,function(P){if(P&&(P.code==="EMFILE"||P.code==="ENFILE"))v9([h,[b,l,f],P,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var Y=D.writeFile;D.writeFile=J;function J(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var w=D.copyFile;if(w)D.copyFile=Z;function Z(_,v,S,h){if(typeof S==="function")h=S,S=0;return b(_,v,S,h);function b(l,f,j,P,u){return w(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var G=D.readdir;D.readdir=O;var U=/^v[0-5]\./;function O(_,v,S){if(typeof v==="function")S=v,v=null;var h=U.test(process.version)?function(f,j,P,u){return G(f,b(f,j,P,u))}:function(f,j,P,u){return G(f,j,b(f,j,P,u))};return h(_,v,S);function b(l,f,j,P){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))v9([h,[l,f,j],u,P||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,u,y)}}}}if(process.version.substr(0,4)==="v0.8"){var z=YQD(D);M=z.ReadStream,W=z.WriteStream}var q=D.ReadStream;if(q)M.prototype=Object.create(q.prototype),M.prototype.open=I;var B=D.WriteStream;if(B)W.prototype=Object.create(B.prototype),W.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var K=M;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var L=W;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});function M(_,v){if(this instanceof M)return q.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v){if(_.autoClose)_.destroy();_.emit("error",v)}else _.fd=S,_.emit("open",S),_.read()})}function W(_,v){if(this instanceof W)return B.apply(this,arguments),this;else return W.apply(Object.create(W.prototype),arguments)}function N(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v)_.destroy(),_.emit("error",v);else _.fd=S,_.emit("open",S)})}function V(_,v){return new D.ReadStream(_,v)}function R(_,v){return new D.WriteStream(_,v)}var x=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return x(l,f,j,function(y,d){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}return D}function v9(D){$8("ENQUEUE",D[0].name,D[1]),M0[o0].push(D),zO()}var OY;function qx(){var D=Date.now();for(var $=0;$<M0[o0].length;++$)if(M0[o0][$].length>2)M0[o0][$][3]=D,M0[o0][$][4]=D;zO()}function zO(){if(clearTimeout(OY),OY=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var w=Date.now()-Q,Z=Math.max(Q-J,1),G=Math.min(Z*1.2,100);if(w>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([J]));else M0[o0].push(D)}if(OY===void 0)OY=setTimeout(zO,0)}});var Kx=T((lyD,Bx)=>{function e1(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}Bx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,X=F}return $}});var Hx=T((ZQD)=>{var wQD=Kx();ZQD.operation=function(D){var $=ZQD.timeouts(D);return new wQD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};ZQD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};ZQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};ZQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(Z){var G=ZQD.operation($),U=Array.prototype.slice.call(arguments,1),O=U.pop();U.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();O.apply(this,arguments)}),G.attempt(function(){Z.apply(D,U)})}.bind(D,F),D[Q].options=$}}});var Vx=T((iyD,zY)=>{zY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")zY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")zY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var WY=T((pyD,k9)=>{var K0=global.process,X8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!X8(K0))k9.exports=function(){return function(){}};else{if(KO=i("assert"),J8=Vx(),WO=/^win/i.test(K0.platform),_9=i("events"),typeof _9!=="function")_9=_9.EventEmitter;if(K0.__signal_exit_emitter__)g0=K0.__signal_exit_emitter__;else g0=K0.__signal_exit_emitter__=new _9,g0.count=0,g0.emitted={};if(!g0.infinite)g0.setMaxListeners(1/0),g0.infinite=!0;k9.exports=function(D,$){if(!X8(global.process))return function(){};if(KO.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)BY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)Z3()};return g0.on(X,D),Y},Z3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,G3[$])}catch(X){}}),K0.emit=U3,K0.reallyExit=KY,g0.count-=1},k9.exports.unload=Z3,l6=function($,X,Y){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,Y)},G3={},J8.forEach(function(D){G3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===g0.count){if(Z3(),l6("exit",null,D),l6("afterexit",null,D),WO&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),k9.exports.signals=function(){return J8},Y8=!1,BY=function(){if(Y8||!X8(global.process))return;Y8=!0,g0.count+=1,J8=J8.filter(function($){try{return K0.on($,G3[$]),!0}catch(X){return!1}}),K0.emit=VO,K0.reallyExit=HO},k9.exports.load=BY,KY=K0.reallyExit,HO=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),KY.call(K0,K0.exitCode)},U3=K0.emit,VO=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=U3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return U3.apply(this,arguments)}}var KO,J8,WO,_9,g0,Z3,l6,G3,Y8,BY,KY,HO,U3,VO});var Lx=T((BQD,NO)=>{var Nx=Symbol();function qQD(D,$,X){let Y=$[Nx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(Q)=>{if(Q)return X(Q);$.stat(D,(F,w)=>{if(F)return X(F);let Z=w.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,Nx,{value:Z}),X(null,w.mtime,Z)})})}function zQD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}BQD.probe=qQD;BQD.getMtime=zQD});var jx=T((AQD,q3)=>{var HQD=i("path"),IO=S0(),VQD=Hx(),NQD=WY(),Mx=Lx(),F6={};function O3(D,$){return $.lockfilePath||`${D}.lock`}function AO(D,$,X){if(!$.realpath)return X(null,HQD.resolve(D));$.fs.realpath(D,X)}function MO(D,$,X){let Y=O3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return Mx.probe(Y,$.fs,(Q,F,w)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,w)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return MO(D,{...$,stale:0},X);return X(Q)}if(!Ix(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));Ax(D,$,(w)=>{if(w)return X(w);MO(D,{...$,stale:0},X)})})})}function Ix(D,$){return D.mtime.getTime()<Date.now()-$.stale}function Ax(D,$,X){$.fs.rmdir(O3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function HY(D,$){let X=F6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return LO(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,HY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return LO(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let w=Mx.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,w,w,(Z)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||G)return LO(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,HY(D,$)}X.mtime=w,X.lastUpdate=Date.now(),X.updateDelay=null,HY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function LO(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(F6[D]===$)delete F6[D];$.options.onCompromised(X)}function LQD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:IO,onCompromised:(Y)=>{throw Y},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),AO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=VQD.operation($.retries);Q.attempt(()=>{MO(J,$,(F,w,Z)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=F6[J]={lockfilePath:O3(J,$),mtime:w,mtimePrecision:Z,options:$,lastUpdate:Date.now()};HY(J,$),X(null,(U)=>{if(G.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Rx(J,{...$,realpath:!1},U)})})})})}function Rx(D,$,X){$={fs:IO,realpath:!0,...$},AO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=F6[J];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete F6[J],Ax(J,$,X)})}function MQD(D,$,X){$={stale:1e4,realpath:!0,fs:IO,...$},$.stale=Math.max($.stale||0,2000),AO(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(O3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!Ix(F,$))})})}function IQD(){return F6}NQD(()=>{for(let D in F6){let $=F6[D].options;try{$.fs.rmdirSync(O3(D,$))}catch(X){}}});AQD.lock=LQD;AQD.unlock=Rx;AQD.check=MQD;AQD.getLocks=IQD});var Tx=T((ryD,Ex)=>{var CQD=S0();function PQD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(w){return Q(w)}Q(null,F)}}),X}function xQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function SQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function uQD(D){if(D={...D},D.fs=PQD(D.fs||CQD),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}Ex.exports={toPromise:xQD,toSync:SQD,toSyncOptions:uQD}});var Px=T((oyD,n6)=>{var f9=jx(),{toPromise:VY,toSync:NY,toSyncOptions:RO}=Tx();async function Cx(D,$){let X=await VY(f9.lock)(D,$);return VY(X)}function vQD(D,$){let X=NY(f9.lock)(D,RO($));return NY(X)}function _QD(D,$){return VY(f9.unlock)(D,$)}function kQD(D,$){return NY(f9.unlock)(D,RO($))}function fQD(D,$){return VY(f9.check)(D,$)}function yQD(D,$){return NY(f9.check)(D,RO($))}n6.exports=Cx;n6.exports.lock=Cx;n6.exports.unlock=_QD;n6.exports.lockSync=vQD;n6.exports.unlockSync=kQD;n6.exports.check=fQD;n6.exports.checkSync=yQD});var fx=T((_x)=>{Object.defineProperty(_x,"__esModule",{value:!0});_x.canStoreURLs=_x.FileUrlStorage=void 0;var xx=i("fs"),bQD=gQD(Yx()),Sx=hQD(Px());function vx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(vx=function(Y){return Y?X:$})(D)}function hQD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=vx($);if(X&&X.has(D))return X.get(D);var Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}function gQD(D){return D&&D.__esModule?D:{default:D}}function z3(D){return z3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},z3(D)}function mQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function ux(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,cQD(Y.key),Y)}}function dQD(D,$,X){if($)ux(D.prototype,$);if(X)ux(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function cQD(D){var $=lQD(D,"string");return z3($)=="symbol"?$:$+""}function lQD(D,$){if(z3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(z3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var ayD=_x.canStoreURLs=!0,tyD=_x.FileUrlStorage=function(){function D($){mQD(this,D),this.path=$}return dQD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,w){if(F)Q(F);else J(w)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(w,Z){J._setItem(F,Y,function(G){if(G)Z(G);else w(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;Sx.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(w,Z){if(w){J(w);return}Z[X]=Y,Q._writeData(Z,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);return}var F=Object.keys(Q).filter(function(w){return w.startsWith(X)}).map(function(w){var Z=Q[w];return Z.urlStorageKey=w,Z});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;Sx.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,w){if(F){Y(F);return}delete w[X],J._writeData(w,function(Z){return Y(Z)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,bQD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,xx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,xx.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var MY=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return gx.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return iQD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return mx.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return tQD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return mx.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return pQD.enableDebugLog}});i6.isSupported=void 0;var iQD=Q8(RU()),pQD=jU(),rQD=Q8(PT()),jO=Q8(ZC()),oQD=Q8(CC()),aQD=Q8(vC()),gx=Q8(oC()),tQD=Q8(fU()),mx=fx();function Q8(D){return D&&D.__esModule?D:{default:D}}function b9(D){return b9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},b9(D)}function sQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function yx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,cx(Y.key),Y)}}function eQD(D,$,X){if($)yx(D.prototype,$);if(X)yx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function DFD(D,$,X){return $=LY($),$FD(D,dx()?Reflect.construct($,X||[],LY(D).constructor):$.apply(D,X))}function $FD(D,$){if($&&(b9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return XFD(D)}function XFD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function dx(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(dx=function(){return!!D})()}function LY(D){return LY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},LY(D)}function JFD(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)EO(D,$)}function EO(D,$){return EO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},EO(D,$)}function bx(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function y9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?bx(Object(X),!0).forEach(function(Y){YFD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):bx(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function YFD(D,$,X){if($=cx($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function cx(D){var $=QFD(D,"string");return b9($)=="symbol"?$:$+""}function QFD(D,$){if(b9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(b9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var hx=i6.defaultOptions=y9(y9({},jO.default.defaultOptions),{},{httpStack:new gx.default,fileReader:new oQD.default,urlStorage:new rQD.default,fingerprint:aQD.default}),eyD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return sQD(this,$),Y=y9(y9({},hx),Y),DFD(this,$,[X,Y])}return JFD($,D),eQD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=y9(y9({},hx),J),jO.default.terminate(Y,J)}}])}(jO.default),DbD=i6.isSupported=!0});var V$;var B3=o(()=>{V$={name:"@capgo/cli",type:"module",version:"7.84.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});async function IY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function F0(){let D=await IY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==V$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${V$.version} it's not the latest version.
|
|
130
|
+
GFS4: `),console.error(D)};if(!M0[o0]){if(OO=global[o0]||[],zx(M0,OO),M0.close=function(D){function $(X,Y){return D.call(M0,X,function(J){if(!J)qx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,qY,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),qx()}return Object.defineProperty($,qY,{value:D}),$}(M0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(M0[o0]),i("assert").equal(M0[o0].length,0)})}var OO;if(!global[o0])zx(global,M0[o0]);BO.exports=qO(QQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)BO.exports=qO(M0),M0.__patched=!0;function qO(D){JQD(D),D.gracefulify=qO,D.createReadStream=V,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,v,S){if(typeof v==="function")S=v,v=null;return h(_,v,S);function h(b,l,f,j){return $(b,l,function(P){if(P&&(P.code==="EMFILE"||P.code==="ENFILE"))v9([h,[b,l,f],P,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var Y=D.writeFile;D.writeFile=J;function J(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var w=D.copyFile;if(w)D.copyFile=Z;function Z(_,v,S,h){if(typeof S==="function")h=S,S=0;return b(_,v,S,h);function b(l,f,j,P,u){return w(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var G=D.readdir;D.readdir=O;var U=/^v[0-5]\./;function O(_,v,S){if(typeof v==="function")S=v,v=null;var h=U.test(process.version)?function(f,j,P,u){return G(f,b(f,j,P,u))}:function(f,j,P,u){return G(f,j,b(f,j,P,u))};return h(_,v,S);function b(l,f,j,P){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))v9([h,[l,f,j],u,P||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,u,y)}}}}if(process.version.substr(0,4)==="v0.8"){var z=YQD(D);M=z.ReadStream,W=z.WriteStream}var q=D.ReadStream;if(q)M.prototype=Object.create(q.prototype),M.prototype.open=I;var B=D.WriteStream;if(B)W.prototype=Object.create(B.prototype),W.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var K=M;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var L=W;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});function M(_,v){if(this instanceof M)return q.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v){if(_.autoClose)_.destroy();_.emit("error",v)}else _.fd=S,_.emit("open",S),_.read()})}function W(_,v){if(this instanceof W)return B.apply(this,arguments),this;else return W.apply(Object.create(W.prototype),arguments)}function N(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v)_.destroy(),_.emit("error",v);else _.fd=S,_.emit("open",S)})}function V(_,v){return new D.ReadStream(_,v)}function R(_,v){return new D.WriteStream(_,v)}var x=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return x(l,f,j,function(y,d){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}return D}function v9(D){$8("ENQUEUE",D[0].name,D[1]),M0[o0].push(D),zO()}var OY;function qx(){var D=Date.now();for(var $=0;$<M0[o0].length;++$)if(M0[o0][$].length>2)M0[o0][$][3]=D,M0[o0][$][4]=D;zO()}function zO(){if(clearTimeout(OY),OY=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var w=Date.now()-Q,Z=Math.max(Q-J,1),G=Math.min(Z*1.2,100);if(w>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([J]));else M0[o0].push(D)}if(OY===void 0)OY=setTimeout(zO,0)}});var Kx=T((lyD,Bx)=>{function e1(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}Bx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,X=F}return $}});var Hx=T((ZQD)=>{var wQD=Kx();ZQD.operation=function(D){var $=ZQD.timeouts(D);return new wQD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};ZQD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};ZQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};ZQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(Z){var G=ZQD.operation($),U=Array.prototype.slice.call(arguments,1),O=U.pop();U.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();O.apply(this,arguments)}),G.attempt(function(){Z.apply(D,U)})}.bind(D,F),D[Q].options=$}}});var Vx=T((iyD,zY)=>{zY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")zY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")zY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var WY=T((pyD,k9)=>{var K0=global.process,X8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!X8(K0))k9.exports=function(){return function(){}};else{if(KO=i("assert"),J8=Vx(),WO=/^win/i.test(K0.platform),_9=i("events"),typeof _9!=="function")_9=_9.EventEmitter;if(K0.__signal_exit_emitter__)g0=K0.__signal_exit_emitter__;else g0=K0.__signal_exit_emitter__=new _9,g0.count=0,g0.emitted={};if(!g0.infinite)g0.setMaxListeners(1/0),g0.infinite=!0;k9.exports=function(D,$){if(!X8(global.process))return function(){};if(KO.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)BY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)Z3()};return g0.on(X,D),Y},Z3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,G3[$])}catch(X){}}),K0.emit=U3,K0.reallyExit=KY,g0.count-=1},k9.exports.unload=Z3,l6=function($,X,Y){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,Y)},G3={},J8.forEach(function(D){G3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===g0.count){if(Z3(),l6("exit",null,D),l6("afterexit",null,D),WO&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),k9.exports.signals=function(){return J8},Y8=!1,BY=function(){if(Y8||!X8(global.process))return;Y8=!0,g0.count+=1,J8=J8.filter(function($){try{return K0.on($,G3[$]),!0}catch(X){return!1}}),K0.emit=VO,K0.reallyExit=HO},k9.exports.load=BY,KY=K0.reallyExit,HO=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),KY.call(K0,K0.exitCode)},U3=K0.emit,VO=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=U3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return U3.apply(this,arguments)}}var KO,J8,WO,_9,g0,Z3,l6,G3,Y8,BY,KY,HO,U3,VO});var Lx=T((BQD,NO)=>{var Nx=Symbol();function qQD(D,$,X){let Y=$[Nx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(Q)=>{if(Q)return X(Q);$.stat(D,(F,w)=>{if(F)return X(F);let Z=w.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,Nx,{value:Z}),X(null,w.mtime,Z)})})}function zQD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}BQD.probe=qQD;BQD.getMtime=zQD});var jx=T((AQD,q3)=>{var HQD=i("path"),IO=S0(),VQD=Hx(),NQD=WY(),Mx=Lx(),F6={};function O3(D,$){return $.lockfilePath||`${D}.lock`}function AO(D,$,X){if(!$.realpath)return X(null,HQD.resolve(D));$.fs.realpath(D,X)}function MO(D,$,X){let Y=O3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return Mx.probe(Y,$.fs,(Q,F,w)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,w)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return MO(D,{...$,stale:0},X);return X(Q)}if(!Ix(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));Ax(D,$,(w)=>{if(w)return X(w);MO(D,{...$,stale:0},X)})})})}function Ix(D,$){return D.mtime.getTime()<Date.now()-$.stale}function Ax(D,$,X){$.fs.rmdir(O3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function HY(D,$){let X=F6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return LO(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,HY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return LO(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let w=Mx.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,w,w,(Z)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||G)return LO(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,HY(D,$)}X.mtime=w,X.lastUpdate=Date.now(),X.updateDelay=null,HY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function LO(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(F6[D]===$)delete F6[D];$.options.onCompromised(X)}function LQD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:IO,onCompromised:(Y)=>{throw Y},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),AO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=VQD.operation($.retries);Q.attempt(()=>{MO(J,$,(F,w,Z)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=F6[J]={lockfilePath:O3(J,$),mtime:w,mtimePrecision:Z,options:$,lastUpdate:Date.now()};HY(J,$),X(null,(U)=>{if(G.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Rx(J,{...$,realpath:!1},U)})})})})}function Rx(D,$,X){$={fs:IO,realpath:!0,...$},AO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=F6[J];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete F6[J],Ax(J,$,X)})}function MQD(D,$,X){$={stale:1e4,realpath:!0,fs:IO,...$},$.stale=Math.max($.stale||0,2000),AO(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(O3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!Ix(F,$))})})}function IQD(){return F6}NQD(()=>{for(let D in F6){let $=F6[D].options;try{$.fs.rmdirSync(O3(D,$))}catch(X){}}});AQD.lock=LQD;AQD.unlock=Rx;AQD.check=MQD;AQD.getLocks=IQD});var Tx=T((ryD,Ex)=>{var CQD=S0();function PQD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(w){return Q(w)}Q(null,F)}}),X}function xQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function SQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function uQD(D){if(D={...D},D.fs=PQD(D.fs||CQD),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}Ex.exports={toPromise:xQD,toSync:SQD,toSyncOptions:uQD}});var Px=T((oyD,n6)=>{var f9=jx(),{toPromise:VY,toSync:NY,toSyncOptions:RO}=Tx();async function Cx(D,$){let X=await VY(f9.lock)(D,$);return VY(X)}function vQD(D,$){let X=NY(f9.lock)(D,RO($));return NY(X)}function _QD(D,$){return VY(f9.unlock)(D,$)}function kQD(D,$){return NY(f9.unlock)(D,RO($))}function fQD(D,$){return VY(f9.check)(D,$)}function yQD(D,$){return NY(f9.check)(D,RO($))}n6.exports=Cx;n6.exports.lock=Cx;n6.exports.unlock=_QD;n6.exports.lockSync=vQD;n6.exports.unlockSync=kQD;n6.exports.check=fQD;n6.exports.checkSync=yQD});var fx=T((_x)=>{Object.defineProperty(_x,"__esModule",{value:!0});_x.canStoreURLs=_x.FileUrlStorage=void 0;var xx=i("fs"),bQD=gQD(Yx()),Sx=hQD(Px());function vx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(vx=function(Y){return Y?X:$})(D)}function hQD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=vx($);if(X&&X.has(D))return X.get(D);var Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}function gQD(D){return D&&D.__esModule?D:{default:D}}function z3(D){return z3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},z3(D)}function mQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function ux(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,cQD(Y.key),Y)}}function dQD(D,$,X){if($)ux(D.prototype,$);if(X)ux(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function cQD(D){var $=lQD(D,"string");return z3($)=="symbol"?$:$+""}function lQD(D,$){if(z3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(z3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var ayD=_x.canStoreURLs=!0,tyD=_x.FileUrlStorage=function(){function D($){mQD(this,D),this.path=$}return dQD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,w){if(F)Q(F);else J(w)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(w,Z){J._setItem(F,Y,function(G){if(G)Z(G);else w(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;Sx.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(w,Z){if(w){J(w);return}Z[X]=Y,Q._writeData(Z,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);return}var F=Object.keys(Q).filter(function(w){return w.startsWith(X)}).map(function(w){var Z=Q[w];return Z.urlStorageKey=w,Z});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;Sx.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,w){if(F){Y(F);return}delete w[X],J._writeData(w,function(Z){return Y(Z)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,bQD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,xx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,xx.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var MY=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return gx.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return iQD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return mx.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return tQD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return mx.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return pQD.enableDebugLog}});i6.isSupported=void 0;var iQD=Q8(RU()),pQD=jU(),rQD=Q8(PT()),jO=Q8(ZC()),oQD=Q8(CC()),aQD=Q8(vC()),gx=Q8(oC()),tQD=Q8(fU()),mx=fx();function Q8(D){return D&&D.__esModule?D:{default:D}}function b9(D){return b9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},b9(D)}function sQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function yx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,cx(Y.key),Y)}}function eQD(D,$,X){if($)yx(D.prototype,$);if(X)yx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function DFD(D,$,X){return $=LY($),$FD(D,dx()?Reflect.construct($,X||[],LY(D).constructor):$.apply(D,X))}function $FD(D,$){if($&&(b9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return XFD(D)}function XFD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function dx(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(dx=function(){return!!D})()}function LY(D){return LY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},LY(D)}function JFD(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)EO(D,$)}function EO(D,$){return EO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},EO(D,$)}function bx(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function y9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?bx(Object(X),!0).forEach(function(Y){YFD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):bx(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function YFD(D,$,X){if($=cx($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function cx(D){var $=QFD(D,"string");return b9($)=="symbol"?$:$+""}function QFD(D,$){if(b9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(b9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var hx=i6.defaultOptions=y9(y9({},jO.default.defaultOptions),{},{httpStack:new gx.default,fileReader:new oQD.default,urlStorage:new rQD.default,fingerprint:aQD.default}),eyD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return sQD(this,$),Y=y9(y9({},hx),Y),DFD(this,$,[X,Y])}return JFD($,D),eQD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=y9(y9({},hx),J),jO.default.terminate(Y,J)}}])}(jO.default),DbD=i6.isSupported=!0});var V$;var B3=o(()=>{V$={name:"@capgo/cli",type:"module",version:"7.84.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});async function IY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function F0(){let D=await IY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==V$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${V$.version} it's not the latest version.
|
|
131
131
|
Please use @capgo/cli@${D}" or @capgo/cli@${$} to keep up to date with the latest features and bug fixes.`)}var q1=o(()=>{vD();B3()});async function px(D,$,X,Y,J,Q="✅"){await AD(X,{channel:D,event:Y,icon:Q,user_id:$,...J?{tags:{"app-id":J}}:{},notify:!1})}var rx=o(()=>{vD();e$();q1();kD()});import{Buffer as ox}from"node:buffer";import{createHash as wFD}from"node:crypto";function GFD(D){let $=4294967295;for(let X=0;X<D.length;X++){let Y=D[X];$=ZFD[($^Y)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function p6(D,$="sha256"){let X=ox.isBuffer(D)?D:ox.from(D);if($==="crc32")return GFD(X);let Y=wFD($);return Y.update(X),Y.digest("hex")}var ZFD;var K3=o(()=>{ZFD=(()=>{let D=[];for(let $=0;$<256;$++){let X=$;for(let Y=0;Y<8;Y++)X=X&1?3988292384^X>>>1:X>>>1;D[$]=X}return D})()});var tx=T((WbD,ax)=>{var h9=1000,g9=h9*60,m9=g9*60,F8=m9*24,UFD=F8*7,OFD=F8*365.25;ax.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return qFD(D);else if(X==="number"&&isFinite(D))return $.long?BFD(D):zFD(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function qFD(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var X=parseFloat($[1]),Y=($[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return X*OFD;case"weeks":case"week":case"w":return X*UFD;case"days":case"day":case"d":return X*F8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*m9;case"minutes":case"minute":case"mins":case"min":case"m":return X*g9;case"seconds":case"second":case"secs":case"sec":case"s":return X*h9;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function zFD(D){var $=Math.abs(D);if($>=F8)return Math.round(D/F8)+"d";if($>=m9)return Math.round(D/m9)+"h";if($>=g9)return Math.round(D/g9)+"m";if($>=h9)return Math.round(D/h9)+"s";return D+"ms"}function BFD(D){var $=Math.abs(D);if($>=F8)return AY(D,$,F8,"day");if($>=m9)return AY(D,$,m9,"hour");if($>=g9)return AY(D,$,g9,"minute");if($>=h9)return AY(D,$,h9,"second");return D+" ms"}function AY(D,$,X,Y){var J=$>=X*1.5;return Math.round(D/X)+" "+Y+(J?"s":"")}});var TO=T((HbD,sx)=>{function KFD(D){X.debug=X,X.default=X,X.coerce=Z,X.disable=F,X.enable=J,X.enabled=w,X.humanize=tx(),X.destroy=G,Object.keys(D).forEach((U)=>{X[U]=D[U]}),X.names=[],X.skips=[],X.formatters={};function $(U){let O=0;for(let z=0;z<U.length;z++)O=(O<<5)-O+U.charCodeAt(z),O|=0;return X.colors[Math.abs(O)%X.colors.length]}X.selectColor=$;function X(U){let O,z=null,q,B;function K(...L){if(!K.enabled)return;let M=K,I=Number(new Date),W=I-(O||I);if(M.diff=W,M.prev=O,M.curr=I,O=I,L[0]=X.coerce(L[0]),typeof L[0]!=="string")L.unshift("%O");let N=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(R,x)=>{if(R==="%%")return"%";N++;let A=X.formatters[x];if(typeof A==="function"){let _=L[N];R=A.call(M,_),L.splice(N,1),N--}return R}),X.formatArgs.call(M,L),(M.log||X.log).apply(M,L)}if(K.namespace=U,K.useColors=X.useColors(),K.color=X.selectColor(U),K.extend=Y,K.destroy=X.destroy,Object.defineProperty(K,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(z!==null)return z;if(q!==X.namespaces)q=X.namespaces,B=X.enabled(U);return B},set:(L)=>{z=L}}),typeof X.init==="function")X.init(K);return K}function Y(U,O){let z=X(this.namespace+(typeof O>"u"?":":O)+U);return z.log=this.log,z}function J(U){X.save(U),X.namespaces=U,X.names=[],X.skips=[];let O=(typeof U==="string"?U:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let z of O)if(z[0]==="-")X.skips.push(z.slice(1));else X.names.push(z)}function Q(U,O){let z=0,q=0,B=-1,K=0;while(z<U.length)if(q<O.length&&(O[q]===U[z]||O[q]==="*"))if(O[q]==="*")B=q,K=z,q++;else z++,q++;else if(B!==-1)q=B+1,K++,z=K;else return!1;while(q<O.length&&O[q]==="*")q++;return q===O.length}function F(){let U=[...X.names,...X.skips.map((O)=>"-"+O)].join(",");return X.enable(""),U}function w(U){for(let O of X.skips)if(Q(U,O))return!1;for(let O of X.names)if(Q(U,O))return!0;return!1}function Z(U){if(U instanceof Error)return U.stack||U.message;return U}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}sx.exports=KFD});var DS=T((ex,RY)=>{ex.formatArgs=HFD;ex.save=VFD;ex.load=NFD;ex.useColors=WFD;ex.storage=LFD();ex.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();ex.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function WFD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function HFD(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+RY.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let X=0,Y=0;D[0].replace(/%[a-zA-Z%]/g,(J)=>{if(J==="%%")return;if(X++,J==="%c")Y=X}),D.splice(Y,0,$)}ex.log=console.debug||console.log||(()=>{});function VFD(D){try{if(D)ex.storage.setItem("debug",D);else ex.storage.removeItem("debug")}catch($){}}function NFD(){let D;try{D=ex.storage.getItem("debug")||ex.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function LFD(){try{return localStorage}catch(D){}}RY.exports=TO()(ex);var{formatters:MFD}=RY.exports;MFD.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var XS=T((NbD,$S)=>{$S.exports=(D,$=process.argv)=>{let X=D.startsWith("-")?"":D.length===1?"-":"--",Y=$.indexOf(X+D),J=$.indexOf("--");return Y!==-1&&(J===-1||Y<J)}});var QS=T((LbD,YS)=>{var PFD=i("os"),JS=i("tty"),D$=XS(),{env:l0}=process,r6;if(D$("no-color")||D$("no-colors")||D$("color=false")||D$("color=never"))r6=0;else if(D$("color")||D$("colors")||D$("color=true")||D$("color=always"))r6=1;if("FORCE_COLOR"in l0)if(l0.FORCE_COLOR==="true")r6=1;else if(l0.FORCE_COLOR==="false")r6=0;else r6=l0.FORCE_COLOR.length===0?1:Math.min(parseInt(l0.FORCE_COLOR,10),3);function CO(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function PO(D,$){if(r6===0)return 0;if(D$("color=16m")||D$("color=full")||D$("color=truecolor"))return 3;if(D$("color=256"))return 2;if(D&&!$&&r6===void 0)return 0;let X=r6||0;if(l0.TERM==="dumb")return X;if(process.platform==="win32"){let Y=PFD.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in l0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((Y)=>(Y in l0))||l0.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in l0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l0.TEAMCITY_VERSION)?1:0;if(l0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in l0){let Y=parseInt((l0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l0.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(l0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l0.TERM))return 1;if("COLORTERM"in l0)return 1;return X}function xFD(D){let $=PO(D,D&&D.isTTY);return CO($)}YS.exports={supportsColor:xFD,stdout:CO(PO(!0,JS.isatty(1))),stderr:CO(PO(!0,JS.isatty(2)))}});var GS=T((wS,EY)=>{var SFD=i("tty"),jY=i("util");wS.init=bFD;wS.log=kFD;wS.formatArgs=vFD;wS.save=fFD;wS.load=yFD;wS.useColors=uFD;wS.destroy=jY.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");wS.colors=[6,2,3,4,5,1];try{let D=QS();if(D&&(D.stderr||D).level>=2)wS.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}wS.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let X=$.substring(6).toLowerCase().replace(/_([a-z])/g,(J,Q)=>{return Q.toUpperCase()}),Y=process.env[$];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return D[X]=Y,D},{});function uFD(){return"colors"in wS.inspectOpts?Boolean(wS.inspectOpts.colors):SFD.isatty(process.stderr.fd)}function vFD(D){let{namespace:$,useColors:X}=this;if(X){let Y=this.color,J="\x1B[3"+(Y<8?Y:"8;5;"+Y),Q=` ${J};1m${$} \x1B[0m`;D[0]=Q+D[0].split(`
|
|
132
132
|
`).join(`
|
|
133
133
|
`+Q),D.push(J+"m+"+EY.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=_FD()+$+" "+D[0]}function _FD(){if(wS.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function kFD(...D){return process.stderr.write(jY.formatWithOptions(wS.inspectOpts,...D)+`
|