@capgo/cli 7.79.0 → 7.80.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.79.0",
4
+ "version": "7.80.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
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 $x=T((qyD,Dx)=>{var c6=p("constants"),uYD=process.cwd,QY=null,vYD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!QY)QY=uYD.call(process);return QY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(FY=process.chdir,process.chdir=function(D){QY=null,FY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,FY)}var FY;Dx.exports=_YD;function _YD(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(O,U,z){if(z)process.nextTick(z)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(O,U,z,q){if(q)process.nextTick(q)},D.lchownSync=function(){};if(vYD==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(O){function U(z,q,B){var K=Date.now(),M=0;O(z,q,function L(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")O(z,q,L);else B(I)})},M),M<100)M+=10;return}if(B)B(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(U,O);return U}(D.rename);D.read=typeof D.read!=="function"?D.read:function(O){function U(z,q,B,K,M,L){var I;if(L&&typeof L==="function"){var W=0;I=function(N,V,R){if(N&&N.code==="EAGAIN"&&W<10)return W++,O.call(D,z,q,B,K,M,I);L.apply(this,arguments)}}return O.call(D,z,q,B,K,M,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(U,O);return U}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(O){return function(U,z,q,B,K){var M=0;while(!0)try{return O.call(D,U,z,q,B,K)}catch(L){if(L.code==="EAGAIN"&&M<10){M++;continue}throw L}}}(D.readSync);function $(O){O.lchmod=function(U,z,q){O.open(U,c6.O_WRONLY|c6.O_SYMLINK,z,function(B,K){if(B){if(q)q(B);return}O.fchmod(K,z,function(M){O.close(K,function(L){if(q)q(M||L)})})})},O.lchmodSync=function(U,z){var q=O.openSync(U,c6.O_WRONLY|c6.O_SYMLINK,z),B=!0,K;try{K=O.fchmodSync(q,z),B=!1}finally{if(B)try{O.closeSync(q)}catch(M){}else O.closeSync(q)}return K}}function X(O){if(c6.hasOwnProperty("O_SYMLINK")&&O.futimes)O.lutimes=function(U,z,q,B){O.open(U,c6.O_SYMLINK,function(K,M){if(K){if(B)B(K);return}O.futimes(M,z,q,function(L){O.close(M,function(I){if(B)B(L||I)})})})},O.lutimesSync=function(U,z,q){var B=O.openSync(U,c6.O_SYMLINK),K,M=!0;try{K=O.futimesSync(B,z,q),M=!1}finally{if(M)try{O.closeSync(B)}catch(L){}else O.closeSync(B)}return K};else if(O.futimes)O.lutimes=function(U,z,q,B){if(B)process.nextTick(B)},O.lutimesSync=function(){}}function Y(O){if(!O)return O;return function(U,z,q){return O.call(D,U,z,function(B){if(G(B))B=null;if(q)q.apply(this,arguments)})}}function J(O){if(!O)return O;return function(U,z){try{return O.call(D,U,z)}catch(q){if(!G(q))throw q}}}function Q(O){if(!O)return O;return function(U,z,q,B){return O.call(D,U,z,q,function(K){if(G(K))K=null;if(B)B.apply(this,arguments)})}}function F(O){if(!O)return O;return function(U,z,q){try{return O.call(D,U,z,q)}catch(B){if(!G(B))throw B}}}function w(O){if(!O)return O;return function(U,z,q){if(typeof z==="function")q=z,z=null;function B(K,M){if(M){if(M.uid<0)M.uid+=4294967296;if(M.gid<0)M.gid+=4294967296}if(q)q.apply(this,arguments)}return z?O.call(D,U,z,B):O.call(D,U,B)}}function Z(O){if(!O)return O;return function(U,z){var q=z?O.call(D,U,z):O.call(D,U);if(q){if(q.uid<0)q.uid+=4294967296;if(q.gid<0)q.gid+=4294967296}return q}}function G(O){if(!O)return!0;if(O.code==="ENOSYS")return!0;var U=!process.getuid||process.getuid()!==0;if(U){if(O.code==="EINVAL"||O.code==="EPERM")return!0}return!1}}});var Yx=T((zyD,Jx)=>{var Xx=p("stream").Stream;Jx.exports=kYD;function kYD(D){return{ReadStream:$,WriteStream:X};function $(Y,J){if(!(this instanceof $))return new $(Y,J);Xx.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(O,U){if(O){Q.emit("error",O),Q.readable=!1;return}Q.fd=U,Q.emit("open",U),Q._read()})}function X(Y,J){if(!(this instanceof X))return new X(Y,J);Xx.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 Fx=T((ByD,Qx)=>{Qx.exports=yYD;var fYD=Object.getPrototypeOf||function(D){return D.__proto__};function yYD(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:fYD(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var S0=T((KyD,UU)=>{var L0=p("fs"),bYD=$x(),gYD=Yx(),hYD=Fx(),wY=p("util"),r0,GY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")r0=Symbol.for("graceful-fs.queue"),GY=Symbol.for("graceful-fs.previous");else r0="___graceful-fs.queue",GY="___graceful-fs.previous";function mYD(){}function Zx(D,$){Object.defineProperty(D,r0,{get:function(){return $}})}var $8=mYD;if(wY.debuglog)$8=wY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))$8=function(){var D=wY.format.apply(wY,arguments);D="GFS4: "+D.split(/\n/).join(`
130
- GFS4: `),console.error(D)};if(!L0[r0]){if(ZU=global[r0]||[],Zx(L0,ZU),L0.close=function(D){function $(X,Y){return D.call(L0,X,function(J){if(!J)wx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,GY,{value:D}),$}(L0.close),L0.closeSync=function(D){function $(X){D.apply(L0,arguments),wx()}return Object.defineProperty($,GY,{value:D}),$}(L0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(L0[r0]),p("assert").equal(L0[r0].length,0)})}var ZU;if(!global[r0])Zx(global,L0[r0]);UU.exports=GU(hYD(L0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!L0.__patched)UU.exports=GU(L0),L0.__patched=!0;function GU(D){bYD(D),D.gracefulify=GU,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(g,l,f,j){return $(g,l,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))u9([h,[g,l,f],x,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 g(_,v,S,h);function g(l,f,j,x,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.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 g(_,v,S,h);function g(l,f,j,x,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.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 g(_,v,S,h);function g(l,f,j,x,u){return w(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var G=D.readdir;D.readdir=U;var O=/^v[0-5]\./;function U(_,v,S){if(typeof v==="function")S=v,v=null;var h=O.test(process.version)?function(f,j,x,u){return G(f,g(f,j,x,u))}:function(f,j,x,u){return G(f,j,g(f,j,x,u))};return h(_,v,S);function g(l,f,j,x){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))u9([h,[l,f,j],u,x||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=gYD(D);L=z.ReadStream,W=z.WriteStream}var q=D.ReadStream;if(q)L.prototype=Object.create(q.prototype),L.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 L},set:function(_){L=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var M=W;Object.defineProperty(D,"FileWriteStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0});function L(_,v){if(this instanceof L)return q.apply(this,arguments),this;else return L.apply(Object.create(L.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 P=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return P(l,f,j,function(y,d){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}return D}function u9(D){$8("ENQUEUE",D[0].name,D[1]),L0[r0].push(D),OU()}var ZY;function wx(){var D=Date.now();for(var $=0;$<L0[r0].length;++$)if(L0[r0][$].length>2)L0[r0][$][3]=D,L0[r0][$][4]=D;OU()}function OU(){if(clearTimeout(ZY),ZY=void 0,L0[r0].length===0)return;var D=L0[r0].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 L0[r0].push(D)}if(ZY===void 0)ZY=setTimeout(OU,0)}});var Ox=T((WyD,Gx)=>{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)}Gx.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 qx=T((cYD)=>{var dYD=Ox();cYD.operation=function(D){var $=cYD.timeouts(D);return new dYD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};cYD.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};cYD.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};cYD.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=cYD.operation($),O=Array.prototype.slice.call(arguments,1),U=O.pop();O.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();U.apply(this,arguments)}),G.attempt(function(){Z.apply(D,O)})}.bind(D,F),D[Q].options=$}}});var zx=T((VyD,OY)=>{OY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")OY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")OY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var zY=T((NyD,_9)=>{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))_9.exports=function(){return function(){}};else{if(qU=p("assert"),J8=zx(),zU=/^win/i.test(K0.platform),v9=p("events"),typeof v9!=="function")v9=v9.EventEmitter;if(K0.__signal_exit_emitter__)h0=K0.__signal_exit_emitter__;else h0=K0.__signal_exit_emitter__=new v9,h0.count=0,h0.emitted={};if(!h0.infinite)h0.setMaxListeners(1/0),h0.infinite=!0;_9.exports=function(D,$){if(!X8(global.process))return function(){};if(qU.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)UY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(h0.removeListener(X,D),h0.listeners("exit").length===0&&h0.listeners("afterexit").length===0)F3()};return h0.on(X,D),Y},F3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,w3[$])}catch(X){}}),K0.emit=Z3,K0.reallyExit=qY,h0.count-=1},_9.exports.unload=F3,l6=function($,X,Y){if(h0.emitted[$])return;h0.emitted[$]=!0,h0.emit($,X,Y)},w3={},J8.forEach(function(D){w3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===h0.count){if(F3(),l6("exit",null,D),l6("afterexit",null,D),zU&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),_9.exports.signals=function(){return J8},Y8=!1,UY=function(){if(Y8||!X8(global.process))return;Y8=!0,h0.count+=1,J8=J8.filter(function($){try{return K0.on($,w3[$]),!0}catch(X){return!1}}),K0.emit=KU,K0.reallyExit=BU},_9.exports.load=UY,qY=K0.reallyExit,BU=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),qY.call(K0,K0.exitCode)},Z3=K0.emit,KU=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=Z3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return Z3.apply(this,arguments)}}var qU,J8,zU,v9,h0,F3,l6,w3,Y8,UY,qY,BU,Z3,KU});var Kx=T((oYD,WU)=>{var Bx=Symbol();function pYD(D,$,X){let Y=$[Bx];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($,Bx,{value:Z}),X(null,w.mtime,Z)})})}function rYD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}oYD.probe=pYD;oYD.getMtime=rYD});var Mx=T((YQD,O3)=>{var sYD=p("path"),NU=S0(),eYD=qx(),DQD=zY(),Wx=Kx(),Q6={};function G3(D,$){return $.lockfilePath||`${D}.lock`}function MU(D,$,X){if(!$.realpath)return X(null,sYD.resolve(D));$.fs.realpath(D,X)}function VU(D,$,X){let Y=G3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return Wx.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 VU(D,{...$,stale:0},X);return X(Q)}if(!Hx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));Vx(D,$,(w)=>{if(w)return X(w);VU(D,{...$,stale:0},X)})})})}function Hx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function Vx(D,$,X){$.fs.rmdir(G3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function BY(D,$){let X=Q6[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 HU(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,BY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return HU(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let w=Wx.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 HU(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,BY(D,$)}X.mtime=w,X.lastUpdate=Date.now(),X.updateDelay=null,BY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function HU(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Q6[D]===$)delete Q6[D];$.options.onCompromised(X)}function $QD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:NU,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),MU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=eYD.operation($.retries);Q.attempt(()=>{VU(J,$,(F,w,Z)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Q6[J]={lockfilePath:G3(J,$),mtime:w,mtimePrecision:Z,options:$,lastUpdate:Date.now()};BY(J,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Nx(J,{...$,realpath:!1},O)})})})})}function Nx(D,$,X){$={fs:NU,realpath:!0,...$},MU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Q6[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 Q6[J],Vx(J,$,X)})}function XQD(D,$,X){$={stale:1e4,realpath:!0,fs:NU,...$},$.stale=Math.max($.stale||0,2000),MU(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(G3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!Hx(F,$))})})}function JQD(){return Q6}DQD(()=>{for(let D in Q6){let $=Q6[D].options;try{$.fs.rmdirSync(G3(D,$))}catch(X){}}});YQD.lock=$QD;YQD.unlock=Nx;YQD.check=XQD;YQD.getLocks=JQD});var Ix=T((MyD,Lx)=>{var GQD=S0();function OQD(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 UQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function qQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function zQD(D){if(D={...D},D.fs=OQD(D.fs||GQD),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}Lx.exports={toPromise:UQD,toSync:qQD,toSyncOptions:zQD}});var Rx=T((LyD,n6)=>{var k9=Mx(),{toPromise:KY,toSync:WY,toSyncOptions:LU}=Ix();async function Ax(D,$){let X=await KY(k9.lock)(D,$);return KY(X)}function BQD(D,$){let X=WY(k9.lock)(D,LU($));return WY(X)}function KQD(D,$){return KY(k9.unlock)(D,$)}function WQD(D,$){return WY(k9.unlock)(D,LU($))}function HQD(D,$){return KY(k9.check)(D,$)}function VQD(D,$){return WY(k9.check)(D,LU($))}n6.exports=Ax;n6.exports.lock=Ax;n6.exports.unlock=KQD;n6.exports.lockSync=BQD;n6.exports.unlockSync=WQD;n6.exports.check=HQD;n6.exports.checkSync=VQD});var Sx=T((Px)=>{Object.defineProperty(Px,"__esModule",{value:!0});Px.canStoreURLs=Px.FileUrlStorage=void 0;var jx=p("fs"),NQD=LQD(eP()),Ex=MQD(Rx());function Cx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(Cx=function(Y){return Y?X:$})(D)}function MQD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=Cx($);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 LQD(D){return D&&D.__esModule?D:{default:D}}function U3(D){return U3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},U3(D)}function IQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Tx(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,RQD(Y.key),Y)}}function AQD(D,$,X){if($)Tx(D.prototype,$);if(X)Tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function RQD(D){var $=jQD(D,"string");return U3($)=="symbol"?$:$+""}function jQD(D,$){if(U3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(U3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var IyD=Px.canStoreURLs=!0,AyD=Px.FileUrlStorage=function(){function D($){IQD(this,D),this.path=$}return AQD(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;Ex.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;Ex.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,NQD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,jx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,jx.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 VY=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return kx.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return TQD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return fx.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return uQD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return fx.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return CQD.enableDebugLog}});i6.isSupported=void 0;var TQD=Q8(LO()),CQD=IO(),PQD=Q8(RT()),IU=Q8(JC()),xQD=Q8(AC()),SQD=Q8(CC()),kx=Q8(lC()),uQD=Q8(vO()),fx=Sx();function Q8(D){return D&&D.__esModule?D:{default:D}}function y9(D){return y9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y9(D)}function vQD(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,bx(Y.key),Y)}}function _QD(D,$,X){if($)ux(D.prototype,$);if(X)ux(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function kQD(D,$,X){return $=HY($),fQD(D,yx()?Reflect.construct($,X||[],HY(D).constructor):$.apply(D,X))}function fQD(D,$){if($&&(y9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return yQD(D)}function yQD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function yx(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(yx=function(){return!!D})()}function HY(D){return HY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},HY(D)}function bQD(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}),$)AU(D,$)}function AU(D,$){return AU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},AU(D,$)}function vx(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 f9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?vx(Object(X),!0).forEach(function(Y){gQD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):vx(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function gQD(D,$,X){if($=bx($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function bx(D){var $=hQD(D,"string");return y9($)=="symbol"?$:$+""}function hQD(D,$){if(y9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(y9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var _x=i6.defaultOptions=f9(f9({},IU.default.defaultOptions),{},{httpStack:new kx.default,fileReader:new xQD.default,urlStorage:new PQD.default,fingerprint:SQD.default}),jyD=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 vQD(this,$),Y=f9(f9({},_x),Y),kQD(this,$,[X,Y])}return bQD($,D),_QD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=f9(f9({},_x),J),IU.default.terminate(Y,J)}}])}(IU.default),EyD=i6.isSupported=!0});var F6;var NY=o(()=>{F6={name:"@capgo/cli",type:"module",version:"7.79.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:"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"},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 MY(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 MY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==F6.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${F6.version} it's not the latest version.
130
+ GFS4: `),console.error(D)};if(!L0[r0]){if(ZU=global[r0]||[],Zx(L0,ZU),L0.close=function(D){function $(X,Y){return D.call(L0,X,function(J){if(!J)wx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,GY,{value:D}),$}(L0.close),L0.closeSync=function(D){function $(X){D.apply(L0,arguments),wx()}return Object.defineProperty($,GY,{value:D}),$}(L0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(L0[r0]),p("assert").equal(L0[r0].length,0)})}var ZU;if(!global[r0])Zx(global,L0[r0]);UU.exports=GU(hYD(L0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!L0.__patched)UU.exports=GU(L0),L0.__patched=!0;function GU(D){bYD(D),D.gracefulify=GU,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(g,l,f,j){return $(g,l,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))u9([h,[g,l,f],x,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 g(_,v,S,h);function g(l,f,j,x,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.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 g(_,v,S,h);function g(l,f,j,x,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.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 g(_,v,S,h);function g(l,f,j,x,u){return w(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var G=D.readdir;D.readdir=U;var O=/^v[0-5]\./;function U(_,v,S){if(typeof v==="function")S=v,v=null;var h=O.test(process.version)?function(f,j,x,u){return G(f,g(f,j,x,u))}:function(f,j,x,u){return G(f,j,g(f,j,x,u))};return h(_,v,S);function g(l,f,j,x){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))u9([h,[l,f,j],u,x||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=gYD(D);L=z.ReadStream,W=z.WriteStream}var q=D.ReadStream;if(q)L.prototype=Object.create(q.prototype),L.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 L},set:function(_){L=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var M=W;Object.defineProperty(D,"FileWriteStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0});function L(_,v){if(this instanceof L)return q.apply(this,arguments),this;else return L.apply(Object.create(L.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 P=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return g(_,v,S,h);function g(l,f,j,x,u){return P(l,f,j,function(y,d){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))u9([g,[l,f,j,x],y,u||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}return D}function u9(D){$8("ENQUEUE",D[0].name,D[1]),L0[r0].push(D),OU()}var ZY;function wx(){var D=Date.now();for(var $=0;$<L0[r0].length;++$)if(L0[r0][$].length>2)L0[r0][$][3]=D,L0[r0][$][4]=D;OU()}function OU(){if(clearTimeout(ZY),ZY=void 0,L0[r0].length===0)return;var D=L0[r0].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 L0[r0].push(D)}if(ZY===void 0)ZY=setTimeout(OU,0)}});var Ox=T((WyD,Gx)=>{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)}Gx.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 qx=T((cYD)=>{var dYD=Ox();cYD.operation=function(D){var $=cYD.timeouts(D);return new dYD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};cYD.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};cYD.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};cYD.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=cYD.operation($),O=Array.prototype.slice.call(arguments,1),U=O.pop();O.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();U.apply(this,arguments)}),G.attempt(function(){Z.apply(D,O)})}.bind(D,F),D[Q].options=$}}});var zx=T((VyD,OY)=>{OY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")OY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")OY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var zY=T((NyD,_9)=>{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))_9.exports=function(){return function(){}};else{if(qU=p("assert"),J8=zx(),zU=/^win/i.test(K0.platform),v9=p("events"),typeof v9!=="function")v9=v9.EventEmitter;if(K0.__signal_exit_emitter__)h0=K0.__signal_exit_emitter__;else h0=K0.__signal_exit_emitter__=new v9,h0.count=0,h0.emitted={};if(!h0.infinite)h0.setMaxListeners(1/0),h0.infinite=!0;_9.exports=function(D,$){if(!X8(global.process))return function(){};if(qU.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)UY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(h0.removeListener(X,D),h0.listeners("exit").length===0&&h0.listeners("afterexit").length===0)F3()};return h0.on(X,D),Y},F3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,w3[$])}catch(X){}}),K0.emit=Z3,K0.reallyExit=qY,h0.count-=1},_9.exports.unload=F3,l6=function($,X,Y){if(h0.emitted[$])return;h0.emitted[$]=!0,h0.emit($,X,Y)},w3={},J8.forEach(function(D){w3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===h0.count){if(F3(),l6("exit",null,D),l6("afterexit",null,D),zU&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),_9.exports.signals=function(){return J8},Y8=!1,UY=function(){if(Y8||!X8(global.process))return;Y8=!0,h0.count+=1,J8=J8.filter(function($){try{return K0.on($,w3[$]),!0}catch(X){return!1}}),K0.emit=KU,K0.reallyExit=BU},_9.exports.load=UY,qY=K0.reallyExit,BU=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),qY.call(K0,K0.exitCode)},Z3=K0.emit,KU=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=Z3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return Z3.apply(this,arguments)}}var qU,J8,zU,v9,h0,F3,l6,w3,Y8,UY,qY,BU,Z3,KU});var Kx=T((oYD,WU)=>{var Bx=Symbol();function pYD(D,$,X){let Y=$[Bx];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($,Bx,{value:Z}),X(null,w.mtime,Z)})})}function rYD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}oYD.probe=pYD;oYD.getMtime=rYD});var Mx=T((YQD,O3)=>{var sYD=p("path"),NU=S0(),eYD=qx(),DQD=zY(),Wx=Kx(),Q6={};function G3(D,$){return $.lockfilePath||`${D}.lock`}function MU(D,$,X){if(!$.realpath)return X(null,sYD.resolve(D));$.fs.realpath(D,X)}function VU(D,$,X){let Y=G3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return Wx.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 VU(D,{...$,stale:0},X);return X(Q)}if(!Hx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));Vx(D,$,(w)=>{if(w)return X(w);VU(D,{...$,stale:0},X)})})})}function Hx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function Vx(D,$,X){$.fs.rmdir(G3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function BY(D,$){let X=Q6[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 HU(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,BY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return HU(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let w=Wx.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 HU(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,BY(D,$)}X.mtime=w,X.lastUpdate=Date.now(),X.updateDelay=null,BY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function HU(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Q6[D]===$)delete Q6[D];$.options.onCompromised(X)}function $QD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:NU,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),MU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=eYD.operation($.retries);Q.attempt(()=>{VU(J,$,(F,w,Z)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Q6[J]={lockfilePath:G3(J,$),mtime:w,mtimePrecision:Z,options:$,lastUpdate:Date.now()};BY(J,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Nx(J,{...$,realpath:!1},O)})})})})}function Nx(D,$,X){$={fs:NU,realpath:!0,...$},MU(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Q6[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 Q6[J],Vx(J,$,X)})}function XQD(D,$,X){$={stale:1e4,realpath:!0,fs:NU,...$},$.stale=Math.max($.stale||0,2000),MU(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(G3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!Hx(F,$))})})}function JQD(){return Q6}DQD(()=>{for(let D in Q6){let $=Q6[D].options;try{$.fs.rmdirSync(G3(D,$))}catch(X){}}});YQD.lock=$QD;YQD.unlock=Nx;YQD.check=XQD;YQD.getLocks=JQD});var Ix=T((MyD,Lx)=>{var GQD=S0();function OQD(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 UQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function qQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function zQD(D){if(D={...D},D.fs=OQD(D.fs||GQD),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}Lx.exports={toPromise:UQD,toSync:qQD,toSyncOptions:zQD}});var Rx=T((LyD,n6)=>{var k9=Mx(),{toPromise:KY,toSync:WY,toSyncOptions:LU}=Ix();async function Ax(D,$){let X=await KY(k9.lock)(D,$);return KY(X)}function BQD(D,$){let X=WY(k9.lock)(D,LU($));return WY(X)}function KQD(D,$){return KY(k9.unlock)(D,$)}function WQD(D,$){return WY(k9.unlock)(D,LU($))}function HQD(D,$){return KY(k9.check)(D,$)}function VQD(D,$){return WY(k9.check)(D,LU($))}n6.exports=Ax;n6.exports.lock=Ax;n6.exports.unlock=KQD;n6.exports.lockSync=BQD;n6.exports.unlockSync=WQD;n6.exports.check=HQD;n6.exports.checkSync=VQD});var Sx=T((Px)=>{Object.defineProperty(Px,"__esModule",{value:!0});Px.canStoreURLs=Px.FileUrlStorage=void 0;var jx=p("fs"),NQD=LQD(eP()),Ex=MQD(Rx());function Cx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(Cx=function(Y){return Y?X:$})(D)}function MQD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=Cx($);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 LQD(D){return D&&D.__esModule?D:{default:D}}function U3(D){return U3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},U3(D)}function IQD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function Tx(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,RQD(Y.key),Y)}}function AQD(D,$,X){if($)Tx(D.prototype,$);if(X)Tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function RQD(D){var $=jQD(D,"string");return U3($)=="symbol"?$:$+""}function jQD(D,$){if(U3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(U3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var IyD=Px.canStoreURLs=!0,AyD=Px.FileUrlStorage=function(){function D($){IQD(this,D),this.path=$}return AQD(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;Ex.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;Ex.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,NQD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,jx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,jx.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 VY=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return kx.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return TQD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return fx.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return uQD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return fx.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return CQD.enableDebugLog}});i6.isSupported=void 0;var TQD=Q8(LO()),CQD=IO(),PQD=Q8(RT()),IU=Q8(JC()),xQD=Q8(AC()),SQD=Q8(CC()),kx=Q8(lC()),uQD=Q8(vO()),fx=Sx();function Q8(D){return D&&D.__esModule?D:{default:D}}function y9(D){return y9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y9(D)}function vQD(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,bx(Y.key),Y)}}function _QD(D,$,X){if($)ux(D.prototype,$);if(X)ux(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function kQD(D,$,X){return $=HY($),fQD(D,yx()?Reflect.construct($,X||[],HY(D).constructor):$.apply(D,X))}function fQD(D,$){if($&&(y9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return yQD(D)}function yQD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function yx(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(yx=function(){return!!D})()}function HY(D){return HY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},HY(D)}function bQD(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}),$)AU(D,$)}function AU(D,$){return AU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},AU(D,$)}function vx(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 f9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?vx(Object(X),!0).forEach(function(Y){gQD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):vx(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function gQD(D,$,X){if($=bx($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function bx(D){var $=hQD(D,"string");return y9($)=="symbol"?$:$+""}function hQD(D,$){if(y9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(y9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var _x=i6.defaultOptions=f9(f9({},IU.default.defaultOptions),{},{httpStack:new kx.default,fileReader:new xQD.default,urlStorage:new PQD.default,fingerprint:SQD.default}),jyD=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 vQD(this,$),Y=f9(f9({},_x),Y),kQD(this,$,[X,Y])}return bQD($,D),_QD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=f9(f9({},_x),J),IU.default.terminate(Y,J)}}])}(IU.default),EyD=i6.isSupported=!0});var F6;var NY=o(()=>{F6={name:"@capgo/cli",type:"module",version:"7.80.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:"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"},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 MY(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 MY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==F6.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${F6.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();NY()});async function dx(D,$,X,Y,J,Q="✅"){await RD(X,{channel:D,event:Y,icon:Q,user_id:$,...J?{tags:{"app-id":J}}:{},notify:!1})}var cx=o(()=>{vD();s$();q1();fD()});import{Buffer as lx}from"node:buffer";import{createHash as dQD}from"node:crypto";function lQD(D){let $=4294967295;for(let X=0;X<D.length;X++){let Y=D[X];$=cQD[($^Y)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function p6(D,$="sha256"){let X=lx.isBuffer(D)?D:lx.from(D);if($==="crc32")return lQD(X);let Y=dQD($);return Y.update(X),Y.digest("hex")}var cQD;var q3=o(()=>{cQD=(()=>{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 ix=T((dyD,nx)=>{var b9=1000,g9=b9*60,h9=g9*60,F8=h9*24,nQD=F8*7,iQD=F8*365.25;nx.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return pQD(D);else if(X==="number"&&isFinite(D))return $.long?oQD(D):rQD(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function pQD(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*iQD;case"weeks":case"week":case"w":return X*nQD;case"days":case"day":case"d":return X*F8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*h9;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*b9;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function rQD(D){var $=Math.abs(D);if($>=F8)return Math.round(D/F8)+"d";if($>=h9)return Math.round(D/h9)+"h";if($>=g9)return Math.round(D/g9)+"m";if($>=b9)return Math.round(D/b9)+"s";return D+"ms"}function oQD(D){var $=Math.abs(D);if($>=F8)return LY(D,$,F8,"day");if($>=h9)return LY(D,$,h9,"hour");if($>=g9)return LY(D,$,g9,"minute");if($>=b9)return LY(D,$,b9,"second");return D+" ms"}function LY(D,$,X,Y){var J=$>=X*1.5;return Math.round(D/X)+" "+Y+(J?"s":"")}});var RU=T((cyD,px)=>{function aQD(D){X.debug=X,X.default=X,X.coerce=Z,X.disable=F,X.enable=J,X.enabled=w,X.humanize=ix(),X.destroy=G,Object.keys(D).forEach((O)=>{X[O]=D[O]}),X.names=[],X.skips=[],X.formatters={};function $(O){let U=0;for(let z=0;z<O.length;z++)U=(U<<5)-U+O.charCodeAt(z),U|=0;return X.colors[Math.abs(U)%X.colors.length]}X.selectColor=$;function X(O){let U,z=null,q,B;function K(...M){if(!K.enabled)return;let L=K,I=Number(new Date),W=I-(U||I);if(L.diff=W,L.prev=U,L.curr=I,U=I,M[0]=X.coerce(M[0]),typeof M[0]!=="string")M.unshift("%O");let N=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(R,P)=>{if(R==="%%")return"%";N++;let A=X.formatters[P];if(typeof A==="function"){let _=M[N];R=A.call(L,_),M.splice(N,1),N--}return R}),X.formatArgs.call(L,M),(L.log||X.log).apply(L,M)}if(K.namespace=O,K.useColors=X.useColors(),K.color=X.selectColor(O),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(O);return B},set:(M)=>{z=M}}),typeof X.init==="function")X.init(K);return K}function Y(O,U){let z=X(this.namespace+(typeof U>"u"?":":U)+O);return z.log=this.log,z}function J(O){X.save(O),X.namespaces=O,X.names=[],X.skips=[];let U=(typeof O==="string"?O:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let z of U)if(z[0]==="-")X.skips.push(z.slice(1));else X.names.push(z)}function Q(O,U){let z=0,q=0,B=-1,K=0;while(z<O.length)if(q<U.length&&(U[q]===O[z]||U[q]==="*"))if(U[q]==="*")B=q,K=z,q++;else z++,q++;else if(B!==-1)q=B+1,K++,z=K;else return!1;while(q<U.length&&U[q]==="*")q++;return q===U.length}function F(){let O=[...X.names,...X.skips.map((U)=>"-"+U)].join(",");return X.enable(""),O}function w(O){for(let U of X.skips)if(Q(O,U))return!1;for(let U of X.names)if(Q(O,U))return!0;return!1}function Z(O){if(O instanceof Error)return O.stack||O.message;return O}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}px.exports=aQD});var ox=T((rx,IY)=>{rx.formatArgs=sQD;rx.save=eQD;rx.load=DFD;rx.useColors=tQD;rx.storage=$FD();rx.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`.")}})();rx.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 tQD(){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 sQD(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+IY.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,$)}rx.log=console.debug||console.log||(()=>{});function eQD(D){try{if(D)rx.storage.setItem("debug",D);else rx.storage.removeItem("debug")}catch($){}}function DFD(){let D;try{D=rx.storage.getItem("debug")||rx.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function $FD(){try{return localStorage}catch(D){}}IY.exports=RU()(rx);var{formatters:XFD}=IY.exports;XFD.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var tx=T((nyD,ax)=>{ax.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 DS=T((iyD,ex)=>{var OFD=p("os"),sx=p("tty"),D$=tx(),{env:c0}=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 c0)if(c0.FORCE_COLOR==="true")r6=1;else if(c0.FORCE_COLOR==="false")r6=0;else r6=c0.FORCE_COLOR.length===0?1:Math.min(parseInt(c0.FORCE_COLOR,10),3);function jU(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function EU(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(c0.TERM==="dumb")return X;if(process.platform==="win32"){let Y=OFD.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in c0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((Y)=>(Y in c0))||c0.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in c0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c0.TEAMCITY_VERSION)?1:0;if(c0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in c0){let Y=parseInt((c0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c0.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(c0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c0.TERM))return 1;if("COLORTERM"in c0)return 1;return X}function UFD(D){let $=EU(D,D&&D.isTTY);return jU($)}ex.exports={supportsColor:UFD,stdout:jU(EU(!0,sx.isatty(1))),stderr:jU(EU(!0,sx.isatty(2)))}});var YS=T((XS,RY)=>{var qFD=p("tty"),AY=p("util");XS.init=NFD;XS.log=WFD;XS.formatArgs=BFD;XS.save=HFD;XS.load=VFD;XS.useColors=zFD;XS.destroy=AY.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");XS.colors=[6,2,3,4,5,1];try{let D=DS();if(D&&(D.stderr||D).level>=2)XS.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){}XS.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 zFD(){return"colors"in XS.inspectOpts?Boolean(XS.inspectOpts.colors):qFD.isatty(process.stderr.fd)}function BFD(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+"+RY.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=KFD()+$+" "+D[0]}function KFD(){if(XS.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function WFD(...D){return process.stderr.write(AY.formatWithOptions(XS.inspectOpts,...D)+`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.79.0",
4
+ "version": "7.80.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",