@gadgetinc/ggt 1.7.0 → 1.7.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.
Files changed (42) hide show
  1. package/dist/{add-623ZJFNZ.js → add-M2YVCVDJ.js} +2 -2
  2. package/dist/{add-623ZJFNZ.js.map → add-M2YVCVDJ.js.map} +1 -1
  3. package/dist/{chunk-RV4YYWDE.js → chunk-2WKENYA3.js} +2 -2
  4. package/dist/{chunk-RV4YYWDE.js.map → chunk-2WKENYA3.js.map} +1 -1
  5. package/dist/{chunk-5AMZWMRB.js → chunk-DP2MEKPK.js} +2 -2
  6. package/dist/{chunk-T3XUROKS.js → chunk-GC4CQ6BI.js} +2 -2
  7. package/dist/chunk-TPWSJOGX.js +66 -0
  8. package/dist/chunk-TPWSJOGX.js.map +7 -0
  9. package/dist/{chunk-7VB3L2XK.js → chunk-UAZBF6WU.js} +4 -4
  10. package/dist/{chunk-7VB3L2XK.js.map → chunk-UAZBF6WU.js.map} +1 -1
  11. package/dist/{deploy-4AVZFDZ4.js → deploy-QX2ELPOA.js} +2 -2
  12. package/dist/{deploy-4AVZFDZ4.js.map → deploy-QX2ELPOA.js.map} +1 -1
  13. package/dist/{dev-RHG4RVQG.js → dev-ODLZZUI4.js} +2 -2
  14. package/dist/{dev-RHG4RVQG.js.map → dev-ODLZZUI4.js.map} +1 -1
  15. package/dist/list-E3DN5VVW.js +11 -0
  16. package/dist/{list-YXCTVLRH.js.map → list-E3DN5VVW.js.map} +1 -1
  17. package/dist/login-LXGUUTW3.js +2 -0
  18. package/dist/{logs-DMHPRDXZ.js → logs-VGDAULNT.js} +2 -2
  19. package/dist/{logs-DMHPRDXZ.js.map → logs-VGDAULNT.js.map} +1 -1
  20. package/dist/main.js +1 -1
  21. package/dist/{open-CYXBST4H.js → open-LBVP7DXX.js} +2 -2
  22. package/dist/{open-CYXBST4H.js.map → open-LBVP7DXX.js.map} +1 -1
  23. package/dist/{pull-57RYWYNZ.js → pull-I3WM4RL3.js} +2 -2
  24. package/dist/{pull-57RYWYNZ.js.map → pull-I3WM4RL3.js.map} +1 -1
  25. package/dist/push-GE55G6KR.js +2 -0
  26. package/dist/{status-C3VTFX7J.js → status-2PKSATWL.js} +2 -2
  27. package/dist/{status-C3VTFX7J.js.map → status-2PKSATWL.js.map} +1 -1
  28. package/dist/whoami-LEZVATND.js +7 -0
  29. package/dist/{whoami-AA3ISE77.js.map → whoami-LEZVATND.js.map} +1 -1
  30. package/package.json +3 -1
  31. package/dist/chunk-FILWLZUN.js +0 -18
  32. package/dist/chunk-FILWLZUN.js.map +0 -7
  33. package/dist/chunk-GCO2TOVZ.js +0 -50
  34. package/dist/chunk-GCO2TOVZ.js.map +0 -7
  35. package/dist/list-YXCTVLRH.js +0 -11
  36. package/dist/login-XIEASAMY.js +0 -2
  37. package/dist/push-464T6F4H.js +0 -2
  38. package/dist/whoami-AA3ISE77.js +0 -7
  39. /package/dist/{chunk-5AMZWMRB.js.map → chunk-DP2MEKPK.js.map} +0 -0
  40. /package/dist/{chunk-T3XUROKS.js.map → chunk-GC4CQ6BI.js.map} +0 -0
  41. /package/dist/{login-XIEASAMY.js.map → login-LXGUUTW3.js.map} +0 -0
  42. /package/dist/{push-464T6F4H.js.map → push-GE55G6KR.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{c as K}from"./chunk-T3XUROKS.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as no,b as so}from"./chunk-HN3YKQ3C.js";import{g as Lr}from"./chunk-FILWLZUN.js";import{a as ft,c as Rr,f as wt,g as _t,k as io,l as Ar,n as ge,o as X,p as Fr,t as jr,u as ye,v as ve,w as Dr,z as kt}from"./chunk-GCO2TOVZ.js";import{a as $r}from"./chunk-KMNQ3LJT.js";import{$ as Or,A as ro,N as Pr,U as vt,Z as he,b as st,e as J,g as br,h as wr,ha as C,i as _r,ia as $,ja as bt,m as kr,n as Tr,u as Sr,v as Cr,w as xr,z as Er}from"./chunk-24OT7GHO.js";import{a as eo}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as pt,h as T}from"./chunk-7DYQUG5M.js";var Gr=nt(N=>{"use strict";T();var uo=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var co=de("fs"),lo=uo(so()),mt=lo.default("@kwsites/file-exists");function po(t,e,r){mt("checking %s",t);try{let s=co.statSync(t);return s.isFile()&&e?(mt("[OK] path represents a file"),!0):s.isDirectory()&&r?(mt("[OK] path represents a directory"),!0):(mt("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return mt("[FAIL] path is not accessible: %o",s),!1;throw mt("[FATAL] %o",s),s}}n(po,"check");function fo(t,e=N.READABLE){return po(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(fo,"exists");N.exists=fo;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var Ur=nt(Bt=>{"use strict";T();function mo(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(mo,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});mo(Gr())});var _e=nt((kl,qr)=>{T();function ho(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=eo(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,ct=Number(new Date),le=ct-(m||ct);Y.diff=le,Y.prev=m,Y.curr=ct,m=ct,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let lt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(yt,pe)=>{if(yt==="%%")return"%";lt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[lt];yt=Lt.call(Y,fe),D.splice(lt,1),lt--}return yt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){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 n(d,"destroy"),r.enable(r.load()),r}n(ho,"setup");qr.exports=ho});var Jr=nt((G,It)=>{T();G.formatArgs=yo;G.save=vo;G.load=bo;G.useColors=go;G.storage=wo();G.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();G.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 go(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(go,"useColors");function yo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(yo,"formatArgs");G.log=console.debug||console.log||(()=>{});function vo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(vo,"save");function bo(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(bo,"load");function wo(){try{return localStorage}catch{}}n(wo,"localstorage");It.exports=_e()(G);var{formatters:_o}=It.exports;_o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vr=nt((R,Gt)=>{T();var ko=de("tty"),Nt=de("util");R.init=Oo;R.log=xo;R.formatArgs=So;R.save=Eo;R.load=Po;R.useColors=To;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=no();t&&(t.stderr||t).level>=2&&(R.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{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function To(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:ko.isatty(process.stderr.fd)}n(To,"useColors");function So(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
1
+ import{c as K}from"./chunk-GC4CQ6BI.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as no,b as so}from"./chunk-HN3YKQ3C.js";import{A as Lr,D as kt,a as ft,b as Rr,e as wt,f as _t,j as io,k as Ar,m as ge,n as X,o as Fr,w as jr,x as Dr,y as ye,z as ve}from"./chunk-TPWSJOGX.js";import{a as $r}from"./chunk-KMNQ3LJT.js";import{$ as Or,A as ro,N as Pr,U as vt,Z as he,b as st,e as J,g as br,h as wr,ha as C,i as _r,ia as $,ja as bt,m as kr,n as Tr,u as Sr,v as Cr,w as xr,z as Er}from"./chunk-24OT7GHO.js";import{a as eo}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as pt,h as T}from"./chunk-7DYQUG5M.js";var Gr=nt(N=>{"use strict";T();var uo=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var co=de("fs"),lo=uo(so()),mt=lo.default("@kwsites/file-exists");function po(t,e,r){mt("checking %s",t);try{let s=co.statSync(t);return s.isFile()&&e?(mt("[OK] path represents a file"),!0):s.isDirectory()&&r?(mt("[OK] path represents a directory"),!0):(mt("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return mt("[FAIL] path is not accessible: %o",s),!1;throw mt("[FATAL] %o",s),s}}n(po,"check");function fo(t,e=N.READABLE){return po(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(fo,"exists");N.exists=fo;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var Ur=nt(Bt=>{"use strict";T();function mo(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(mo,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});mo(Gr())});var _e=nt((kl,qr)=>{T();function ho(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=eo(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,ct=Number(new Date),le=ct-(m||ct);Y.diff=le,Y.prev=m,Y.curr=ct,m=ct,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let lt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(yt,pe)=>{if(yt==="%%")return"%";lt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[lt];yt=Lt.call(Y,fe),D.splice(lt,1),lt--}return yt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){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 n(d,"destroy"),r.enable(r.load()),r}n(ho,"setup");qr.exports=ho});var Jr=nt((G,It)=>{T();G.formatArgs=yo;G.save=vo;G.load=bo;G.useColors=go;G.storage=wo();G.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();G.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 go(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(go,"useColors");function yo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(yo,"formatArgs");G.log=console.debug||console.log||(()=>{});function vo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(vo,"save");function bo(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(bo,"load");function wo(){try{return localStorage}catch{}}n(wo,"localstorage");It.exports=_e()(G);var{formatters:_o}=It.exports;_o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vr=nt((R,Gt)=>{T();var ko=de("tty"),Nt=de("util");R.init=Oo;R.log=xo;R.formatArgs=So;R.save=Eo;R.load=Po;R.useColors=To;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=no();t&&(t.stderr||t).level>=2&&(R.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{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function To(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:ko.isatty(process.stderr.fd)}n(To,"useColors");function So(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
2
2
  `).join(`
3
3
  `+o),t.push(i+"m+"+Gt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Co()+e+" "+t[0]}n(So,"formatArgs");function Co(){return R.inspectOpts.hideDate?"":new Date().toISOString()+" "}n(Co,"getDate");function xo(...t){return process.stderr.write(Nt.formatWithOptions(R.inspectOpts,...t)+`
4
4
  `)}n(xo,"log");function Eo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}n(Eo,"save");function Po(){return process.env.DEBUG}n(Po,"load");function Oo(t){t.inspectOpts={};let e=Object.keys(R.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=R.inspectOpts[e[r]]}n(Oo,"init");Gt.exports=_e()(R);var{formatters:zr}=Gt.exports;zr.o=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts).split(`
@@ -57,7 +57,7 @@ import{c as K}from"./chunk-T3XUROKS.js";import{a as be}from"./chunk-JBY5A44K.js"
57
57
  ${e} https://my-app.gadget.app
58
58
  ${e} https://my-app.gadget.app/edit
59
59
  ${e} https://my-app--development.gadget.app/edit
60
- `)},"AppArg");T();import dr from"node:assert";var ue=class{static{n(this,"Edit")}ctx;#t;constructor(e,r){this.ctx=e.child({name:"edit"}),this.#t=new jr(this.ctx,r,"/edit/api/graphql")}async query({query:e,variables:r,...s}){let i=/query (\w+)/.exec(e)?.[1];dr(i,"query name not found");let o=this.ctx.child({name:"edit",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:vt(r)}}});o.log.info("executing graphql query");let a=await this.#t.execute(o,{operation:e,variables:r,...s,http:{retry:{methods:["POST"]},...s.http}});if(a.errors)throw new X(e,a.errors);if(!a.data)throw new X(e,"Query response did not contain data");return a.data}async mutate({mutation:e,variables:r,...s}){let i=/mutation (\w+)/.exec(e)?.[1];dr(i,"mutation name not found");let o=this.ctx.child({name:"edit",fields:{edit:{mutation:i}},devFields:{edit:{mutation:i,variables:vt(r)}}});o.log.info("executing graphql mutation");let a=await this.#t.execute(o,{operation:e,variables:r,...s});if(a.errors)throw _r(a.errors)&&a.errors[0]&&a.errors[0]==="Unauthenticated. No authenticated client."?new Fr(e):new X(e,a.errors);if(!a.data)throw new X(e,"Mutation response did not contain data");return a.data}subscribe({onData:e,...r}){let s=/subscription (\w+)/.exec(r.subscription)?.[1];dr(s,"subscription name not found");let i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:vt(r.variables)}}}),o=n(async u=>{if(u.errors){a(),await r.onError(new X(r.subscription,u.errors));return}if(!u.data){a(),await r.onError(new X(r.subscription,"Subscription response did not contain data"));return}await e(u.data)},"onResponse");i.log.info("subscribing to graphql subscription");let a=this.#t.subscribe(i,{...r,onResponse:o});return{unsubscribe:n(()=>{a()},"unsubscribe"),resubscribe:n(u=>{a(),u!==void 0&&(r.variables=u),i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:vt(r.variables)}}}),i.log.info("re-subscribing to graphql subscription"),a=this.#t.subscribe(i,{...r,onResponse:o})},"resubscribe")}}async dispose(){await this.#t.dispose()}};var Hp={"--app":{type:Oi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},gr=class t{constructor(e,r,s,i,o,a){this.ctx=e;this.args=r;this.directory=s;this.environment=i;this.previousEnvironment=o;this.state=a;this.ctx=e.child({name:"sync-json",fields:n(()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}}),"fields")}),this.edit=new ue(this.ctx,this.environment)}static{n(this,"SyncJson")}gitBranch;edit;get filesVersion(){let e=this.state.environments[this.state.environment];return hr(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{command:r,args:s,directory:i}){e=e.child({name:"sync-json"});let o=await Lr(e,r),a=await ve(e);if(a.length===0)throw new K(C`
60
+ `)},"AppArg");T();import dr from"node:assert";var ue=class{static{n(this,"Edit")}ctx;#t;constructor(e,r){this.ctx=e.child({name:"edit"}),this.#t=new Dr(this.ctx,r,"/edit/api/graphql")}async query({query:e,variables:r,...s}){let i=/query (\w+)/.exec(e)?.[1];dr(i,"query name not found");let o=this.ctx.child({name:"edit",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:vt(r)}}});o.log.info("executing graphql query");let a=await this.#t.execute(o,{operation:e,variables:r,...s,http:{retry:{methods:["POST"]},...s.http}});if(a.errors)throw new X(e,a.errors);if(!a.data)throw new X(e,"Query response did not contain data");return a.data}async mutate({mutation:e,variables:r,...s}){let i=/mutation (\w+)/.exec(e)?.[1];dr(i,"mutation name not found");let o=this.ctx.child({name:"edit",fields:{edit:{mutation:i}},devFields:{edit:{mutation:i,variables:vt(r)}}});o.log.info("executing graphql mutation");let a=await this.#t.execute(o,{operation:e,variables:r,...s});if(a.errors)throw _r(a.errors)&&a.errors[0]&&a.errors[0]==="Unauthenticated. No authenticated client."?new Fr(e):new X(e,a.errors);if(!a.data)throw new X(e,"Mutation response did not contain data");return a.data}subscribe({onData:e,...r}){let s=/subscription (\w+)/.exec(r.subscription)?.[1];dr(s,"subscription name not found");let i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:vt(r.variables)}}}),o=n(async u=>{if(u.errors){a(),await r.onError(new X(r.subscription,u.errors));return}if(!u.data){a(),await r.onError(new X(r.subscription,"Subscription response did not contain data"));return}await e(u.data)},"onResponse");i.log.info("subscribing to graphql subscription");let a=this.#t.subscribe(i,{...r,onResponse:o});return{unsubscribe:n(()=>{a()},"unsubscribe"),resubscribe:n(u=>{a(),u!==void 0&&(r.variables=u),i=this.ctx.child({name:"edit",fields:{edit:{subscription:s}},devFields:{edit:{subscription:s,variables:vt(r.variables)}}}),i.log.info("re-subscribing to graphql subscription"),a=this.#t.subscribe(i,{...r,onResponse:o})},"resubscribe")}}async dispose(){await this.#t.dispose()}};var Hp={"--app":{type:Oi,alias:["-a","--application"]},"--env":{type:String,alias:["-e","--environment"]},"--allow-unknown-directory":Boolean,"--allow-different-app":Boolean},gr=class t{constructor(e,r,s,i,o,a){this.ctx=e;this.args=r;this.directory=s;this.environment=i;this.previousEnvironment=o;this.state=a;this.ctx=e.child({name:"sync-json",fields:n(()=>({syncJson:{directory:this.directory.path,branch:this.gitBranch,...this.state}}),"fields")}),this.edit=new ue(this.ctx,this.environment)}static{n(this,"SyncJson")}gitBranch;edit;get filesVersion(){let e=this.state.environments[this.state.environment];return hr(e,"environment must exist in environments"),BigInt(e.filesVersion)}static async load(e,{command:r,args:s,directory:i}){e=e.child({name:"sync-json"});let o=await jr(e,r),a=await ve(e);if(a.length===0)throw new K(C`
61
61
  You (${o.email}) don't have have any Gadget applications.
62
62
 
63
63
  Visit https://gadget.new to create one!
@@ -88,7 +88,7 @@ import{c as K}from"./chunk-T3XUROKS.js";import{a as be}from"./chunk-JBY5A44K.js"
88
88
  Editor https://${this.environment.application.primaryDomain}/edit/${this.environment.name}
89
89
  Playground https://${this.environment.application.primaryDomain}/api/playground/javascript?environment=${this.environment.name}
90
90
  Docs https://docs.gadget.dev/api/${this.environment.application.slug}
91
- `,$({...e,content:r})}print(e){e=Pr(e,{ensureEmptyLineAbove:!0}),bt(this.sprint(e))}},Dt=class extends gr{static{n(this,"EphemeralSyncJson")}async save(e){let r=this.state.environments[this.state.environment];return hr(r,"environment must exist in environments"),r.filesVersion=String(e),Promise.resolve()}},Yp=n(async t=>{he.windows&&t.startsWith("~/")&&(t=Or(t.slice(2)));let e=await Er(".gadget/sync.json",{cwd:t});return e&&(t=Ri.join(e,"../..")),t=Ri.resolve(t),await $r.init(t)},"loadSyncJsonDirectory"),Ai=n(async({args:t,availableApps:e,state:r})=>{let s=t["--app"]||r?.application;if(!s){let a=Array.from(Dr(e)).map(([u,c])=>[u,c.map(d=>d.slug)]);s=await be({groupedChoices:a,content:"Which application do you want to develop?"})}let i=e.find(a=>a.slug===s);if(i)return i;let o=ge(s,e.map(a=>a.slug)).slice(0,5);throw new K(C`
91
+ `,$({...e,content:r})}print(e){e=Pr(e,{ensureEmptyLineAbove:!0}),bt(this.sprint(e))}},Dt=class extends gr{static{n(this,"EphemeralSyncJson")}async save(e){let r=this.state.environments[this.state.environment];return hr(r,"environment must exist in environments"),r.filesVersion=String(e),Promise.resolve()}},Yp=n(async t=>{he.windows&&t.startsWith("~/")&&(t=Or(t.slice(2)));let e=await Er(".gadget/sync.json",{cwd:t});return e&&(t=Ri.join(e,"../..")),t=Ri.resolve(t),await $r.init(t)},"loadSyncJsonDirectory"),Ai=n(async({args:t,availableApps:e,state:r})=>{let s=t["--app"]||r?.application;if(!s){let a=Array.from(Lr(e)).map(([u,c])=>[u,c.map(d=>d.slug)]);s=await be({groupedChoices:a,content:"Which application do you want to develop?"})}let i=e.find(a=>a.slug===s);if(i)return i;let o=ge(s,e.map(a=>a.slug)).slice(0,5);throw new K(C`
92
92
  Unknown application:
93
93
 
94
94
  ${s}
@@ -113,4 +113,4 @@ import{c as K}from"./chunk-T3XUROKS.js";import{a as be}from"./chunk-JBY5A44K.js"
113
113
  • ${u.join(`
114
114
  \u2022 `)}
115
115
  `)},"loadEnvironment"),Uc=n(async(t,{directory:e})=>{try{return await Pi(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},"loadBranch"),qc=J.object({application:J.string(),environment:J.string(),environments:J.record(J.object({filesVersion:J.string()}))}),Jc=J.object({app:J.string(),filesVersion:J.string(),mtime:J.number()}),zc=J.union([qc,Jc]),Vc=zc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Xc as a,we as b,Zc as c,tl as d,el as e,Br as f,Mt as g,Ir as h,Nr as i,ao as j,fl as k,Hp as l,gr as m,Yp as n};
116
- //# sourceMappingURL=chunk-7VB3L2XK.js.map
116
+ //# sourceMappingURL=chunk-UAZBF6WU.js.map