shopify 3.94.0 → 3.94.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DBDY2YEY.js → chunk-2E6Y4J4T.js} +1 -1
- package/dist/{chunk-DEW5QFGH.js → chunk-KVWHPGOA.js} +114 -114
- package/dist/{chunk-AQOYGO3U.js → chunk-LH4VO6EV.js} +1 -1
- package/dist/{chunk-7JFIBCHH.js → chunk-PRNHS74J.js} +3 -3
- package/dist/{chunk-R6N4NGU6.js → chunk-RXF32AET.js} +2 -2
- package/dist/{chunk-7F3HZJH4.js → chunk-YPE4BWWD.js} +2 -2
- package/dist/{error-handler-JHFQZGYG.js → error-handler-CRWXGODM.js} +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/index.js +6 -6
- package/dist/{local-4PW2CHVR.js → local-7MUCLBBI.js} +1 -1
- package/dist/{node-package-manager-NTQEYCSE.js → node-package-manager-GFIGZZ24.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-7Z2HOOEO.js → ui-AOFJCTTO.js} +1 -1
- package/dist/{workerd-VL54JTEU.js → workerd-VBG5LYNX.js} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as RI,$a as zM,A as e7e,Aa as Pat,B as OM,Ba as o7e,C as oj,Ca as Fat,D as FI,Da as Rat,E as uat,Ea as Aat,F as lne,Fa as gne,G as t7e,Ga as vne,H as sj,Ha as yne,I as n7e,Ia as Nat,J as dat,Ja as bne,K as fat,Ka as wne,L as r7e,La as Oat,M as pat,Ma as _ne,N as i7e,Na as Sne,O as cne,Oa as WF,P as une,Pa as UM,Q as lj,Qa as xne,R as hat,Ra as Mat,S as Br,Sa as Lat,T as Od,Ta as qat,U as mat,V as _x,W as dne,X as zF,Y as MM,Z as nE,Za as s7e,_ as gat,_a as Bat,a as FKn,aa as rE,ab as AI,b as ij,ba as vat,bb as l7e,c as Wh,ca as fne,cb as Ene,d as Wit,da as C_,db as jF,e as Yit,ea as a7e,eb as HM,f as gr,fa as yat,fb as cj,g as $it,ga as LM,gb as kne,h as Qit,ha as qM,hb as WM,i as Xit,ia as bat,ib as Cne,j as h3,ja as pne,jb as zat,k as one,ka as wat,kb as Hat,l as eat,la as _at,lb as Wat,m as tat,ma as Sat,mb as Tne,n as nat,na as xat,nb as jat,o as rat,oa as Eat,ob as Vat,p as sne,pa as HF,pb as Gat,q as iat,qa as kat,r as k_,ra as Im,s as aj,sa as BM,t as aat,ta as Cat,u as m3,ua as Tat,v as tE,va as hne,w as UF,wa as mne,x as oat,xa as Iat,y as sat,ya as T_,z as lat,za as Dat}from"./chunk-R6N4NGU6.js";import{a as Uat,b as OKn}from"./chunk-45T5XUIM.js";import{b as cat,o as NKn}from"./chunk-KADPE3PY.js";import{a as RKn,b as AKn}from"./chunk-52KHWFYF.js";import{a as kit}from"./chunk-AKML26N3.js";import{a as Xxe}from"./chunk-NKQBEFPS.js";import{b as jit,c as Vit,d as Git,f as Zit}from"./chunk-DBDY2YEY.js";import{a as Kit,b as Jit,c as Zat}from"./chunk-7F3HZJH4.js";import{$ as AF,A as he,Aa as pit,B as Oxe,Ba as Yte,C as FF,D as Hte,Da as vit,E as RF,Ea as Hu,F as krt,Fa as jl,G as Mxe,Ga as ds,H as Crt,Ha as yit,I as ns,Ia as EKn,J as Lxe,Ja as Kte,K as aw,Ka as jxe,L as ow,La as kKn,M as Prt,Ma as CKn,N as Frt,O as Rrt,Oa as bit,P as Art,Q as Bxe,R as TM,S as IM,T as Nrt,U as Uxe,V as zxe,W as Ort,X as jte,Y as V5,_ as Mrt,a as Uh,aa as fKn,b as w_,ba as Lrt,c as Bte,ca as qrt,d as __,da as pKn,e as EI,ea as hKn,f as prt,fa as Brt,g as hrt,ga as mKn,h as mrt,ha as G5,i as grt,ia as kI,j as Nxe,ja as CI,k as vrt,ka as Urt,l as Ute,la as dp,m as PF,ma as zrt,n as yrt,na as NF,o as La,oa as Hrt,p as brt,pa as lv,q as lKn,qa as x_,r as cKn,ra as Wrt,s as wrt,t as _rt,ta as jrt,u as Srt,ua as Zte,v as zte,va as uit,w as dl,wa as dit,x as S_,xa as fit,y as xrt,z as Ert,za as Wxe}from"./chunk-7JFIBCHH.js";import"./chunk-PRKBO42R.js";import{A as Xrt,C as eit,F as tit,G as Z5,H as nit,I as rit,J as bx,L as iit,M as Vte,N as ait,O as oit,Q as OF,R as DM,S as Hxe,V as Gte,W as sit,X as lit,Y as cit,b as ej,d as uKn,e as sv,j as qxe,o as Trt,q as Irt,s as Drt,t as Wte,z as Qrt}from"./chunk-AQOYGO3U.js";import{$ as oKn,$a as io,$b as Gxe,Aa as Rxe,Ab as wit,Ac as E_,Ad as aa,Ba as pi,Bc as Jo,Bd as Jn,C as rKn,Ca as Nte,Cc as xg,Cd as wx,Da as To,Db as Y5,Dc as cd,Dd as Dy,Ea as nrt,Eb as Jte,Ec as tne,Ed as at,Fa as _g,Fb as tj,Fc as Iit,Fd as ka,G as Qnt,Ga as rrt,Gb as PM,Gc as BF,Gd as kg,H as iKn,Ha as irt,Hb as K,Hc as Kxe,Hd as PI,I as Cxe,Ia as art,Ib as nj,Ic as Dit,Id as Uit,Ja as j5,Jb as _it,Jc as we,Jd as NM,Ka as Ty,Kb as Sit,Kc as Nd,Kd as zit,La as Ote,Lb as xit,Lc as Qi,Ld as Hit,Ma as CM,Mb as u3,Na as ort,Nb as sw,Oa as srt,Ob as $te,P as aKn,Pa as lrt,Pb as Eit,Qa as XW,Qb as Cit,Qc as nne,Ra as Mte,Rb as TKn,Rc as v0,Sa as Axe,Sb as Hh,Sc as Pit,Ta as iw,Tb as FM,Tc as Fit,Ua as xI,Ub as IKn,Uc as Eg,V as c3,Va as crt,Vb as Tit,Vc as y0,Wb as Io,Wc as Jxe,X as Fte,Xb as Jr,Xc as AM,Y as YW,Ya as En,Yb as Vxe,Yc as Rit,Z as Txe,Za as Cc,Zb as d3,Zc as Ait,_ as Ixe,_a as Lte,_b as f3,_c as Nit,a as nw,aa as sKn,ab as urt,ac as Zxe,ba as EM,bb as km,bc as LF,bd as Oit,c as kxe,ca as IF,cb as yx,cc as RM,cd as Mit,da as DF,db as drt,dc as Cm,dd as rne,ea as KW,eb as qte,ec as cv,ed as b0,fb as Iy,fc as rj,ga as sc,gb as frt,gc as Qte,h as Gnt,ha as JW,ia as Dxe,ic as Qr,id as II,j as $Yn,ja as rw,jb as Vrt,jc as qF,jd as ine,k as QYn,kb as Grt,kc as Xte,kd as $xe,l as Znt,la as Rte,lb as Zrt,lc as Yxe,ld as Qxe,m as XYn,ma as $W,mc as p3,md as Lit,n as eKn,na as Ate,nb as Yrt,nc as DKn,oa as Xnt,ob as Krt,pa as QW,pb as Jrt,pc as PKn,q as Ynt,qa as ert,qb as $rt,qc as ene,ra as Pxe,rc as TI,rd as ane,sa as kM,sc as yr,t as tKn,ta as W5,tc as dr,td as qit,u as Knt,ua as Fxe,ub as hit,uc as Ci,va as Or,vb as mit,vc as Ko,vd as Bit,w as nKn,wa as Cy,wc as Tm,wd as ut,xa as trt,xb as git,xc as Tc,xd as d1,y as Jnt,ya as zh,yb as MF,yc as Uo,yd as it,z as $nt,za as vx,zc as Sg,zd as DI}from"./chunk-DEW5QFGH.js";import{a as dKn,c as bKn,m as wKn,n as SKn,r as xKn,t as ga}from"./chunk-SVA22NZQ.js";import{a as vKn,c as yKn}from"./chunk-FU2Y2M3M.js";import{b as _Kn}from"./chunk-QYR5VPQA.js";import"./chunk-EENHXSWU.js";import{c as Ne,d as ky,e as Kr,f as ji,g as Pte,h as ki,i as Ma,j as u1,k as jnt,m as eE,o as l3,p as kf,r as Vnt,s as Exe}from"./chunk-JBSYWYIP.js";import"./chunk-T4M5CWAO.js";import"./chunk-PRVQAHWI.js";import{a as gKn}from"./chunk-QUTQDXSL.js";import{a as Wt,b as Pi,c as E,d as ZW,e as Nt,f as Ey,g as c}from"./chunk-VPRTJUIN.js";var hot=E(Rne=>{"use strict";c();Object.defineProperty(Rne,"__esModule",{value:!0});Rne.boolean=void 0;var QKn=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};Rne.boolean=QKn});var mot=E(Ane=>{"use strict";c();Object.defineProperty(Ane,"__esModule",{value:!0});Ane.isBooleanable=void 0;var XKn=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};Ane.isBooleanable=XKn});var Nne=E(VM=>{"use strict";c();Object.defineProperty(VM,"__esModule",{value:!0});VM.isBooleanable=VM.boolean=void 0;var eJn=hot();Object.defineProperty(VM,"boolean",{enumerable:!0,get:function(){return eJn.boolean}});var tJn=mot();Object.defineProperty(VM,"isBooleanable",{enumerable:!0,get:function(){return tJn.isBooleanable}})});var One=E((Qia,got)=>{c();got.exports=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});var p7e=E((eaa,yot)=>{"use strict";c();var vot=Object.prototype.toString;yot.exports=function(t){var n=vot.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&vot.call(t.callee)==="[object Function]"),r}});var Tot=E((naa,Cot)=>{"use strict";c();var kot;Object.keys||(Aj=Object.prototype.hasOwnProperty,h7e=Object.prototype.toString,bot=p7e(),m7e=Object.prototype.propertyIsEnumerable,wot=!m7e.call({toString:null},"toString"),_ot=m7e.call(function(){},"prototype"),Nj=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Mne=function(e){var t=e.constructor;return t&&t.prototype===e},Sot={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},xot=(function(){if(typeof window>"u")return!1;for(var e in window)try{if(!Sot["$"+e]&&Aj.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Mne(window[e])}catch{return!0}}catch{return!0}return!1})(),Eot=function(e){if(typeof window>"u"||!xot)return Mne(e);try{return Mne(e)}catch{return!1}},kot=function(t){var n=t!==null&&typeof t=="object",r=h7e.call(t)==="[object Function]",i=bot(t),a=n&&h7e.call(t)==="[object String]",o=[];if(!n&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var s=_ot&&r;if(a&&t.length>0&&!Aj.call(t,0))for(var l=0;l<t.length;++l)o.push(String(l));if(i&&t.length>0)for(var u=0;u<t.length;++u)o.push(String(u));else for(var d in t)!(s&&d==="prototype")&&Aj.call(t,d)&&o.push(String(d));if(wot)for(var p=Eot(t),h=0;h<Nj.length;++h)!(p&&Nj[h]==="constructor")&&Aj.call(t,Nj[h])&&o.push(Nj[h]);return o});var Aj,h7e,bot,m7e,wot,_ot,Nj,Mne,Sot,xot,Eot;Cot.exports=kot});var Fot=E((iaa,Pot)=>{"use strict";c();var nJn=Array.prototype.slice,rJn=p7e(),Iot=Object.keys,Lne=Iot?function(t){return Iot(t)}:Tot(),Dot=Object.keys;Lne.shim=function(){if(Object.keys){var t=(function(){var n=Object.keys(arguments);return n&&n.length===arguments.length})(1,2);t||(Object.keys=function(r){return rJn(r)?Dot(nJn.call(r)):Dot(r)})}else Object.keys=Lne;return Object.keys||Lne};Pot.exports=Lne});var Oot=E((oaa,Not)=>{"use strict";c();var Rot=_rt(),iJn=lKn(),GM=cKn(),Aot=wrt();Not.exports=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new GM("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new GM("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new GM("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new GM("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new GM("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new GM("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!Aot&&Aot(t,n);if(Rot)Rot(t,n,{configurable:o===null&&l?l.configurable:!o,enumerable:i===null&&l?l.enumerable:!i,value:r,writable:a===null&&l?l.writable:!a});else if(s||!i&&!a&&!o)t[n]=r;else throw new iJn("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var qot=E((laa,Lot)=>{"use strict";c();var g7e=_rt(),Mot=function(){return!!g7e};Mot.hasArrayLengthDefineBug=function(){if(!g7e)return null;try{return g7e([],"length",{value:1}).length!==1}catch{return!0}};Lot.exports=Mot});var v7e=E((uaa,Hot)=>{"use strict";c();var aJn=Fot(),oJn=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",sJn=Object.prototype.toString,lJn=Array.prototype.concat,Bot=Oot(),cJn=function(e){return typeof e=="function"&&sJn.call(e)==="[object Function]"},Uot=qot()(),uJn=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!cJn(r)||!r())return}Uot?Bot(e,t,n,!0):Bot(e,t,n)},zot=function(e,t){var n=arguments.length>2?arguments[2]:{},r=aJn(t);oJn&&(r=lJn.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)uJn(e,r[i],t[r[i]],n[r[i]])};zot.supportsDescriptors=!!Uot;Hot.exports=zot});var y7e=E((faa,Wot)=>{"use strict";c();Wot.exports=global});var b7e=E((haa,jot)=>{"use strict";c();var dJn=y7e();jot.exports=function(){return typeof global!="object"||!global||global.Math!==Math||global.Array!==Array?dJn:global}});var Got=E((gaa,Vot)=>{"use strict";c();var fJn=v7e(),pJn=wrt(),hJn=b7e();Vot.exports=function(){var t=hJn();if(fJn.supportsDescriptors){var n=pJn(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t}});var w7e=E((yaa,Kot)=>{"use strict";c();var mJn=v7e(),gJn=y7e(),Zot=b7e(),vJn=Got(),yJn=Zot(),Yot=function(){return yJn};mJn(Yot,{getPolyfill:Zot,implementation:gJn,shim:vJn});Kot.exports=Yot});var Qot=E((_7e,$ot)=>{c();_7e=$ot.exports=bJn;_7e.getSerialize=Jot;function bJn(e,t,n,r){return JSON.stringify(e,Jot(t,r),n)}function Jot(e,t){var n=[],r=[];return t==null&&(t=function(i,a){return n[0]===a?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(a)).join(".")+"]"}),function(i,a){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?r.splice(o,1/0,i):r.push(i),~n.indexOf(a)&&(a=t.call(this,i,a))}else n.push(a);return e==null?a:e.call(this,i,a)}}});var Xot=E(qne=>{c();(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(o){return r(a(o),arguments)}function n(o,s){return t.apply(null,[o].concat(s||[]))}function r(o,s){var l=1,u=o.length,d,p="",h,v,S,k,I,C,N,q;for(h=0;h<u;h++)if(typeof o[h]=="string")p+=o[h];else if(typeof o[h]=="object"){if(S=o[h],S.keys)for(d=s[l],v=0;v<S.keys.length;v++){if(d==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',S.keys[v],S.keys[v-1]));d=d[S.keys[v]]}else S.param_no?d=s[S.param_no]:d=s[l++];if(e.not_type.test(S.type)&&e.not_primitive.test(S.type)&&d instanceof Function&&(d=d()),e.numeric_arg.test(S.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(t("[sprintf] expecting number but found %T",d));switch(e.number.test(S.type)&&(N=d>=0),S.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,S.width?parseInt(S.width):0);break;case"e":d=S.precision?parseFloat(d).toExponential(S.precision):parseFloat(d).toExponential();break;case"f":d=S.precision?parseFloat(d).toFixed(S.precision):parseFloat(d);break;case"g":d=S.precision?String(Number(d.toPrecision(S.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=S.precision?d.substring(0,S.precision):d;break;case"t":d=String(!!d),d=S.precision?d.substring(0,S.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=S.precision?d.substring(0,S.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=S.precision?d.substring(0,S.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase();break}e.json.test(S.type)?p+=d:(e.number.test(S.type)&&(!N||S.sign)?(q=N?"+":"-",d=d.toString().replace(e.sign,"")):q="",I=S.pad_char?S.pad_char==="0"?"0":S.pad_char.charAt(1):" ",C=S.width-(q+d).length,k=S.width&&C>0?I.repeat(C):"",p+=S.align?q+d+k:I==="0"?q+k+d:k+q+d)}return p}var i=Object.create(null);function a(o){if(i[o])return i[o];for(var s=o,l,u=[],d=0;s;){if((l=e.text.exec(s))!==null)u.push(l[0]);else if((l=e.modulo.exec(s))!==null)u.push("%");else if((l=e.placeholder.exec(s))!==null){if(l[2]){d|=1;var p=[],h=l[2],v=[];if((v=e.key.exec(h))!==null)for(p.push(v[1]);(h=h.substring(v[0].length))!=="";)if((v=e.key_access.exec(h))!==null)p.push(v[1]);else if((v=e.index_access.exec(h))!==null)p.push(v[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=p}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");u.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");s=s.substring(l[0].length)}return i[o]=u}typeof qne<"u"&&(qne.sprintf=t,qne.vsprintf=n),typeof window<"u"&&(window.sprintf=t,window.vsprintf=n,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:n}}))})()});var S7e=E(Bne=>{"use strict";c();Object.defineProperty(Bne,"__esModule",{value:!0});Bne.logLevels=void 0;var wJn={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};Bne.logLevels=wJn});var nst=E(zne=>{"use strict";c();Object.defineProperty(zne,"__esModule",{value:!0});zne.default=void 0;var _Jn=C7e(One()),SJn=C7e(w7e()),xJn=C7e(Qot()),x7e=Xot(),est=S7e();function C7e(e){return e&&e.__esModule?e:{default:e}}function E7e(){return E7e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E7e.apply(this,arguments)}function tst(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function K5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tst(Object(n),!0).forEach(function(r){EJn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tst(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EJn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kJn=(0,SJn.default)(),Oj;_Jn.default&&(Oj=Wt("domain"));var CJn=()=>{if(!Oj)return{};let e=[],t=process.domain;if(!t||!t.parentDomain)return{};for(;t&&t.parentDomain;)t=t.parentDomain,t.roarr&&t.roarr.context&&e.push(t.roarr.context);let n={};for(let r of e)n=K5(K5({},n),r);return n},Une=()=>{if(!Oj)return{};let e=process.domain;if(e&&e.roarr&&e.roarr.context)return e.roarr.context;if(!e||!e.parentDomain)return{};for(;e&&e.parentDomain;)if(e=e.parentDomain,e.roarr&&e.roarr.context)return e.roarr.context;return{}},k7e=(e,t)=>{let n=(r,i,a,o,s,l,u,d,p,h)=>{let v=Date.now(),S=kJn.ROARR.sequence++,k,I;if(typeof r=="string"){k=K5(K5({},Une()),t||{});let C=E7e({},{a:r,b:i,c:a,d:o,e:s,f:l,g:u,h:d,i:p,k:h});I=Object.keys(C).map(M=>C[M]).reduce((M,V)=>M+=typeof V>"u"?0:1,0)===1?(0,x7e.sprintf)("%s",r):(0,x7e.sprintf)(r,i,a,o,s,l,u,d,p,h)}else{if(typeof i!="string")throw new TypeError("Message must be a string.");k=JSON.parse((0,xJn.default)(K5(K5(K5({},Une()),t||{}),r))),I=(0,x7e.sprintf)(i,a,o,s,l,u,d,p,h)}e({context:k,message:I,sequence:S,time:v,version:"1.0.0"})};n.child=r=>typeof r=="function"?k7e(i=>{if(typeof r!="function")throw new TypeError("Unexpected state.");e(r(i))},t):k7e(e,K5(K5(K5({},Une()),t),r)),n.getContext=()=>K5(K5({},Une()),t||{}),n.adopt=async(r,i)=>{if(!Oj)return r();let a=Oj.create();return a.run(()=>(a.roarr={context:K5(K5({},CJn()),i)},r()))};for(let r of Object.keys(est.logLevels))n[r]=(i,a,o,s,l,u,d,p,h,v)=>n.child({logLevel:est.logLevels[r]})(i,a,o,s,l,u,d,p,h,v);return n},TJn=k7e;zne.default=TJn});var ast=E(Hne=>{"use strict";c();Object.defineProperty(Hne,"__esModule",{value:!0});Hne.default=void 0;var rst=S7e(),ist=(e,t)=>{let n=(r,i,a,o,s,l,u,d,p,h)=>{};n.adopt=async r=>r(),n.child=r=>ist(e,t),n.getContext=()=>({});for(let r of Object.keys(rst.logLevels))n[r]=(i,a,o,s,l,u,d,p,h,v)=>n.child({logLevel:rst.logLevels[r]})(i,a,o,s,l,u,d,p,h,v);return n},IJn=ist;Hne.default=IJn});var sst=E((Daa,ost)=>{c();ost.exports=function(t,n){for(var r=t.split("."),i=n.split("."),a=0;a<3;a++){var o=Number(r[a]),s=Number(i[a]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return 0}});var lst=E((Faa,DJn)=>{DJn.exports={author:{email:"gajus@gajus.com",name:"Gajus Kuizinas",url:"http://gajus.com"},ava:{babel:{compileAsTests:["test/helpers/**/*"]},files:["test/roarr/**/*"],require:["@babel/register"]},dependencies:{boolean:"^3.0.1","detect-node":"^2.0.4",globalthis:"^1.0.1","json-stringify-safe":"^5.0.1","semver-compare":"^1.0.0","sprintf-js":"^1.1.2"},description:"JSON logger for Node.js and browser.",devDependencies:{"@ava/babel":"^1.0.1","@babel/cli":"^7.11.6","@babel/core":"^7.11.6","@babel/node":"^7.10.5","@babel/plugin-transform-flow-strip-types":"^7.10.4","@babel/preset-env":"^7.11.5","@babel/register":"^7.11.5",ava:"^3.12.1","babel-plugin-istanbul":"^6.0.0","babel-plugin-transform-export-default-name":"^2.0.4",coveralls:"^3.1.0","domain-parent":"^1.0.0",eslint:"^7.9.0","eslint-config-canonical":"^24.1.1","flow-bin":"^0.133.0","flow-copy-source":"^2.0.9",gitdown:"^3.1.3",husky:"^4.3.0",nyc:"^15.1.0","semantic-release":"^17.1.1"},engines:{node:">=8.0"},husky:{hooks:{"pre-commit":"npm run lint && npm run test && npm run build","pre-push":"gitdown ./.README/README.md --output-file ./README.md --check"}},keywords:["log","logger","json"],main:"./dist/log.js",name:"roarr",nyc:{include:["src/**/*.js"],instrument:!1,reporter:["text-lcov"],require:["@babel/register"],sourceMap:!1},license:"BSD-3-Clause",repository:{type:"git",url:"git@github.com:gajus/roarr.git"},scripts:{build:"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","create-readme":"gitdown ./.README/README.md --output-file ./README.md",dev:"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch",lint:"eslint ./src ./test && flow",test:"NODE_ENV=test ava --serial --verbose"},version:"2.15.4"}});var cst=E(Wne=>{"use strict";c();Object.defineProperty(Wne,"__esModule",{value:!0});Wne.default=void 0;var PJn=e=>({write:t=>{e.write(t+`
|
|
1
|
+
import{$ as RI,$a as zM,A as e7e,Aa as Pat,B as OM,Ba as o7e,C as oj,Ca as Fat,D as FI,Da as Rat,E as uat,Ea as Aat,F as lne,Fa as gne,G as t7e,Ga as vne,H as sj,Ha as yne,I as n7e,Ia as Nat,J as dat,Ja as bne,K as fat,Ka as wne,L as r7e,La as Oat,M as pat,Ma as _ne,N as i7e,Na as Sne,O as cne,Oa as WF,P as une,Pa as UM,Q as lj,Qa as xne,R as hat,Ra as Mat,S as Br,Sa as Lat,T as Od,Ta as qat,U as mat,V as _x,W as dne,X as zF,Y as MM,Z as nE,Za as s7e,_ as gat,_a as Bat,a as FKn,aa as rE,ab as AI,b as ij,ba as vat,bb as l7e,c as Wh,ca as fne,cb as Ene,d as Wit,da as C_,db as jF,e as Yit,ea as a7e,eb as HM,f as gr,fa as yat,fb as cj,g as $it,ga as LM,gb as kne,h as Qit,ha as qM,hb as WM,i as Xit,ia as bat,ib as Cne,j as h3,ja as pne,jb as zat,k as one,ka as wat,kb as Hat,l as eat,la as _at,lb as Wat,m as tat,ma as Sat,mb as Tne,n as nat,na as xat,nb as jat,o as rat,oa as Eat,ob as Vat,p as sne,pa as HF,pb as Gat,q as iat,qa as kat,r as k_,ra as Im,s as aj,sa as BM,t as aat,ta as Cat,u as m3,ua as Tat,v as tE,va as hne,w as UF,wa as mne,x as oat,xa as Iat,y as sat,ya as T_,z as lat,za as Dat}from"./chunk-RXF32AET.js";import{a as Uat,b as OKn}from"./chunk-45T5XUIM.js";import{b as cat,o as NKn}from"./chunk-KADPE3PY.js";import{a as RKn,b as AKn}from"./chunk-52KHWFYF.js";import{a as kit}from"./chunk-AKML26N3.js";import{a as Xxe}from"./chunk-NKQBEFPS.js";import{b as jit,c as Vit,d as Git,f as Zit}from"./chunk-2E6Y4J4T.js";import{a as Kit,b as Jit,c as Zat}from"./chunk-YPE4BWWD.js";import{$ as AF,A as he,Aa as pit,B as Oxe,Ba as Yte,C as FF,D as Hte,Da as vit,E as RF,Ea as Hu,F as krt,Fa as jl,G as Mxe,Ga as ds,H as Crt,Ha as yit,I as ns,Ia as EKn,J as Lxe,Ja as Kte,K as aw,Ka as jxe,L as ow,La as kKn,M as Prt,Ma as CKn,N as Frt,O as Rrt,Oa as bit,P as Art,Q as Bxe,R as TM,S as IM,T as Nrt,U as Uxe,V as zxe,W as Ort,X as jte,Y as V5,_ as Mrt,a as Uh,aa as fKn,b as w_,ba as Lrt,c as Bte,ca as qrt,d as __,da as pKn,e as EI,ea as hKn,f as prt,fa as Brt,g as hrt,ga as mKn,h as mrt,ha as G5,i as grt,ia as kI,j as Nxe,ja as CI,k as vrt,ka as Urt,l as Ute,la as dp,m as PF,ma as zrt,n as yrt,na as NF,o as La,oa as Hrt,p as brt,pa as lv,q as lKn,qa as x_,r as cKn,ra as Wrt,s as wrt,t as _rt,ta as jrt,u as Srt,ua as Zte,v as zte,va as uit,w as dl,wa as dit,x as S_,xa as fit,y as xrt,z as Ert,za as Wxe}from"./chunk-PRNHS74J.js";import"./chunk-PRKBO42R.js";import{A as Xrt,C as eit,F as tit,G as Z5,H as nit,I as rit,J as bx,L as iit,M as Vte,N as ait,O as oit,Q as OF,R as DM,S as Hxe,V as Gte,W as sit,X as lit,Y as cit,b as ej,d as uKn,e as sv,j as qxe,o as Trt,q as Irt,s as Drt,t as Wte,z as Qrt}from"./chunk-LH4VO6EV.js";import{$ as oKn,$a as io,$b as Gxe,Aa as Rxe,Ab as wit,Ac as E_,Ad as aa,Ba as pi,Bc as Jo,Bd as Jn,C as rKn,Ca as Nte,Cc as xg,Cd as wx,Da as To,Db as Y5,Dc as cd,Dd as Dy,Ea as nrt,Eb as Jte,Ec as tne,Ed as at,Fa as _g,Fb as tj,Fc as Iit,Fd as ka,G as Qnt,Ga as rrt,Gb as PM,Gc as BF,Gd as kg,H as iKn,Ha as irt,Hb as K,Hc as Kxe,Hd as PI,I as Cxe,Ia as art,Ib as nj,Ic as Dit,Id as Uit,Ja as j5,Jb as _it,Jc as we,Jd as NM,Ka as Ty,Kb as Sit,Kc as Nd,Kd as zit,La as Ote,Lb as xit,Lc as Qi,Ld as Hit,Ma as CM,Mb as u3,Na as ort,Nb as sw,Oa as srt,Ob as $te,P as aKn,Pa as lrt,Pb as Eit,Qa as XW,Qb as Cit,Qc as nne,Ra as Mte,Rb as TKn,Rc as v0,Sa as Axe,Sb as Hh,Sc as Pit,Ta as iw,Tb as FM,Tc as Fit,Ua as xI,Ub as IKn,Uc as Eg,V as c3,Va as crt,Vb as Tit,Vc as y0,Wb as Io,Wc as Jxe,X as Fte,Xb as Jr,Xc as AM,Y as YW,Ya as En,Yb as Vxe,Yc as Rit,Z as Txe,Za as Cc,Zb as d3,Zc as Ait,_ as Ixe,_a as Lte,_b as f3,_c as Nit,a as nw,aa as sKn,ab as urt,ac as Zxe,ba as EM,bb as km,bc as LF,bd as Oit,c as kxe,ca as IF,cb as yx,cc as RM,cd as Mit,da as DF,db as drt,dc as Cm,dd as rne,ea as KW,eb as qte,ec as cv,ed as b0,fb as Iy,fc as rj,ga as sc,gb as frt,gc as Qte,h as Gnt,ha as JW,ia as Dxe,ic as Qr,id as II,j as $Yn,ja as rw,jb as Vrt,jc as qF,jd as ine,k as QYn,kb as Grt,kc as Xte,kd as $xe,l as Znt,la as Rte,lb as Zrt,lc as Yxe,ld as Qxe,m as XYn,ma as $W,mc as p3,md as Lit,n as eKn,na as Ate,nb as Yrt,nc as DKn,oa as Xnt,ob as Krt,pa as QW,pb as Jrt,pc as PKn,q as Ynt,qa as ert,qb as $rt,qc as ene,ra as Pxe,rc as TI,rd as ane,sa as kM,sc as yr,t as tKn,ta as W5,tc as dr,td as qit,u as Knt,ua as Fxe,ub as hit,uc as Ci,va as Or,vb as mit,vc as Ko,vd as Bit,w as nKn,wa as Cy,wc as Tm,wd as ut,xa as trt,xb as git,xc as Tc,xd as d1,y as Jnt,ya as zh,yb as MF,yc as Uo,yd as it,z as $nt,za as vx,zc as Sg,zd as DI}from"./chunk-KVWHPGOA.js";import{a as dKn,c as bKn,m as wKn,n as SKn,r as xKn,t as ga}from"./chunk-SVA22NZQ.js";import{a as vKn,c as yKn}from"./chunk-FU2Y2M3M.js";import{b as _Kn}from"./chunk-QYR5VPQA.js";import"./chunk-EENHXSWU.js";import{c as Ne,d as ky,e as Kr,f as ji,g as Pte,h as ki,i as Ma,j as u1,k as jnt,m as eE,o as l3,p as kf,r as Vnt,s as Exe}from"./chunk-JBSYWYIP.js";import"./chunk-T4M5CWAO.js";import"./chunk-PRVQAHWI.js";import{a as gKn}from"./chunk-QUTQDXSL.js";import{a as Wt,b as Pi,c as E,d as ZW,e as Nt,f as Ey,g as c}from"./chunk-VPRTJUIN.js";var hot=E(Rne=>{"use strict";c();Object.defineProperty(Rne,"__esModule",{value:!0});Rne.boolean=void 0;var QKn=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};Rne.boolean=QKn});var mot=E(Ane=>{"use strict";c();Object.defineProperty(Ane,"__esModule",{value:!0});Ane.isBooleanable=void 0;var XKn=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};Ane.isBooleanable=XKn});var Nne=E(VM=>{"use strict";c();Object.defineProperty(VM,"__esModule",{value:!0});VM.isBooleanable=VM.boolean=void 0;var eJn=hot();Object.defineProperty(VM,"boolean",{enumerable:!0,get:function(){return eJn.boolean}});var tJn=mot();Object.defineProperty(VM,"isBooleanable",{enumerable:!0,get:function(){return tJn.isBooleanable}})});var One=E((Qia,got)=>{c();got.exports=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});var p7e=E((eaa,yot)=>{"use strict";c();var vot=Object.prototype.toString;yot.exports=function(t){var n=vot.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&vot.call(t.callee)==="[object Function]"),r}});var Tot=E((naa,Cot)=>{"use strict";c();var kot;Object.keys||(Aj=Object.prototype.hasOwnProperty,h7e=Object.prototype.toString,bot=p7e(),m7e=Object.prototype.propertyIsEnumerable,wot=!m7e.call({toString:null},"toString"),_ot=m7e.call(function(){},"prototype"),Nj=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Mne=function(e){var t=e.constructor;return t&&t.prototype===e},Sot={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},xot=(function(){if(typeof window>"u")return!1;for(var e in window)try{if(!Sot["$"+e]&&Aj.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Mne(window[e])}catch{return!0}}catch{return!0}return!1})(),Eot=function(e){if(typeof window>"u"||!xot)return Mne(e);try{return Mne(e)}catch{return!1}},kot=function(t){var n=t!==null&&typeof t=="object",r=h7e.call(t)==="[object Function]",i=bot(t),a=n&&h7e.call(t)==="[object String]",o=[];if(!n&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var s=_ot&&r;if(a&&t.length>0&&!Aj.call(t,0))for(var l=0;l<t.length;++l)o.push(String(l));if(i&&t.length>0)for(var u=0;u<t.length;++u)o.push(String(u));else for(var d in t)!(s&&d==="prototype")&&Aj.call(t,d)&&o.push(String(d));if(wot)for(var p=Eot(t),h=0;h<Nj.length;++h)!(p&&Nj[h]==="constructor")&&Aj.call(t,Nj[h])&&o.push(Nj[h]);return o});var Aj,h7e,bot,m7e,wot,_ot,Nj,Mne,Sot,xot,Eot;Cot.exports=kot});var Fot=E((iaa,Pot)=>{"use strict";c();var nJn=Array.prototype.slice,rJn=p7e(),Iot=Object.keys,Lne=Iot?function(t){return Iot(t)}:Tot(),Dot=Object.keys;Lne.shim=function(){if(Object.keys){var t=(function(){var n=Object.keys(arguments);return n&&n.length===arguments.length})(1,2);t||(Object.keys=function(r){return rJn(r)?Dot(nJn.call(r)):Dot(r)})}else Object.keys=Lne;return Object.keys||Lne};Pot.exports=Lne});var Oot=E((oaa,Not)=>{"use strict";c();var Rot=_rt(),iJn=lKn(),GM=cKn(),Aot=wrt();Not.exports=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new GM("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new GM("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new GM("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new GM("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new GM("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new GM("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!Aot&&Aot(t,n);if(Rot)Rot(t,n,{configurable:o===null&&l?l.configurable:!o,enumerable:i===null&&l?l.enumerable:!i,value:r,writable:a===null&&l?l.writable:!a});else if(s||!i&&!a&&!o)t[n]=r;else throw new iJn("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var qot=E((laa,Lot)=>{"use strict";c();var g7e=_rt(),Mot=function(){return!!g7e};Mot.hasArrayLengthDefineBug=function(){if(!g7e)return null;try{return g7e([],"length",{value:1}).length!==1}catch{return!0}};Lot.exports=Mot});var v7e=E((uaa,Hot)=>{"use strict";c();var aJn=Fot(),oJn=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",sJn=Object.prototype.toString,lJn=Array.prototype.concat,Bot=Oot(),cJn=function(e){return typeof e=="function"&&sJn.call(e)==="[object Function]"},Uot=qot()(),uJn=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!cJn(r)||!r())return}Uot?Bot(e,t,n,!0):Bot(e,t,n)},zot=function(e,t){var n=arguments.length>2?arguments[2]:{},r=aJn(t);oJn&&(r=lJn.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)uJn(e,r[i],t[r[i]],n[r[i]])};zot.supportsDescriptors=!!Uot;Hot.exports=zot});var y7e=E((faa,Wot)=>{"use strict";c();Wot.exports=global});var b7e=E((haa,jot)=>{"use strict";c();var dJn=y7e();jot.exports=function(){return typeof global!="object"||!global||global.Math!==Math||global.Array!==Array?dJn:global}});var Got=E((gaa,Vot)=>{"use strict";c();var fJn=v7e(),pJn=wrt(),hJn=b7e();Vot.exports=function(){var t=hJn();if(fJn.supportsDescriptors){var n=pJn(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t}});var w7e=E((yaa,Kot)=>{"use strict";c();var mJn=v7e(),gJn=y7e(),Zot=b7e(),vJn=Got(),yJn=Zot(),Yot=function(){return yJn};mJn(Yot,{getPolyfill:Zot,implementation:gJn,shim:vJn});Kot.exports=Yot});var Qot=E((_7e,$ot)=>{c();_7e=$ot.exports=bJn;_7e.getSerialize=Jot;function bJn(e,t,n,r){return JSON.stringify(e,Jot(t,r),n)}function Jot(e,t){var n=[],r=[];return t==null&&(t=function(i,a){return n[0]===a?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(a)).join(".")+"]"}),function(i,a){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?r.splice(o,1/0,i):r.push(i),~n.indexOf(a)&&(a=t.call(this,i,a))}else n.push(a);return e==null?a:e.call(this,i,a)}}});var Xot=E(qne=>{c();(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(o){return r(a(o),arguments)}function n(o,s){return t.apply(null,[o].concat(s||[]))}function r(o,s){var l=1,u=o.length,d,p="",h,v,S,k,I,C,N,q;for(h=0;h<u;h++)if(typeof o[h]=="string")p+=o[h];else if(typeof o[h]=="object"){if(S=o[h],S.keys)for(d=s[l],v=0;v<S.keys.length;v++){if(d==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',S.keys[v],S.keys[v-1]));d=d[S.keys[v]]}else S.param_no?d=s[S.param_no]:d=s[l++];if(e.not_type.test(S.type)&&e.not_primitive.test(S.type)&&d instanceof Function&&(d=d()),e.numeric_arg.test(S.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(t("[sprintf] expecting number but found %T",d));switch(e.number.test(S.type)&&(N=d>=0),S.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,S.width?parseInt(S.width):0);break;case"e":d=S.precision?parseFloat(d).toExponential(S.precision):parseFloat(d).toExponential();break;case"f":d=S.precision?parseFloat(d).toFixed(S.precision):parseFloat(d);break;case"g":d=S.precision?String(Number(d.toPrecision(S.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=S.precision?d.substring(0,S.precision):d;break;case"t":d=String(!!d),d=S.precision?d.substring(0,S.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=S.precision?d.substring(0,S.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=S.precision?d.substring(0,S.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase();break}e.json.test(S.type)?p+=d:(e.number.test(S.type)&&(!N||S.sign)?(q=N?"+":"-",d=d.toString().replace(e.sign,"")):q="",I=S.pad_char?S.pad_char==="0"?"0":S.pad_char.charAt(1):" ",C=S.width-(q+d).length,k=S.width&&C>0?I.repeat(C):"",p+=S.align?q+d+k:I==="0"?q+k+d:k+q+d)}return p}var i=Object.create(null);function a(o){if(i[o])return i[o];for(var s=o,l,u=[],d=0;s;){if((l=e.text.exec(s))!==null)u.push(l[0]);else if((l=e.modulo.exec(s))!==null)u.push("%");else if((l=e.placeholder.exec(s))!==null){if(l[2]){d|=1;var p=[],h=l[2],v=[];if((v=e.key.exec(h))!==null)for(p.push(v[1]);(h=h.substring(v[0].length))!=="";)if((v=e.key_access.exec(h))!==null)p.push(v[1]);else if((v=e.index_access.exec(h))!==null)p.push(v[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=p}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");u.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");s=s.substring(l[0].length)}return i[o]=u}typeof qne<"u"&&(qne.sprintf=t,qne.vsprintf=n),typeof window<"u"&&(window.sprintf=t,window.vsprintf=n,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:n}}))})()});var S7e=E(Bne=>{"use strict";c();Object.defineProperty(Bne,"__esModule",{value:!0});Bne.logLevels=void 0;var wJn={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};Bne.logLevels=wJn});var nst=E(zne=>{"use strict";c();Object.defineProperty(zne,"__esModule",{value:!0});zne.default=void 0;var _Jn=C7e(One()),SJn=C7e(w7e()),xJn=C7e(Qot()),x7e=Xot(),est=S7e();function C7e(e){return e&&e.__esModule?e:{default:e}}function E7e(){return E7e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E7e.apply(this,arguments)}function tst(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function K5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tst(Object(n),!0).forEach(function(r){EJn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tst(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EJn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kJn=(0,SJn.default)(),Oj;_Jn.default&&(Oj=Wt("domain"));var CJn=()=>{if(!Oj)return{};let e=[],t=process.domain;if(!t||!t.parentDomain)return{};for(;t&&t.parentDomain;)t=t.parentDomain,t.roarr&&t.roarr.context&&e.push(t.roarr.context);let n={};for(let r of e)n=K5(K5({},n),r);return n},Une=()=>{if(!Oj)return{};let e=process.domain;if(e&&e.roarr&&e.roarr.context)return e.roarr.context;if(!e||!e.parentDomain)return{};for(;e&&e.parentDomain;)if(e=e.parentDomain,e.roarr&&e.roarr.context)return e.roarr.context;return{}},k7e=(e,t)=>{let n=(r,i,a,o,s,l,u,d,p,h)=>{let v=Date.now(),S=kJn.ROARR.sequence++,k,I;if(typeof r=="string"){k=K5(K5({},Une()),t||{});let C=E7e({},{a:r,b:i,c:a,d:o,e:s,f:l,g:u,h:d,i:p,k:h});I=Object.keys(C).map(M=>C[M]).reduce((M,V)=>M+=typeof V>"u"?0:1,0)===1?(0,x7e.sprintf)("%s",r):(0,x7e.sprintf)(r,i,a,o,s,l,u,d,p,h)}else{if(typeof i!="string")throw new TypeError("Message must be a string.");k=JSON.parse((0,xJn.default)(K5(K5(K5({},Une()),t||{}),r))),I=(0,x7e.sprintf)(i,a,o,s,l,u,d,p,h)}e({context:k,message:I,sequence:S,time:v,version:"1.0.0"})};n.child=r=>typeof r=="function"?k7e(i=>{if(typeof r!="function")throw new TypeError("Unexpected state.");e(r(i))},t):k7e(e,K5(K5(K5({},Une()),t),r)),n.getContext=()=>K5(K5({},Une()),t||{}),n.adopt=async(r,i)=>{if(!Oj)return r();let a=Oj.create();return a.run(()=>(a.roarr={context:K5(K5({},CJn()),i)},r()))};for(let r of Object.keys(est.logLevels))n[r]=(i,a,o,s,l,u,d,p,h,v)=>n.child({logLevel:est.logLevels[r]})(i,a,o,s,l,u,d,p,h,v);return n},TJn=k7e;zne.default=TJn});var ast=E(Hne=>{"use strict";c();Object.defineProperty(Hne,"__esModule",{value:!0});Hne.default=void 0;var rst=S7e(),ist=(e,t)=>{let n=(r,i,a,o,s,l,u,d,p,h)=>{};n.adopt=async r=>r(),n.child=r=>ist(e,t),n.getContext=()=>({});for(let r of Object.keys(rst.logLevels))n[r]=(i,a,o,s,l,u,d,p,h,v)=>n.child({logLevel:rst.logLevels[r]})(i,a,o,s,l,u,d,p,h,v);return n},IJn=ist;Hne.default=IJn});var sst=E((Daa,ost)=>{c();ost.exports=function(t,n){for(var r=t.split("."),i=n.split("."),a=0;a<3;a++){var o=Number(r[a]),s=Number(i[a]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return 0}});var lst=E((Faa,DJn)=>{DJn.exports={author:{email:"gajus@gajus.com",name:"Gajus Kuizinas",url:"http://gajus.com"},ava:{babel:{compileAsTests:["test/helpers/**/*"]},files:["test/roarr/**/*"],require:["@babel/register"]},dependencies:{boolean:"^3.0.1","detect-node":"^2.0.4",globalthis:"^1.0.1","json-stringify-safe":"^5.0.1","semver-compare":"^1.0.0","sprintf-js":"^1.1.2"},description:"JSON logger for Node.js and browser.",devDependencies:{"@ava/babel":"^1.0.1","@babel/cli":"^7.11.6","@babel/core":"^7.11.6","@babel/node":"^7.10.5","@babel/plugin-transform-flow-strip-types":"^7.10.4","@babel/preset-env":"^7.11.5","@babel/register":"^7.11.5",ava:"^3.12.1","babel-plugin-istanbul":"^6.0.0","babel-plugin-transform-export-default-name":"^2.0.4",coveralls:"^3.1.0","domain-parent":"^1.0.0",eslint:"^7.9.0","eslint-config-canonical":"^24.1.1","flow-bin":"^0.133.0","flow-copy-source":"^2.0.9",gitdown:"^3.1.3",husky:"^4.3.0",nyc:"^15.1.0","semantic-release":"^17.1.1"},engines:{node:">=8.0"},husky:{hooks:{"pre-commit":"npm run lint && npm run test && npm run build","pre-push":"gitdown ./.README/README.md --output-file ./README.md --check"}},keywords:["log","logger","json"],main:"./dist/log.js",name:"roarr",nyc:{include:["src/**/*.js"],instrument:!1,reporter:["text-lcov"],require:["@babel/register"],sourceMap:!1},license:"BSD-3-Clause",repository:{type:"git",url:"git@github.com:gajus/roarr.git"},scripts:{build:"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","create-readme":"gitdown ./.README/README.md --output-file ./README.md",dev:"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch",lint:"eslint ./src ./test && flow",test:"NODE_ENV=test ava --serial --verbose"},version:"2.15.4"}});var cst=E(Wne=>{"use strict";c();Object.defineProperty(Wne,"__esModule",{value:!0});Wne.default=void 0;var PJn=e=>({write:t=>{e.write(t+`
|
|
2
2
|
`)}}),FJn=()=>{let t=(process.env.ROARR_STREAM||"STDOUT").toUpperCase().toUpperCase()==="STDOUT"?process.stdout:process.stderr;return PJn(t)},RJn=FJn;Wne.default=RJn});var dst=E(Vne=>{"use strict";c();Object.defineProperty(Vne,"__esModule",{value:!0});Vne.default=void 0;var AJn=D7e(One()),T7e=D7e(sst()),I7e=lst(),NJn=D7e(cst());function D7e(e){return e&&e.__esModule?e:{default:e}}function ust(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ust(Object(n),!0).forEach(function(r){OJn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ust(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OJn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var MJn=e=>{let t=(e.versions||[]).concat();t.sort(T7e.default);let n=!t.length||(0,T7e.default)(I7e.version,t[t.length-1])===1;t.includes(I7e.version)||t.push(I7e.version),t.sort(T7e.default);let r=jne(jne({sequence:0},e),{},{versions:t});return AJn.default&&(n||!r.write)&&(r=jne(jne({},r),(0,NJn.default)())),r},LJn=MJn;Vne.default=LJn});var fst=E(Mj=>{"use strict";c();Object.defineProperty(Mj,"__esModule",{value:!0});Object.defineProperty(Mj,"createLogger",{enumerable:!0,get:function(){return qJn.default}});Object.defineProperty(Mj,"createMockLogger",{enumerable:!0,get:function(){return BJn.default}});Object.defineProperty(Mj,"createRoarrInititialGlobalState",{enumerable:!0,get:function(){return UJn.default}});var qJn=P7e(nst()),BJn=P7e(ast()),UJn=P7e(dst());function P7e(e){return e&&e.__esModule?e:{default:e}}});var gst=E(ZM=>{"use strict";c();Object.defineProperty(ZM,"__esModule",{value:!0});ZM.default=ZM.ROARR=void 0;var zJn=Nne(),HJn=hst(One()),WJn=hst(w7e()),R7e=fst();function hst(e){return e&&e.__esModule?e:{default:e}}var pst=(0,WJn.default)(),F7e=pst.ROARR=(0,R7e.createRoarrInititialGlobalState)(pst.ROARR||{});ZM.ROARR=F7e;var mst=R7e.createLogger;HJn.default&&((0,zJn.boolean)(process.env.ROARR_LOG||"")||(mst=R7e.createMockLogger));var jJn=mst(e=>{if(F7e.write){let t=JSON.stringify(e);F7e.write(t)}});ZM.default=jJn});var Lj=E(Gne=>{"use strict";c();Object.defineProperty(Gne,"__esModule",{value:!0});Gne.default=void 0;var VJn=GJn(gst());function GJn(e){return e&&e.__esModule?e:{default:e}}var ZJn=VJn.default.child({package:"global-agent"}),YJn=ZJn;Gne.default=YJn});var yst=E((Haa,vst)=>{"use strict";c();var A7e=class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(t){try{return JSON.stringify(t)}catch{return String(t)}}},KJn=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],N7e=({from:e,seen:t,to_:n,forceEnumerable:r})=>{let i=n||(Array.isArray(e)?[]:{});t.push(e);for(let[a,o]of Object.entries(e))if(typeof o!="function"){if(!o||typeof o!="object"){i[a]=o;continue}if(!t.includes(e[a])){i[a]=N7e({from:e[a],seen:t.slice(),forceEnumerable:r});continue}i[a]="[Circular]"}for(let{property:a,enumerable:o}of KJn)typeof e[a]=="string"&&Object.defineProperty(i,a,{value:e[a],enumerable:r?!0:o,configurable:!0,writable:!0});return i},JJn=e=>typeof e=="object"&&e!==null?N7e({from:e,seen:[],forceEnumerable:!0}):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:e,$Jn=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=new Error;return N7e({from:e,seen:[],to_:t}),t}return new A7e(e)};vst.exports={serializeError:JJn,deserializeError:$Jn}});var Yne=E(Zne=>{"use strict";c();Object.defineProperty(Zne,"__esModule",{value:!0});Zne.default=void 0;var bst=yst(),QJn=Nne(),XJn=e$n(Lj());function e$n(e){return e&&e.__esModule?e:{default:e}}var iE=XJn.default.child({namespace:"Agent"}),t$n=0,O7e=class{constructor(t,n,r,i,a){this.fallbackAgent=i,this.isProxyConfigured=t,this.mustUrlUseProxy=n,this.getUrlProxy=r,this.socketConnectionTimeout=a}addRequest(t,n){let r;if(t.path.startsWith("http://")||t.path.startsWith("https://")?r=t.path:r=this.protocol+"//"+(n.hostname||n.host)+(n.port===80||n.port===443?"":":"+n.port)+t.path,!this.isProxyConfigured()){iE.trace({destination:r},"not proxying request; GLOBAL_AGENT.HTTP_PROXY is not configured"),this.fallbackAgent.addRequest(t,n);return}if(!this.mustUrlUseProxy(r)){iE.trace({destination:r},"not proxying request; url matches GLOBAL_AGENT.NO_PROXY"),this.fallbackAgent.addRequest(t,n);return}let i=t$n++,a=this.getUrlProxy(r);this.protocol==="http:"&&(t.path=r,a.authorization&&t.setHeader("proxy-authorization","Basic "+Buffer.from(a.authorization).toString("base64"))),iE.trace({destination:r,proxy:"http://"+a.hostname+":"+a.port,requestId:i},"proxying request"),t.on("error",s=>{iE.error({error:(0,bst.serializeError)(s)},"request error")}),t.once("response",s=>{iE.trace({headers:s.headers,requestId:i,statusCode:s.statusCode},"proxying response")}),t.shouldKeepAlive=!1;let o={host:n.hostname||n.host,port:n.port||80,proxy:a,tls:{}};this.protocol==="https:"&&(o.tls={ca:n.ca,cert:n.cert,ciphers:n.ciphers,clientCertEngine:n.clientCertEngine,crl:n.crl,dhparam:n.dhparam,ecdhCurve:n.ecdhCurve,honorCipherOrder:n.honorCipherOrder,key:n.key,passphrase:n.passphrase,pfx:n.pfx,rejectUnauthorized:n.rejectUnauthorized,secureOptions:n.secureOptions,secureProtocol:n.secureProtocol,servername:n.servername||o.host,sessionIdContext:n.sessionIdContext},typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED=="string"&&(0,QJn.boolean)(process.env.NODE_TLS_REJECT_UNAUTHORIZED)===!1&&(o.tls.rejectUnauthorized=!1)),this.createConnection(o,(s,l)=>{iE.trace({target:o},"connecting"),l&&(l.setTimeout(this.socketConnectionTimeout,()=>{l.destroy()}),l.once("connect",()=>{iE.trace({target:o},"connected"),l.setTimeout(0)}),l.once("secureConnect",()=>{iE.trace({target:o},"connected (secure)"),l.setTimeout(0)})),s?t.emit("error",s):(iE.debug("created socket"),l.on("error",u=>{iE.error({error:(0,bst.serializeError)(u)},"socket error")}),t.onSocket(l))})}},n$n=O7e;Zne.default=n$n});var _st=E(Kne=>{"use strict";c();Object.defineProperty(Kne,"__esModule",{value:!0});Kne.default=void 0;var r$n=wst(Wt("net")),i$n=wst(Yne());function wst(e){return e&&e.__esModule?e:{default:e}}var M7e=class extends i$n.default{constructor(...t){super(...t),this.protocol="http:",this.defaultPort=80}createConnection(t,n){let r=r$n.default.connect(t.proxy.port,t.proxy.hostname);n(null,r)}},a$n=M7e;Kne.default=a$n});var Sst=E(Jne=>{"use strict";c();Object.defineProperty(Jne,"__esModule",{value:!0});Jne.default=void 0;var o$n=q7e(Wt("net")),s$n=q7e(Wt("tls")),l$n=q7e(Yne());function q7e(e){return e&&e.__esModule?e:{default:e}}var L7e=class extends l$n.default{constructor(...t){super(...t),this.protocol="https:",this.defaultPort=443}createConnection(t,n){let r=o$n.default.connect(t.proxy.port,t.proxy.hostname);r.on("error",a=>{n(a)}),r.once("data",()=>{let a=s$n.default.connect({...t.tls,socket:r});n(null,a)});let i="";i+="CONNECT "+t.host+":"+t.port+` HTTP/1.1\r
|
|
3
3
|
`,i+="Host: "+t.host+":"+t.port+`\r
|
|
4
4
|
`,t.proxy.authorization&&(i+="Proxy-Authorization: Basic "+Buffer.from(t.proxy.authorization).toString("base64")+`\r
|
|
@@ -2451,7 +2451,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
2451
2451
|
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
|
|
2452
2452
|
at Module.load (internal/modules/cjs/loader.js:985:32)
|
|
2453
2453
|
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
|
|
2454
|
-
`,Tm(e);let t=[["Have you",{link:{label:"created a Shopify Partners organization",url:"https://partners.shopify.com/signup"}},{char:"?"}],"Have you confirmed your accounts from the emails you received?",["Need to connect to a different App or organization? Run the command again with",{command:"--reset"}]];Tm(new we("No Organization found",void 0,t)),Ko({headline:"Version couldn't be released.",body:"This version needs to be submitted for review and approved by Shopify before it can be released."}),E_({rows:[{id:"1",name:"John Doe",email:"jon@doe.com"},{id:"2",name:"Jane Doe",email:"jane@doe.com"},{id:"3",name:"John Smith",email:"jon@smith.com"}],columns:{id:{header:"ID",color:"red"},name:{header:"Name",color:"dim"},email:{}}})}var yj=class extends gr{static{this.description="View the UI kit components that display static output"}static{this.hidden=!0}async run(){await Pne()}};c();var bj=class extends gr{static{this.description="View all the available UI kit components"}static{this.hiddenAliases=["kitchen-sink all"]}static{this.hidden=!0}async run(){await Pne(),await Dne(),await Ine()}};c();var wj=class extends gr{static{this.description="Run CLI doctor-release tests"}static{this.hidden=!0}async run(){ine()&&yr({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};c();c();c();c();var VF=class{constructor(){this.assertions=[],this.registeredTests=[]}async runSuite(t){this.context=t,this.registeredTests=[];let n=[];this.tests();for(let r of this.registeredTests){this.assertions=[];let i=Date.now();try{await r.fn(),n.push({name:r.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-i,assertions:[...this.assertions]})}catch(a){n.push({name:r.name,status:"failed",duration:Date.now()-i,assertions:[...this.assertions],error:a instanceof Error?a:new Error(String(a))})}}return n}test(t,n){this.registeredTests.push({name:t,fn:n})}tests(){}async run(t,n){let r=n?.cwd??this.context.workingDirectory,i=await Pit(t,{cwd:r,env:n?.env});return{command:t,exitCode:i.exitCode,stdout:i.stdout,stderr:i.stderr,output:String(i.stdout)+String(i.stderr),success:i.exitCode===0}}async runInteractive(t,n){let r=n?.cwd??this.context.workingDirectory,i=0;try{await Fit(t,{cwd:r,env:n?.env,stdin:"inherit"})}catch{i=1}return{command:t,exitCode:i,stdout:"",stderr:"",output:"",success:i===0}}assertSuccess(t,n){this.assertions.push({description:n??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,n,r){let i=!t.success;if(n){let o=(typeof n=="string"?new RegExp(n):n).test(t.output),s;i?o?s="matched":s=`output: ${t.output.slice(0,200)}`:s="command succeeded",this.assertions.push({description:r??`Command failed with expected error: ${n}`,passed:i&&o,expected:`failure with error matching ${n}`,actual:s})}else this.assertions.push({description:r??`Command failed: ${t.command}`,passed:i,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,n,r){let i=Pte(t)?t:Ne(this.context.workingDirectory,t),a=ji(this.context.workingDirectory,i);if(!await En(i)){this.assertions.push({description:r??`File exists: ${a}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(n){let s=await Or(i),u=(typeof n=="string"?new RegExp(n):n).test(s);this.assertions.push({description:r??`File ${a} matches ${n}`,passed:u,expected:`content matching ${n}`,actual:u?"matched":`content: ${s.slice(0,200)}...`})}else this.assertions.push({description:r??`File exists: ${a}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,n){let r=Pte(t)?t:Ne(this.context.workingDirectory,t),i=ji(this.context.workingDirectory,r),a=await En(r);this.assertions.push({description:n??`File does not exist: ${i}`,passed:!a,expected:"file does not exist",actual:a?"file exists":"file does not exist"})}async assertDirectory(t,n){let r=Pte(t)?t:Ne(this.context.workingDirectory,t),i=ji(this.context.workingDirectory,r),a=await En(r);this.assertions.push({description:n??`Directory exists: ${i}`,passed:a,expected:"directory exists",actual:a?"directory exists":"directory not found"})}assertOutput(t,n,r){let a=(typeof n=="string"?new RegExp(n):n).test(t.output);this.assertions.push({description:r??`Output matches ${n}`,passed:a,expected:`output matching ${n}`,actual:a?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,n,r){try{let i=JSON.parse(t.stdout);if(n){let a=n(i);this.assertions.push({description:r??"Output is valid JSON matching validator",passed:a,expected:"valid JSON matching validator",actual:a?"matched":"validator returned false"})}else this.assertions.push({description:r??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return i}catch{this.assertions.push({description:r??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,n){this.assertions.push({description:n,passed:t,expected:"true",actual:String(t)})}assertEqual(t,n,r){this.assertions.push({description:r,passed:t===n,expected:String(n),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};VF.description="Doctor test suite";var _j=class extends VF{constructor(){super(...arguments);this.themeName="";this.themePath=""}static{this.description="Tests the theme init command creates a valid theme structure"}tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${EM("creative")}`,this.themePath=Ne(this.context.workingDirectory,this.themeName);let n=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(n),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let n=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(n.map(r=>this.assertFile(Ne(this.themePath,r))))}),this.test("theme directories exist",async()=>{let n=["sections","snippets","assets","locales"];await Promise.all(n.map(r=>this.assertDirectory(Ne(this.themePath,r))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(Ne(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};c();var Sj=class extends VF{static{this.description="Tests pushing a theme to the store creates an unpublished theme"}static{this.requiresStore=!0}tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",n=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(n+=` -e ${this.context.environment}`),this.context.store&&(n+=` -s ${this.context.store}`),this.context.password&&(n+=` --password ${this.context.password}`);let r=await this.run(n);this.assertSuccess(r);let i=this.assertJson(r,a=>typeof a.theme?.id=="number");i?.theme&&(this.assert(typeof i.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(i.theme.role,"unpublished","Theme role is unpublished"),this.assert(i.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(i.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(i.theme.id),this.context.data.editorUrl=i.theme.editor_url,this.context.data.previewUrl=i.theme.preview_url)})}};c();function eot(e){return{workingDirectory:e.path??kf(),environment:e.environment,store:e.store,password:e.password,data:{}}}c();var uv=e=>Jn(e),u7e;function not(e){u7e=e}function BKn(e){if(!u7e)return e;let t=/\/[^\s,)]+/g;return e.replace(t,n=>eE(n,u7e))}function rot(e,t){uv(""),uv(Qr.bold(Qr.cyan(`Suite: ${e}`))),uv(Qr.dim(t))}function iot(e){uv(Qr.bold(Qr.blue(`Running: ${e}`)))}function aot(e){let t=`(${(e.duration/1e3).toFixed(2)}s)`;if(e.status==="passed"){uv(Qr.bold(Qr.green(`PASSED: ${e.name} ${Qr.dim(t)}`)));for(let n of tot(e.assertions))uv(n)}else if(e.status==="failed"){uv(Qr.red(`FAILED: ${e.name} ${Qr.dim(t)}`));for(let n of tot(e.assertions))uv(n);e.error&&uv(Qr.red(` Error: ${BKn(e.error.message)}`))}else uv(Qr.yellow(`SKIPPED: ${e.name}`))}function d7e(e){let t=e.filter(o=>o.status==="passed").length,n=e.filter(o=>o.status==="failed").length,r=e.filter(o=>o.status==="skipped").length,i=e.length,a=e.reduce((o,s)=>o+s.duration,0);uv(""),uv(Qr.bold("\u2500".repeat(40))),n>0?uv(Qr.red(Qr.bold(`Doctor Complete: ${n}/${i} tests failed`))):uv(Qr.green(Qr.bold(`Doctor Complete: ${t}/${i} tests passed`))),uv(` Passed: ${Qr.green(String(t))}`),uv(` Failed: ${Qr.red(String(n))}`),r>0&&uv(` Skipped: ${Qr.yellow(String(r))}`),uv(` Total time: ${Qr.dim(`${(a/1e3).toFixed(2)}s`)}`)}function tot(e){return e.map(t=>{if(t.passed)return Qr.green(` [OK] ${t.description}`);{let n=` (expected: ${t.expected}, actual: ${t.actual})`;return Qr.red(` [FAIL] ${t.description}${n}`)}})}var UKn=[_j,Sj];async function oot(e){let t=[],n=eot(e);not(n.workingDirectory);for(let r of UKn){let i=new r,a=r.description??"Test suite";rot(r.name,a);let o=await i.runSuite(n);for(let s of o)if(iot(s.name),aot(s),t.push(s),s.status==="failed")return d7e(t),t}return d7e(t),t}c();c();import{fileURLToPath as zKn}from"node:url";async function sot(e){let{errorHandler:t}=await import("./error-handler-JHFQZGYG.js"),{isDevelopment:n}=await import("./local-4PW2CHVR.js"),r=await import("./lib-3WHF5XD3.js"),{Config:i,run:a,flush:o,Errors:s,settings:l}=r.default??r;n()&&(l.debug=!0);try{let u=new i({root:zKn(e.moduleURL)});await u.load(),await a(e.argv,u),await o()}catch(u){return await t(u),s.handle(u)}}var Fne=Nt(ga());async function HKn(e=process.versions){let t=e.node,n=Number(t.split(".")[0]);if(n<18){let{renderError:i}=await import("./ui-7Z2HOOEO.js");i({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function WKn(e,t=process.argv,n=process.env){t.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function jKn(e=process.argv,t=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||nw(t.NO_COLOR)||nw(t.SHOPIFY_FLAG_NO_COLOR)||nw(t[kxe.json])||t.TERM==="dumb")&&(t.FORCE_COLOR="0")}async function lot(e,t=sot,n=process.argv,r=process.env,i=process.versions){return WKn(e,n,r),e.runInCreateMode&&await VKn(e,n),jKn(n,r),await HKn(i),t({moduleURL:e.moduleURL})}async function VKn(e,t=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-NTQEYCSE.js"),{moduleDirectory:r}=await import("./path-HUAU3YBW.js"),o=(await n(r(e.moduleURL))).content.name.replace("@shopify/create-","");if(t.findIndex(l=>l.includes("init"))===-1){let l=t.findIndex(u=>u.match(new RegExp(`bin(\\/|\\\\)+(create-${o}|dev|run)`)))+1;t.splice(l,0,"init")}}var ar={"no-color":Fne.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:Fne.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output.",env:"SHOPIFY_FLAG_VERBOSE"})},Wu={json:Fne.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:kxe.json})};function cot(){Trt()}var xj=Nt(ga(),1);var Ej=class e extends gr{static{this.description="Run all theme command doctor-release tests"}static{this.hidden=!0}static{this.flags={...ar,path:xj.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>Kr(t),default:async()=>kf()}),environment:xj.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:xj.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:xj.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})}}async run(){if(!ine())return;let{flags:t}=await this.parse(e);(await oot({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(i=>i.status==="failed")&&(process.exitCode=1)}};c();var GF=Ne(kf(),"/docs-shopify.dev/commands"),kj=class extends gr{static{this.description="Generate CLI commands documentation"}static{this.hidden=!0}async run(){let t=this.config.commands;await j5(GF),await To(GF);let r=t.sort((i,a)=>i.id.length-a.id.length).filter(i=>!ZKn(i)).flatMap(i=>{let a=YKn(i);return[JKn(i,a),$Kn(i,a),KKn(i,a)]});await Promise.all(r)}},uot=["commands","help","plugins"],GKn=["config","auth","organization"];function ZKn(e){return e.hidden?(uot.push(e.id),!0):e.pluginType==="user"?!0:uot.some(t=>e.id.startsWith(`${t}:`))}function YKn(e){let t=e.id.replace(/[:]/g," "),n=e.id.replace(/[:]/g,"-"),r=e.id.replace(/[:-]/g,""),i=e.id.includes(":"),a=e.id.split(":")[0],o=e.flags&&Object.keys(e.flags).length>0;return{commandName:t,fileName:n,interfaceName:r,hasTopic:i,topic:a,hasFlags:o}}async function KKn(e,{commandName:t,fileName:n,interfaceName:r,hasTopic:i,topic:a,hasFlags:o}){let s=`
|
|
2454
|
+
`,Tm(e);let t=[["Have you",{link:{label:"created a Shopify Partners organization",url:"https://partners.shopify.com/signup"}},{char:"?"}],"Have you confirmed your accounts from the emails you received?",["Need to connect to a different App or organization? Run the command again with",{command:"--reset"}]];Tm(new we("No Organization found",void 0,t)),Ko({headline:"Version couldn't be released.",body:"This version needs to be submitted for review and approved by Shopify before it can be released."}),E_({rows:[{id:"1",name:"John Doe",email:"jon@doe.com"},{id:"2",name:"Jane Doe",email:"jane@doe.com"},{id:"3",name:"John Smith",email:"jon@smith.com"}],columns:{id:{header:"ID",color:"red"},name:{header:"Name",color:"dim"},email:{}}})}var yj=class extends gr{static{this.description="View the UI kit components that display static output"}static{this.hidden=!0}async run(){await Pne()}};c();var bj=class extends gr{static{this.description="View all the available UI kit components"}static{this.hiddenAliases=["kitchen-sink all"]}static{this.hidden=!0}async run(){await Pne(),await Dne(),await Ine()}};c();var wj=class extends gr{static{this.description="Run CLI doctor-release tests"}static{this.hidden=!0}async run(){ine()&&yr({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};c();c();c();c();var VF=class{constructor(){this.assertions=[],this.registeredTests=[]}async runSuite(t){this.context=t,this.registeredTests=[];let n=[];this.tests();for(let r of this.registeredTests){this.assertions=[];let i=Date.now();try{await r.fn(),n.push({name:r.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-i,assertions:[...this.assertions]})}catch(a){n.push({name:r.name,status:"failed",duration:Date.now()-i,assertions:[...this.assertions],error:a instanceof Error?a:new Error(String(a))})}}return n}test(t,n){this.registeredTests.push({name:t,fn:n})}tests(){}async run(t,n){let r=n?.cwd??this.context.workingDirectory,i=await Pit(t,{cwd:r,env:n?.env});return{command:t,exitCode:i.exitCode,stdout:i.stdout,stderr:i.stderr,output:String(i.stdout)+String(i.stderr),success:i.exitCode===0}}async runInteractive(t,n){let r=n?.cwd??this.context.workingDirectory,i=0;try{await Fit(t,{cwd:r,env:n?.env,stdin:"inherit"})}catch{i=1}return{command:t,exitCode:i,stdout:"",stderr:"",output:"",success:i===0}}assertSuccess(t,n){this.assertions.push({description:n??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,n,r){let i=!t.success;if(n){let o=(typeof n=="string"?new RegExp(n):n).test(t.output),s;i?o?s="matched":s=`output: ${t.output.slice(0,200)}`:s="command succeeded",this.assertions.push({description:r??`Command failed with expected error: ${n}`,passed:i&&o,expected:`failure with error matching ${n}`,actual:s})}else this.assertions.push({description:r??`Command failed: ${t.command}`,passed:i,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,n,r){let i=Pte(t)?t:Ne(this.context.workingDirectory,t),a=ji(this.context.workingDirectory,i);if(!await En(i)){this.assertions.push({description:r??`File exists: ${a}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(n){let s=await Or(i),u=(typeof n=="string"?new RegExp(n):n).test(s);this.assertions.push({description:r??`File ${a} matches ${n}`,passed:u,expected:`content matching ${n}`,actual:u?"matched":`content: ${s.slice(0,200)}...`})}else this.assertions.push({description:r??`File exists: ${a}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,n){let r=Pte(t)?t:Ne(this.context.workingDirectory,t),i=ji(this.context.workingDirectory,r),a=await En(r);this.assertions.push({description:n??`File does not exist: ${i}`,passed:!a,expected:"file does not exist",actual:a?"file exists":"file does not exist"})}async assertDirectory(t,n){let r=Pte(t)?t:Ne(this.context.workingDirectory,t),i=ji(this.context.workingDirectory,r),a=await En(r);this.assertions.push({description:n??`Directory exists: ${i}`,passed:a,expected:"directory exists",actual:a?"directory exists":"directory not found"})}assertOutput(t,n,r){let a=(typeof n=="string"?new RegExp(n):n).test(t.output);this.assertions.push({description:r??`Output matches ${n}`,passed:a,expected:`output matching ${n}`,actual:a?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,n,r){try{let i=JSON.parse(t.stdout);if(n){let a=n(i);this.assertions.push({description:r??"Output is valid JSON matching validator",passed:a,expected:"valid JSON matching validator",actual:a?"matched":"validator returned false"})}else this.assertions.push({description:r??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return i}catch{this.assertions.push({description:r??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,n){this.assertions.push({description:n,passed:t,expected:"true",actual:String(t)})}assertEqual(t,n,r){this.assertions.push({description:r,passed:t===n,expected:String(n),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};VF.description="Doctor test suite";var _j=class extends VF{constructor(){super(...arguments);this.themeName="";this.themePath=""}static{this.description="Tests the theme init command creates a valid theme structure"}tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${EM("creative")}`,this.themePath=Ne(this.context.workingDirectory,this.themeName);let n=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(n),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let n=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(n.map(r=>this.assertFile(Ne(this.themePath,r))))}),this.test("theme directories exist",async()=>{let n=["sections","snippets","assets","locales"];await Promise.all(n.map(r=>this.assertDirectory(Ne(this.themePath,r))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(Ne(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};c();var Sj=class extends VF{static{this.description="Tests pushing a theme to the store creates an unpublished theme"}static{this.requiresStore=!0}tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",n=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(n+=` -e ${this.context.environment}`),this.context.store&&(n+=` -s ${this.context.store}`),this.context.password&&(n+=` --password ${this.context.password}`);let r=await this.run(n);this.assertSuccess(r);let i=this.assertJson(r,a=>typeof a.theme?.id=="number");i?.theme&&(this.assert(typeof i.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(i.theme.role,"unpublished","Theme role is unpublished"),this.assert(i.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(i.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(i.theme.id),this.context.data.editorUrl=i.theme.editor_url,this.context.data.previewUrl=i.theme.preview_url)})}};c();function eot(e){return{workingDirectory:e.path??kf(),environment:e.environment,store:e.store,password:e.password,data:{}}}c();var uv=e=>Jn(e),u7e;function not(e){u7e=e}function BKn(e){if(!u7e)return e;let t=/\/[^\s,)]+/g;return e.replace(t,n=>eE(n,u7e))}function rot(e,t){uv(""),uv(Qr.bold(Qr.cyan(`Suite: ${e}`))),uv(Qr.dim(t))}function iot(e){uv(Qr.bold(Qr.blue(`Running: ${e}`)))}function aot(e){let t=`(${(e.duration/1e3).toFixed(2)}s)`;if(e.status==="passed"){uv(Qr.bold(Qr.green(`PASSED: ${e.name} ${Qr.dim(t)}`)));for(let n of tot(e.assertions))uv(n)}else if(e.status==="failed"){uv(Qr.red(`FAILED: ${e.name} ${Qr.dim(t)}`));for(let n of tot(e.assertions))uv(n);e.error&&uv(Qr.red(` Error: ${BKn(e.error.message)}`))}else uv(Qr.yellow(`SKIPPED: ${e.name}`))}function d7e(e){let t=e.filter(o=>o.status==="passed").length,n=e.filter(o=>o.status==="failed").length,r=e.filter(o=>o.status==="skipped").length,i=e.length,a=e.reduce((o,s)=>o+s.duration,0);uv(""),uv(Qr.bold("\u2500".repeat(40))),n>0?uv(Qr.red(Qr.bold(`Doctor Complete: ${n}/${i} tests failed`))):uv(Qr.green(Qr.bold(`Doctor Complete: ${t}/${i} tests passed`))),uv(` Passed: ${Qr.green(String(t))}`),uv(` Failed: ${Qr.red(String(n))}`),r>0&&uv(` Skipped: ${Qr.yellow(String(r))}`),uv(` Total time: ${Qr.dim(`${(a/1e3).toFixed(2)}s`)}`)}function tot(e){return e.map(t=>{if(t.passed)return Qr.green(` [OK] ${t.description}`);{let n=` (expected: ${t.expected}, actual: ${t.actual})`;return Qr.red(` [FAIL] ${t.description}${n}`)}})}var UKn=[_j,Sj];async function oot(e){let t=[],n=eot(e);not(n.workingDirectory);for(let r of UKn){let i=new r,a=r.description??"Test suite";rot(r.name,a);let o=await i.runSuite(n);for(let s of o)if(iot(s.name),aot(s),t.push(s),s.status==="failed")return d7e(t),t}return d7e(t),t}c();c();import{fileURLToPath as zKn}from"node:url";async function sot(e){let{errorHandler:t}=await import("./error-handler-CRWXGODM.js"),{isDevelopment:n}=await import("./local-7MUCLBBI.js"),r=await import("./lib-3WHF5XD3.js"),{Config:i,run:a,flush:o,Errors:s,settings:l}=r.default??r;n()&&(l.debug=!0);try{let u=new i({root:zKn(e.moduleURL)});await u.load(),await a(e.argv,u),await o()}catch(u){return await t(u),s.handle(u)}}var Fne=Nt(ga());async function HKn(e=process.versions){let t=e.node,n=Number(t.split(".")[0]);if(n<18){let{renderError:i}=await import("./ui-AOFJCTTO.js");i({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function WKn(e,t=process.argv,n=process.env){t.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function jKn(e=process.argv,t=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||nw(t.NO_COLOR)||nw(t.SHOPIFY_FLAG_NO_COLOR)||nw(t[kxe.json])||t.TERM==="dumb")&&(t.FORCE_COLOR="0")}async function lot(e,t=sot,n=process.argv,r=process.env,i=process.versions){return WKn(e,n,r),e.runInCreateMode&&await VKn(e,n),jKn(n,r),await HKn(i),t({moduleURL:e.moduleURL})}async function VKn(e,t=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-GFIGZZ24.js"),{moduleDirectory:r}=await import("./path-HUAU3YBW.js"),o=(await n(r(e.moduleURL))).content.name.replace("@shopify/create-","");if(t.findIndex(l=>l.includes("init"))===-1){let l=t.findIndex(u=>u.match(new RegExp(`bin(\\/|\\\\)+(create-${o}|dev|run)`)))+1;t.splice(l,0,"init")}}var ar={"no-color":Fne.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:Fne.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output.",env:"SHOPIFY_FLAG_VERBOSE"})},Wu={json:Fne.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:kxe.json})};function cot(){Trt()}var xj=Nt(ga(),1);var Ej=class e extends gr{static{this.description="Run all theme command doctor-release tests"}static{this.hidden=!0}static{this.flags={...ar,path:xj.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>Kr(t),default:async()=>kf()}),environment:xj.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:xj.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:xj.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})}}async run(){if(!ine())return;let{flags:t}=await this.parse(e);(await oot({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(i=>i.status==="failed")&&(process.exitCode=1)}};c();var GF=Ne(kf(),"/docs-shopify.dev/commands"),kj=class extends gr{static{this.description="Generate CLI commands documentation"}static{this.hidden=!0}async run(){let t=this.config.commands;await j5(GF),await To(GF);let r=t.sort((i,a)=>i.id.length-a.id.length).filter(i=>!ZKn(i)).flatMap(i=>{let a=YKn(i);return[JKn(i,a),$Kn(i,a),KKn(i,a)]});await Promise.all(r)}},uot=["commands","help","plugins"],GKn=["config","auth","organization"];function ZKn(e){return e.hidden?(uot.push(e.id),!0):e.pluginType==="user"?!0:uot.some(t=>e.id.startsWith(`${t}:`))}function YKn(e){let t=e.id.replace(/[:]/g," "),n=e.id.replace(/[:]/g,"-"),r=e.id.replace(/[:-]/g,""),i=e.id.includes(":"),a=e.id.split(":")[0],o=e.flags&&Object.keys(e.flags).length>0;return{commandName:t,fileName:n,interfaceName:r,hasTopic:i,topic:a,hasFlags:o}}async function KKn(e,{commandName:t,fileName:n,interfaceName:r,hasTopic:i,topic:a,hasFlags:o}){let s=`
|
|
2455
2455
|
{
|
|
2456
2456
|
title: 'Flags',
|
|
2457
2457
|
description: 'The following flags are available for the \`${t}\` command:',
|
|
@@ -3136,7 +3136,7 @@ Skip the flag or provide the name of a template or example in the Hydrogen repos
|
|
|
3136
3136
|
}
|
|
3137
3137
|
}
|
|
3138
3138
|
}
|
|
3139
|
-
`;async function yMt(e){let{hydrogenStorefronts:t}=await LM(eVr,e);return t.map(n=>({...n,parsedId:qM(n.id)}))}var Qme=class e extends gr{static descriptionWithMarkdown="Lists all remote Hydrogen storefronts available to link to your local development environment.";static description="Returns a list of Hydrogen storefronts available on a given shop.";static flags={...Br.path};async run(){let{flags:t}=await this.parse(e);await tVr(t)}};async function tVr({path:e=process.cwd()}){let{session:t}=await T_(e),n=await yMt(t);n.length>0?(kg(),Jn(iVr({storefronts:n,shop:t.storeFqdn}).toString()),n.forEach(({currentProductionDeployment:r,id:i,productionUrl:a,title:o})=>{kg(),Jn(it`${Qr.whiteBright(o)} ${Qr.dim(`(id: ${qM(i)})`)}`.value),a&&Jn(it` ${Qr.whiteBright(a)}`.value),r&&Jn(it` ${Qr.dim(rVr(r))}`.value)})):yr({headline:"Hydrogen storefronts",body:"There are no Hydrogen storefronts on your Shop.",nextSteps:[`Ensure you are logged in to the correct shop (currently: ${t.storeFqdn})`,`Create a new Hydrogen storefront: Run \`${await Im(e)} link\` or visit ${qOt(t)}`]})}var nVr=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric"});function rVr(e){let t="";if(!e)return t;if(t+=nVr.format(new Date(e.createdAt)),e.commitMessage){let n=e.commitMessage.split(/\n/)[0];t+=`, ${n}`}return t}var iVr=({storefronts:e,shop:t})=>DF(e,n=>`Showing ${n.length} Hydrogen storefronts for the store ${t}`,n=>`Showing 1 Hydrogen storefront for the store ${t}`);c();var Xme=class e extends gr{static descriptionWithMarkdown="Logs in to the specified shop and saves the shop domain to the project.";static description="Login to your Shopify account.";static flags={...Br.path,...Br.shop};async run(){let{flags:t}=await this.parse(e);await aVr(t)}};async function aVr({path:e=process.cwd(),shop:t}){kg(),Cat(!0);let{config:n}=await T_(e,t??!0);Dat(n)}c();var ege=class e extends gr{static descriptionWithMarkdown="Log out from the current shop.";static description="Logout of your local session.";static flags={...Br.path};async run(){let{flags:t}=await this.parse(e);await oVr(t)}};async function oVr({path:e=process.cwd()}){kg(),await Iat(e),dr({body:"You are logged out from Shopify."})}c();var d9e=Nt(k_(),1);c();async function bMt(e){let{startWorkerdServer:t}=await import("./workerd-
|
|
3139
|
+
`;async function yMt(e){let{hydrogenStorefronts:t}=await LM(eVr,e);return t.map(n=>({...n,parsedId:qM(n.id)}))}var Qme=class e extends gr{static descriptionWithMarkdown="Lists all remote Hydrogen storefronts available to link to your local development environment.";static description="Returns a list of Hydrogen storefronts available on a given shop.";static flags={...Br.path};async run(){let{flags:t}=await this.parse(e);await tVr(t)}};async function tVr({path:e=process.cwd()}){let{session:t}=await T_(e),n=await yMt(t);n.length>0?(kg(),Jn(iVr({storefronts:n,shop:t.storeFqdn}).toString()),n.forEach(({currentProductionDeployment:r,id:i,productionUrl:a,title:o})=>{kg(),Jn(it`${Qr.whiteBright(o)} ${Qr.dim(`(id: ${qM(i)})`)}`.value),a&&Jn(it` ${Qr.whiteBright(a)}`.value),r&&Jn(it` ${Qr.dim(rVr(r))}`.value)})):yr({headline:"Hydrogen storefronts",body:"There are no Hydrogen storefronts on your Shop.",nextSteps:[`Ensure you are logged in to the correct shop (currently: ${t.storeFqdn})`,`Create a new Hydrogen storefront: Run \`${await Im(e)} link\` or visit ${qOt(t)}`]})}var nVr=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric"});function rVr(e){let t="";if(!e)return t;if(t+=nVr.format(new Date(e.createdAt)),e.commitMessage){let n=e.commitMessage.split(/\n/)[0];t+=`, ${n}`}return t}var iVr=({storefronts:e,shop:t})=>DF(e,n=>`Showing ${n.length} Hydrogen storefronts for the store ${t}`,n=>`Showing 1 Hydrogen storefront for the store ${t}`);c();var Xme=class e extends gr{static descriptionWithMarkdown="Logs in to the specified shop and saves the shop domain to the project.";static description="Login to your Shopify account.";static flags={...Br.path,...Br.shop};async run(){let{flags:t}=await this.parse(e);await aVr(t)}};async function aVr({path:e=process.cwd(),shop:t}){kg(),Cat(!0);let{config:n}=await T_(e,t??!0);Dat(n)}c();var ege=class e extends gr{static descriptionWithMarkdown="Log out from the current shop.";static description="Logout of your local session.";static flags={...Br.path};async run(){let{flags:t}=await this.parse(e);await oVr(t)}};async function oVr({path:e=process.cwd()}){kg(),await Iat(e),dr({body:"You are logged out from Shopify."})}c();var d9e=Nt(k_(),1);c();async function bMt(e){let{startWorkerdServer:t}=await import("./workerd-VBG5LYNX.js");return t(e)}var tge=class e extends gr{static descriptionWithMarkdown="Runs a server in your local development environment that serves your Hydrogen app's production build. Requires running the [build](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-build) command first.";static description="Runs a Hydrogen storefront in an Oxygen worker for production.";static flags={...Br.path,...Br.port,...Br.env,...Br.envBranch,...Br.envFile,...Br.inspectorPort,...Br.debug,...Br.verbose,build:d9e.Flags.boolean({description:"Builds the app before starting the preview server."}),watch:d9e.Flags.boolean({description:"Watches for changes and rebuilds the project.",dependsOn:["build"]}),..._x(Br.entry,{entry:{dependsOn:["build"]}}),..._x(Br.codegen,{codegen:{dependsOn:["build"]}})};async run(){let{flags:t}=await this.parse(e),n=t.path?Kr(t.path):process.cwd(),{close:r}=await sVr({...Od(t),directory:n});P6(async()=>{await r()})}};async function sVr({port:e,directory:t,env:n,envBranch:r,inspectorPort:i,debug:a,verbose:o,build:s=!1,watch:l=!1,codegen:u=!1,codegenConfigPath:d,entry:p,envFile:h}){process.env.NODE_ENV||(process.env.NODE_ENV=l?"development":"production"),o&&hne(),mne()||BM();let{root:v,buildPath:S,buildPathWorkerFile:k,buildPathClient:I}=nE(t),C=await MM(v);if(C)throw new we(rE);let N,q=HK(),V=s?await YA({...{directory:v,entry:p,disableRouteWarning:!1,lockfileCheck:!1,sourcemap:!0,bundleStats:!1,useCodegen:u,codegenConfigPath:d},watch:l,async onServerBuildFinish(){q.state==="pending"?q.resolve():Jn("\u{1F3D7}\uFE0F Project rebuilt. Reloading server..."),await N?.reload()}}):q.resolve();C||(k=(await C_(v).catch(()=>null))?.serverOutFile??Ne(S,"server","index.js"));let{shop:G,storefront:Y}=await pne(v),X=!!G&&!!Y?.id,{allVariables:ne,logInjectedVariables:se}=await Cne({root:v,fetchRemote:X,envBranch:r,envHandle:n,envFile:h});e||(e=await YK(lj));let re=await YK(e+100);return await q.promise,se(),N=await bMt({root:v,appPort:e,assetsPort:re,env:ne,buildPathClient:I,buildPathWorkerFile:k,inspectorPort:i,debug:a,watch:l}),N.showBanner({mode:"preview",headlinePrefix:l?"Watching for changes. ":""}),{async close(){await Promise.allSettled([N.close(),V?.close()])}}}c();var nge=class e extends gr{static description="Scaffold routes and core functionality.";static flags={...Br.path,...Br.force,...Br.markets,...Br.shortcut,..._x(Br.installDeps,{"install-deps":{default:!0}})};async run(){let{flags:t}=await this.parse(e),n=t.path?Kr(t.path):process.cwd();await lVr({...Od(t),directory:n})}};async function lVr(e){let t=new Iy,{rootDirectory:n,appDirectory:r}=await RI(e.directory),i=Ma(n),a=Im(),o=Promise.resolve(),s=[{title:"Setting up project",task:async()=>{await o}}],l=e.markets?e.markets:await une({abortSignal:t.signal,extraChoices:{none:"Set up later"}}),u=l==="none"?void 0:l,{setupRoutes:d}=gne(t),p,h=await oat(".."),[v,S]=await Promise.all([En(Ne(n,"tsconfig.json")),io("*.d.ts",{cwd:h})]);o=o.then(()=>Promise.all([...S.map(N=>zh(Ne(h,N),Kr(n,N))),vne({rootDirectory:n,appDirectory:r,typescript:v})])).then(async()=>{p=await d(n,v?"ts":"js",{i18nStrategy:u,overwriteFileDeps:!0})}),u&&(o=o.then(()=>cne(u,{rootDirectory:n})));let k=await Promise.resolve(a),{createShortcut:I,showShortcutBanner:C}=await yne(t,k,e.shortcut);!u&&!I||(I&&(o=o.then(async()=>{await I()&&(k=HF)}),C()),await Jo(s),await UM({location:i,name:i,directory:n},{cliCommand:k,depsInstalled:!0,packageManager:"npm",i18n:u,routes:p}))}c();var wMt=Nt(k_(),1);var rge=class e extends gr{static descriptionWithMarkdown="Adds support for certain CSS strategies to your project.";static description="Setup CSS strategies for your project.";static flags={...Br.path,...Br.force,..._x(Br.installDeps,{"install-deps":{default:!0}})};static args={strategy:wMt.Args.string({name:"strategy",description:`The CSS strategy to setup. One of ${e7e.join()}`,options:e7e})};async run(){let{flags:t,args:n}=await this.parse(e),r=t.path?Kr(t.path):process.cwd();await cVr({...Od(t),strategy:n.strategy,directory:r})}};async function cVr({strategy:e,directory:t,force:n=!1,installDeps:r=!0}){let i=await C_(t).catch(()=>null);if(!i)throw new we("No Vite config found. This command is only supported in Vite projects.");let{remixConfig:a}=i,o=e||await fat();if(o==="css-modules"||o==="postcss"){dr({headline:`Vite works out of the box with ${sj[o]}.`,body:`See the Vite documentation for more information:
|
|
3140
3140
|
${n7e[o]}`});return}let s=await dat(o,a,n);if(!s)return;let{workPromise:l,generatedAssets:u,needsInstallDeps:d}=s,p=[{title:"Updating files",task:async()=>{await l}}],h=!1;if(r&&d){let v=Z5(a.rootDirectory);p.push({title:"Installing new dependencies",task:async()=>{let S=await v;h=S==="npm"||S==="unknown",await bx({directory:a.rootDirectory,packageManager:S,args:[]})}})}await Jo(p),dr({headline:`${sj[o]} setup complete.`,body:(u.length>0?`You can now modify CSS configuration in the following files:
|
|
3141
3141
|
`+u.map(v=>` - ${v}`).join(`
|
|
3142
3142
|
`)+`
|
|
@@ -3197,7 +3197,7 @@ JavaScript exports with camelCase names are automatically mapped to kebab-case W
|
|
|
3197
3197
|
|
|
3198
3198
|
Alternatively, continue using shop-specific webhooks with the legacy install flow.
|
|
3199
3199
|
|
|
3200
|
-
Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app-installation`)}};function XVr(e,t){let n=[];return e.forEach(r=>{let i=r.configuration.ui.handle,a=lLt(t,i);a?a.type!=="ui_extension"&&n.push(`[${r.name}] - Local app must contain one extension of type 'ui_extension' and handle '${i}'`):n.push(`[${r.name}] - Local app must contain a ui_extension with handle '${i}'`)}),n.length>0?n:void 0}function eGr(e,t){let n=[],r=["ui_extension"];return e.forEach(i=>{i.configuration.inCollection.forEach(a=>{let o=lLt(t,a.handle);o?r.includes(o.specification.identifier)?o.specification.identifier==="ui_extension"&&o.configuration.extension_points.forEach(l=>{l.target.startsWith("admin.")&&n.push(`[${i.handle}] editor extension collection: Remove extension '${o.configuration.handle}' with target '${l.target}' from this collection. This extension target is not supported in collections.`)}):n.push(`[${i.handle}] editor extension collection: Remove extension of type '${o.specification.identifier}' from this collection. This extension type is not supported in collections.`):n.push(`[${i.handle}] editor extension collection: Add extension with handle '${a.handle}' to local app. Local app must include extension with handle '${a.handle}'.`)})}),n.length>0?n:void 0}function lLt(e,t){return e.find(n=>n.handle===t)}async function cLt(e){let t=e.dependency;if(t)return uJ(t,e.directory)}async function uJ(e,t){let n=e.replace("-react","").split("/"),r=Ne("node_modules",n[0],n[1],"package.json"),i=await km(r,{cwd:t,type:"file",allowSymlinks:!0});if(!i)return"not_found";i=await trt(i);let a=await DM(i);return a.version?{name:e,version:a.version}:"not_found"}c();function tGr(e){if(!e?.length)return null;let t=null,n=-1;for(let r of e){if(!r.issues?.length)continue;let i=0,a=0,o=0;for(let l of r.issues)l.message?.includes("Required")||l.message?.includes("required")?i++:l.message?.includes("Expected")&&l.message?.includes("received")?a++:o++;let s;i>0?s=1e3-i*10-a-o:a>0?s=100-a*5-o:s=50-o,s>n&&(n=s,t=r)}return t}function uLt(e){let t=[];for(let n of e)if(n.code==="invalid_union"&&n.unionErrors){let r=tGr(n.unionErrors);if(r?.issues?.length)for(let i of r.issues)t.push({path:i.path,message:i.message,code:n.code});else t.push({path:n.path,message:n.message??"Configuration doesn't match any expected format",code:n.code})}else t.push({path:n.path,message:n.message??"Unknown error",code:n.code});return t}c();var dLt=/^shopify\.app(\.[-\w]+)?\.toml$/;function Ow(e){return e?yge(e)?e:`shopify.app.${sc(e)}.toml`:uf.app}function fJ(e){return Ma(e).match(dLt)?.[1]?.slice(1)}function yge(e){return!!dLt.test(e)}c();var nGr=wit({cmd_app_warning_api_key_deprecation_displayed:!1}),Rs=nGr;c();c();c();import{deflate as rGr}from"node:zlib";import{promisify as iGr}from"node:util";var aGr=iGr(rGr);async function oGr(e){let t=await Or(e),n=Buffer.byteLength(t),i=(await aGr(Buffer.from(t))).byteLength;return{path:e,rawBytes:n,compressedBytes:i}}function fLt(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/1024).toFixed(1)} KB`}async function pLt(e){try{let{rawBytes:t,compressedBytes:n}=await oGr(e);return` (${fLt(t)} original, ~${fLt(n)} compressed)`}catch(t){return at(`Failed to get bundle size for ${e}: ${t}`),""}}c();c();import{createInterface as sGr}from"readline";var lGr=[".git",".hg",".bzr",".svn","_darcs","CVS",".sublime-(project|workspace)",".DS_Store",".sass-cache","Thumbs.db","desktop.ini","config.yml","node_modules",".gitkeep",".shopifyignore","*.toml"];async function N6(e){let n=Ne(e.directory,".shopifyignore"),r=lGr.map(i=>Ne("*",i));if(Cc(n)){let i=await cGr(n);r.push(...i)}return io("*/*",{absolute:!0,cwd:e.directory,ignore:r})}function cGr(e){return new Promise((t,n)=>{let r=[],i=sGr({input:XW(e),crlfDelay:1/0});i.on("line",a=>{let o=a.trim();o.length>0&&!o.startsWith("#")&&r.push(o)}),i.on("close",()=>{t(r)}),i.on("error",a=>{n(a)})})}import{context as CGr,formatMessagesSync as CLt}from"esbuild";var TLt=Nt(kLt(),1);async function k9e(e,t=process.env){let n=DGr(e,t),r=await CGr(n),i=await r.rebuild();IGr(i,e),await TGr(i,e.outputPath),await r.dispose()}async function ILt(e,t){t.stdout.write(`Bundling theme extension ${e.localIdentifier}...`);let n=await N6(e);await Promise.all(n.map(function(r){let i=ji(e.directory,r),a=Ne(e.outputPath,i);if(r!==a)return zh(r,a)}))}async function TGr(e,t){if(!e?.metafile)return;let{dir:n,name:r}=jnt(t),i=Ne(n,`${r}.metafile.json`);try{await pi(i,JSON.stringify(e.metafile))}catch(a){ka(`Failed to write metafile to ${i}: ${a}`)}}function IGr(e,t){let n=e?.warnings??[],r=e?.errors??[];n.length>0&&CLt(n,{kind:"warning"}).forEach(a=>{t.stdout.write(a)}),r.length>0&&CLt(r,{kind:"error"}).forEach(a=>{t.stderr.write(a)})}function DGr(e,t=process.env){let n=kI(t,(o,s)=>dge.test(s)&&o),r={...e.env,...n},i=Object.keys(r||{}).reduce((o,s)=>({...o,[`process.env.${s}`]:JSON.stringify(r[s])}),{"process.env.NODE_ENV":JSON.stringify(e.environment)}),a={outfile:e.outputPath,stdin:e.stdin,bundle:!0,define:i,jsx:"automatic",logLevel:e.logLevel??"error",loader:{".esnext":"ts",".js":"jsx"},legalComments:"none",minify:e.minify,plugins:PGr(e.stdin.resolveDir,t),target:"es6",resolveExtensions:[".tsx",".ts",".js",".json",".esnext",".mjs",".ejs"]};if(e.sourceMaps&&(a.sourcemap=!0,a.sourceRoot=`${e.stdin.resolveDir}/src`),e.environment==="production"&&(a.metafile=!0),e.environment==="development"){let o=r[YC.disableMinificationOnDev];a.minify=!nw(o),a.logLevel="silent"}return a}function PGr(e,t=process.env){let n=[TLt.default.default()],r=nw(t[YC.skipEsbuildReactDedeuplication]);if(e&&!r){let i;try{i=Wt.resolve("react",{paths:[e]})}catch{at(`Unable to load React in ${e}, skipping React de-duplication`)}i&&(at(`Deduplicating React dependency for ${e}, using ${i}`),n.push(FGr(i)))}return n}function FGr(e){return{name:"shopify:deduplicate-react",setup({onResolve:t}){t({filter:/^react$/},n=>({path:e}))}}}var VLt=Nt(jLt(),1);async function GLt(e,t){t.stdout.write(`Bundling UI extension ${e.localIdentifier}...`);let n=t.app.dotenv?.variables??{};t.appURL&&(n.APP_URL=t.appURL);let r=t.buildDirectory??"",i=Ne(e.directory,r,e.outputRelativePath),{main:a,assets:o}=e.getBundleExtensionStdinContent(),s=performance.now();try{await k9e({minify:!0,outputPath:i,stdin:{contents:a,resolveDir:e.directory,loader:"tsx"},environment:t.environment,env:n,stderr:t.stderr,stdout:t.stdout,sourceMaps:e.isSourceMapGeneratingExtension}),o&&await Promise.all(o.map(async d=>{await k9e({minify:!0,outputPath:Ne(ki(i),d.outputFileName),stdin:{contents:d.content,resolveDir:e.directory,loader:"tsx"},environment:t.environment,env:n,stderr:t.stderr,stdout:t.stdout})}))}catch(d){let p=d.message??"Unknown error occurred",h=new we(`Failed to bundle extension ${e.localIdentifier}. Please check the extension source code for errors.`,p);throw h.errors=d.errors,h}await e.buildValidation();let l=Math.round(performance.now()-s),u=await pLt(i);return t.stdout.write(`${e.localIdentifier} successfully built in ${l}ms${u}`),i}async function kge(e,t){let n=Ne(e.directory,".build-lock"),r;try{r=await VLt.default.lock(e.directory,{retries:20,lockfilePath:n})}catch(i){throw at(`Failed to acquire function build lock: ${i.message}`),new we("Failed to build function.","This is likely due to another in-progress build.",["Ensure there are no other function builds in-progress.","Delete the `.build-lock` file in your function directory."])}try{let i=e.outputPath,a=e.configuration.build?.path??e.outputRelativePath;e.outputPath=Ne(e.directory,a),e.isJavaScript?await $Gr(e,t):await QGr(e,t);let o=e.configuration.build?.wasm_opt;Cc(e.outputPath)&&o&&await zMt(e.outputPath),Cc(e.outputPath)&&await HMt(e.outputPath);let s=Ne(e.directory,e.outputRelativePath);Cc(e.outputPath)&&i!==e.outputPath&&i!==s&&ki(i)!==ki(e.outputPath)&&await R9e(e.outputPath,i)}catch(i){if(i instanceof we)throw i;let a=i.message??"Unknown error occurred",o=new we("Failed to build function.",a);throw o.errors=i.errors,o}finally{await r()}}async function R9e(e,t){at(`Converting WASM from ${e} to base64 in ${t}`);let n=await Or(e,{encoding:"base64"});await vx(t),await pi(t,n)}async function $Gr(e,t){return e.buildCommand?(e.typegenCommand&&await KC(e,t),ZLt(e.buildCommand,e,t)):qMt(e,t)}async function QGr(e,t){if(!e.buildCommand)throw t.stderr.write(`The function extension ${e.localIdentifier} doesn't have a build command or it's empty`),t.stderr.write(`
|
|
3200
|
+
Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app-installation`)}};function XVr(e,t){let n=[];return e.forEach(r=>{let i=r.configuration.ui.handle,a=lLt(t,i);a?a.type!=="ui_extension"&&n.push(`[${r.name}] - Local app must contain one extension of type 'ui_extension' and handle '${i}'`):n.push(`[${r.name}] - Local app must contain a ui_extension with handle '${i}'`)}),n.length>0?n:void 0}function eGr(e,t){let n=[],r=["ui_extension"];return e.forEach(i=>{i.configuration.inCollection.forEach(a=>{let o=lLt(t,a.handle);o?r.includes(o.specification.identifier)?o.specification.identifier==="ui_extension"&&o.configuration.extension_points.forEach(l=>{l.target.startsWith("admin.")&&n.push(`[${i.handle}] editor extension collection: Remove extension '${o.configuration.handle}' with target '${l.target}' from this collection. This extension target is not supported in collections.`)}):n.push(`[${i.handle}] editor extension collection: Remove extension of type '${o.specification.identifier}' from this collection. This extension type is not supported in collections.`):n.push(`[${i.handle}] editor extension collection: Add extension with handle '${a.handle}' to local app. Local app must include extension with handle '${a.handle}'.`)})}),n.length>0?n:void 0}function lLt(e,t){return e.find(n=>n.handle===t)}async function cLt(e){let t=e.dependency;if(t)return uJ(t,e.directory)}async function uJ(e,t){let n=e.replace("-react","").split("/"),r=Ne("node_modules",n[0],n[1],"package.json"),i=await km(r,{cwd:t,type:"file",allowSymlinks:!0});if(!i)return"not_found";i=await trt(i);let a=await DM(i);return a.version?{name:e,version:a.version}:"not_found"}c();function tGr(e){if(!e?.length)return null;let t=null,n=-1;for(let r of e){if(!r.issues?.length)continue;let i=0,a=0,o=0;for(let l of r.issues)l.message?.includes("Required")||l.message?.includes("required")?i++:l.message?.includes("Expected")&&l.message?.includes("received")?a++:o++;let s;i>0?s=1e3-i*10-a-o:a>0?s=100-a*5-o:s=50-o,s>n&&(n=s,t=r)}return t}function uLt(e){let t=[];for(let n of e)if(n.code==="invalid_union"&&n.unionErrors){let r=tGr(n.unionErrors);if(r?.issues?.length)for(let i of r.issues)t.push({path:i.path,message:i.message,code:n.code});else t.push({path:n.path,message:n.message??"Configuration doesn't match any expected format",code:n.code})}else t.push({path:n.path,message:n.message??"Unknown error",code:n.code});return t}c();var dLt=/^shopify\.app(\.[-\w]+)?\.toml$/;function Ow(e){return e?yge(e)?e:`shopify.app.${sc(e)}.toml`:uf.app}function fJ(e){return Ma(e).match(dLt)?.[1]?.slice(1)}function yge(e){return!!dLt.test(e)}c();var nGr=wit({cmd_app_warning_api_key_deprecation_displayed:!1}),Rs=nGr;c();c();c();import{deflate as rGr}from"node:zlib";import{promisify as iGr}from"node:util";var aGr=iGr(rGr);async function oGr(e){let t=await Or(e),n=Buffer.byteLength(t),i=(await aGr(Buffer.from(t))).byteLength;return{path:e,rawBytes:n,compressedBytes:i}}function fLt(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/1024).toFixed(1)} KB`}async function pLt(e){try{let{rawBytes:t,compressedBytes:n}=await oGr(e);return` (${fLt(t)} original, ~${fLt(n)} compressed)`}catch(t){return at(`Failed to get bundle size for ${e}: ${t}`),""}}c();c();import{createInterface as sGr}from"readline";var lGr=[".git",".hg",".bzr",".svn","_darcs","CVS",".sublime-(project|workspace)",".DS_Store",".sass-cache","Thumbs.db","desktop.ini","config.yml","node_modules",".gitkeep",".shopifyignore","*.toml"];async function N6(e){let n=Ne(e.directory,".shopifyignore"),r=lGr.map(i=>Ne("*",i));if(Cc(n)){let i=await cGr(n);r.push(...i)}return io("*/*",{absolute:!0,cwd:e.directory,ignore:r})}function cGr(e){return new Promise((t,n)=>{let r=[],i=sGr({input:XW(e),crlfDelay:1/0});i.on("line",a=>{let o=a.trim();o.length>0&&!o.startsWith("#")&&r.push(o)}),i.on("close",()=>{t(r)}),i.on("error",a=>{n(a)})})}import{context as CGr,formatMessagesSync as CLt}from"esbuild";var TLt=Nt(kLt(),1);async function k9e(e,t=process.env){let n=DGr(e,t),r=await CGr(n),i=await r.rebuild();IGr(i,e),await TGr(i,e.outputPath),await r.dispose()}async function ILt(e,t){t.stdout.write(`Bundling theme extension ${e.localIdentifier}...`);let n=await N6(e);await Promise.all(n.map(function(r){let i=ji(e.directory,r),a=Ne(e.outputPath,i);if(r!==a)return zh(r,a)}))}async function TGr(e,t){if(!e?.metafile)return;let{dir:n,name:r}=jnt(t),i=Ne(n,`${r}.metafile.json`);try{await pi(i,JSON.stringify(e.metafile))}catch(a){ka(`Failed to write metafile to ${i}: ${a}`)}}function IGr(e,t){let n=e?.warnings??[],r=e?.errors??[];n.length>0&&CLt(n,{kind:"warning"}).forEach(a=>{t.stdout.write(a)}),r.length>0&&CLt(r,{kind:"error"}).forEach(a=>{t.stderr.write(a)})}function DGr(e,t=process.env){let n=kI(t,(o,s)=>dge.test(s)&&o),r={...e.env,...n},i=Object.keys(r||{}).reduce((o,s)=>({...o,[`process.env.${s}`]:JSON.stringify(r[s])}),{"process.env.NODE_ENV":JSON.stringify(e.environment)}),a={outfile:e.outputPath,stdin:e.stdin,bundle:!0,define:i,jsx:"automatic",logLevel:e.logLevel??"error",loader:{".esnext":"ts",".js":"jsx"},legalComments:"none",minify:e.minify,plugins:PGr(e.stdin.resolveDir,t),target:"es6",resolveExtensions:[".tsx",".ts",".js",".json",".esnext",".mjs",".ejs"]};if(e.sourceMaps&&(a.sourcemap=!0,a.sourceRoot=`${e.stdin.resolveDir}/src`),e.environment==="production"&&(a.metafile=!0),e.environment==="development"){let o=r[YC.disableMinificationOnDev];a.minify=!nw(o),a.logLevel="silent"}return a}function PGr(e,t=process.env){let n=[TLt.default.default()],r=nw(t[YC.skipEsbuildReactDedeuplication]);if(e&&!r){let i;try{i=Wt.resolve("react",{paths:[e]})}catch{at(`Unable to load React in ${e}, skipping React de-duplication`)}i&&(at(`Deduplicating React dependency for ${e}, using ${i}`),n.push(FGr(i)))}return n}function FGr(e){return{name:"shopify:deduplicate-react",setup({onResolve:t}){t({filter:/^react$/},n=>({path:e}))}}}var VLt=Nt(jLt(),1);async function GLt(e,t){t.stdout.write(`Bundling UI extension ${e.localIdentifier}...`);let n=t.app.dotenv?.variables??{};t.appURL&&(n.APP_URL=t.appURL);let r=t.buildDirectory??"",i=Ne(e.directory,r,e.outputRelativePath),{main:a,assets:o}=e.getBundleExtensionStdinContent(),s=performance.now();try{await k9e({minify:!0,outputPath:i,stdin:{contents:a,resolveDir:e.directory,loader:"tsx"},environment:t.environment,env:n,stderr:t.stderr,stdout:t.stdout,sourceMaps:e.isSourceMapGeneratingExtension}),o&&await Promise.all(o.map(async d=>{await k9e({minify:!0,outputPath:Ne(ki(i),d.outputFileName),stdin:{contents:d.content,resolveDir:e.directory,loader:"tsx"},environment:t.environment,env:n,stderr:t.stderr,stdout:t.stdout})}))}catch(d){let p=d.message??"Unknown error occurred",h=new we(`Failed to bundle extension ${e.localIdentifier}. Please check the extension source code for errors.`,p);throw h.errors=d.errors,h}await e.buildValidation({outputPath:i});let l=Math.round(performance.now()-s),u=await pLt(i);return t.stdout.write(`${e.localIdentifier} successfully built in ${l}ms${u}`),i}async function kge(e,t){let n=Ne(e.directory,".build-lock"),r;try{r=await VLt.default.lock(e.directory,{retries:20,lockfilePath:n})}catch(i){throw at(`Failed to acquire function build lock: ${i.message}`),new we("Failed to build function.","This is likely due to another in-progress build.",["Ensure there are no other function builds in-progress.","Delete the `.build-lock` file in your function directory."])}try{let i=e.outputPath,a=e.configuration.build?.path??e.outputRelativePath;e.outputPath=Ne(e.directory,a),e.isJavaScript?await $Gr(e,t):await QGr(e,t);let o=e.configuration.build?.wasm_opt;Cc(e.outputPath)&&o&&await zMt(e.outputPath),Cc(e.outputPath)&&await HMt(e.outputPath);let s=Ne(e.directory,e.outputRelativePath);Cc(e.outputPath)&&i!==e.outputPath&&i!==s&&ki(i)!==ki(e.outputPath)&&await R9e(e.outputPath,i)}catch(i){if(i instanceof we)throw i;let a=i.message??"Unknown error occurred",o=new we("Failed to build function.",a);throw o.errors=i.errors,o}finally{await r()}}async function R9e(e,t){at(`Converting WASM from ${e} to base64 in ${t}`);let n=await Or(e,{encoding:"base64"});await vx(t),await pi(t,n)}async function $Gr(e,t){return e.buildCommand?(e.typegenCommand&&await KC(e,t),ZLt(e.buildCommand,e,t)):qMt(e,t)}async function QGr(e,t){if(!e.buildCommand)throw t.stderr.write(`The function extension ${e.localIdentifier} doesn't have a build command or it's empty`),t.stderr.write(`
|
|
3201
3201
|
Edit the shopify.function.extension.toml configuration file and set how to build the extension.
|
|
3202
3202
|
|
|
3203
3203
|
[build]
|
|
@@ -3226,7 +3226,7 @@ Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app
|
|
|
3226
3226
|
${i}`},`
|
|
3227
3227
|
|
|
3228
3228
|
${d}`,p]}).flat()}async function XLt(e){let n=await(0,M6.check)(e,"theme-check:theme-app-extension"),r=uZr(n);return Uit(r)}async function e9t(e,t){let{extension:n,options:r}=t;r.stdout.write("Running theme check on your Theme app extension...");let i=await XLt(n.directory);i&&r.stdout.write(i)}c();async function t9t(e,t){let{extension:n,options:r}=t;r.stdout.write(`Bundling theme extension ${n.localIdentifier}...`);let i=await N6(n);return await Promise.all(i.map(async a=>{let o=ji(n.directory,a),s=Ne(n.outputPath,o);a!==s&&await zh(a,s)})),{filesCopied:i.length}}c();async function n9t(e,t){let n=t.extension.configuration;t.options.buildDirectory=e.config?.bundleFolder??void 0;let r=await GLt(t.extension,t.options),i=ki(r),a=e.config?.bundleFolder?Ne(ki(t.extension.outputPath),e.config.bundleFolder):ki(t.extension.outputPath);if(i!==a&&await zh(i,a),!e.config?.generatesAssetsManifest||!Array.isArray(n.extension_points))return;let o=n.extension_points.filter(l=>typeof l=="object"&&l.build_manifest),s=dZr(o,e.config?.bundleFolder);Object.keys(s).length>0&&await M9e(t,s)}function dZr(e,t){let n={};for(let{target:r,build_manifest:i}of e){if(!i?.assets)continue;let a={};for(let[o,s]of Object.entries(i.assets))s?.filepath&&(a[o]=t?Ne(t,s.filepath):s.filepath);Object.keys(a).length>0&&(n[r]=a)}return n}c();async function r9t(e,t){return kge(t.extension,t.options)}c();async function i9t(e,t){let{extension:n}=t;if(await En(n.outputPath)&&await Ty(n.outputPath))throw new Error(`outputPath '${n.outputPath}' is a directory \u2014 expected a file path for the tax stub`);await vx(n.outputPath),await pi(n.outputPath,"(()=>{})();")}async function a9t(e,t){switch(e.type){case"include_assets":return QLt(e,t);case"build_theme":return e9t(e,t);case"bundle_theme":return t9t(e,t);case"bundle_ui":return n9t(e,t);case"build_function":return r9t(e,t);case"create_tax_stub":return i9t(e,t);default:throw new Error(`Unknown build step type: ${e.type}`)}}async function o9t(e,t){let n=Date.now();try{let r=await a9t(e,t);return{id:e.id,success:!0,duration:Date.now()-n,output:r}}catch(r){let i=r;if(e.continueOnError)return t.options.stderr.write(`Warning: Step "${e.name}" failed but continuing: ${i.message}
|
|
3229
|
-
`),{id:e.id,success:!1,duration:Date.now()-n,error:i};throw i.message=`Build step "${e.name}" failed: ${i.message}`,i}}c();import{openSync as fZr,readSync as pZr,closeSync as hZr}from"fs";var s9t=128*1024,Ige=new Map,Dge=new Map,Pge=new Map;function nN(e){let t=Dge.get(e);if(t!==void 0)return t;let n=Cc(e);return Dge.set(e,n),n}function mJ(e){let t=Pge.get(e);if(t!==void 0)return t;let n=Ote(e);return Pge.set(e,n),n}function mZr(e){let t=fZr(e,"r");try{let n=Buffer.alloc(s9t),r=pZr(t,n,0,s9t,0);return n.subarray(0,r).toString()}finally{hZr(t)}}function l9t(){Ige.clear(),Dge.clear(),Pge.clear()}function gZr(e){let t=Ige.get(e);if(t)return t;let n=mZr(e),r=e.substring(e.lastIndexOf(".")),i;switch(r){case".js":case".mjs":case".cjs":case".ts":case".tsx":case".jsx":i=u9t(n,e);break;case".rs":i=vZr(n,e);break;default:i=[]}return Ige.set(e,i),i}function L9e(e,t=new Set){if(t.has(e))return[];t.add(e);let n=gZr(e),r=[e,...n];for(let i of n)try{if(nN(i)&&!mJ(i)){let a=L9e(i,t);r.push(...a)}}catch(a){if(a instanceof Error&&a.message.includes("ENOENT"))continue;throw a}return[...new Set(r)]}function c9t(){return{directImports:Ige.size,fileExists:Dge.size,isDir:Pge.size}}function q9e(e,t){return u9t(e,t)}function u9t(e,t){let n=[],r=[/import\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,/import\s+['"](\.\.?\/[^'"]+)['"]/g,/export\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,/import\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g,/require\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g];for(let i of r){let a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o&&o.startsWith(".")){let s=yZr(o,t);s&&n.push(s)}}}return[...new Set(n)]}function vZr(e,t){let n=[],r=/^\s*(?:pub\s+)?mod\s+([a-z_][a-z0-9_]*)\s*;/gm,i;for(;(i=r.exec(e))!==null;){let o=i[1];if(o){let s=bZr(o,t);s&&n.push(s)}}let a=/#\[path\s*=\s*"([^"]+)"\]/g;for(;(i=a.exec(e))!==null;){let o=i[1];if(o){let s=Ne(ki(t),o);nN(s)&&n.push(s)}}return[...new Set(n)]}function yZr(e,t){let n=nN(t)&&mJ(t)?t:ki(t),r=Ne(n,e);if(nN(r)&&mJ(r)){let a=[Ne(r,"index.js"),Ne(r,"index.ts"),Ne(r,"index.tsx"),Ne(r,"index.jsx")];for(let o of a)if(nN(o)&&!mJ(o))return o;return null}let i=[r,`${r}.js`,`${r}.ts`,`${r}.tsx`,`${r}.jsx`];for(let a of i)if(nN(a)&&!mJ(a))return a;return null}function bZr(e,t){let n=ki(t),r=[Ne(n,`${e}.rs`),Ne(n,e,"mod.rs")];for(let i of r)if(nN(i))return i;return null}var Fge=class{get graphQLType(){return(this.specification.graphQLType??this.specification.identifier).toUpperCase()}get type(){return this.specification.identifier}get humanName(){return this.specification.externalName}get name(){return this.configuration.name??this.specification.externalName}get dependency(){return this.specification.dependency}get externalType(){return this.specification.externalIdentifier}get surface(){return this.specification.surface}get isPreviewable(){return this.features.includes("ui_preview")}get isThemeExtension(){return this.features.includes("theme")}get isFunctionExtension(){return this.features.includes("function")}get isESBuildExtension(){return this.features.includes("esbuild")}get isSourceMapGeneratingExtension(){return this.features.includes("generates_source_maps")}get isAppConfigExtension(){return this.specification.experience==="configuration"}get isFlow(){return this.specification.identifier.includes("flow")}get isEditorExtensionCollection(){return this.specification.identifier==="editor_extension_collection"}get hasDeploySteps(){return this.specification.clientSteps?.some(t=>t.lifecycle==="deploy"&&t.steps.length>0)??!1}get features(){return this.specification.appModuleFeatures(this.configuration)}get outputFileName(){return Ma(this.outputRelativePath)}get outputRelativePath(){return this.specification.getOutputRelativePath?.(this)??""}constructor(t){this.configuration=t.configuration,this.configurationPath=t.configurationPath,this.entrySourceFilePath=t.entryPath??"",this.directory=t.directory,this.specification=t.specification,this.handle=this.buildHandle(),this.localIdentifier=this.handle,this.idEnvironmentVariableName=`SHOPIFY_${Rte(this.localIdentifier)}_ID`,this.outputPath=Ne(this.directory,this.outputRelativePath),this.uid=this.buildUIDFromStrategy(),this.devUUID=`dev-${this.uid}`}get draftMessages(){if(this.isAppConfigExtension)return{successMessage:void 0,errorMessage:void 0};let t=`Draft updated successfully for extension: ${this.localIdentifier}`,n=`Error updating extension draft for ${this.localIdentifier}`;return{successMessage:t,errorMessage:n}}get isUUIDStrategyExtension(){return this.specification.uidStrategy==="uuid"}get isSingleStrategyExtension(){return this.specification.uidStrategy==="single"}get isDynamicStrategyExtension(){return this.specification.uidStrategy==="dynamic"}get outputPrefix(){return this.handle}isSentToMetrics(){return!this.isAppConfigExtension}isReturnedAsInfo(){return!this.isAppConfigExtension}async deployConfig({apiKey:t,appConfiguration:n}){let r=await this.specification.deployConfig?.(this.configuration,this.directory,t,void 0),i=this.specification.transformLocalToRemote?.(this.configuration,n),a=r??i??void 0;return a&&Object.keys(a).length>0?a:void 0}validate(){return this.specification.validate?this.specification.validate(this.configuration,this.configurationPath,this.directory):Promise.resolve(aw(void 0))}preDeployValidation(){return this.specification.preDeployValidation?this.specification.preDeployValidation(this):Promise.resolve()}buildValidation(){return this.specification.buildValidation?this.specification.buildValidation(this):Promise.resolve()}async keepBuiltSourcemapsLocally(t){if(!this.isSourceMapGeneratingExtension)return Promise.resolve();let r=(await io(`**/${this.handle}.js.map`,{cwd:t,absolute:!0,followSymbolicLinks:!1}))[0];if(r===void 0)return Promise.resolve();let i=Ne(this.directory,ji(t,r));await iw(r,i,{overwrite:!0}),at(`Source map for ${this.localIdentifier} created: ${i}`)}async publishURL(t){let n=await FF(),r=this.specification.partnersWebIdentifier;return`https://${n}/${t.orgId}/apps/${t.appId}/extensions/${r}/${t.extensionId}`}getOutputFolderId(t){return t??this.uid}getBundleExtensionStdinContent(){return this.specification.getBundleExtensionStdinContent?this.specification.getBundleExtensionStdinContent(this.configuration):{main:`import '.${this.entrySourceFilePath.replace(this.directory,"")}';`}}shouldFetchCartUrl(){return this.features.includes("cart_url")}hasExtensionPointTarget(t){return this.specification.hasExtensionPointTarget?.(this.configuration,t)??!1}get buildCommand(){return this.configuration.build?.command}get typegenCommand(){return this.configuration.build?.typegen_command}devSessionDefaultWatchPaths(){if(this.specification.identifier==="ui_extension"){let{main:t,assets:n}=this.getBundleExtensionStdinContent(),r=q9e(t,this.directory),i=n?.flatMap(a=>q9e(a.content,this.directory))??[];return r.concat(...i)}return[this.entrySourceFilePath]}get devSessionWatchConfig(){return this.specification.devSessionWatchConfig?this.specification.devSessionWatchConfig(this):this.isAppConfigExtension?{paths:[]}:void 0}async watchConfigurationPaths(){if(this.isAppConfigExtension)return[this.configurationPath];{let t=[];return await En(Ne(this.directory,"locales"))&&t.push(Ne(this.directory,"locales","**.json")),t.push(Ne(this.directory,"**.toml")),t}}get inputQueryPath(){return Ne(this.directory,"input.graphql")}get isJavaScript(){return!!(this.entrySourceFilePath.endsWith(".js")||this.entrySourceFilePath.endsWith(".ts"))}async build(t){let{clientSteps:n=[]}=this.specification,r={extension:this,options:t,stepResults:new Map},i=n.find(a=>a.lifecycle==="deploy")?.steps??[];for(let a of i){let o=await o9t(a,r);r.stepResults.set(a.id,o)}}async buildForBundle(t,n,r){this.outputPath=this.getOutputPathForDirectory(n,r),await this.build(t);let i=Ne(n,this.getOutputFolderId(r));await this.keepBuiltSourcemapsLocally(i)}async copyIntoBundle(t,n,r){let i=this.outputPath;this.outputPath=this.getOutputPathForDirectory(n,r),this.isThemeExtension?await ILt(this,t):this.hasDeploySteps&&(at(`Will copy pre-built file from ${i} to ${this.outputPath}`),await En(i)&&(await zh(i,this.outputPath),this.isFunctionExtension&&await R9e(this.outputPath,this.outputPath)))}getOutputPathForDirectory(t,n){let r=this.getOutputFolderId(n);return Ne(t,r,this.outputRelativePath)}get singleTarget(){let t=dp(this.configuration,"targeting")??[];if(t.length===1)return t[0]?.target}get contextValue(){let t=this.singleTarget??"";return this.isFlow&&(t=this.configuration.handle??""),t}async bundleConfig({identifiers:t,developerPlatformClient:n,apiKey:r,appConfiguration:i}){let a=await this.deployConfig({apiKey:r,appConfiguration:i});if(!a)return;let o={config:JSON.stringify(a),context:this.contextValue,handle:this.handle},s=this.isUUIDStrategyExtension?t.extensions[this.localIdentifier]:t.extensionsNonUuidManaged[this.localIdentifier];return{...o,uid:this.uid,uuid:s,specificationIdentifier:n.toExtensionGraphQLType(this.graphQLType)}}async getDevSessionUpdateMessages(){if(this.specification.getDevSessionUpdateMessages)return this.specification.getDevSessionUpdateMessages(this.configuration)}patchWithAppDevURLs(t){this.specification.patchWithAppDevURLs&&this.specification.patchWithAppDevURLs(this.configuration,t)}async contributeToSharedTypeFile(t){await this.specification.contributeToSharedTypeFile?.(this,t)}watchedFiles(){let t=[],n=["**/node_modules/**","**/.git/**","**/*.test.*","**/dist/**","**/*.swp","**/generated/**","**/.gitignore"],r=this.devSessionWatchConfig,i=r?.paths??["**/*"],a=r?.ignore??n,o=i.flatMap(s=>urt(s,{cwd:this.directory,absolute:!0,followSymbolicLinks:!1,ignore:a}));if(t.push(...o.flat()),!r){let s=this.scanImports();t.push(...s)}return[...new Set(t.map(s=>ky(s)))]}async rescanImports(){let t=this.cachedImportPaths;return this.cachedImportPaths=void 0,l9t(),this.scanImports(),t!==this.cachedImportPaths}scanImports(){if(this.cachedImportPaths!==void 0)return this.cachedImportPaths;if(nw(process.env.SHOPIFY_CLI_DISABLE_IMPORT_SCANNING))return this.cachedImportPaths=[],this.cachedImportPaths;try{let t=performance.now(),n=this.devSessionDefaultWatchPaths(),r=n.flatMap(s=>L9e(s).map(l=>ky(Kr(l))));this.cachedImportPaths=Fte(r)??[];let i=Math.round(performance.now()-t),a=c9t(),o=a?` (cache: ${a.directImports} parsed, ${a.fileExists} stats)`:"";return at(`Import scan for "${this.handle}": ${n.length} entries, ${this.cachedImportPaths.length} files, ${i}ms${o}`),this.cachedImportPaths}catch(t){return at(`Failed to scan imports for extension ${this.handle}: ${t}`),this.cachedImportPaths=[],this.cachedImportPaths}}buildHandle(){switch(this.specification.uidStrategy){case"single":return this.specification.identifier;case"uuid":return this.configuration.handle??sc(this.name??"");case"dynamic":if("topic"in this.configuration&&"uri"in this.configuration){let t=this.configuration,n=`${t.topic}${t.uri}${t.filter}`;return w_(n).substring(0,qm)}else return EI(JSON.stringify(this.configuration));default:return this.specification.identifier}}buildUIDFromStrategy(){switch(this.specification.uidStrategy){case"single":return this.specification.identifier;case"uuid":return this.configuration.uid??EI(this.handle);case"dynamic":if("topic"in this.configuration&&"uri"in this.configuration){let t=this.configuration;return`${t.topic}::${t.filter}::${t.uri}`.substring(0,mge)}else return EI(JSON.stringify(this.configuration))}}};c();async function d9t(e,t=""){let n=wZr(t),r=await cd(n);for(;await En(Ne(e,Rge(r)))&&await Uo({message:`Configuration file ${Rge(r)} already exists. Do you want to choose a different configuration name?`,confirmationMessage:"Yes, I'll choose a different name",cancellationMessage:"No, overwrite my existing configuration file"});)r=await cd(n);return Rge(r)}function Rge(e,t=!1){let n=sc(e);return n===""?"shopify.app.toml":`shopify.app.${t?Qr.cyan(n):n}.toml`}async function B9e(e){return io(Ne(e,"shopify.app*.toml"))}async function f9t(e){let t=(await B9e(e)).map(r=>Ma(r));if(t.length===0)return ow("Could not find any shopify.app.toml file in the directory.");if(t.length===1)return aw(t[0]);let n=await Tc({message:"Configuration file",choices:t.map(r=>({label:r,value:r}))});return aw(n)}function wZr(e){return{message:"Configuration file name:",initialAnswer:e,validate:_Zr,preview:t=>`${Rge(t,!0)} will be generated in your root directory`}}function _Zr(e){if(sc(e).length>238)return"The file name is too long."}c();c();var SZr=/^(https:\/\/)/,xZr=/^pubsub:\/\/(?<gcp_project_id>[^:]+):(?<gcp_topic>.+)$/,EZr=/^arn:aws:events:(?<aws_region>[a-z]{2}-[a-z]+-[0-9]+)::event-source\/aws\.partner\/shopify\.com(\.test)?\/(?<api_client_id>\d+)\/(?<event_source_name>.+)$/;function e5(e){return typeof e=="string"&&e.endsWith("/")?e.replace(/\/+$/,""):e}var L6=he.string({invalid_type_error:"Value must be string"}).refine(e=>e.startsWith("/")?!0:SZr.test(e)||xZr.test(e)||EZr.test(e),{message:"URI format isn't correct. Valid formats include: relative path starting with a slash, HTTPS URL, pubsub://{project-id}:{topic-id} or Eventbridge ARN"});c();function q6(e,t){return!t||!e.startsWith("/")?e:`${e5(t)}${e}`}var XB="webhook_subscription",kZr=he.object({topic:he.string(),actions:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),api_version:he.string(),uri:he.preprocess(e5,L6,{required_error:"Missing value at"}),include_fields:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),filter:he.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional()});function CZr(e){let{api_version:t,topic:n,...r}=e;return{webhooks:{subscriptions:[{topics:[n],...r}]}}}var TZr={forward:(e,t)=>{let n=e,r;return"application_url"in t&&(r=t?.application_url),{...n,uri:q6(n.uri,r)}},reverse:CZr},IZr=xv({identifier:XB,schema:kZr,transformConfig:TZr,uidStrategy:"dynamic"}),p9t=IZr;c();c();var QC;(function(e){e.CustomersRedact="customers/redact",e.CustomersDataRequest="customers/data_request",e.ShopRedact="shop/redact"})(QC||(QC={}));var h9t=he.object({topics:he.array(he.string({invalid_type_error:"Values within array must be a string"}),{invalid_type_error:"Value must be string[]"}).optional(),actions:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),uri:he.preprocess(e=>e5(e),L6,{required_error:"Missing value at"}),include_fields:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),filter:he.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional(),compliance_topics:he.array(he.enum([QC.CustomersRedact,QC.CustomersDataRequest,QC.ShopRedact]),{invalid_type_error:"Value must be an array containing values: customers/redact, customers/data_request or shop/redact"}).optional()});c();function m9t(e,t){let n=DZr(e);if(n)return t.addIssue(n),he.NEVER}function DZr(e){let{subscriptions:t=[]}=e,n=new Set,r=[];if(!t.length)return;if(e.privacy_compliance&&e.subscriptions?.some(a=>a.compliance_topics))return{code:he.ZodIssueCode.custom,message:"The privacy_compliance section can't be used if there are subscriptions including compliance_topics"};let i=t.flatMap(a=>a.compliance_topics).filter(Boolean);if(Fte(i).length!==i.length)return{code:he.ZodIssueCode.custom,message:"You can\u2019t have multiple subscriptions with the same compliance topic",fatal:!0,path:["subscriptions"]};for(let[a,{uri:o,topics:s=[],compliance_topics:l=[],filter:u=""}]of t.entries()){let d=["subscriptions",a];if(!s.length&&!l.length)return{code:he.ZodIssueCode.custom,message:"Either topics or compliance_topics must be added to the webhook subscription",path:d};s.forEach(p=>{let h=`${p}::${o}::${u}`;if(n.has(h)){let v=u?Qr.dim(`
|
|
3229
|
+
`),{id:e.id,success:!1,duration:Date.now()-n,error:i};throw i.message=`Build step "${e.name}" failed: ${i.message}`,i}}c();import{openSync as fZr,readSync as pZr,closeSync as hZr}from"fs";var s9t=128*1024,Ige=new Map,Dge=new Map,Pge=new Map;function nN(e){let t=Dge.get(e);if(t!==void 0)return t;let n=Cc(e);return Dge.set(e,n),n}function mJ(e){let t=Pge.get(e);if(t!==void 0)return t;let n=Ote(e);return Pge.set(e,n),n}function mZr(e){let t=fZr(e,"r");try{let n=Buffer.alloc(s9t),r=pZr(t,n,0,s9t,0);return n.subarray(0,r).toString()}finally{hZr(t)}}function l9t(){Ige.clear(),Dge.clear(),Pge.clear()}function gZr(e){let t=Ige.get(e);if(t)return t;let n=mZr(e),r=e.substring(e.lastIndexOf(".")),i;switch(r){case".js":case".mjs":case".cjs":case".ts":case".tsx":case".jsx":i=u9t(n,e);break;case".rs":i=vZr(n,e);break;default:i=[]}return Ige.set(e,i),i}function L9e(e,t=new Set){if(t.has(e))return[];t.add(e);let n=gZr(e),r=[e,...n];for(let i of n)try{if(nN(i)&&!mJ(i)){let a=L9e(i,t);r.push(...a)}}catch(a){if(a instanceof Error&&a.message.includes("ENOENT"))continue;throw a}return[...new Set(r)]}function c9t(){return{directImports:Ige.size,fileExists:Dge.size,isDir:Pge.size}}function q9e(e,t){return u9t(e,t)}function u9t(e,t){let n=[],r=[/import\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,/import\s+['"](\.\.?\/[^'"]+)['"]/g,/export\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,/import\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g,/require\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g];for(let i of r){let a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o&&o.startsWith(".")){let s=yZr(o,t);s&&n.push(s)}}}return[...new Set(n)]}function vZr(e,t){let n=[],r=/^\s*(?:pub\s+)?mod\s+([a-z_][a-z0-9_]*)\s*;/gm,i;for(;(i=r.exec(e))!==null;){let o=i[1];if(o){let s=bZr(o,t);s&&n.push(s)}}let a=/#\[path\s*=\s*"([^"]+)"\]/g;for(;(i=a.exec(e))!==null;){let o=i[1];if(o){let s=Ne(ki(t),o);nN(s)&&n.push(s)}}return[...new Set(n)]}function yZr(e,t){let n=nN(t)&&mJ(t)?t:ki(t),r=Ne(n,e);if(nN(r)&&mJ(r)){let a=[Ne(r,"index.js"),Ne(r,"index.ts"),Ne(r,"index.tsx"),Ne(r,"index.jsx")];for(let o of a)if(nN(o)&&!mJ(o))return o;return null}let i=[r,`${r}.js`,`${r}.ts`,`${r}.tsx`,`${r}.jsx`];for(let a of i)if(nN(a)&&!mJ(a))return a;return null}function bZr(e,t){let n=ki(t),r=[Ne(n,`${e}.rs`),Ne(n,e,"mod.rs")];for(let i of r)if(nN(i))return i;return null}var Fge=class{get graphQLType(){return(this.specification.graphQLType??this.specification.identifier).toUpperCase()}get type(){return this.specification.identifier}get humanName(){return this.specification.externalName}get name(){return this.configuration.name??this.specification.externalName}get dependency(){return this.specification.dependency}get externalType(){return this.specification.externalIdentifier}get surface(){return this.specification.surface}get isPreviewable(){return this.features.includes("ui_preview")}get isThemeExtension(){return this.features.includes("theme")}get isFunctionExtension(){return this.features.includes("function")}get isESBuildExtension(){return this.features.includes("esbuild")}get isSourceMapGeneratingExtension(){return this.features.includes("generates_source_maps")}get isAppConfigExtension(){return this.specification.experience==="configuration"}get isFlow(){return this.specification.identifier.includes("flow")}get isEditorExtensionCollection(){return this.specification.identifier==="editor_extension_collection"}get hasDeploySteps(){return this.specification.clientSteps?.some(t=>t.lifecycle==="deploy"&&t.steps.length>0)??!1}get features(){return this.specification.appModuleFeatures(this.configuration)}get outputFileName(){return Ma(this.outputRelativePath)}get outputRelativePath(){return this.specification.getOutputRelativePath?.(this)??""}constructor(t){this.configuration=t.configuration,this.configurationPath=t.configurationPath,this.entrySourceFilePath=t.entryPath??"",this.directory=t.directory,this.specification=t.specification,this.handle=this.buildHandle(),this.localIdentifier=this.handle,this.idEnvironmentVariableName=`SHOPIFY_${Rte(this.localIdentifier)}_ID`,this.outputPath=Ne(this.directory,this.outputRelativePath),this.uid=this.buildUIDFromStrategy(),this.devUUID=`dev-${this.uid}`}get draftMessages(){if(this.isAppConfigExtension)return{successMessage:void 0,errorMessage:void 0};let t=`Draft updated successfully for extension: ${this.localIdentifier}`,n=`Error updating extension draft for ${this.localIdentifier}`;return{successMessage:t,errorMessage:n}}get isUUIDStrategyExtension(){return this.specification.uidStrategy==="uuid"}get isSingleStrategyExtension(){return this.specification.uidStrategy==="single"}get isDynamicStrategyExtension(){return this.specification.uidStrategy==="dynamic"}get outputPrefix(){return this.handle}isSentToMetrics(){return!this.isAppConfigExtension}isReturnedAsInfo(){return!this.isAppConfigExtension}async deployConfig({apiKey:t,appConfiguration:n}){let r=await this.specification.deployConfig?.(this.configuration,this.directory,t,void 0),i=this.specification.transformLocalToRemote?.(this.configuration,n),a=r??i??void 0;return a&&Object.keys(a).length>0?a:void 0}validate(){return this.specification.validate?this.specification.validate(this.configuration,this.configurationPath,this.directory):Promise.resolve(aw(void 0))}preDeployValidation(){return this.specification.preDeployValidation?this.specification.preDeployValidation(this):Promise.resolve()}buildValidation({outputPath:t}){return this.specification.buildValidation?this.specification.buildValidation(this,t):Promise.resolve()}async keepBuiltSourcemapsLocally(t){if(!this.isSourceMapGeneratingExtension)return Promise.resolve();let r=(await io(`**/${this.handle}.js.map`,{cwd:t,absolute:!0,followSymbolicLinks:!1}))[0];if(r===void 0)return Promise.resolve();let i=Ne(this.directory,ji(t,r));await iw(r,i,{overwrite:!0}),at(`Source map for ${this.localIdentifier} created: ${i}`)}async publishURL(t){let n=await FF(),r=this.specification.partnersWebIdentifier;return`https://${n}/${t.orgId}/apps/${t.appId}/extensions/${r}/${t.extensionId}`}getOutputFolderId(t){return t??this.uid}getBundleExtensionStdinContent(){return this.specification.getBundleExtensionStdinContent?this.specification.getBundleExtensionStdinContent(this.configuration):{main:`import '.${this.entrySourceFilePath.replace(this.directory,"")}';`}}shouldFetchCartUrl(){return this.features.includes("cart_url")}hasExtensionPointTarget(t){return this.specification.hasExtensionPointTarget?.(this.configuration,t)??!1}get buildCommand(){return this.configuration.build?.command}get typegenCommand(){return this.configuration.build?.typegen_command}devSessionDefaultWatchPaths(){if(this.specification.identifier==="ui_extension"){let{main:t,assets:n}=this.getBundleExtensionStdinContent(),r=q9e(t,this.directory),i=n?.flatMap(a=>q9e(a.content,this.directory))??[];return r.concat(...i)}return[this.entrySourceFilePath]}get devSessionWatchConfig(){return this.specification.devSessionWatchConfig?this.specification.devSessionWatchConfig(this):this.isAppConfigExtension?{paths:[]}:void 0}async watchConfigurationPaths(){if(this.isAppConfigExtension)return[this.configurationPath];{let t=[];return await En(Ne(this.directory,"locales"))&&t.push(Ne(this.directory,"locales","**.json")),t.push(Ne(this.directory,"**.toml")),t}}get inputQueryPath(){return Ne(this.directory,"input.graphql")}get isJavaScript(){return!!(this.entrySourceFilePath.endsWith(".js")||this.entrySourceFilePath.endsWith(".ts"))}async build(t){let{clientSteps:n=[]}=this.specification,r={extension:this,options:t,stepResults:new Map},i=n.find(a=>a.lifecycle==="deploy")?.steps??[];for(let a of i){let o=await o9t(a,r);r.stepResults.set(a.id,o)}}async buildForBundle(t,n,r){this.outputPath=this.getOutputPathForDirectory(n,r),await this.build(t);let i=Ne(n,this.getOutputFolderId(r));await this.keepBuiltSourcemapsLocally(i)}async copyIntoBundle(t,n,r){let i=this.outputPath;this.outputPath=this.getOutputPathForDirectory(n,r),this.isThemeExtension?await ILt(this,t):this.hasDeploySteps&&(at(`Will copy pre-built file from ${i} to ${this.outputPath}`),await En(i)&&(await zh(i,this.outputPath),this.isFunctionExtension&&await R9e(this.outputPath,this.outputPath)))}getOutputPathForDirectory(t,n){let r=this.getOutputFolderId(n);return Ne(t,r,this.outputRelativePath)}get singleTarget(){let t=dp(this.configuration,"targeting")??[];if(t.length===1)return t[0]?.target}get contextValue(){let t=this.singleTarget??"";return this.isFlow&&(t=this.configuration.handle??""),t}async bundleConfig({identifiers:t,developerPlatformClient:n,apiKey:r,appConfiguration:i}){let a=await this.deployConfig({apiKey:r,appConfiguration:i});if(!a)return;let o={config:JSON.stringify(a),context:this.contextValue,handle:this.handle},s=this.isUUIDStrategyExtension?t.extensions[this.localIdentifier]:t.extensionsNonUuidManaged[this.localIdentifier];return{...o,uid:this.uid,uuid:s,specificationIdentifier:n.toExtensionGraphQLType(this.graphQLType)}}async getDevSessionUpdateMessages(){if(this.specification.getDevSessionUpdateMessages)return this.specification.getDevSessionUpdateMessages(this.configuration)}patchWithAppDevURLs(t){this.specification.patchWithAppDevURLs&&this.specification.patchWithAppDevURLs(this.configuration,t)}async contributeToSharedTypeFile(t){await this.specification.contributeToSharedTypeFile?.(this,t)}watchedFiles(){let t=[],n=["**/node_modules/**","**/.git/**","**/*.test.*","**/dist/**","**/*.swp","**/generated/**","**/.gitignore"],r=this.devSessionWatchConfig,i=r?.paths??["**/*"],a=r?.ignore??n,o=i.flatMap(s=>urt(s,{cwd:this.directory,absolute:!0,followSymbolicLinks:!1,ignore:a}));if(t.push(...o.flat()),!r){let s=this.scanImports();t.push(...s)}return[...new Set(t.map(s=>ky(s)))]}async rescanImports(){let t=this.cachedImportPaths;return this.cachedImportPaths=void 0,l9t(),this.scanImports(),t!==this.cachedImportPaths}scanImports(){if(this.cachedImportPaths!==void 0)return this.cachedImportPaths;if(nw(process.env.SHOPIFY_CLI_DISABLE_IMPORT_SCANNING))return this.cachedImportPaths=[],this.cachedImportPaths;try{let t=performance.now(),n=this.devSessionDefaultWatchPaths(),r=n.flatMap(s=>L9e(s).map(l=>ky(Kr(l))));this.cachedImportPaths=Fte(r)??[];let i=Math.round(performance.now()-t),a=c9t(),o=a?` (cache: ${a.directImports} parsed, ${a.fileExists} stats)`:"";return at(`Import scan for "${this.handle}": ${n.length} entries, ${this.cachedImportPaths.length} files, ${i}ms${o}`),this.cachedImportPaths}catch(t){return at(`Failed to scan imports for extension ${this.handle}: ${t}`),this.cachedImportPaths=[],this.cachedImportPaths}}buildHandle(){switch(this.specification.uidStrategy){case"single":return this.specification.identifier;case"uuid":return this.configuration.handle??sc(this.name??"");case"dynamic":if("topic"in this.configuration&&"uri"in this.configuration){let t=this.configuration,n=`${t.topic}${t.uri}${t.filter}`;return w_(n).substring(0,qm)}else return EI(JSON.stringify(this.configuration));default:return this.specification.identifier}}buildUIDFromStrategy(){switch(this.specification.uidStrategy){case"single":return this.specification.identifier;case"uuid":return this.configuration.uid??EI(this.handle);case"dynamic":if("topic"in this.configuration&&"uri"in this.configuration){let t=this.configuration;return`${t.topic}::${t.filter}::${t.uri}`.substring(0,mge)}else return EI(JSON.stringify(this.configuration))}}};c();async function d9t(e,t=""){let n=wZr(t),r=await cd(n);for(;await En(Ne(e,Rge(r)))&&await Uo({message:`Configuration file ${Rge(r)} already exists. Do you want to choose a different configuration name?`,confirmationMessage:"Yes, I'll choose a different name",cancellationMessage:"No, overwrite my existing configuration file"});)r=await cd(n);return Rge(r)}function Rge(e,t=!1){let n=sc(e);return n===""?"shopify.app.toml":`shopify.app.${t?Qr.cyan(n):n}.toml`}async function B9e(e){return io(Ne(e,"shopify.app*.toml"))}async function f9t(e){let t=(await B9e(e)).map(r=>Ma(r));if(t.length===0)return ow("Could not find any shopify.app.toml file in the directory.");if(t.length===1)return aw(t[0]);let n=await Tc({message:"Configuration file",choices:t.map(r=>({label:r,value:r}))});return aw(n)}function wZr(e){return{message:"Configuration file name:",initialAnswer:e,validate:_Zr,preview:t=>`${Rge(t,!0)} will be generated in your root directory`}}function _Zr(e){if(sc(e).length>238)return"The file name is too long."}c();c();var SZr=/^(https:\/\/)/,xZr=/^pubsub:\/\/(?<gcp_project_id>[^:]+):(?<gcp_topic>.+)$/,EZr=/^arn:aws:events:(?<aws_region>[a-z]{2}-[a-z]+-[0-9]+)::event-source\/aws\.partner\/shopify\.com(\.test)?\/(?<api_client_id>\d+)\/(?<event_source_name>.+)$/;function e5(e){return typeof e=="string"&&e.endsWith("/")?e.replace(/\/+$/,""):e}var L6=he.string({invalid_type_error:"Value must be string"}).refine(e=>e.startsWith("/")?!0:SZr.test(e)||xZr.test(e)||EZr.test(e),{message:"URI format isn't correct. Valid formats include: relative path starting with a slash, HTTPS URL, pubsub://{project-id}:{topic-id} or Eventbridge ARN"});c();function q6(e,t){return!t||!e.startsWith("/")?e:`${e5(t)}${e}`}var XB="webhook_subscription",kZr=he.object({topic:he.string(),actions:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),api_version:he.string(),uri:he.preprocess(e5,L6,{required_error:"Missing value at"}),include_fields:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),filter:he.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional()});function CZr(e){let{api_version:t,topic:n,...r}=e;return{webhooks:{subscriptions:[{topics:[n],...r}]}}}var TZr={forward:(e,t)=>{let n=e,r;return"application_url"in t&&(r=t?.application_url),{...n,uri:q6(n.uri,r)}},reverse:CZr},IZr=xv({identifier:XB,schema:kZr,transformConfig:TZr,uidStrategy:"dynamic"}),p9t=IZr;c();c();var QC;(function(e){e.CustomersRedact="customers/redact",e.CustomersDataRequest="customers/data_request",e.ShopRedact="shop/redact"})(QC||(QC={}));var h9t=he.object({topics:he.array(he.string({invalid_type_error:"Values within array must be a string"}),{invalid_type_error:"Value must be string[]"}).optional(),actions:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),uri:he.preprocess(e=>e5(e),L6,{required_error:"Missing value at"}),include_fields:he.array(he.string({invalid_type_error:"Value must be a string"})).optional(),filter:he.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:he.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional(),compliance_topics:he.array(he.enum([QC.CustomersRedact,QC.CustomersDataRequest,QC.ShopRedact]),{invalid_type_error:"Value must be an array containing values: customers/redact, customers/data_request or shop/redact"}).optional()});c();function m9t(e,t){let n=DZr(e);if(n)return t.addIssue(n),he.NEVER}function DZr(e){let{subscriptions:t=[]}=e,n=new Set,r=[];if(!t.length)return;if(e.privacy_compliance&&e.subscriptions?.some(a=>a.compliance_topics))return{code:he.ZodIssueCode.custom,message:"The privacy_compliance section can't be used if there are subscriptions including compliance_topics"};let i=t.flatMap(a=>a.compliance_topics).filter(Boolean);if(Fte(i).length!==i.length)return{code:he.ZodIssueCode.custom,message:"You can\u2019t have multiple subscriptions with the same compliance topic",fatal:!0,path:["subscriptions"]};for(let[a,{uri:o,topics:s=[],compliance_topics:l=[],filter:u=""}]of t.entries()){let d=["subscriptions",a];if(!s.length&&!l.length)return{code:he.ZodIssueCode.custom,message:"Either topics or compliance_topics must be added to the webhook subscription",path:d};s.forEach(p=>{let h=`${p}::${o}::${u}`;if(n.has(h)){let v=u?Qr.dim(`
|
|
3230
3230
|
|
|
3231
3231
|
topic: ${p}
|
|
3232
3232
|
uri: ${o}
|
|
@@ -3851,7 +3851,7 @@ ${s}`)}return n.products.edges[0].node.variants.edges[0].node.id.split("/").pop(
|
|
|
3851
3851
|
Please check the ${r} path for ${n}`.value}async function tii(e,t,n){let r=[],i=[],a=[];if(!t||t.length===0)return ow(aVt);for await(let o of t){let{module:s,target:l}=o,u=await eii(e,s,l,"module");u&&r.push(u),i.includes(l)?a.push(l):i.push(l)}return a.length&&r.push(`Duplicate targets found: ${a.join(", ")}
|
|
3852
3852
|
Extension point targets must be unique`),r.length?(r.push(`Please check the configuration in ${n}`),ow(r.join(`
|
|
3853
3853
|
|
|
3854
|
-
`))):aw({})}function iVt(e){let t=e.api_version;if(!t)return!1;let{year:n,month:r}=ive(t)??{year:0,month:0};return n>2025||n===2025&&r>=10}function fUe(e){return e.replace(/\.render$/,".should-render")}function nii(e,t){let n=e.build_manifest.assets[w2.ShouldRender];if(n)return{identifier:w2.ShouldRender,outputFileName:n.filepath,content:t?`import shouldRender from '${n.module}';shopify.extend('${fUe(e.target)}', (...args) => shouldRender(...args));`:`import '${n.module}'`}}var oVt=Qri;c();var sVt=1024,lVt=128,rii=lVt*sVt,iii="@shopify/web-pixels-extension",aii=Af.extend({runtime_context:he.string(),version:he.string().optional(),configuration:he.any(),customer_privacy:he.object({analytics:he.boolean(),preferences:he.boolean(),marketing:he.boolean(),sale_of_data:he.enum(["enabled","disabled","ldu"])}).optional(),settings:he.any()}),oii=fu({identifier:"web_pixel_extension",dependency:iii,partnersWebIdentifier:"web_pixel",schema:aii,appModuleFeatures:e=>["esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>({runtime_context:e.runtime_context,customer_privacy:e.customer_privacy,runtime_configuration_definition:e.settings}),buildValidation:async e=>{let t=await CM(e.outputPath);if(t>rii){let n=`${(t/sVt).toFixed(2)} kB`;throw new we(`Your web pixel extension exceeds the total file size limit (${lVt} kB). It's currently ${n}.`,"Reduce your total file size and try again.")}},preDeployValidation:async e=>{if(e.configuration.configuration)throw new we("The property configuration is deprecated and no longer supported.","It has been replaced by settings.");return Promise.resolve()}}),cVt=oii;c();var sii=he.object({handle:he.string()}),lii=Af.extend({name:he.string(),include:he.array(sii).optional(),includes:he.array(he.string()).optional(),type:he.literal("editor_extension_collection")}).transform(e=>{let t=e.includes?.map(r=>({handle:r}))??[],n=e.include??[];return{...e,inCollection:[...t,...n]}}),cii=fu({identifier:"editor_extension_collection",schema:lii,appModuleFeatures:e=>[],deployConfig:async(e,t)=>({name:e.name,handle:e.handle,in_collection:e.inCollection,localization:await yS(t,e.name)})}),uVt=cii;c();var dVt="specifications",uii=["json","toml","yaml","yml","svg"],dii=A6({identifier:"channel_config",uidStrategy:"single",experience:"extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"copy-files",name:"Copy Files",type:"include_assets",config:{inclusions:[{type:"pattern",baseDir:dVt,destination:dVt,include:uii.map(e=>`**/*.${e}`)}]}}]}],appModuleFeatures:()=>[]}),fVt=dii;c();var pVt="icons",fii=["svg"],pii=A6({identifier:"order_attribution_config",uidStrategy:"single",experience:"extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"copy-files",name:"Copy Files",type:"include_assets",config:{inclusions:[{type:"pattern",baseDir:pVt,destination:pVt,include:fii.map(e=>`**/*.${e}`)}]}}]}],appModuleFeatures:()=>[]}),hVt=pii;c();var hii=A6({identifier:"admin_link",uidStrategy:"uuid",experience:"extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"include-admin-link-assets",name:"Include Admin Link Assets",type:"include_assets",config:{generatesAssetsManifest:!0,inclusions:[{type:"configKey",anchor:"targeting[]",groupBy:"target",key:"targeting[].tools"},{type:"configKey",anchor:"targeting[]",groupBy:"target",key:"targeting[].instructions"},{type:"configKey",anchor:"targeting[]",groupBy:"target",key:"targeting[].intents[].schema"}]}}]}],appModuleFeatures:()=>["localization","ui_preview"]}),mVt=hii;var gVt=[bJ,eN,wJ,XB,mqe,vqe,pqe,hqe,yJ];async function qU(){let e=(t,n)=>gVt.indexOf(t.identifier)-gVt.indexOf(n.identifier);return mii().sort(e)}function mii(){let e=[nLt,Uqt,vUt,zqt,yUt,SUt,fBt,p9t,_Ut,Wqt],t=[xUt,EUt,OUt,LUt,PUt,qUt,szt,lzt,czt,uzt,mzt,oVt,cVt,uVt,fVt,hVt,mVt];return[...e,...t]}c();c();var xGt=Nt(uKn()),EGt=Nt(cUe()),kGt=Nt(_Gt());async function cve(e){let t=JSON.parse(e);return await EGt.default.dereference(t,{resolve:{external:!1}}),t}function pUe(e,t){e==="strip"&&(t.additionalProperties=!0);let n=new xGt.Ajv({allowUnionTypes:!0,allErrors:!0,verbose:!0});return n.addKeyword("x-taplo"),n.compile(t)}var SGt=new Map;function CGt(e,t,n,r){let i=(0,kGt.default)(e),a=r??__(),o=SGt.get(a)??pUe(n,t);SGt.set(a,o),o(i);let s;if(o.errors&&o.errors.length>0)return s=Moi(o.errors,i,t),{state:"error",data:void 0,errors:s,rawErrors:o.errors};if(n==="strip"){let l=Object.keys(t.properties??{});Object.keys(i).forEach(u=>{l.includes(u)||delete i[u]})}return{state:"ok",data:i,errors:void 0,rawErrors:void 0}}function Moi(e,t,n){return Loi(e,t,n).map(i=>{let a=i.instancePath.split("/").slice(1);if(i.params.missingProperty){let o=i.params.missingProperty;return{path:[...a,o],message:"Required"}}if(i.params.type){let o=Array.isArray(i.params.type)?i.params.type.join(", "):i.params.type,s=dp(t,a.join("."));return{path:a,message:`Expected ${o}, received ${typeof s}`}}if(i.keyword==="anyOf"||i.keyword==="oneOf")return{path:a,message:"Invalid input"};if(i.params.allowedValues){let o=i.params.allowedValues,s=dp(t,a.join("."));return{path:a,message:`Invalid enum value. Expected ${o.map(l=>JSON.stringify(l)).join(" | ")}, received ${JSON.stringify(s)}`.replace(/"/g,"'")}}if(i.params.comparison){let o=i.params.comparison,s=i.params.limit,l=dp(t,a.join(".")),u=o;switch(o){case"<=":u="less than or equal to";break;case"<":u="less than";break;case">=":u="greater than or equal to";break;case">":u="greater than";break}return{path:a,message:IF(`${typeof l} must be ${u} ${s}`)}}if(i.params.additionalProperty){let o=Object.keys(i.parentSchema?.properties??{}),s=Object.keys(i.data??{}),l=o.filter(u=>!s.includes(u));if(l.length>0)return{path:[...a,i.params.additionalProperty],message:`No additional properties allowed. You can set ${l.sort().join(", ")}.`}}return{path:a,message:i.message}})}function Loi(e,t,n){let r=e,i=new Set;for(;;){let a=r.filter(p=>(p.keyword==="oneOf"||p.keyword==="anyOf")&&!i.has(p.instancePath))[0];if(a===void 0)break;let o=r.filter(p=>!p.instancePath.startsWith(a.instancePath)),s=[a],l=a.schemaPath.replace("#/","").replace(/\//g,"."),u=dp(n,l),d=dp(t,a.instancePath.split("/").slice(1).join("."));if(u!==void 0&&d!==void 0){let p=u.map(h=>{let v=pUe("fail",h);v(d);let S=0;return h.type==="object"&&(S=Object.keys(h.properties).reduce((I,C)=>{let N=h.properties[C],q=dp(d,C);return pUe("fail",N)(q)?I+1:I},S)),[S,v.errors]}).sort(([h],[v])=>h-v);if(p.length>=2){let[h,v]=p[p.length-1],[S]=p[p.length-2];h!==S&&(s=[a,...v.map(k=>({...k,instancePath:a.instancePath+k.instancePath}))])}}r=[...o,...s],i.add(a.instancePath)}return r}var qoi={type:{type:"string"},handle:{type:"string"},uid:{type:"string"},path:{type:"string"},extensions:{}};async function TGt(e,t,n="strip"){let r=t?.jsonSchema;if(r===void 0||NF(JSON.parse(r)))return e.parseConfigurationObject;let i=await cve(r);i.properties={...qoi,...i.properties};let a=e.identifier;return s=>{let l=e.parseConfigurationObject(s),d=(l.state==="ok"?l.data:void 0)??s,p=CGt(d,i,n,a),h=l.errors??[];p.state==="error"&&(h=h.concat(p.errors));let v=new Set;return h=h.filter(S=>{let k=JSON.stringify({path:S.path,message:S.message});return v.has(k)?!1:(v.add(k),!0)}),l.state!=="ok"||h.length>0?{state:"error",data:void 0,errors:h}:{state:"ok",data:p.data,errors:void 0}}}async function UU({developerPlatformClient:e,app:t}){let r=(await e.specifications(t)).filter(o=>["extension","configuration"].includes(o.experience)).map(o=>(o.identifier==="theme_app_extension"&&(o.identifier="theme"),o.identifier==="subscription_management"&&(o.identifier="product_subscription"),o.identifier==="checkout_post_purchase"&&(o.surface="post_purchase"),o.identifier==="webhook_subscription"&&(o.experience="configuration",o.uidStrategy="dynamic"),o)),i=await qU();return[...await Boi(i,r)]}async function Boi(e,t){let n=t.map(async o=>{let s=e.find(d=>d.identifier===o.identifier);if(!s&&o.validationSchema?.jsonSchema&&(s=await zoi(o,o.validationSchema)),!s)return;let l=Uoi(s,o),u=await TGt(l,o.validationSchema,l.experience==="extension"?"fail":"strip");return{...l,parseConfigurationObject:u}}),r=c3(await Promise.all(n)),i=e.filter(o=>!r.find(s=>s.identifier===o.identifier));i.length>0&&at(`The following extension specifications were defined locally but not found in the remote specifications: ${i.map(o=>o.identifier).sort().join(", ")}`);let a=t.filter(o=>!r.find(s=>s.identifier===o.identifier));return a.length>0&&at(`The following extension specifications were found in the remote specifications but not defined locally: ${a.map(o=>o.identifier).sort().join(", ")}`),r}function Uoi(e,t){return{...e,loadedRemoteSpecs:!0,externalName:t.externalName,externalIdentifier:t.externalIdentifier,experience:t.experience,registrationLimit:t.registrationLimit,uidStrategy:t.uidStrategy,surface:t.surface??e.surface}}async function zoi(e,t){let r=(await cve(t.jsonSchema)).properties?.localization!==void 0;return{...A6({identifier:e.identifier,uidStrategy:e.uidStrategy,experience:e.experience,appModuleFeatures:()=>r?["localization"]:[]}),loadedRemoteSpecs:!0}}c();async function eD(e,t=!0){let{remoteApp:n,appDirectory:r,developerPlatformClient:i}=await Hoi(e),a=await UU({developerPlatformClient:i,app:n}),o=n.flags,s=await hUe(e,a,o,n.apiKey),l=await joi(n,e,{appDirectory:s.appDirectory});await fN(n,i.organizationSource);let u=await mUe({configFileName:l,remoteApp:n,developerPlatformClient:i,specifications:a,flags:o,appDirectory:r,localAppOptions:s});return t&&Goi(l,u.name,s.packageManager),{remoteApp:n,configFileName:l,configuration:u}}async function Hoi(e){let{creationOptions:t,appDirectory:n}=await Woi(e),r=n??e.directory;if(e.apiKey){let o=await oU({apiKey:e.apiKey});if(!o){let s=dUt(e.apiKey);throw new we(s.message,s.tryMessage)}return e.isNewApp&&(o.newApp=!0),{remoteApp:o,appDirectory:r,developerPlatformClient:o.developerPlatformClient}}let i=await pUt({...t,directory:r}),a=i.developerPlatformClient;return{remoteApp:i,appDirectory:r,developerPlatformClient:a}}async function Woi(e){let t={isLaunchable:!1,scopesArray:[],name:"",directory:e.directory,isEmbedded:!1};try{let n=await V9t({specifications:await qU(),directory:e.directory,userProvidedConfigName:e.configName,remoteFlags:void 0,skipPrompts:!0});return{creationOptions:n.creationDefaultOptions(),appDirectory:n.directory}}catch{return{creationOptions:t}}}async function hUe(e,t,n,r){let i=await G9t({directory:e.directory,configName:e.configName,specifications:t,remoteFlags:n,skipPrompts:!0});switch(i.state){case"loaded-app":{let{app:a,configuration:o}=i;return o.client_id===r||e.isNewApp?{state:"reusable-current-app",scopes:bS(o),localAppIdMatchedRemote:!0,existingBuildOptions:o.build,existingConfig:{...o},appDirectory:a.directory,packageManager:i.packageManager}:{state:"unable-to-reuse-current-config",scopes:"",localAppIdMatchedRemote:!0,appDirectory:void 0,existingBuildOptions:void 0,existingConfig:void 0,packageManager:"npm"}}case"loaded-template":return{state:"reusable-current-app",scopes:i.scopes,localAppIdMatchedRemote:!0,existingBuildOptions:void 0,existingConfig:i.rawConfig,appDirectory:i.appDirectory,packageManager:i.packageManager};case"error":return{state:"unable-to-load-config",scopes:"",localAppIdMatchedRemote:!1,appDirectory:void 0,existingBuildOptions:void 0,existingConfig:void 0,packageManager:"npm"}}}async function joi(e,t,n){if(t.configName)return Ow(t.configName);let r=Nge();if(r?.selectedToml)return r.selectedToml;let i=await nU(t.directory),a=i[e.apiKey];return a||(NF(i)?"shopify.app.toml":d9t(n.appDirectory??t.directory,e.title))}async function mUe(e){let{remoteApp:t,developerPlatformClient:n,specifications:r,flags:i,configFileName:a,appDirectory:o,localAppOptions:s}=e,l=Ne(o,a),u=await aU(t,n,r,i);if(!u){let h=s.scopes;u=Zoi(t,h)}let d=(h,v)=>v,p={...G5({...s.existingConfig??{}},{client_id:t.apiKey,...u},d),build:Voi({existingBuildOptions:s.existingBuildOptions,linkedAppAndClientIdFromFileAreInSync:s.localAppIdMatchedRemote,linkedAppWasNewlyCreated:!!t.newApp,defaultToUpdateUrlsOnDev:n.supportsDevSessions})};return delete p.scopes,await sUt(p,l),Y9e(p,{configFileName:a,directory:o}),p}function Voi(e){let{existingBuildOptions:t,linkedAppAndClientIdFromFileAreInSync:n,linkedAppWasNewlyCreated:r,defaultToUpdateUrlsOnDev:i}=e,a={...r?{include_config_on_deploy:!0}:{},...i&&r?{automatically_update_urls_on_dev:!0}:{},...n?t:{}};if(!NF(a))return a}function Goi(e,t,n){dr({headline:`${e} is now linked to "${t}" on Shopify`,body:`Using ${e} as your default config.`,nextSteps:[[`Make updates to ${e} in your local project`],["To upload your config, run",{command:d1(n,"shopify app deploy")}]],reference:[{link:{label:"App configuration",url:"https://shopify.dev/docs/apps/tools/cli/configuration"}}]})}function Zoi(e,t){return{...Xoi(e),...Qoi(e),...Joi(e),...$oi(t,e),...Koi(e),...Yoi(e)}}function Yoi(e){let t={application_url:e.applicationUrl?.replace(/\/$/,"")??"",embedded:e.embedded??!0};return e.preferencesUrl?{...t,app_preferences:{url:e.preferencesUrl}}:{...t}}function Koi(e){return e.appProxy?.url?{app_proxy:{url:e.appProxy.url,subpath:e.appProxy.subPath,prefix:e.appProxy.subPathPrefix}}:{}}function Joi(e){let t=e.gdprWebhooks?.customerDataRequestUrl??e.gdprWebhooks?.customerDeletionUrl??e.gdprWebhooks?.shopDeletionUrl,n={privacy_compliance:{customer_data_request_url:e.gdprWebhooks?.customerDataRequestUrl,customer_deletion_url:e.gdprWebhooks?.customerDeletionUrl,shop_deletion_url:e.gdprWebhooks?.shopDeletionUrl}};return{webhooks:{api_version:e.webhookApiVersion??"2023-07",...t?n:{}}}}function $oi(e,t){let n={};return t.requestedAccessScopes?n={scopes:t.requestedAccessScopes.join(",")}:e===""?n={use_legacy_install_flow:!0}:n={scopes:e,use_legacy_install_flow:!0},{auth:{redirect_urls:t.redirectUrlWhitelist??[]},access_scopes:n}}function Qoi(e){return{pos:{embedded:e.posEmbedded??!1}}}function Xoi(e){return{name:e.title}}c();async function IGt(e,t){if(t.supportsAtomicDeployments)for(let n of e)await esi(n)}async function esi(e){if(!e.isUUIDStrategyExtension||e.configuration.uid)return;let t=await Wh.read(e.configurationPath),n=dp(t.content,"extensions");if(!("uid"in t.content)){if(n){let r=n.find(i=>i.handle===e.handle);if(r&&"uid"in r)return}if(n&&n.length>1){let r=e.handle;await t.transformRaw(i=>{let a=new RegExp(`(\\n?(\\s*)handle\\s*=\\s*"${r}")`);return i.replace(a,`$1
|
|
3854
|
+
`))):aw({})}function iVt(e){let t=e.api_version;if(!t)return!1;let{year:n,month:r}=ive(t)??{year:0,month:0};return n>2025||n===2025&&r>=10}function fUe(e){return e.replace(/\.render$/,".should-render")}function nii(e,t){let n=e.build_manifest.assets[w2.ShouldRender];if(n)return{identifier:w2.ShouldRender,outputFileName:n.filepath,content:t?`import shouldRender from '${n.module}';shopify.extend('${fUe(e.target)}', (...args) => shouldRender(...args));`:`import '${n.module}'`}}var oVt=Qri;c();var sVt=1024,lVt=128,rii=lVt*sVt,iii="@shopify/web-pixels-extension",aii=Af.extend({runtime_context:he.string(),version:he.string().optional(),configuration:he.any(),customer_privacy:he.object({analytics:he.boolean(),preferences:he.boolean(),marketing:he.boolean(),sale_of_data:he.enum(["enabled","disabled","ldu"])}).optional(),settings:he.any()}),oii=fu({identifier:"web_pixel_extension",dependency:iii,partnersWebIdentifier:"web_pixel",schema:aii,appModuleFeatures:e=>["esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>({runtime_context:e.runtime_context,customer_privacy:e.customer_privacy,runtime_configuration_definition:e.settings}),buildValidation:async(e,t)=>{let n=await CM(t);if(n>rii){let r=`${(n/sVt).toFixed(2)} kB`;throw new we(`Your web pixel extension exceeds the total file size limit (${lVt} kB). It's currently ${r}.`,"Reduce your total file size and try again.")}},preDeployValidation:async e=>{if(e.configuration.configuration)throw new we("The property configuration is deprecated and no longer supported.","It has been replaced by settings.");return Promise.resolve()}}),cVt=oii;c();var sii=he.object({handle:he.string()}),lii=Af.extend({name:he.string(),include:he.array(sii).optional(),includes:he.array(he.string()).optional(),type:he.literal("editor_extension_collection")}).transform(e=>{let t=e.includes?.map(r=>({handle:r}))??[],n=e.include??[];return{...e,inCollection:[...t,...n]}}),cii=fu({identifier:"editor_extension_collection",schema:lii,appModuleFeatures:e=>[],deployConfig:async(e,t)=>({name:e.name,handle:e.handle,in_collection:e.inCollection,localization:await yS(t,e.name)})}),uVt=cii;c();var dVt="specifications",uii=["json","toml","yaml","yml","svg"],dii=A6({identifier:"channel_config",uidStrategy:"single",experience:"extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"copy-files",name:"Copy Files",type:"include_assets",config:{inclusions:[{type:"pattern",baseDir:dVt,destination:dVt,include:uii.map(e=>`**/*.${e}`)}]}}]}],appModuleFeatures:()=>[]}),fVt=dii;c();var pVt="icons",fii=["svg"],pii=A6({identifier:"order_attribution_config",uidStrategy:"single",experience:"extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"copy-files",name:"Copy Files",type:"include_assets",config:{inclusions:[{type:"pattern",baseDir:pVt,destination:pVt,include:fii.map(e=>`**/*.${e}`)}]}}]}],appModuleFeatures:()=>[]}),hVt=pii;c();var hii=A6({identifier:"admin_link",uidStrategy:"uuid",experience:"extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"include-admin-link-assets",name:"Include Admin Link Assets",type:"include_assets",config:{generatesAssetsManifest:!0,inclusions:[{type:"configKey",anchor:"targeting[]",groupBy:"target",key:"targeting[].tools"},{type:"configKey",anchor:"targeting[]",groupBy:"target",key:"targeting[].instructions"},{type:"configKey",anchor:"targeting[]",groupBy:"target",key:"targeting[].intents[].schema"}]}}]}],appModuleFeatures:()=>["localization","ui_preview"]}),mVt=hii;var gVt=[bJ,eN,wJ,XB,mqe,vqe,pqe,hqe,yJ];async function qU(){let e=(t,n)=>gVt.indexOf(t.identifier)-gVt.indexOf(n.identifier);return mii().sort(e)}function mii(){let e=[nLt,Uqt,vUt,zqt,yUt,SUt,fBt,p9t,_Ut,Wqt],t=[xUt,EUt,OUt,LUt,PUt,qUt,szt,lzt,czt,uzt,mzt,oVt,cVt,uVt,fVt,hVt,mVt];return[...e,...t]}c();c();var xGt=Nt(uKn()),EGt=Nt(cUe()),kGt=Nt(_Gt());async function cve(e){let t=JSON.parse(e);return await EGt.default.dereference(t,{resolve:{external:!1}}),t}function pUe(e,t){e==="strip"&&(t.additionalProperties=!0);let n=new xGt.Ajv({allowUnionTypes:!0,allErrors:!0,verbose:!0});return n.addKeyword("x-taplo"),n.compile(t)}var SGt=new Map;function CGt(e,t,n,r){let i=(0,kGt.default)(e),a=r??__(),o=SGt.get(a)??pUe(n,t);SGt.set(a,o),o(i);let s;if(o.errors&&o.errors.length>0)return s=Moi(o.errors,i,t),{state:"error",data:void 0,errors:s,rawErrors:o.errors};if(n==="strip"){let l=Object.keys(t.properties??{});Object.keys(i).forEach(u=>{l.includes(u)||delete i[u]})}return{state:"ok",data:i,errors:void 0,rawErrors:void 0}}function Moi(e,t,n){return Loi(e,t,n).map(i=>{let a=i.instancePath.split("/").slice(1);if(i.params.missingProperty){let o=i.params.missingProperty;return{path:[...a,o],message:"Required"}}if(i.params.type){let o=Array.isArray(i.params.type)?i.params.type.join(", "):i.params.type,s=dp(t,a.join("."));return{path:a,message:`Expected ${o}, received ${typeof s}`}}if(i.keyword==="anyOf"||i.keyword==="oneOf")return{path:a,message:"Invalid input"};if(i.params.allowedValues){let o=i.params.allowedValues,s=dp(t,a.join("."));return{path:a,message:`Invalid enum value. Expected ${o.map(l=>JSON.stringify(l)).join(" | ")}, received ${JSON.stringify(s)}`.replace(/"/g,"'")}}if(i.params.comparison){let o=i.params.comparison,s=i.params.limit,l=dp(t,a.join(".")),u=o;switch(o){case"<=":u="less than or equal to";break;case"<":u="less than";break;case">=":u="greater than or equal to";break;case">":u="greater than";break}return{path:a,message:IF(`${typeof l} must be ${u} ${s}`)}}if(i.params.additionalProperty){let o=Object.keys(i.parentSchema?.properties??{}),s=Object.keys(i.data??{}),l=o.filter(u=>!s.includes(u));if(l.length>0)return{path:[...a,i.params.additionalProperty],message:`No additional properties allowed. You can set ${l.sort().join(", ")}.`}}return{path:a,message:i.message}})}function Loi(e,t,n){let r=e,i=new Set;for(;;){let a=r.filter(p=>(p.keyword==="oneOf"||p.keyword==="anyOf")&&!i.has(p.instancePath))[0];if(a===void 0)break;let o=r.filter(p=>!p.instancePath.startsWith(a.instancePath)),s=[a],l=a.schemaPath.replace("#/","").replace(/\//g,"."),u=dp(n,l),d=dp(t,a.instancePath.split("/").slice(1).join("."));if(u!==void 0&&d!==void 0){let p=u.map(h=>{let v=pUe("fail",h);v(d);let S=0;return h.type==="object"&&(S=Object.keys(h.properties).reduce((I,C)=>{let N=h.properties[C],q=dp(d,C);return pUe("fail",N)(q)?I+1:I},S)),[S,v.errors]}).sort(([h],[v])=>h-v);if(p.length>=2){let[h,v]=p[p.length-1],[S]=p[p.length-2];h!==S&&(s=[a,...v.map(k=>({...k,instancePath:a.instancePath+k.instancePath}))])}}r=[...o,...s],i.add(a.instancePath)}return r}var qoi={type:{type:"string"},handle:{type:"string"},uid:{type:"string"},path:{type:"string"},extensions:{}};async function TGt(e,t,n="strip"){let r=t?.jsonSchema;if(r===void 0||NF(JSON.parse(r)))return e.parseConfigurationObject;let i=await cve(r);i.properties={...qoi,...i.properties};let a=e.identifier;return s=>{let l=e.parseConfigurationObject(s),d=(l.state==="ok"?l.data:void 0)??s,p=CGt(d,i,n,a),h=l.errors??[];p.state==="error"&&(h=h.concat(p.errors));let v=new Set;return h=h.filter(S=>{let k=JSON.stringify({path:S.path,message:S.message});return v.has(k)?!1:(v.add(k),!0)}),l.state!=="ok"||h.length>0?{state:"error",data:void 0,errors:h}:{state:"ok",data:p.data,errors:void 0}}}async function UU({developerPlatformClient:e,app:t}){let r=(await e.specifications(t)).filter(o=>["extension","configuration"].includes(o.experience)).map(o=>(o.identifier==="theme_app_extension"&&(o.identifier="theme"),o.identifier==="subscription_management"&&(o.identifier="product_subscription"),o.identifier==="checkout_post_purchase"&&(o.surface="post_purchase"),o.identifier==="webhook_subscription"&&(o.experience="configuration",o.uidStrategy="dynamic"),o)),i=await qU();return[...await Boi(i,r)]}async function Boi(e,t){let n=t.map(async o=>{let s=e.find(d=>d.identifier===o.identifier);if(!s&&o.validationSchema?.jsonSchema&&(s=await zoi(o,o.validationSchema)),!s)return;let l=Uoi(s,o),u=await TGt(l,o.validationSchema,l.experience==="extension"?"fail":"strip");return{...l,parseConfigurationObject:u}}),r=c3(await Promise.all(n)),i=e.filter(o=>!r.find(s=>s.identifier===o.identifier));i.length>0&&at(`The following extension specifications were defined locally but not found in the remote specifications: ${i.map(o=>o.identifier).sort().join(", ")}`);let a=t.filter(o=>!r.find(s=>s.identifier===o.identifier));return a.length>0&&at(`The following extension specifications were found in the remote specifications but not defined locally: ${a.map(o=>o.identifier).sort().join(", ")}`),r}function Uoi(e,t){return{...e,loadedRemoteSpecs:!0,externalName:t.externalName,externalIdentifier:t.externalIdentifier,experience:t.experience,registrationLimit:t.registrationLimit,uidStrategy:t.uidStrategy,surface:t.surface??e.surface}}async function zoi(e,t){let r=(await cve(t.jsonSchema)).properties?.localization!==void 0;return{...A6({identifier:e.identifier,uidStrategy:e.uidStrategy,experience:e.experience,appModuleFeatures:()=>r?["localization"]:[]}),loadedRemoteSpecs:!0}}c();async function eD(e,t=!0){let{remoteApp:n,appDirectory:r,developerPlatformClient:i}=await Hoi(e),a=await UU({developerPlatformClient:i,app:n}),o=n.flags,s=await hUe(e,a,o,n.apiKey),l=await joi(n,e,{appDirectory:s.appDirectory});await fN(n,i.organizationSource);let u=await mUe({configFileName:l,remoteApp:n,developerPlatformClient:i,specifications:a,flags:o,appDirectory:r,localAppOptions:s});return t&&Goi(l,u.name,s.packageManager),{remoteApp:n,configFileName:l,configuration:u}}async function Hoi(e){let{creationOptions:t,appDirectory:n}=await Woi(e),r=n??e.directory;if(e.apiKey){let o=await oU({apiKey:e.apiKey});if(!o){let s=dUt(e.apiKey);throw new we(s.message,s.tryMessage)}return e.isNewApp&&(o.newApp=!0),{remoteApp:o,appDirectory:r,developerPlatformClient:o.developerPlatformClient}}let i=await pUt({...t,directory:r}),a=i.developerPlatformClient;return{remoteApp:i,appDirectory:r,developerPlatformClient:a}}async function Woi(e){let t={isLaunchable:!1,scopesArray:[],name:"",directory:e.directory,isEmbedded:!1};try{let n=await V9t({specifications:await qU(),directory:e.directory,userProvidedConfigName:e.configName,remoteFlags:void 0,skipPrompts:!0});return{creationOptions:n.creationDefaultOptions(),appDirectory:n.directory}}catch{return{creationOptions:t}}}async function hUe(e,t,n,r){let i=await G9t({directory:e.directory,configName:e.configName,specifications:t,remoteFlags:n,skipPrompts:!0});switch(i.state){case"loaded-app":{let{app:a,configuration:o}=i;return o.client_id===r||e.isNewApp?{state:"reusable-current-app",scopes:bS(o),localAppIdMatchedRemote:!0,existingBuildOptions:o.build,existingConfig:{...o},appDirectory:a.directory,packageManager:i.packageManager}:{state:"unable-to-reuse-current-config",scopes:"",localAppIdMatchedRemote:!0,appDirectory:void 0,existingBuildOptions:void 0,existingConfig:void 0,packageManager:"npm"}}case"loaded-template":return{state:"reusable-current-app",scopes:i.scopes,localAppIdMatchedRemote:!0,existingBuildOptions:void 0,existingConfig:i.rawConfig,appDirectory:i.appDirectory,packageManager:i.packageManager};case"error":return{state:"unable-to-load-config",scopes:"",localAppIdMatchedRemote:!1,appDirectory:void 0,existingBuildOptions:void 0,existingConfig:void 0,packageManager:"npm"}}}async function joi(e,t,n){if(t.configName)return Ow(t.configName);let r=Nge();if(r?.selectedToml)return r.selectedToml;let i=await nU(t.directory),a=i[e.apiKey];return a||(NF(i)?"shopify.app.toml":d9t(n.appDirectory??t.directory,e.title))}async function mUe(e){let{remoteApp:t,developerPlatformClient:n,specifications:r,flags:i,configFileName:a,appDirectory:o,localAppOptions:s}=e,l=Ne(o,a),u=await aU(t,n,r,i);if(!u){let h=s.scopes;u=Zoi(t,h)}let d=(h,v)=>v,p={...G5({...s.existingConfig??{}},{client_id:t.apiKey,...u},d),build:Voi({existingBuildOptions:s.existingBuildOptions,linkedAppAndClientIdFromFileAreInSync:s.localAppIdMatchedRemote,linkedAppWasNewlyCreated:!!t.newApp,defaultToUpdateUrlsOnDev:n.supportsDevSessions})};return delete p.scopes,await sUt(p,l),Y9e(p,{configFileName:a,directory:o}),p}function Voi(e){let{existingBuildOptions:t,linkedAppAndClientIdFromFileAreInSync:n,linkedAppWasNewlyCreated:r,defaultToUpdateUrlsOnDev:i}=e,a={...r?{include_config_on_deploy:!0}:{},...i&&r?{automatically_update_urls_on_dev:!0}:{},...n?t:{}};if(!NF(a))return a}function Goi(e,t,n){dr({headline:`${e} is now linked to "${t}" on Shopify`,body:`Using ${e} as your default config.`,nextSteps:[[`Make updates to ${e} in your local project`],["To upload your config, run",{command:d1(n,"shopify app deploy")}]],reference:[{link:{label:"App configuration",url:"https://shopify.dev/docs/apps/tools/cli/configuration"}}]})}function Zoi(e,t){return{...Xoi(e),...Qoi(e),...Joi(e),...$oi(t,e),...Koi(e),...Yoi(e)}}function Yoi(e){let t={application_url:e.applicationUrl?.replace(/\/$/,"")??"",embedded:e.embedded??!0};return e.preferencesUrl?{...t,app_preferences:{url:e.preferencesUrl}}:{...t}}function Koi(e){return e.appProxy?.url?{app_proxy:{url:e.appProxy.url,subpath:e.appProxy.subPath,prefix:e.appProxy.subPathPrefix}}:{}}function Joi(e){let t=e.gdprWebhooks?.customerDataRequestUrl??e.gdprWebhooks?.customerDeletionUrl??e.gdprWebhooks?.shopDeletionUrl,n={privacy_compliance:{customer_data_request_url:e.gdprWebhooks?.customerDataRequestUrl,customer_deletion_url:e.gdprWebhooks?.customerDeletionUrl,shop_deletion_url:e.gdprWebhooks?.shopDeletionUrl}};return{webhooks:{api_version:e.webhookApiVersion??"2023-07",...t?n:{}}}}function $oi(e,t){let n={};return t.requestedAccessScopes?n={scopes:t.requestedAccessScopes.join(",")}:e===""?n={use_legacy_install_flow:!0}:n={scopes:e,use_legacy_install_flow:!0},{auth:{redirect_urls:t.redirectUrlWhitelist??[]},access_scopes:n}}function Qoi(e){return{pos:{embedded:e.posEmbedded??!1}}}function Xoi(e){return{name:e.title}}c();async function IGt(e,t){if(t.supportsAtomicDeployments)for(let n of e)await esi(n)}async function esi(e){if(!e.isUUIDStrategyExtension||e.configuration.uid)return;let t=await Wh.read(e.configurationPath),n=dp(t.content,"extensions");if(!("uid"in t.content)){if(n){let r=n.find(i=>i.handle===e.handle);if(r&&"uid"in r)return}if(n&&n.length>1){let r=e.handle;await t.transformRaw(i=>{let a=new RegExp(`(\\n?(\\s*)handle\\s*=\\s*"${r}")`);return i.replace(a,`$1
|
|
3855
3855
|
$2uid = "${e.uid}"`)})}else await t.patch({uid:e.uid})}}function DGt(e){let t=aN(e);return it`${ut.errorText("Validation error")} in ${ut.path(e.file)}:\n\n${t}`}async function Qo({directory:e,clientId:t,forceRelink:n,userProvidedConfigName:r,unsafeTolerateErrors:i=!1}){let a,o,s;if(n){let I=await eD({directory:e,apiKey:t});s=I.remoteApp;let C=await c7(e,I.configFileName);a=C.project,o=C.activeConfig}else{let I=await c7(e,r);if(a=I.project,o=I.activeConfig,o.file.errors.length>0)throw new we(o.file.errors.map(C=>C.message).join(`
|
|
3856
3856
|
`));if(!o.isLinked){let C=await eD({directory:e,apiKey:t,configName:Ma(o.file.path)});s=C.remoteApp;let N=await c7(e,C.configFileName);a=N.project,o=N.activeConfig}}let l=o.file.content.client_id;if(typeof l!="string"||l.length===0)throw new Qi(`Active config at ${o.file.path} is marked as linked but has no client_id`);s??(s=await oU({apiKey:t??l}));let d=s.developerPlatformClient,p=await Jge(s.organizationId,d),h=await UU({developerPlatformClient:d,app:s}),v=await tU({project:a,activeConfig:o,specifications:h,remoteFlags:s.flags,clientIdOverride:t&&t!==l?t:void 0});if(!i&&!v.errors.isEmpty())throw new we(DGt(v.errors.getErrors()[0]));let S=rN(e),k=s.apiKey===v.configuration.client_id;return(!S||k)&&B6({appId:s.apiKey,title:s.title,directory:e,orgId:s.organizationId}),await tsi(s,p,n),v.errors.isEmpty()&&await IGt(v.allExtensions,d),{project:a,activeConfig:o,app:v,remoteApp:s,developerPlatformClient:d,specifications:h,organization:p}}async function tsi(e,t,n){let r;t.source===_S.BusinessPlatform?r={business_platform_id:KW(t.id)}:r={partner_id:KW(t.id)},await Rs.addPublicMetadata(()=>({...r,api_key:e.apiKey,cmd_app_reset_used:n}))}async function TS({directory:e,userProvidedConfigName:t}){let{project:n,activeConfig:r}=await c7(e,t);if(r.file.errors.length>0)throw new we(r.file.errors.map(o=>o.message).join(`
|
|
3857
3857
|
`));let i=await qU(),a=await tU({project:n,activeConfig:r,specifications:i,ignoreUnknownExtensions:!0});if(!a.errors.isEmpty())throw new we(DGt(a.errors.getErrors()[0]));return{app:a,project:n}}c();c();var CN=class extends gr{environmentsFilename(){return uf.appEnvironments}};var n5=class extends CN{};var PGt=Nt(ga(),1);var gUe,tD=class extends n5{async run(){let{flags:t}=await this.parse(gUe),n=t["client-id"];await Y5(()=>({cmd_app_dependency_installation_skipped:t["skip-dependencies-installation"]}));let{app:r,project:i}=await TS({directory:t.path,userProvidedConfigName:t.config});return await jMt({app:r,project:i,skipDependenciesInstallation:t["skip-dependencies-installation"],apiKey:n}),{app:r}}};gUe=tD;tD.summary="Build the app, including extensions.";tD.descriptionWithMarkdown="This command executes the build script specified in the element's TOML file. You can specify a custom script in the file. To learn about configuration files in Shopify apps, refer to [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration).\n\n If you're building a [theme app extension](https://shopify.dev/docs/apps/online-store/theme-app-extensions), then running the `build` command runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) against your extension to ensure that it's valid.";tD.description=gUe.descriptionWithoutMarkdown();tD.flags={...ar,...ya,"skip-dependencies-installation":PGt.Flags.boolean({hidden:!1,description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1})};var FGt=tD;c();c();var $a=class extends CN{};c();c();c();async function vUe(e,t,n){let r=n.clientName===SS.AppManagement,i;n.supportsStoreSearch&&(i=async s=>n.devStoresForOrg(t.id,s));let a=await $9e({onSearchForStoresByName:i,...e,showDomainOnPrompt:r});if(!a){if(yr({body:await n.getCreateDevStoreLink(t)}),await y0(5),!await K9t(t))throw new Kxe;let l=await nsi(t.id,n);a=await vUe({stores:l,hasMorePages:!1},t,n)}let o=await uve(a,t.id,n,"prompt-first");for(;!o;){if(a=await $9e({stores:[a],hasMorePages:!1,showDomainOnPrompt:r}),!a)throw new Kxe;o=await uve(a,t.id,n,"prompt-first")}return a}async function nsi(e,t){let i=[];return await Jo([{title:"Fetching organization data",task:async()=>{for(let o=0;o<10;o++){let{stores:s}=await t.devStoresForOrg(e);if(s.length>0){i=s;return}await y0(3)}}}]),i}async function uve(e,t,n,r){if(e.transferDisabled||II())return!0;if(!e.transferDisabled&&!e.convertableToPartnerTest)throw new we(`The store you specified (${e.shopDomain}) is not a dev store`,"Run dev --reset and select an eligible dev store.");switch(r){case"prompt-first":return await Y9t()?(await rsi(e,t,n),!0):!1;case"never":throw new we("The store you specified is not transfer-disabled","Try running 'dev --reset' and selecting a different store, or choosing to convert this one.")}}async function rsi(e,t,n){let r={input:{organizationID:parseInt(t,10),shopId:e.shopId}},i=await n.convertToTransferDisabledStore(r);if(!i.convertDevToTestStore.convertedToTestStore){let a=i.convertDevToTestStore.userErrors.map(o=>o.message).join(", ");throw new Qi(`Error converting store ${e.shopDomain} to a transfer-disabled store: ${a}`,"This store might not be compatible with draft apps, please try a different store")}wx(`Converted ${e.shopDomain} to a transfer-disabled store`)}async function sk({appContextResult:e,storeFqdn:t,forceReselectStore:n,storeTypes:r=["APP_DEVELOPMENT"]}){let{app:i,organization:a,developerPlatformClient:o}=e,s,l=i.configuration.build?.dev_store_url,u=i.hiddenConfig.dev_store_url,d=l??u,h=t??(n?void 0:d),v=r.length===1&&r[0]==="APP_DEVELOPMENT";if(h)s=await $ge(a,h,o,r),v&&await uve(s,a.id,o,"never");else{let S=await o.devStoresForOrg(a.id);s=await vUe(S,a,o)}return await isi(s,n),s.shopDomain=ns(s.shopDomain),(s.shopDomain!==d||!u)&&await i.updateHiddenConfig({dev_store_url:s.shopDomain}),await o.ensureUserAccessToStore(a.id,s),s}async function isi(e,t){await Rs.addPublicMetadata(()=>({cmd_app_reset_used:t,store_fqdn_hash:w_(e.shopDomain)})),await Rs.addSensitiveMetadata(()=>({store_fqdn:e.shopDomain}))}c();var yUe=Nt(Ute(),1);async function zU(e,t){let n=e.apiSecretKeys[0]?.secret;if(!n)throw new Qi("No API secret keys found for app");return AF(t,e.apiKey,n)}function dve(e){let t;try{t=(0,yUe.parse)(e)}catch(r){throw r instanceof Error?new we(`Invalid GraphQL syntax: ${r.message}`):r}if(t.definitions.filter(r=>r.kind==="OperationDefinition").length!==1)throw new we("GraphQL document must contain exactly one operation definition. Multiple operations are not supported.")}async function TN(e){let{adminSession:t,userSpecifiedVersion:n,minimumDefaultVersion:r}=e;if(n==="unstable")return n;let i=await Hj(t);if(!n){let l=i.filter(u=>u.supported).map(u=>u.handle);return r&&l.push(r),l.sort().reverse()[0]}let a=i.map(l=>l.handle);if(a.includes(n))return n;let o=it`Invalid API version: ${n}`.value,s=it`Allowed versions: ${a.join(", ")}`.value;throw new we(o,s)}function IN(e){let{organization:t,remoteApp:n,storeFqdn:r,version:i}=e,a=[`Organization: ${t.businessName}`,`App: ${n.title}`,`Store: ${r}`];return i&&a.push(`API version: ${i}`),a}function $J(e){return(0,yUe.parse)(e).definitions.find(r=>r.kind==="OperationDefinition")?.operation==="mutation"}function fve(e,t){if($J(e)&&t.storeType!=="APP_DEVELOPMENT")throw new we("Mutations can only be executed on dev stores.")}async function QJ(e){let t=await Qo({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),n=await sk({appContextResult:t,storeFqdn:e.store,forceReselectStore:e.reset,storeTypes:["APP_DEVELOPMENT","DEVELOPMENT","DEVELOPMENT_SUPERSET","PRODUCTION"]});return{appContextResult:t,store:n}}async function pve(e){let t;if(e.query!==void 0){if(!e.query.trim())throw new we("The --query flag value is empty. Please provide a valid GraphQL query or mutation.");t=e.query}else if(e["query-file"]){let i=e["query-file"];if(!await En(i))throw new we(it`Query file not found at ${ut.path(i)}. Please check the path and try again.`);if(t=await Or(i,{encoding:"utf8"}),!t.trim())throw new we(it`Query file at ${ut.path(i)} is empty. Please provide a valid GraphQL query or mutation.`)}if(!t)throw new Qi("Query should have been provided via --query or --query-file flags due to exactlyOne constraint. This indicates the oclif flag validation failed.");dve(t);let{appContextResult:n,store:r}=await QJ(e);return{query:t,appContextResult:n,store:r}}c();c();c();c();var DN="2026-01";c();var hve={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetBulkOperationById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};c();var RGt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListBulkOperations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sortKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BulkOperationsSortKeys"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"sortKey"},value:{kind:"Variable",name:{kind:"Name",value:"sortKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};function mve(e){return e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/BulkOperation/${e}`:e}function XJ(e){return e.match(/^gid:\/\/shopify\/BulkOperation\/(\d+)$/)?.[1]??e}async function AGt(e){let{organization:t,storeFqdn:n,operationId:r,remoteApp:i}=e;yr({headline:"Checking bulk operation status.",body:[{list:{items:IN({organization:t,remoteApp:i,storeFqdn:n})}}]});let a=i.apiSecretKeys[0]?.secret;if(!a)throw new Qi("No API secret keys found for app");let o=await AF(n,i.apiKey,a),s=await ku({query:hve,session:o,variables:{id:r},version:await TN({adminSession:o,minimumDefaultVersion:DN})});s.bulkOperation?asi(s.bulkOperation):Ko({headline:"Bulk operation not found.",body:it`ID: ${ut.yellow(r)}`.value})}async function NGt(e){let{organization:t,storeFqdn:n,remoteApp:r}=e;yr({headline:"Listing bulk operations.",body:[{list:{items:IN({organization:t,remoteApp:r,storeFqdn:n})}}]});let i=r.apiSecretKeys[0]?.secret;if(!i)throw new Qi("No API secret keys found for app");let a=await AF(n,r.apiKey,i),o=new Date(Date.now()-10080*60*1e3).toISOString().split("T")[0],l=(await ku({query:RGt,session:a,variables:{query:`created_at:>=${o}`,first:100,sortKey:"CREATED_AT"},version:await TN({adminSession:a,minimumDefaultVersion:DN})})).bulkOperations.nodes.map(u=>({id:XJ(u.id),status:ssi(u.status),count:lsi(u.objectCount),dateCreated:$W(new Date(String(u.createdAt))),dateFinished:u.completedAt?$W(new Date(String(u.completedAt))):"",results:csi(u.url??u.partialDataUrl)}));kg(),l.length===0?yr({body:"No bulk operations found in the last 7 days."}):E_({rows:l,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),kg()}function asi(e){let{id:t,status:n,createdAt:r,completedAt:i,url:a,partialDataUrl:o}=e,s=PN(e).value,l=osi(r,i),u=it`ID: ${ut.yellow(t)}\n${l}`.value;if(n==="COMPLETED"){let d=a?ut.link("Download results",a):"";dr({headline:s,body:it`${u}\n${d}`.value})}else if(n==="FAILED"){let d=o?ut.link("Download partial results",o):"";Ko({headline:s,body:it`${u}\n${d}`.value})}else yr({headline:s,body:u})}function osi(e,t){let n=new Date;return t?`Finished ${Pxe(new Date(String(t)),n)}`:`Started ${Pxe(new Date(String(e)),n)}`}function ssi(e){return e==="COMPLETED"?Qr.green(e):e==="FAILED"?Qr.red(e):Qr.dim(e)}function lsi(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function csi(e){return e?it`${ut.link("download",e)}`.value:""}function PN(e){switch(e.status){case"RUNNING":return it`Bulk operation in progress${e.objectCount>0?ut.gray(` (${String(e.objectCount)} objects ${e.type==="MUTATION"?"written":"read"})`):""}`;case"CREATED":return it`Starting`;case"COMPLETED":return it`Bulk operation succeeded: ${ut.gray(`${String(e.objectCount)} objects`)}`;case"FAILED":return it`Bulk operation failed. ${ut.errorText(`Error: ${e.errorCode??"unknown"}`)}`;case"CANCELING":return it`Bulk operation canceling...`;case"CANCELED":return it`Bulk operation canceled.`;case"EXPIRED":return it`Bulk operation expired.`;default:return it`Bulk operation status: ${e.status}`}}function OGt(e,t){let n=e.map(r=>it`${r.field?.join(".")??"unknown"}: ${r.message}`.value).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$c as b,_c as a,ad as c,bd as d,cd as e,dd as f,ed as g,fd as h,gd as i,hd as j,id as k,jd as l,kd as m,ld as n,md as o,nd as p,od as q,pd as r,qd as s,rd as t,sd as u,td as v,ud as w}from"./chunk-
|
|
1
|
+
import{$c as b,_c as a,ad as c,bd as d,cd as e,dd as f,ed as g,fd as h,gd as i,hd as j,id as k,jd as l,kd as m,ld as n,md as o,nd as p,od as q,pd as r,qd as s,rd as t,sd as u,td as v,ud as w}from"./chunk-KVWHPGOA.js";import"./chunk-SVA22NZQ.js";import"./chunk-FU2Y2M3M.js";import"./chunk-QYR5VPQA.js";import"./chunk-EENHXSWU.js";import"./chunk-JBSYWYIP.js";import"./chunk-T4M5CWAO.js";import"./chunk-PRVQAHWI.js";import"./chunk-QUTQDXSL.js";import"./chunk-VPRTJUIN.js";export{i as alwaysLogAnalytics,j as alwaysLogMetrics,h as analyticsDisabled,l as canRunDoctorRelease,t as ciPlatform,r as cloudEnvironment,o as codespacePortForwardingDomain,n as codespaceURL,k as firstPartyDev,v as getThemeKitAccessDomain,m as gitpodURL,s as hasGit,b as homeDirectory,p as isCloudEnvironment,c as isDevelopment,e as isHostedAppsMode,f as isShopify,a as isTerminalInteractive,g as isUnitTest,d as isVerbose,u as macAddress,w as opentelemetryDomain,q as themeToken};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as g,B as h,C as i,D as j,E as k,F as l,G as m,H as n,I as o,J as p,K as q,L as r,M as s,N as t,O as u,P as v,Q as w,R as x,S as y,T as z,U as A,V as B,W as C,X as D,Y as E,u as a,v as b,w as c,x as d,y as e,z as f}from"./chunk-
|
|
1
|
+
import{A as g,B as h,C as i,D as j,E as k,F as l,G as m,H as n,I as o,J as p,K as q,L as r,M as s,N as t,O as u,P as v,Q as w,R as x,S as y,T as z,U as A,V as B,W as C,X as D,Y as E,u as a,v as b,w as c,x as d,y as e,z as f}from"./chunk-LH4VO6EV.js";import"./chunk-KVWHPGOA.js";import"./chunk-SVA22NZQ.js";import"./chunk-FU2Y2M3M.js";import"./chunk-QYR5VPQA.js";import"./chunk-EENHXSWU.js";import"./chunk-JBSYWYIP.js";import"./chunk-T4M5CWAO.js";import"./chunk-PRVQAHWI.js";import"./chunk-QUTQDXSL.js";import"./chunk-VPRTJUIN.js";export{k as FindUpAndReadPackageJsonNotFoundError,j as PackageJsonNotFoundError,i as UnknownPackageManagerError,z as addNPMDependencies,y as addNPMDependenciesIfNeeded,A as addNPMDependenciesWithoutVersionIfNeeded,C as addResolutionOrOverride,d as bunLockfile,v as checkForCachedNewVersion,u as checkForNewVersion,B as findUpAndReadPackageJson,s as getDependencies,m as getPackageManager,q as getPackageName,r as getPackageVersion,E as inferPackageManager,o as installNPMDependenciesRecursively,p as installNodeModules,f as lockfiles,g as lockfilesByManager,b as npmLockfile,h as packageManager,n as packageManagerBinaryCommandForDirectory,l as packageManagerFromUserAgent,c as pnpmLockfile,e as pnpmWorkspaceFile,x as readAndParsePackageJson,t as usesWorkspaces,w as versionSatisfies,D as writePackageJSON,a as yarnLockfile};
|