@shopify/cli 4.8.5 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/dist/analytics-QK4RFCB6.js +1 -0
  2. package/dist/analytics-R6I5APDB.js +1 -0
  3. package/dist/assets/hydrogen/starter/package.json +1 -1
  4. package/dist/bootstrap.js +1 -3
  5. package/dist/chunk-22LJALHJ.js +7 -0
  6. package/dist/{chunk-6ICRPFG4.js → chunk-23K3B23N.js} +1 -1
  7. package/dist/chunk-2KLXRVGQ.js +317 -0
  8. package/dist/{chunk-ZMD5TNU5.js → chunk-2LZQM5JG.js} +1 -1
  9. package/dist/chunk-2OHSGC4Q.js +1 -0
  10. package/dist/chunk-2Q3WIH7S.js +6 -0
  11. package/dist/{chunk-HSETBDXR.js → chunk-2W6M7YDY.js} +1 -1
  12. package/dist/{chunk-2JM3XHTQ.js → chunk-2YFB3PTV.js} +9 -9
  13. package/dist/chunk-2YRVHJEY.js +4 -0
  14. package/dist/{chunk-DKAWQBTI.js → chunk-3AASYIOA.js} +3 -3
  15. package/dist/chunk-3DMDSAWK.js +20 -0
  16. package/dist/{chunk-NZ3HLDJG.js → chunk-3SG5EJFC.js} +1 -1
  17. package/dist/chunk-3T2WMZHC.js +1 -0
  18. package/dist/{chunk-773TIA5M.js → chunk-3VYOLEQE.js} +2 -2
  19. package/dist/chunk-3WVEL423.js +1 -0
  20. package/dist/{chunk-H5MENHJ2.js → chunk-3ZK5JZLY.js} +1 -1
  21. package/dist/chunk-44QTWXOJ.js +8 -0
  22. package/dist/{chunk-4QBJ5JBX.js → chunk-4A7FPJVT.js} +16 -15
  23. package/dist/chunk-4TQFTZVD.js +18 -0
  24. package/dist/chunk-4WACZNFF.js +1 -0
  25. package/dist/{chunk-4UD2LW4O.js → chunk-4XSYMLQG.js} +1 -1
  26. package/dist/{chunk-T3B6KIPU.js → chunk-4Y22EM45.js} +1 -1
  27. package/dist/chunk-53U6XS3J.js +1 -0
  28. package/dist/chunk-55NKAIIT.js +1 -0
  29. package/dist/chunk-55PABKRC.js +5 -0
  30. package/dist/chunk-5BLXN5WU.js +1 -0
  31. package/dist/{chunk-AOPEKBDL.js → chunk-5BYVVXGD.js} +1 -1
  32. package/dist/{chunk-ZMTTZXC4.js → chunk-5HEBS5DG.js} +3 -3
  33. package/dist/{chunk-VIMFXQ3Q.js → chunk-5HONV6NQ.js} +1 -1
  34. package/dist/chunk-5RL6DKWR.js +5 -0
  35. package/dist/chunk-5XO6PAMV.js +1 -0
  36. package/dist/chunk-6DHY67FO.js +6 -0
  37. package/dist/{chunk-5GUXN2RU.js → chunk-6GA56I3E.js} +1 -1
  38. package/dist/chunk-6IL3B5Z5.js +4 -0
  39. package/dist/{chunk-AEPBX4GI.js → chunk-6ILP6QCH.js} +1 -1
  40. package/dist/{chunk-PL7AJVTV.js → chunk-6RBCFXJT.js} +1 -1
  41. package/dist/{chunk-NZE4C4OI.js → chunk-72HS7MHV.js} +1 -1
  42. package/dist/{chunk-RU6J6QQF.js → chunk-74HXMIDM.js} +1 -1
  43. package/dist/{chunk-PJ7L6NSD.js → chunk-77B77IGP.js} +1 -1
  44. package/dist/chunk-7DRKDQRT.js +1 -0
  45. package/dist/chunk-7HDJBEBP.js +3 -0
  46. package/dist/chunk-7IGMIDKK.js +15 -0
  47. package/dist/chunk-7QQPAT4L.js +1 -0
  48. package/dist/chunk-7Y4X5I6N.js +1 -0
  49. package/dist/{chunk-NPATN7YS.js → chunk-7ZSN2QT5.js} +1 -1
  50. package/dist/chunk-A54V5UCD.js +5 -0
  51. package/dist/{chunk-MNYKIPG7.js → chunk-AD4S2VEI.js} +1 -1
  52. package/dist/chunk-ADW7ECNU.js +7 -0
  53. package/dist/chunk-AS2O62JX.js +1 -0
  54. package/dist/chunk-ASUARYJD.js +1 -0
  55. package/dist/chunk-B4RPJYDH.js +1 -0
  56. package/dist/{chunk-PIQI72DV.js → chunk-BJOJNAKH.js} +1 -1
  57. package/dist/chunk-BL5JWD3Y.js +16 -0
  58. package/dist/chunk-BOFCBTX7.js +1 -0
  59. package/dist/chunk-BPIQ4YTW.js +1 -0
  60. package/dist/chunk-C6FZII5S.js +1 -0
  61. package/dist/{chunk-6LNTC6EK.js → chunk-CACPRKUF.js} +1 -1
  62. package/dist/{chunk-WKTIQUQP.js → chunk-CHLSNYF7.js} +1 -1
  63. package/dist/chunk-CMICT4XI.js +1 -0
  64. package/dist/chunk-CPFAATMO.js +6 -0
  65. package/dist/{chunk-R4TOHQH3.js → chunk-CSRNHTHO.js} +2 -2
  66. package/dist/chunk-D3K42KBL.js +9 -0
  67. package/dist/chunk-DGMRL5DQ.js +1 -0
  68. package/dist/chunk-DKJPE42V.js +2 -0
  69. package/dist/{chunk-SOJHJ4QK.js → chunk-DYA5UUXL.js} +1 -1
  70. package/dist/chunk-E5ND6RBL.js +1 -0
  71. package/dist/{chunk-DV7FOLG4.js → chunk-E75DJTAF.js} +1 -1
  72. package/dist/chunk-ECEOBSGD.js +1 -0
  73. package/dist/{chunk-6IOVTFAH.js → chunk-EYSZRIUL.js} +1 -1
  74. package/dist/chunk-FCULF3JA.js +1 -0
  75. package/dist/chunk-FL34EOXG.js +1 -0
  76. package/dist/chunk-FW5HGFSZ.js +20 -0
  77. package/dist/{chunk-M2M3I63K.js → chunk-G54BKNIX.js} +1 -1
  78. package/dist/{chunk-PU6KWWVK.js → chunk-G7OIACY5.js} +1 -1
  79. package/dist/{chunk-VVPIXC3W.js → chunk-GALDYSEX.js} +1 -1
  80. package/dist/{chunk-WQOV3LQA.js → chunk-GDQLA5NB.js} +1 -1
  81. package/dist/{chunk-GCJAY2XJ.js → chunk-GJJBOCKD.js} +3 -3
  82. package/dist/{chunk-OJSF3H2G.js → chunk-GQZPGTG7.js} +2 -2
  83. package/dist/{chunk-MMHTYLTG.js → chunk-GVRFO4CV.js} +1 -1
  84. package/dist/chunk-HB3MJYBK.js +1 -0
  85. package/dist/{chunk-AEUCDGTB.js → chunk-HDQXFGYG.js} +1 -1
  86. package/dist/chunk-HSTNTHWM.js +1 -0
  87. package/dist/{chunk-WAZL37JY.js → chunk-HSZC2LBB.js} +1 -1
  88. package/dist/chunk-I4FGM6UH.js +8 -0
  89. package/dist/chunk-I7GYNNCU.js +6 -0
  90. package/dist/{chunk-MFP63IUM.js → chunk-IBTQO3JD.js} +1 -1
  91. package/dist/{chunk-MVJSQT7V.js → chunk-IISE7SBT.js} +1 -1
  92. package/dist/chunk-IUZZWXJG.js +3 -0
  93. package/dist/chunk-IWML2HLC.js +5 -0
  94. package/dist/{chunk-CTNBSUVU.js → chunk-JA2QZ635.js} +2 -2
  95. package/dist/chunk-JOJRABPY.js +3 -0
  96. package/dist/chunk-JQKB3D37.js +1 -0
  97. package/dist/chunk-JROJL6RV.js +1 -0
  98. package/dist/{chunk-4JU7N2OF.js → chunk-JTPVSO6Y.js} +1 -1
  99. package/dist/chunk-JWDUSMCA.js +1 -0
  100. package/dist/{chunk-3CKUOG4B.js → chunk-KLYJDAP6.js} +1 -1
  101. package/dist/{chunk-LZZAD3FW.js → chunk-KVROYIUQ.js} +1 -1
  102. package/dist/chunk-L5XWYTHY.js +836 -0
  103. package/dist/chunk-LOTGSNS5.js +2 -0
  104. package/dist/{chunk-KHRZFJHM.js → chunk-LQLFMDVD.js} +1 -1
  105. package/dist/{chunk-Z4E2EXZV.js → chunk-LSWFHTJT.js} +1 -1
  106. package/dist/{chunk-BPJRQOHO.js → chunk-LV2IWYGL.js} +1 -1
  107. package/dist/{chunk-XRWQ7AXY.js → chunk-LYPNQFWX.js} +1 -1
  108. package/dist/{chunk-UJSCQJLW.js → chunk-MRVQ6XRW.js} +1 -1
  109. package/dist/chunk-MVVHISCR.js +2 -0
  110. package/dist/{chunk-VPOAOUT4.js → chunk-N4DE5H65.js} +1 -1
  111. package/dist/{chunk-W6ST525S.js → chunk-N56BJ3F7.js} +1 -1
  112. package/dist/{chunk-POOKYUTJ.js → chunk-NF7MOA4K.js} +1 -1
  113. package/dist/{chunk-PQDB3FUL.js → chunk-NGN7U2UF.js} +1 -1
  114. package/dist/{chunk-KDMJ2BLO.js → chunk-NTVEJYKI.js} +1 -1
  115. package/dist/chunk-NYABB6XW.js +1 -0
  116. package/dist/{chunk-RSGIMVPN.js → chunk-O6E7YL7N.js} +2 -2
  117. package/dist/chunk-OASB6XPV.js +16 -0
  118. package/dist/{chunk-I6DVGPJ7.js → chunk-OBYY45BX.js} +1 -1
  119. package/dist/chunk-OETFY7FE.js +28 -0
  120. package/dist/{chunk-K5OTE6CX.js → chunk-OEZATTOS.js} +1 -1
  121. package/dist/{chunk-D34ZSTCK.js → chunk-OG7SF4FU.js} +1 -1
  122. package/dist/chunk-OM243CQ6.js +6 -0
  123. package/dist/chunk-P3Z5RLVV.js +3 -0
  124. package/dist/{chunk-ZFA5DIJ3.js → chunk-PBBZNGS4.js} +1 -1
  125. package/dist/chunk-PGTKKP2B.js +11 -0
  126. package/dist/chunk-PK4ID32C.js +1 -0
  127. package/dist/{chunk-G7C4LBG2.js → chunk-PVOWU77O.js} +1 -1
  128. package/dist/{chunk-SYBKHTVU.js → chunk-PXD2WJOI.js} +3 -3
  129. package/dist/chunk-PXXTSW6I.js +4 -0
  130. package/dist/{chunk-IYFHBTJ2.js → chunk-PZHE37Z4.js} +1 -1
  131. package/dist/{chunk-WHXY372K.js → chunk-Q34PKJRR.js} +1 -1
  132. package/dist/{chunk-6QWLOSUQ.js → chunk-Q3O3AFZT.js} +1 -1
  133. package/dist/chunk-Q45XAEG2.js +16 -0
  134. package/dist/{chunk-DPMOLROM.js → chunk-QAXFCAOV.js} +5 -5
  135. package/dist/{chunk-FXBQKJTS.js → chunk-QBGSSUJP.js} +1 -1
  136. package/dist/chunk-QILWHHAQ.js +1 -0
  137. package/dist/{chunk-HGFCNPSN.js → chunk-QJST4LZX.js} +1 -1
  138. package/dist/chunk-QQN4PJZD.js +1 -0
  139. package/dist/{chunk-OAEGTH4Q.js → chunk-QSKOR3ED.js} +1 -1
  140. package/dist/{chunk-C4UCOQUP.js → chunk-QTEWTPAQ.js} +2 -2
  141. package/dist/chunk-QWDJRSJJ.js +1 -0
  142. package/dist/{chunk-TUWRPDTE.js → chunk-R757TSQ6.js} +1 -1
  143. package/dist/chunk-RCIU7NHA.js +1 -0
  144. package/dist/chunk-RGIUP4FW.js +1 -0
  145. package/dist/{chunk-4SXHXMK6.js → chunk-RHNFWHFY.js} +1 -1
  146. package/dist/{chunk-6QU2BHVL.js → chunk-S7536EWZ.js} +4 -4
  147. package/dist/{chunk-GW7IEG4G.js → chunk-SDFO7P2M.js} +1 -1
  148. package/dist/{chunk-7O2KMA4J.js → chunk-SDJNAUU6.js} +1 -1
  149. package/dist/chunk-SGBLCVUX.js +1 -0
  150. package/dist/chunk-SJARQZVN.js +3 -0
  151. package/dist/chunk-SKRUMRB4.js +383 -0
  152. package/dist/{chunk-BU6LJZG7.js → chunk-SW5EWGBJ.js} +1 -1
  153. package/dist/chunk-SXPWOYLT.js +7 -0
  154. package/dist/chunk-T234RERA.js +7 -0
  155. package/dist/chunk-TJJVX7CU.js +4 -0
  156. package/dist/{chunk-TTV2GWNE.js → chunk-TMV37ENR.js} +1 -1
  157. package/dist/{chunk-4UAJ6ULU.js → chunk-TNXZWQZU.js} +1 -1
  158. package/dist/{chunk-GUPUXFIP.js → chunk-TO7TXDLU.js} +1 -1
  159. package/dist/chunk-TSLZNTFM.js +3 -0
  160. package/dist/{chunk-NAQ7KT6L.js → chunk-UFU2LGFK.js} +1 -1
  161. package/dist/chunk-VDDNDA5K.js +15 -0
  162. package/dist/{chunk-F33TYJM5.js → chunk-VFO5OYQ4.js} +1 -1
  163. package/dist/{chunk-4DIR65KL.js → chunk-VFP3PUGZ.js} +24 -24
  164. package/dist/{chunk-6QDOCBD4.js → chunk-VZUHMW5E.js} +4 -3
  165. package/dist/chunk-W7CBJNXD.js +12 -0
  166. package/dist/chunk-WCAGYCT7.js +4 -0
  167. package/dist/{chunk-DPNZWBT5.js → chunk-WNO2V53C.js} +1 -1
  168. package/dist/{chunk-4XE6E4DC.js → chunk-WPUQTUDX.js} +1 -1
  169. package/dist/chunk-WU7MSL3I.js +8 -0
  170. package/dist/chunk-WXV35TPE.js +1 -0
  171. package/dist/{chunk-77KSMVIO.js → chunk-XBSWZ6BT.js} +6 -6
  172. package/dist/chunk-XCNJL7ES.js +1 -0
  173. package/dist/{chunk-WM3GKSPE.js → chunk-XFZDFDZV.js} +1 -1
  174. package/dist/chunk-XTYSJIZY.js +1 -0
  175. package/dist/chunk-Y5ZN62VF.js +1 -0
  176. package/dist/{chunk-EBBS7VG6.js → chunk-YAH5WFYR.js} +3 -3
  177. package/dist/{chunk-EJJPVVQ2.js → chunk-YBQKJHZW.js} +1 -1
  178. package/dist/chunk-YD66PU3Y.js +1 -0
  179. package/dist/chunk-YGFEUXKQ.js +1 -0
  180. package/dist/chunk-YJWNM4XO.js +18 -0
  181. package/dist/{chunk-RX63KGTK.js → chunk-YQQHBFMA.js} +1 -1
  182. package/dist/chunk-YRHFPXC3.js +1 -0
  183. package/dist/chunk-YTJ3EPD3.js +1 -0
  184. package/dist/chunk-YX5GRXRS.js +2368 -0
  185. package/dist/chunk-Z35PUKKP.js +7 -0
  186. package/dist/{chunk-WKRX4FBZ.js → chunk-Z3XIZMEM.js} +1 -1
  187. package/dist/chunk-ZGASBRSQ.js +5 -0
  188. package/dist/{chunk-HS3VTFW3.js → chunk-ZHJ6KA43.js} +1 -1
  189. package/dist/{chunk-H6TWXT6Q.js → chunk-ZO4IBP4B.js} +1 -1
  190. package/dist/chunk-ZOYSMJ27.js +1 -0
  191. package/dist/chunk-ZPCCSPAE.js +3 -0
  192. package/dist/chunk-ZSJXZCAW.js +4 -0
  193. package/dist/{chunk-A2BZY6TE.js → chunk-ZSVR5NEO.js} +1 -1
  194. package/dist/{chunk-J774336K.js → chunk-ZUVAHONX.js} +1 -1
  195. package/dist/chunk-ZVDFCUJT.js +2 -0
  196. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  197. package/dist/cli/commands/app/build.js +1 -1
  198. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  199. package/dist/cli/commands/app/bulk/execute.js +1 -1
  200. package/dist/cli/commands/app/bulk/status.js +1 -1
  201. package/dist/cli/commands/app/config/link.js +1 -1
  202. package/dist/cli/commands/app/config/pull.js +1 -1
  203. package/dist/cli/commands/app/config/use.js +1 -1
  204. package/dist/cli/commands/app/config/validate.js +1 -1
  205. package/dist/cli/commands/app/demo/watcher.js +1 -1
  206. package/dist/cli/commands/app/deploy.js +1 -1
  207. package/dist/cli/commands/app/dev/clean.js +1 -1
  208. package/dist/cli/commands/app/dev.js +1 -1
  209. package/dist/cli/commands/app/env/pull.js +1 -1
  210. package/dist/cli/commands/app/env/show.js +1 -1
  211. package/dist/cli/commands/app/execute.js +1 -1
  212. package/dist/cli/commands/app/function/build.js +1 -1
  213. package/dist/cli/commands/app/function/info.js +1 -1
  214. package/dist/cli/commands/app/function/replay.js +1 -1
  215. package/dist/cli/commands/app/function/run.js +1 -1
  216. package/dist/cli/commands/app/function/schema.js +1 -1
  217. package/dist/cli/commands/app/function/typegen.js +1 -1
  218. package/dist/cli/commands/app/generate/extension.js +1 -1
  219. package/dist/cli/commands/app/graphiql.js +1 -1
  220. package/dist/cli/commands/app/import/channel-config.js +1 -0
  221. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -0
  222. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -0
  223. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  224. package/dist/cli/commands/app/import-extensions.js +1 -1
  225. package/dist/cli/commands/app/info.js +1 -1
  226. package/dist/cli/commands/app/init.js +1 -1
  227. package/dist/cli/commands/app/logs.js +1 -1
  228. package/dist/cli/commands/app/release.js +1 -1
  229. package/dist/cli/commands/app/security/check.js +1 -0
  230. package/dist/cli/commands/app/security/clean.js +1 -0
  231. package/dist/cli/commands/app/security/instructions.js +1 -0
  232. package/dist/cli/commands/app/security/record.js +1 -0
  233. package/dist/cli/commands/app/security/review.js +1 -0
  234. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  235. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  236. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  237. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  238. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  239. package/dist/cli/commands/app/versions/list.js +1 -1
  240. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  241. package/dist/cli/commands/auth/login.d.ts +16 -1
  242. package/dist/cli/commands/auth/login.js +1 -1
  243. package/dist/cli/commands/auth/logout.d.ts +16 -1
  244. package/dist/cli/commands/auth/logout.js +1 -1
  245. package/dist/cli/commands/cache/clear.js +1 -1
  246. package/dist/cli/commands/config/autoupgrade/off.d.ts +13 -0
  247. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  248. package/dist/cli/commands/config/autoupgrade/on.d.ts +13 -0
  249. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  250. package/dist/cli/commands/config/autoupgrade/status.d.ts +13 -0
  251. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  252. package/dist/cli/commands/debug/command-flags.js +1 -1
  253. package/dist/cli/commands/doc/fetch.d.ts +2 -0
  254. package/dist/cli/commands/doc/fetch.js +1 -1
  255. package/dist/cli/commands/doc/search.d.ts +1 -0
  256. package/dist/cli/commands/doc/search.js +1 -1
  257. package/dist/cli/commands/docs/generate.js +1 -1
  258. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  259. package/dist/cli/commands/doctor-release/theme/index.d.ts +1 -0
  260. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  261. package/dist/cli/commands/help.d.ts +431 -1
  262. package/dist/cli/commands/help.js +1 -1
  263. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  264. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  265. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  266. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  267. package/dist/cli/commands/notifications/generate.js +1 -1
  268. package/dist/cli/commands/notifications/list.js +1 -1
  269. package/dist/cli/commands/organization/list.js +1 -1
  270. package/dist/cli/commands/search.d.ts +11 -1
  271. package/dist/cli/commands/search.js +1 -1
  272. package/dist/cli/commands/send-analytics.js +1 -1
  273. package/dist/cli/commands/theme/check.js +1 -1
  274. package/dist/cli/commands/theme/console.js +1 -1
  275. package/dist/cli/commands/theme/delete.js +1 -1
  276. package/dist/cli/commands/theme/dev.js +1 -1
  277. package/dist/cli/commands/theme/duplicate.js +1 -1
  278. package/dist/cli/commands/theme/info.js +1 -1
  279. package/dist/cli/commands/theme/init.js +1 -1
  280. package/dist/cli/commands/theme/language-server.js +1 -1
  281. package/dist/cli/commands/theme/list.js +1 -1
  282. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  283. package/dist/cli/commands/theme/open.js +1 -1
  284. package/dist/cli/commands/theme/package.js +1 -1
  285. package/dist/cli/commands/theme/preview.js +1 -1
  286. package/dist/cli/commands/theme/profile.js +1 -1
  287. package/dist/cli/commands/theme/publish.js +1 -1
  288. package/dist/cli/commands/theme/pull.js +1 -1
  289. package/dist/cli/commands/theme/push.js +1 -1
  290. package/dist/cli/commands/theme/rename.js +1 -1
  291. package/dist/cli/commands/theme/share.js +1 -1
  292. package/dist/cli/commands/upgrade.js +1 -1
  293. package/dist/cli/commands/version.d.ts +15 -1
  294. package/dist/cli/commands/version.js +1 -1
  295. package/dist/cli/help.d.ts +5 -2
  296. package/dist/cli/help.js +6 -2
  297. package/dist/cli/services/commands/auth/login/types.d.ts +11 -0
  298. package/dist/cli/services/commands/auth/login/types.js +7 -0
  299. package/dist/cli/services/commands/config/autoupgrade/index.d.ts +3 -0
  300. package/dist/cli/services/commands/config/autoupgrade/index.js +9 -0
  301. package/dist/cli/services/commands/config/autoupgrade/result.d.ts +2 -0
  302. package/dist/cli/services/commands/config/autoupgrade/result.js +15 -0
  303. package/dist/cli/services/commands/config/autoupgrade/types.d.ts +10 -0
  304. package/dist/cli/services/commands/config/autoupgrade/types.js +7 -0
  305. package/dist/cli/services/commands/doc/fetch.d.ts +1 -1
  306. package/dist/cli/services/commands/doc/fetch.js +11 -2
  307. package/dist/cli/services/commands/help/index.d.ts +3 -0
  308. package/dist/cli/services/commands/help/index.js +51 -0
  309. package/dist/cli/services/commands/help/result.d.ts +2 -0
  310. package/dist/cli/services/commands/help/result.js +6 -0
  311. package/dist/cli/services/commands/help/types.d.ts +431 -0
  312. package/dist/cli/services/commands/help/types.js +71 -0
  313. package/dist/cli/services/commands/search/index.d.ts +2 -0
  314. package/dist/cli/services/commands/search/index.js +8 -0
  315. package/dist/cli/services/commands/search/result.d.ts +2 -0
  316. package/dist/cli/services/commands/search/result.js +12 -0
  317. package/dist/cli/services/commands/search/types.d.ts +10 -0
  318. package/dist/cli/services/commands/search/types.js +7 -0
  319. package/dist/cli/services/commands/version/index.d.ts +2 -0
  320. package/dist/cli/services/commands/version/index.js +5 -0
  321. package/dist/cli/services/commands/version/result.d.ts +2 -0
  322. package/dist/cli/services/commands/version/result.js +6 -0
  323. package/dist/cli/services/commands/version/types.d.ts +10 -0
  324. package/dist/cli/services/commands/version/types.js +7 -0
  325. package/dist/command-json-schema-Y3N2NUZN.js +1 -0
  326. package/dist/command-registry.js +1 -1
  327. package/dist/{conf-store-5UUKEHZV.js → conf-store-5ZA3ILWV.js} +1 -1
  328. package/dist/custom-oclif-loader-VQKMCXNH.js +1 -0
  329. package/dist/deprecations-PFQXWNF6.js +1 -0
  330. package/dist/dist-4X53WJBQ.js +1 -0
  331. package/dist/dist-5M2V3YCM.js +1 -0
  332. package/dist/environment-ZUTBXY7U.js +1 -0
  333. package/dist/environments-3RUZ7F4Q.js +1 -0
  334. package/dist/error-FBSXLW22.js +1 -0
  335. package/dist/error-handler-D5BURRJ7.js +1 -0
  336. package/dist/fs-ZLV5W4TV.js +1 -0
  337. package/dist/hooks/did-you-mean.js +1 -1
  338. package/dist/hooks/hydrogen-init.js +1 -1
  339. package/dist/hooks/plugin-plugins.js +1 -1
  340. package/dist/hooks/postrun.js +1 -1
  341. package/dist/hooks/prerun.js +1 -1
  342. package/dist/hooks/public-metadata.js +1 -1
  343. package/dist/hooks/sensitive-metadata.js +1 -1
  344. package/dist/hooks/tunnel-provider.js +1 -1
  345. package/dist/hooks/tunnel-start.js +1 -1
  346. package/dist/http-proxy-node16-D3JUYA5D.js +38 -0
  347. package/dist/index.js +13 -14
  348. package/dist/is-global-GZ5CIXQA.js +1 -0
  349. package/dist/json-error-2BL3UZ7H.js +1 -0
  350. package/dist/lib-AD2G3QH3.js +1 -0
  351. package/dist/lib-VEVNMHDE.js +1 -0
  352. package/dist/lib-ZQW4E7QU.js +1 -0
  353. package/dist/local-KAZJAYLX.js +1 -0
  354. package/dist/metadata-M3ZE24WB.js +1 -0
  355. package/dist/{morph-BMYYMQNX.js → morph-42EXMN3K.js} +3 -3
  356. package/dist/node-package-manager-RVPONQBY.js +1 -0
  357. package/dist/notifications-system-MYEMV7JF.js +1 -0
  358. package/dist/os-DRUILZZR.js +1 -0
  359. package/dist/output-SDE274Y5.js +1 -0
  360. package/dist/{path-MBXP7ZIC.js → path-6YMSTSWG.js} +1 -1
  361. package/dist/system-5FQ3L5PA.js +1 -0
  362. package/dist/tsconfig.tsbuildinfo +1 -1
  363. package/dist/ui-TEZZM7SE.js +1 -0
  364. package/dist/uncaught-error-handler.d.ts +6 -0
  365. package/dist/uncaught-error-handler.js +33 -0
  366. package/dist/upgrade-3PIVJYBL.js +1 -0
  367. package/dist/version-FMWTVLMF.js +1 -0
  368. package/dist/version-IAMVSP7U.js +1 -0
  369. package/dist/workerd-WRW4ZUYM.js +18 -0
  370. package/oclif.manifest.json +2646 -226
  371. package/package.json +17 -8
  372. package/dist/analytics-4D5FCVMV.js +0 -1
  373. package/dist/analytics-XRYJEPWC.js +0 -1
  374. package/dist/chunk-2IZROVCY.js +0 -1
  375. package/dist/chunk-2KD4LHRT.js +0 -5
  376. package/dist/chunk-2SOA4M4G.js +0 -1
  377. package/dist/chunk-2WNF5BX4.js +0 -18
  378. package/dist/chunk-2Z52XJQG.js +0 -1
  379. package/dist/chunk-34PQ6LJC.js +0 -1
  380. package/dist/chunk-3NW372KT.js +0 -1
  381. package/dist/chunk-4JLOCGTK.js +0 -3
  382. package/dist/chunk-4NZ465W4.js +0 -1
  383. package/dist/chunk-5EME57E6.js +0 -7
  384. package/dist/chunk-5N33O2RV.js +0 -1
  385. package/dist/chunk-5PAPCPUM.js +0 -1
  386. package/dist/chunk-5U24BORP.js +0 -6
  387. package/dist/chunk-6ARAJULJ.js +0 -1
  388. package/dist/chunk-7VJPQ52S.js +0 -15
  389. package/dist/chunk-7ZEVVGCH.js +0 -1
  390. package/dist/chunk-A5FV7HOY.js +0 -16
  391. package/dist/chunk-ADS7BFDG.js +0 -15
  392. package/dist/chunk-ADUMJRRY.js +0 -1
  393. package/dist/chunk-AI4SPBPV.js +0 -2
  394. package/dist/chunk-AKETXXYD.js +0 -1
  395. package/dist/chunk-ANOCIVJ3.js +0 -8
  396. package/dist/chunk-BMPCDXJR.js +0 -4
  397. package/dist/chunk-CAKGQWX4.js +0 -7
  398. package/dist/chunk-CBGDD3ZG.js +0 -317
  399. package/dist/chunk-CRALWNNO.js +0 -1
  400. package/dist/chunk-CUGLV7UX.js +0 -1
  401. package/dist/chunk-CWSQIPY5.js +0 -5
  402. package/dist/chunk-D6LV5CJL.js +0 -2
  403. package/dist/chunk-DGMHUJV3.js +0 -4
  404. package/dist/chunk-ENUN2VSC.js +0 -2
  405. package/dist/chunk-EX7Y3BEH.js +0 -1
  406. package/dist/chunk-FDK3NDYQ.js +0 -5
  407. package/dist/chunk-FLV6UQRA.js +0 -1
  408. package/dist/chunk-FTC3BXSD.js +0 -3
  409. package/dist/chunk-FXWNYGIW.js +0 -1
  410. package/dist/chunk-G5272L77.js +0 -7
  411. package/dist/chunk-G5QSVBYP.js +0 -19
  412. package/dist/chunk-G6SURO6V.js +0 -8
  413. package/dist/chunk-GBYDMHZ3.js +0 -3
  414. package/dist/chunk-GCN4O7HM.js +0 -1
  415. package/dist/chunk-GR6NR5QK.js +0 -1
  416. package/dist/chunk-HKHGJYRC.js +0 -1
  417. package/dist/chunk-IKNCFVVX.js +0 -1
  418. package/dist/chunk-IMIPD73V.js +0 -6
  419. package/dist/chunk-IPN5OHBY.js +0 -6
  420. package/dist/chunk-J2HBEHCX.js +0 -9
  421. package/dist/chunk-K3OI5VDE.js +0 -1
  422. package/dist/chunk-KB43BSFM.js +0 -3
  423. package/dist/chunk-KGRDHI2A.js +0 -2
  424. package/dist/chunk-KNCYAIJ2.js +0 -7
  425. package/dist/chunk-KYNXMDFU.js +0 -836
  426. package/dist/chunk-L7CQQML6.js +0 -6
  427. package/dist/chunk-LCVDLQEZ.js +0 -1
  428. package/dist/chunk-NDAUL4H4.js +0 -1
  429. package/dist/chunk-NDFKLPHJ.js +0 -1705
  430. package/dist/chunk-NUKSSKYR.js +0 -1
  431. package/dist/chunk-NVNDQQN6.js +0 -8
  432. package/dist/chunk-O452KNRL.js +0 -1
  433. package/dist/chunk-P5R6JZMT.js +0 -6
  434. package/dist/chunk-PDWJ2YH2.js +0 -1
  435. package/dist/chunk-PSSOCUUD.js +0 -375
  436. package/dist/chunk-PWXGGZQB.js +0 -1
  437. package/dist/chunk-QKUTVLRJ.js +0 -4
  438. package/dist/chunk-QOOVB6RW.js +0 -6
  439. package/dist/chunk-RGJVJ22M.js +0 -3
  440. package/dist/chunk-TIG7SSKB.js +0 -3
  441. package/dist/chunk-TU47HMTL.js +0 -1
  442. package/dist/chunk-UBTHWHPB.js +0 -12
  443. package/dist/chunk-UDWSRNKO.js +0 -1
  444. package/dist/chunk-VE6BYYBP.js +0 -5
  445. package/dist/chunk-W3BNL2Q5.js +0 -1
  446. package/dist/chunk-WDY5CK2T.js +0 -11
  447. package/dist/chunk-WHZKFG2B.js +0 -1
  448. package/dist/chunk-WLU7UG44.js +0 -3
  449. package/dist/chunk-WNBRPWSB.js +0 -1
  450. package/dist/chunk-WWRLFLGM.js +0 -2
  451. package/dist/chunk-XOEBZR5C.js +0 -3
  452. package/dist/chunk-YGSXN3YD.js +0 -28
  453. package/dist/chunk-YN5SVIOI.js +0 -11
  454. package/dist/chunk-YVB7ZPHR.js +0 -20
  455. package/dist/chunk-ZIAXZ5VG.js +0 -1
  456. package/dist/chunk-ZZNGFCJ3.js +0 -4
  457. package/dist/cli/commands/app/doctor/instructions.js +0 -1
  458. package/dist/cli/commands/app/doctor.js +0 -1
  459. package/dist/cli/commands/config/autoupgrade/constants.d.ts +0 -4
  460. package/dist/cli/commands/config/autoupgrade/constants.js +0 -1
  461. package/dist/cli/services/commands/search.d.ts +0 -1
  462. package/dist/cli/services/commands/search.js +0 -7
  463. package/dist/cli/services/commands/version.d.ts +0 -1
  464. package/dist/cli/services/commands/version.js +0 -6
  465. package/dist/custom-oclif-loader-BWAMUFQ4.js +0 -1
  466. package/dist/deprecations-DVGWC3RL.js +0 -1
  467. package/dist/dist-CN7N5IOM.js +0 -1
  468. package/dist/dist-Q5U4WGYG.js +0 -1
  469. package/dist/environments-M4CFP4XF.js +0 -1
  470. package/dist/error-ZES2RSN7.js +0 -1
  471. package/dist/error-handler-CRTU67VJ.js +0 -1
  472. package/dist/fs-GELMKEWX.js +0 -1
  473. package/dist/http-proxy-node16-A6AKKRQH.js +0 -38
  474. package/dist/is-global-X2QNCXXB.js +0 -1
  475. package/dist/lib-2BR2WN7L.js +0 -1
  476. package/dist/lib-M72BVWQ3.js +0 -1
  477. package/dist/lib-P3APEIHY.js +0 -1
  478. package/dist/local-HMFFXIE3.js +0 -1
  479. package/dist/metadata-SXJZZMCI.js +0 -1
  480. package/dist/node-package-manager-2D2CIFTG.js +0 -1
  481. package/dist/notifications-system-WH6MAXEN.js +0 -1
  482. package/dist/os-PY42WAOB.js +0 -1
  483. package/dist/output-MSTNB7GI.js +0 -1
  484. package/dist/system-7XRI63YJ.js +0 -1
  485. package/dist/ui-77QYNWJB.js +0 -1
  486. package/dist/upgrade-UVPNOKKK.js +0 -1
  487. package/dist/version-DXGPL73I.js +0 -1
  488. package/dist/version-XMVQO6PD.js +0 -1
  489. package/dist/workerd-SOWC66FA.js +0 -18
@@ -0,0 +1,3 @@
1
+ import{a as ne}from"./chunk-XFZDFDZV.js";import{d as ie}from"./chunk-DGMRL5DQ.js";import{a as se,b as q}from"./chunk-FW5HGFSZ.js";import{B as C,K as L,pa as V,ra as U,sa as X,u as w}from"./chunk-L5XWYTHY.js";import{e as x}from"./chunk-QAXFCAOV.js";import{A as N,B as I,E as re,a as Q,x as te}from"./chunk-SKRUMRB4.js";import{b as K}from"./chunk-YTJ3EPD3.js";import{d as Z,e as ee}from"./chunk-G54BKNIX.js";import{i as F,l as oe}from"./chunk-FCULF3JA.js";import{Cb as R,Eb as l,Ja as W,Nb as h,Ya as _}from"./chunk-YJWNM4XO.js";import{b as Ie}from"./chunk-JA2QZ635.js";import{d as Y,f as k,i as J,q as $}from"./chunk-3VYOLEQE.js";import{e as Te,g as f}from"./chunk-VKWPEFWQ.js";f();var T=Te(Ie(),1);var O={path:T.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>{let e=k(t);return _(e)?W(e)?e:(I({headline:"The path must be a directory, not a file.",body:[`The provided path is not a directory: ${e}`,`Did you mean: ${J(e)}`]}),process.exit(1)):(I({headline:"A path was explicitly provided but doesn't exist.",body:[`Please check the path and try again: ${e}`]}),process.exit(1))},default:async()=>$(),noCacheDefault:!0}),password:T.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:T.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async t=>w(t)}),environment:T.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},ae="Wrap the value in double quotes if you're using wildcards.",qe=t=>({only:T.Flags.string({char:"o",multiple:!0,description:`${t.charAt(0).toUpperCase()+t.slice(1)} only the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:T.Flags.string({char:"x",multiple:!0,description:`Skip ${t}ing the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_IGNORE"})});f();f();import{AsyncLocalStorage as _e}from"node:async_hooks";var pe=new _e,ce,ue,me,de;function S(){return ce??=new x({projectName:"shopify-cli-theme-conf"}),ce}function j(){return ue??=new x({projectName:"shopify-cli-development-theme-config"}),ue}function D(){return me??=new x({projectName:"shopify-cli-repl-theme-config"}),me}function M(){return de??=new x({projectName:"shopify-cli-theme-store-password"}),de}function B(t=S()){return pe.getStore()?.store??t.get("themeStore")}function fe(t,e=S()){e.set("themeStore",t)}function He(t=S()){return h(l`Getting development theme...`),j().get(v(t))}function ze(t,e=S()){h(l`Setting development theme...`),j().set(v(e),t)}function Ye(t=S()){h(l`Removing development theme...`),j().delete(v(t))}function Je(t=S()){return h(l`Getting REPL theme...`),D().get(v(t))}function We(t,e=S()){h(l`Setting REPL theme to ${t}...`),D().set(v(e),t)}function Ke(t=S()){h(l`Removing REPL theme...`),D().delete(v(t))}function Qe(t=S()){let e=v(t);return h(l`Getting storefront password for shop ${e}...`),M().get(e)}function Ve(t,e=S()){let o=v(e);h(l`Setting storefront password for shop ${o}...`),M().set(o,t)}function Xe(t=S()){let e=v(t);h(l`Removing storefront password for ${e}...`),M().delete(e)}function v(t=S()){let e=B(t);if(!e)throw new oe("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function he(t,e){return pe.run({store:t},e)}function le(t){let e=t.store??B();if(!e)throw V(new F("A store is required",`Specify the store passing ${l`${R.genericShellCommand(`--${O.store.name}=example.myshopify.com`)}`.value} or set the ${l`${R.genericShellCommand(O.store.env)}`.value} environment variable.`));return fe(e),e}f();f();var Se="shopify.theme.toml",ct=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ut=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],mt=50;f();f();var G="7e9cb568cfd431c538f36d1ad3f2b4f6";var Fe="shopify-cli-store",be=240*1e3,ge;function P(){return ge??=new x({projectName:Fe}),ge}function b(t){return`${G}::${Ee(t)}`}function Ee(t){return t.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function d(t){return typeof t=="string"}function ke(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.id=="number")return{id:e.id,...d(e.email)?{email:e.email}:{},...d(e.firstName)?{firstName:e.firstName}:{},...d(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function $e(t){if(!t||typeof t!="object")return;let e=t;if(!(!d(e.shopId)||!d(e.name)||!d(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...d(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...d(e.country)?{country:e.country}:{},...d(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function Pe(t){if(!t||typeof t!="object")return;let e=t;if(!d(e.store)||!d(e.clientId)||!d(e.userId)||!d(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(d)||!d(e.acquiredAt))return;let o=ke(e.associatedUser),r=e.kind==="preview"?"preview":"standard",n=r==="preview"?$e(e.preview):void 0;if(!(r==="preview"&&!n))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...d(e.refreshToken)?{refreshToken:e.refreshToken}:{},...d(e.expiresAt)?{expiresAt:e.expiresAt}:{},...d(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function ye(t,e,o){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:n}=e;if(!(r!==void 0||n!==void 0))return;let s=b(t);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(s);return}let a=Object.fromEntries(Object.entries(r).flatMap(([u,c])=>{let p=Pe(c);return p?[[u,p]]:[]}));if(Object.keys(a).length!==Object.keys(r).length)if(a[n])o.set(s,{currentUserId:n,sessionsByUserId:a});else{o.delete(s);return}return{currentUserId:n,sessionsByUserId:a}}function H(t,e){return ye(t,e.get(b(t)),e)}function Ce(t){return t.config?.store??{}}function we(t=P()){let e=[],o=`${G}::`;for(let[r,n]of Object.entries(Ce(t))){if(!r.startsWith(o))continue;let i=ye(r.slice(o.length),n,t),s=i?.sessionsByUserId[i.currentUserId];s&&e.push(s)}return e}function Ae(t,e=P()){let o=w(t),r=H(o,e);if(!r)return;let n=r.sessionsByUserId[r.currentUserId];if(!n){e.delete(b(o));return}return n}function wt(t,e=P()){let o=b(t.store),r=H(t.store,e),n={currentUserId:t.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[t.userId]:t}};e.set(o,n)}function At(t,e,o){let r=w(t),n=typeof e=="string"?e:void 0,i=(typeof e=="string"?o:e)??P(),s=b(r);if(!n){i.delete(s);return}let a=H(r,i);if(!a)return;let{[n]:u,...c}=a.sessionsByUserId,p=Object.keys(c);if(p.length===0){i.delete(s);return}i.set(s,{currentUserId:a.currentUserId===n?p[0]:a.currentUserId,sessionsByUserId:c})}function ve(t){if(!t.expiresAt)return!1;let e=new Date(t.expiresAt).getTime();return Number.isNaN(e)?!0:e-be<Date.now()}var z=class extends q{static baseFlags={...q.baseFlags,...ie};environmentsFilename(){return Se}async command(e,o,r=!1,n,i){}async run(e){let o=this.constructor,r=o.multiEnvironmentsFlags,{args:n,flags:i}=await this.parse(o),s="password"in o.flags,a=(Array.isArray(i.environment)?i.environment:[i.environment]).filter(Boolean),u=r!==null&&r.some(m=>Array.isArray(m)?m.includes("store"):m==="store");if(a.length<=1){if(a[0]&&!i.store&&u)throw new F("Please provide a valid environment.");let m=s?await this.createSession(i):void 0,A=this.constructor.name.toLowerCase();if(U(`theme-command:${A}:single-env:authenticated`),i.path&&!_(i.path))throw new F(`Path does not exist: ${i.path}`);try{await this.command(i,m,!1,n)}finally{await this.logAnalyticsData(m)}return}if(r===null){N({body:"This command does not support multiple environments."});return}let{flags:c}=await this.parse(se(o),this.argv);if("path"in c){this.errorOnGlobalPath();return}let p=await this.loadEnvironments(a,i,c),g=await this.validateEnvironments(p,r,s);"force"in o.flags&&!i.force&&!await this.showConfirmation(this.constructor.name,r,g)||await this.runConcurrent(g.valid)}storeAuthScopes(){}async loadEnvironments(e,o,r){let n=new Map;for(let i of e){let s=await ne(i,"shopify.theme.toml",{from:o.path,silent:!0});s?.store&&typeof s.store=="string"&&(s.store=w(s.store)),s?.path&&typeof s.path=="string"&&(s.path=k(s.path)),n.set(i,{flags:{...o,...s,...r,environment:[i]},validationFlags:{...s,...r}})}return n}async validateEnvironments(e,o,r){let n=[],i=[],s=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:u})=>u)):new Map,a=Array.from(e.entries()).map(([u,{flags:c,validationFlags:p}])=>({environmentName:u,flags:c,validationFlags:p,storeAuthSession:this.storeAuthSessionFromCache(p,s)}));for(let{environmentName:u,flags:c,validationFlags:p,storeAuthSession:g}of a){let y=this.validConfig(p,o,u,g);if(y!==!0){let m=y.join(", ");i.push({environment:u,reason:`Missing flags: ${m}`});continue}n.push({environment:u,flags:c,requiresAuth:r,storeAuthSession:g})}return{valid:n,invalid:i}}async showConfirmation(e,o,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},a=[...r.valid.map(({environment:u,flags:c})=>{let p=o.map(g=>{let y=Array.isArray(g)?g.find(m=>c[m]):g;if(y==="password")return"password";if(y==="path"&&typeof c.path=="string"){let m=c.path.split(/[/\\]/);if(m.length===1)return`path: ${c.path}`;let A=m[0]===""?`/${m[1]}`:m[0],E=m.at(-1);return`path: ${A}/.../${E}`}return y&&`${y}: ${c[y]}`}).join(", ");return[u,{subdued:p||"No flags required"}]}),...r.invalid.map(({environment:u,reason:c})=>[u,{error:`Skipping | ${c}`}])];return s.infoTable={Environment:a},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),re(s)}async runConcurrent(e){let o=new Q,r=e.map(s=>s.flags.store),n=new Set(r),i=r.length===n.size?[e]:this.createSequentialGroups(e);for(let s of i)await te({processes:s.map(({environment:a,flags:u,requiresAuth:c,storeAuthSession:p})=>({prefix:a,action:async(g,y,m)=>{try{let A=u.store;await he(A,async()=>{let E=c?await this.createSession(u,p):void 0,xe=this.constructor.name.toLowerCase();U(`theme-command:${xe}:multi-env:authenticated`);try{await this.command(u,E,!0,{},{stdout:g,stderr:y})}finally{await this.logAnalyticsData(E)}})}catch(A){A instanceof Error&&(A.message=`Environment ${a} failed:
2
+
3
+ ${A.message}`,I({body:[A.message]}))}}})),abortSignal:o.signal,showTimestamps:!0,renderOptions:{stdout:process.stderr}})}createSequentialGroups(e){let o=[];return e.forEach(r=>{let n=o.find(i=>!i.some(s=>s.flags.store===r.flags.store));n?n.push(r):o.push([r])}),o}async createSession(e,o){let r=le({store:e.store}),n=e.password;return n?await L(r,n):o??await this.storeAuthSessionForTheme({store:r})??await L(r,n)}async storeAuthSessionForTheme(e){let o=this.storeAuthScopes();if(!o)return;let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!r||n)return;let i=w(r),s=Ae(i);if(s)return this.adminSessionFromStoreAuthSession(s,i,o)}storeAuthSessionsForTheme(e){let o=this.storeAuthScopes();if(!o)return new Map;let r=new Set(e.filter(({store:n,password:i})=>typeof n=="string"&&!i).map(({store:n})=>w(n)));return r.size===0?new Map:new Map(we().map(n=>{let i=w(n.store);if(!r.has(i))return;let s=this.adminSessionFromStoreAuthSession(n,i,o);return s?[i,s]:void 0}).filter(n=>n!==void 0))}storeAuthSessionFromCache(e,o){let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!(!r||n))return o.get(w(r))}adminSessionFromStoreAuthSession(e,o,r){if(ve(e)){h(`Ignoring stored store auth session for ${o}: it expired at ${e.expiresAt??"unknown"}.`);return}if(!this.hasRequiredStoreAuthScopes(e.scopes,r)){h(`Ignoring stored store auth session for ${o}: it is missing required scopes (has: ${e.scopes.join(", ")}; needs: ${r.join(", ")}).`);return}return h(`Using stored store auth session for ${o} (scopes: ${e.scopes.join(", ")}).`),C(e.userId),{token:e.accessToken,storeFqdn:o}}expandImpliedStoreAuthScopes(e){let o=new Set(e);for(let r of e){let n=r.match(/^(unauthenticated_)?write_(.*)$/);n&&o.add(`${n[1]??""}read_${n[2]}`)}return o}hasRequiredStoreAuthScopes(e,o){let r=this.expandImpliedStoreAuthScopes(e);return o.every(n=>r.has(n))}validConfig(e,o,r,n){let i=o.filter(s=>Array.isArray(s)?!s.some(a=>this.hasRequiredFlag(e,a,n)):!this.hasRequiredFlag(e,s,n)).map(s=>Array.isArray(s)?s.join(" or "):s);return i.length>0?(N({body:[`Missing required flags in environment configuration${r?` for ${r}`:""}:`,{list:{items:i}}]}),i):!0}hasRequiredFlag(e,o,r){return o==="password"&&r?!0:!!e[o]}errorOnGlobalPath(){let e=Y($(),"shopify.theme.toml"),o=_(e);I({body:["Can't use `--path` flag with multiple environments.",...o?["Configure each environment's theme path in your shopify.theme.toml file instead."]:["Run this command from the directory containing shopify.theme.toml.","No shopify.theme.toml found in current directory."]]})}async logAnalyticsData(e){if(!e)return;let o=X();await Z(()=>({store_fqdn_hash:K(e.storeFqdn),store_domain:e.storeFqdn,cmd_theme_timings:JSON.stringify(o.timings),cmd_theme_errors:JSON.stringify(o.errors),cmd_theme_retries:JSON.stringify(o.retries),cmd_theme_events:JSON.stringify(o.events)})),await ee(()=>({store_fqdn:e.storeFqdn}))}};export{G as a,we as b,Ae as c,wt as d,At as e,B as f,He as g,ze as h,Ye as i,Je as j,We as k,Ke as l,Qe as m,Ve as n,Xe as o,O as p,qe as q,le as r,ct as s,ut as t,mt as u,z as v};
@@ -1,4 +1,4 @@
1
- import{c as gI,e as nA,f as mI,h as oA,l as y7,n as Bu,s as $5,u as iA,v as lA,w as cA}from"./chunk-Q7BOSHWX.js";import{a as fI}from"./chunk-WKTIQUQP.js";import{a as aA}from"./chunk-CBGDD3ZG.js";import{c as tA,e as rA}from"./chunk-5N33O2RV.js";import{D as tf,E as vI,X as pCe,k as mCe,r as R4}from"./chunk-KYNXMDFU.js";import{d as b}from"./chunk-PSSOCUUD.js";import{d as $F}from"./chunk-K5OTE6CX.js";import{a as jF}from"./chunk-UDWSRNKO.js";import{h as eA}from"./chunk-W3BNL2Q5.js";import{Ab as b7}from"./chunk-G5QSVBYP.js";import{a as j5,c as m,e as ps,g as o}from"./chunk-VKWPEFWQ.js";var uA=m(Vi=>{"use strict";o();var bCe=b();function sA(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e1(){}var Gi={d:{f:e1,r:function(){throw Error(sA(522))},D:e1,C:e1,L:e1,m:e1,X:e1,S:e1,M:e1},p:0,findDOMNode:null},yCe=Symbol.for("react.portal");function ICe(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yCe,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}var rf=bCe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function k4(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Vi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gi;Vi.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(sA(299));return ICe(e,t,null,r)};Vi.flushSync=function(e){var t=rf.T,r=Gi.p;try{if(rf.T=null,Gi.p=2,e)return e()}finally{rf.T=t,Gi.p=r,Gi.d.f()}};Vi.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Gi.d.C(e,t))};Vi.prefetchDNS=function(e){typeof e=="string"&&Gi.d.D(e)};Vi.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,a=k4(r,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?Gi.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:i}):r==="script"&&Gi.d.X(e,{crossOrigin:a,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Vi.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=k4(t.as,t.crossOrigin);Gi.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Gi.d.M(e)};Vi.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,a=k4(r,t.crossOrigin);Gi.d.L(e,r,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Vi.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=k4(t.as,t.crossOrigin);Gi.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Gi.d.m(e)};Vi.requestFormReset=function(e){Gi.d.r(e)};Vi.unstable_batchedUpdates=function(e,t){return e(t)};Vi.useFormState=function(e,t,r){return rf.H.useFormState(e,t,r)};Vi.useFormStatus=function(){return rf.H.useHostTransitionStatus()};Vi.version="19.2.4"});var dA=m(Yi=>{"use strict";o();process.env.NODE_ENV!=="production"&&(function(){function e(){}function t(y){return""+y}function r(y,S,E){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(w);var M=!1}catch{M=!0}return M&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object"),t(w)),{$$typeof:f,key:w==null?null:""+w,children:y,containerInfo:S,implementation:E}}function a(y,S){if(y==="font")return"";if(typeof S=="string")return S==="use-credentials"?S:""}function n(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":'something with type "'+typeof y+'"'}function i(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":typeof y=="string"?JSON.stringify(y):typeof y=="number"?"`"+y+"`":'something with type "'+typeof y+'"'}function u(){var y=I.H;return y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1
+ import{c as gI,e as nA,f as mI,h as oA,l as y7,n as Bu,s as $5,u as iA,v as lA,w as cA}from"./chunk-Q7BOSHWX.js";import{a as fI}from"./chunk-CHLSNYF7.js";import{a as aA}from"./chunk-2KLXRVGQ.js";import{c as tA,e as rA}from"./chunk-NYABB6XW.js";import{O as pCe,b as mCe,j as R4,u as tf,v as vI}from"./chunk-L5XWYTHY.js";import{a as jF}from"./chunk-RGIUP4FW.js";import{d as b}from"./chunk-SKRUMRB4.js";import{d as $F}from"./chunk-OEZATTOS.js";import{i as eA}from"./chunk-FCULF3JA.js";import{Nb as b7}from"./chunk-YJWNM4XO.js";import{a as j5,c as m,e as ps,g as o}from"./chunk-VKWPEFWQ.js";var uA=m(Vi=>{"use strict";o();var bCe=b();function sA(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e1(){}var Gi={d:{f:e1,r:function(){throw Error(sA(522))},D:e1,C:e1,L:e1,m:e1,X:e1,S:e1,M:e1},p:0,findDOMNode:null},yCe=Symbol.for("react.portal");function ICe(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yCe,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}var rf=bCe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function k4(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Vi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gi;Vi.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(sA(299));return ICe(e,t,null,r)};Vi.flushSync=function(e){var t=rf.T,r=Gi.p;try{if(rf.T=null,Gi.p=2,e)return e()}finally{rf.T=t,Gi.p=r,Gi.d.f()}};Vi.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Gi.d.C(e,t))};Vi.prefetchDNS=function(e){typeof e=="string"&&Gi.d.D(e)};Vi.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,a=k4(r,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?Gi.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:i}):r==="script"&&Gi.d.X(e,{crossOrigin:a,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Vi.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=k4(t.as,t.crossOrigin);Gi.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Gi.d.M(e)};Vi.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,a=k4(r,t.crossOrigin);Gi.d.L(e,r,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Vi.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=k4(t.as,t.crossOrigin);Gi.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Gi.d.m(e)};Vi.requestFormReset=function(e){Gi.d.r(e)};Vi.unstable_batchedUpdates=function(e,t){return e(t)};Vi.useFormState=function(e,t,r){return rf.H.useFormState(e,t,r)};Vi.useFormStatus=function(){return rf.H.useHostTransitionStatus()};Vi.version="19.2.4"});var dA=m(Yi=>{"use strict";o();process.env.NODE_ENV!=="production"&&(function(){function e(){}function t(y){return""+y}function r(y,S,E){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(w);var M=!1}catch{M=!0}return M&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&w[Symbol.toStringTag]||w.constructor.name||"Object"),t(w)),{$$typeof:f,key:w==null?null:""+w,children:y,containerInfo:S,implementation:E}}function a(y,S){if(y==="font")return"";if(typeof S=="string")return S==="use-credentials"?S:""}function n(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":'something with type "'+typeof y+'"'}function i(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":typeof y=="string"?JSON.stringify(y):typeof y=="number"?"`"+y+"`":'something with type "'+typeof y+'"'}function u(){var y=I.H;return y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
2
2
  1. You might have mismatching versions of React and the renderer (such as React DOM)
3
3
  2. You might be breaking the Rules of Hooks
4
4
  3. You might have more than one copy of React in the same app
@@ -0,0 +1,11 @@
1
+ import{a as E}from"./chunk-FKIVKNOV.js";import{a as P}from"./chunk-YGFEUXKQ.js";import{a as w}from"./chunk-JTPVSO6Y.js";import{Ha as y,L as F,i as C,ja as x}from"./chunk-2KLXRVGQ.js";import{b as f}from"./chunk-LV2IWYGL.js";import{b as v}from"./chunk-DGMRL5DQ.js";import{Cb as o,Eb as p,Ib as h,Xa as g,qa as u,ya as l}from"./chunk-YJWNM4XO.js";import{b as $}from"./chunk-JA2QZ635.js";import{f as c}from"./chunk-3VYOLEQE.js";import{e as _,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function S({app:d,remoteApp:t,organization:a,envFile:e}){await x(t,a.source);let n={SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:C(d.configuration)};if(await g(e)){let i=await u(e),r=f(i,n);if(r===i)return p`No changes to ${o.path(e)}`;{await l(e,r);let I=E(i??"",r);return p`Updated ${o.path(e)} to be:
2
+
3
+ ${r}
4
+
5
+ Here's what changed:
6
+
7
+ ${o.linesDiff(I)}
8
+ `}}else{let i=f(null,n);return await l(e,i),p`Created ${o.path(e)}:
9
+
10
+ ${i}
11
+ `}}var b=_($(),1);var m=class d extends P{static summary="Pull app and extensions environment variables.";static descriptionWithMarkdown="Creates or updates an `.env` files that contains app and app extension environment variables.\n\n When an existing `.env` file is updated, changes to the variables are displayed in the terminal output. Existing variables and commented variables are preserved.";static description=this.descriptionForHelp();static flags={...v,...w,"env-file":b.Flags.string({hidden:!1,description:"Specify an environment file to update if the update flag is set",env:"SHOPIFY_FLAG_ENV_FILE"})};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:e,organization:n}=await y({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),i=c(a.directory,t["env-file"]??F(a.configPath));return h(await S({app:a,remoteApp:e,organization:n,envFile:i})),{app:a}}};export{m as a};
@@ -0,0 +1 @@
1
+ import{a as j}from"./chunk-YGFEUXKQ.js";import{a as C}from"./chunk-JTPVSO6Y.js";import{Ha as O,ia as N}from"./chunk-2KLXRVGQ.js";import{b as R,c as k}from"./chunk-DGMRL5DQ.js";import{G as w}from"./chunk-SKRUMRB4.js";import{a as y}from"./chunk-5RL6DKWR.js";import{i as S}from"./chunk-FCULF3JA.js";import{Cb as x,Eb as E,Ib as I,Kb as f,Tb as b,b as o,fa as v}from"./chunk-YJWNM4XO.js";import{i as T}from"./chunk-B4OMIONW.js";import{j as L}from"./chunk-3VYOLEQE.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var B=o.object({createdAt:o.string(),createdBy:o.string(),versionTag:o.string().nullable().optional(),status:o.string(),versionId:o.string(),message:o.string()}),u=y({name:"AppVersionsListResult",schema:o.array(B),definitions:{AppVersion:B}});r();async function M(i,t){let n=await i.appVersions(t);if(!n.app)throw new S(`Shopify did not return app information for API key ${t.apiKey}.`);return{appVersions:n.app.appVersions.nodes.map(e=>({createdAt:v(new Date(e.createdAt)),createdBy:e.createdBy?.displayName??"",versionTag:e.versionTag,status:e.status,versionId:e.versionId,message:e.message??""})),totalResults:n.app.appVersions.pageInfo.totalResults}}r();var $=12;async function D({app:i,appVersions:t,totalResults:n,remoteApp:e,organization:p,developerPlatformClient:m},d){if(d==="json"){I(u.encode(t));return}if(N({org:p.businessName,appName:e.title,configFile:L(i.configPath)}),t.length===0){f("No app versions found for this app");return}let g=t.map(({versionId:s,...a})=>({...a,status:a.status==="active"?T.green(`\u2605 ${a.status}`):a.status})),l=(process.stdout.columns??75)-$,c=l;g.forEach(s=>{let a=s.message.length+(s.versionTag?.length??0)+b(s.status).length+s.createdAt.length+s.createdBy.length;if(a>l){let J=a-s.message.length,A=Math.max(l-J,10);A<c&&(c=A)}}),g.forEach(s=>{s.message.length>c&&(s.message=`${s.message.slice(0,c-3)}...`)}),w({rows:g,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let F=x.link(m.webUiName,[await m.appDeepLink(e),"versions"].join("/"));f(E`\nView all ${String(n)} app versions in the ${F}`)}var h=class i extends j{static summary="List deployed versions of your app.";static descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";static get jsonOutputSchema(){return u}static description=this.descriptionForHelp();static flags={...R,...C,...k};async run(){let{flags:t}=await this.parse(i),{app:n,remoteApp:e,developerPlatformClient:p,organization:m}=await O({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),d=await M(p,e);return await D({app:n,remoteApp:e,organization:m,developerPlatformClient:p,...d},t.json?"json":"text"),{app:n}}};export{h as a};
@@ -1 +1 @@
1
- import{r as a}from"./chunk-KYNXMDFU.js";import{h as s}from"./chunk-W3BNL2Q5.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var n={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},p={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function c(t,e){let r=T(t);return r===n.LOCALHOST&&e===n.HTTP?!0:r===e}function l(t){return p.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function d(t,e){if(!c(t,e))throw new s(`Can't deliver your webhook payload to this address using '${e}'`,"Use a valid URL for address",f(e));let r=e;return l(t)&&(r=n.LOCALHOST),[t.trim(),r]}function f(t){return t===n.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===n.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===n.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function g(t,e){if(e.includes(t))return t;throw new s(`Api Version '${t}' does not exist`,`Allowed values: ${e.join(", ")}`,["Try again with a valid api-version value"])}function A(t,e,r){if(r.length===0)throw new s(`No topics found for '${e}'`);let o=h(t.trim(),r);if(o===void 0)throw new s(`Topic '${t}' does not exist for ApiVersion '${e}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return o}function h(t,e){return e.includes(t)?t:e.find(r=>r.toUpperCase().replace("/","_")===t)}function T(t){if(t){if(t.startsWith("pubsub:"))return n.PUBSUB;if(t.startsWith("arn:aws:events:"))return n.EVENTBRIDGE;if(l(t))return n.LOCALHOST;if(p.HTTP.test(t))return n.HTTP}}i();async function O(t,e,r){let{sendSampleWebhook:o}=await t.sendSampleWebhook(e,r);return o}i();async function H(t,e,r){let o={method:"POST",body:e,headers:{"Content-Type":"application/json",...JSON.parse(r)}},u=await a(t,o);return u.status>=200&&u.status<300}i();async function m(t,e){let{publicApiVersions:r}=await t.apiVersions(e),o=r.indexOf("unstable");return o===-1?r.sort().reverse():(r.splice(o,1),r.sort().reverse(),r.push("unstable")),r}export{m as a,O as b,H as c,n as d,c as e,d as f,g,A as h,T as i};
1
+ import{j as a}from"./chunk-L5XWYTHY.js";import{i as s}from"./chunk-FCULF3JA.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var n={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},p={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function c(t,e){let r=T(t);return r===n.LOCALHOST&&e===n.HTTP?!0:r===e}function l(t){return p.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function d(t,e){if(!c(t,e))throw new s(`Can't deliver your webhook payload to this address using '${e}'`,"Use a valid URL for address",f(e));let r=e;return l(t)&&(r=n.LOCALHOST),[t.trim(),r]}function f(t){return t===n.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===n.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===n.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function g(t,e){if(e.includes(t))return t;throw new s(`Api Version '${t}' does not exist`,`Allowed values: ${e.join(", ")}`,["Try again with a valid api-version value"])}function A(t,e,r){if(r.length===0)throw new s(`No topics found for '${e}'`);let o=h(t.trim(),r);if(o===void 0)throw new s(`Topic '${t}' does not exist for ApiVersion '${e}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return o}function h(t,e){return e.includes(t)?t:e.find(r=>r.toUpperCase().replace("/","_")===t)}function T(t){if(t){if(t.startsWith("pubsub:"))return n.PUBSUB;if(t.startsWith("arn:aws:events:"))return n.EVENTBRIDGE;if(l(t))return n.LOCALHOST;if(p.HTTP.test(t))return n.HTTP}}i();async function O(t,e,r){let{sendSampleWebhook:o}=await t.sendSampleWebhook(e,r);return o}i();async function H(t,e,r){let o={method:"POST",body:e,headers:{"Content-Type":"application/json",...JSON.parse(r)}},u=await a(t,o);return u.status>=200&&u.status<300}i();async function m(t,e){let{publicApiVersions:r}=await t.apiVersions(e),o=r.indexOf("unstable");return o===-1?r.sort().reverse():(r.splice(o,1),r.sort().reverse(),r.push("unstable")),r}export{m as a,O as b,H as c,n as d,c as e,d as f,g,A as h,T as i};
@@ -1,5 +1,5 @@
1
- import{a as C}from"./chunk-PU6KWWVK.js";import{b as ne,c as re}from"./chunk-MNYKIPG7.js";import{c as ee,d as te}from"./chunk-LZZAD3FW.js";import{A as M}from"./chunk-CWSQIPY5.js";import{a as Z}from"./chunk-34PQ6LJC.js";import{a as Q}from"./chunk-4JU7N2OF.js";import{wa as X}from"./chunk-CBGDD3ZG.js";import{b as z,c as Y,f as V}from"./chunk-2IZROVCY.js";import{F as K,a as b,d as v,e as l,f as s,g as j,h as G,i as H,l as J,m as q,n as x,t as R}from"./chunk-PSSOCUUD.js";import{h as O}from"./chunk-W3BNL2Q5.js";import{a as ye}from"./chunk-CTNBSUVU.js";import{a as B}from"./chunk-PIQI72DV.js";import{ma as N}from"./chunk-G5QSVBYP.js";import{f as U}from"./chunk-2Z52XJQG.js";import{d as I}from"./chunk-773TIA5M.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(v(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,h.useState)([]),[p,m]=(0,h.useState)([a,a]),[y,d]=(0,h.useState)(void 0),{input:w,export:_}=e.payload,[fe,k]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let A=new b;t.signal.addEventListener("abort",()=>{A.abort()});let $=async()=>{let E=await we(r,JSON.stringify(w),_);m(g=>[E,g[0]]),k(`Watching for changes to ${e.source}...`),f(g=>[...g,E])},de=async()=>{k("Replaying log with local function..."),await $()},ge=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==ee.Updated)){if(F.buildResult?.status==="error"){d(`Error while reloading and building extension: ${F.buildResult?.error}`);return}d(void 0),k("Re-running with latest changes..."),await $()}});let E=new oe({write(g,F,L){f(he=>[...he,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:E,stderr:E,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[w,_,o,r]),R(t.signal,async()=>{setTimeout(()=>{U()||B(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:y}}async function we(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await C({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(v(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=R(t.signal),{isRawModeSupported:a}=G(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:y}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return H((d,w)=>{q(d,w,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,w)=>n.default.createElement(l,{key:`replayOutputScrollerLog${w}`,flexDirection:"column"},n.default.createElement(Re,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",p)),n.default.createElement(be,{recentFunctionRuns:m}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
1
+ import{a as C}from"./chunk-G7OIACY5.js";import{b as ne,c as re}from"./chunk-AD4S2VEI.js";import{c as ee,d as te}from"./chunk-KVROYIUQ.js";import{A as M}from"./chunk-55PABKRC.js";import{a as Z}from"./chunk-YGFEUXKQ.js";import{a as Q}from"./chunk-JTPVSO6Y.js";import{Ha as X}from"./chunk-2KLXRVGQ.js";import{b as z,c as Y,f as V}from"./chunk-DGMRL5DQ.js";import{F as K,a as b,d as v,e as l,f as s,g as j,h as H,i as G,l as J,m as q,n as x,t as R}from"./chunk-SKRUMRB4.js";import{i as O}from"./chunk-FCULF3JA.js";import{a as B}from"./chunk-BJOJNAKH.js";import{qa as N}from"./chunk-YJWNM4XO.js";import{g as U}from"./chunk-SGBLCVUX.js";import{b as ye}from"./chunk-JA2QZ635.js";import{d as I}from"./chunk-3VYOLEQE.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(v(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,h.useState)([]),[p,m]=(0,h.useState)([a,a]),[y,d]=(0,h.useState)(void 0),{input:E,export:_}=e.payload,[fe,k]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let A=new b;t.signal.addEventListener("abort",()=>{A.abort()});let $=async()=>{let w=await Ee(r,JSON.stringify(E),_);m(g=>[w,g[0]]),k(`Watching for changes to ${e.source}...`),f(g=>[...g,w])},de=async()=>{k("Replaying log with local function..."),await $()},ge=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==ee.Updated)){if(F.buildResult?.status==="error"){d(`Error while reloading and building extension: ${F.buildResult?.error}`);return}d(void 0),k("Re-running with latest changes..."),await $()}});let w=new oe({write(g,F,L){f(he=>[...he,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:w,stderr:w,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[E,_,o,r]),R(t.signal,async()=>{setTimeout(()=>{U()||B(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:y}}async function Ee(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await C({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(v(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=R(t.signal),{isRawModeSupported:a}=H(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:y}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return G((d,E)=>{q(d,E,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,E)=>n.default.createElement(l,{key:`replayOutputScrollerLog${E}`,flexDirection:"column"},n.default.createElement(Re,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",p)),n.default.createElement(be,{recentFunctionRuns:m}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
2
2
 
3
3
  `,r,e,r,`
4
- `)}function Ee({input:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,M(e)))}function Fe({logs:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function xe({output:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,M(e)))}function Se({functionRun:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Benchmark Results",backgroundColor:"green"}),n.default.createElement(s,null,"Name: ",e.name),n.default.createElement(s,null,"Linear Memory Usage: ",e.memory_usage,"KB"),n.default.createElement(s,null,"Instructions: ",e.instructions/1e3,"K"),n.default.createElement(s,null,"Size: ",e.size,"KB"))}function be({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(s,null,x.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Re({log:e}){switch(e.type){case"functionRun":return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(Ee,{input:e.input}),n.default.createElement(Fe,{logs:e.logs}),n.default.createElement(xe,{output:e.output}),n.default.createElement(Se,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var se=S(v(),1);async function ce({selectedRun:e,abortController:t,app:o,extension:r}){return J(se.default.createElement(ae,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function le(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await K({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as Ce,readdirSync as De}from"fs";var T=100;async function ue(e){let{watch:t,extension:o,app:r}=e,i=new b;try{let a=r.getLogsDir(),u=e.log?await ke(a,o.handle,e.log):await Le(a,o.handle),{input:f,export:p}=u.payload;t?await ce({selectedRun:u,abortController:i,app:r,extension:o}):await C({functionExtension:o,json:e.json,input:JSON.stringify(f),export:p})}catch(a){throw i.abort(),a}}async function ke(e,t,o){let r=await Ae(e,t,o);if(r===void 0)throw new O(`No log found for '${o}'.
5
- Searched ${e} for function ${t}.`);let i=await N(r);return JSON.parse(i)}function me(e){let t=e.split(/[_.]/);if(!(t.length<6))return{namespace:t[3],functionHandle:t[4],identifier:t[5]}}async function Ae(e,t,o){let r=pe(e).find(i=>{let a=me(i);return a?.namespace==="extensions"&&a?.functionHandle===t&&a?.identifier===o});return r?I(e,r):void 0}async function Le(e,t){let o=await Ie(e,t),r=await le(o);if(r===void 0)throw new O(`No logs found in ${e}`);return r}async function Ie(e,t){let o=pe(e).filter(i=>{let a=me(i);return a?.namespace==="extensions"&&a?.functionHandle===t}).reverse(),r=[];for(let i=0;i<o.length&&r.length<T;i+=T){let u=o.slice(i,i+T).map(m=>I(e,m)),p=(await Promise.all(u.map(async m=>{let y=await N(m);return{...JSON.parse(y),identifier:Ne(m)}}))).filter(m=>m.payload.input!=null);r=r.concat(p)}return r}function Ne(e){return e.split("_").pop().substring(0,6)}function pe(e){return Ce(e)?De(e):[]}var P=S(ye(),1),W=class e extends Z{static get requiresSyncAnalytics(){return!0}static summary="Replays a function run from an app log.";static descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";static description=this.descriptionWithoutMarkdown();static flags={...z,...Q,...ne,...Y,log:V(P.Flags.string({char:"l",description:"Specifies a log identifier to replay instead of selecting from a list. The identifier is provided in the output of `shopify app dev` and is the suffix of the log file name.",env:"SHOPIFY_FLAG_LOG"})),watch:P.Flags.boolean({char:"w",hidden:!1,allowNo:!0,default:!0,description:"Re-run the function when the source code changes.",env:"SHOPIFY_FLAG_WATCH"})};async run(){let{flags:t}=await this.parse(e),{app:o}=await X({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),r=await re(o,t.path);return await ue({app:o,extension:r,path:t.path,log:t.log,json:t.json,watch:t.watch}),{app:o}}};export{W as a};
4
+ `)}function we({input:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,M(e)))}function Fe({logs:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function xe({output:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,M(e)))}function Se({functionRun:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Benchmark Results",backgroundColor:"green"}),n.default.createElement(s,null,"Name: ",e.name),n.default.createElement(s,null,"Linear Memory Usage: ",e.memory_usage,"KB"),n.default.createElement(s,null,"Instructions: ",e.instructions/1e3,"K"),n.default.createElement(s,null,"Size: ",e.size,"KB"))}function be({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(s,null,x.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Re({log:e}){switch(e.type){case"functionRun":return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(we,{input:e.input}),n.default.createElement(Fe,{logs:e.logs}),n.default.createElement(xe,{output:e.output}),n.default.createElement(Se,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var se=S(v(),1);async function ce({selectedRun:e,abortController:t,app:o,extension:r}){return J(se.default.createElement(ae,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function le(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await K({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as Ce,readdirSync as De}from"fs";var T=100;async function ue(e){let{watch:t,extension:o,app:r}=e,i=new b;try{let a=r.getLogsDir(),u=e.log?await ke(a,o.handle,e.log):await Le(a,o.handle),{input:f,export:p}=u.payload;t?await ce({selectedRun:u,abortController:i,app:r,extension:o}):await C({functionExtension:o,json:e.json,input:JSON.stringify(f),export:p})}catch(a){throw i.abort(),a}}async function ke(e,t,o){let r=await Ae(e,t,o);if(r===void 0)throw new O(`No log found for '${o}'.
5
+ Searched ${e} for function ${t}.`);let i=await N(r);return JSON.parse(i)}function me(e){let t=e.split(/[_.]/);if(!(t.length<6))return{namespace:t[3],functionHandle:t[4],identifier:t[5]}}async function Ae(e,t,o){let r=pe(e).find(i=>{let a=me(i);return a?.namespace==="extensions"&&a?.functionHandle===t&&a?.identifier===o});return r?I(e,r):void 0}async function Le(e,t){let o=await Ie(e,t),r=await le(o);if(r===void 0)throw new O(`No logs found in ${e}`);return r}async function Ie(e,t){let o=pe(e).filter(i=>{let a=me(i);return a?.namespace==="extensions"&&a?.functionHandle===t}).reverse(),r=[];for(let i=0;i<o.length&&r.length<T;i+=T){let u=o.slice(i,i+T).map(m=>I(e,m)),p=(await Promise.all(u.map(async m=>{let y=await N(m);return{...JSON.parse(y),identifier:Ne(m)}}))).filter(m=>m.payload.input!=null);r=r.concat(p)}return r}function Ne(e){return e.split("_").pop().substring(0,6)}function pe(e){return Ce(e)?De(e):[]}var P=S(ye(),1),W=class e extends Z{static get requiresSyncAnalytics(){return!0}static summary="Replays a function run from an app log.";static descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";static description=this.descriptionForHelp();static flags={...z,...Q,...ne,...Y,log:V(P.Flags.string({char:"l",description:"Specifies a log identifier to replay instead of selecting from a list. The identifier is provided in the output of `shopify app dev` and is the suffix of the log file name.",env:"SHOPIFY_FLAG_LOG"})),watch:P.Flags.boolean({char:"w",hidden:!1,allowNo:!0,default:!0,description:"Re-run the function when the source code changes.",env:"SHOPIFY_FLAG_WATCH"})};async run(){let{flags:t}=await this.parse(e),{app:o}=await X({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),r=await re(o,t.path);return await ue({app:o,extension:r,path:t.path,log:t.log,json:t.json,watch:t.watch}),{app:o}}};export{W as a};
@@ -0,0 +1,4 @@
1
+ import{a as C}from"./chunk-YGFEUXKQ.js";import{a as k}from"./chunk-JTPVSO6Y.js";import{$ as F,Ha as x,Y as I,Z as E}from"./chunk-2KLXRVGQ.js";import{b as R}from"./chunk-DGMRL5DQ.js";import{B as v,H as h,z as g}from"./chunk-SKRUMRB4.js";import{d as w}from"./chunk-G54BKNIX.js";import{k as A}from"./chunk-FCULF3JA.js";import{b as y}from"./chunk-JA2QZ635.js";import{e as b,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function P(n){let{developerPlatformClient:e,app:l,remoteApp:o}=n,{extensionIdentifiersBreakdown:r,versionDetails:s}=await I(e,o,n.version),i=E({localApp:l,versionAppModules:s.appModuleVersions,activeAppVersion:await e.activeAppVersion(o)});if(!await F({configExtensionIdentifiersBreakdown:i,extensionIdentifiersBreakdown:r,appTitle:o.title,release:!0,allowUpdates:n.force||n.allowUpdates,allowDeletes:n.force||n.allowDeletes}))throw new A;let d=[{title:"Releasing version",task:async m=>{m.appRelease=await e.release({app:o,version:{versionId:s.uuid,appVersionId:s.id}})}}],{appRelease:{appRelease:p}}=await h(d),c=[{link:{label:s.versionTag??void 0,url:s.location}},s.message?`
2
+ ${s.message}`:""];if(p.userErrors&&p.userErrors.length>0){let m=p.userErrors?.map(_=>_.message).join(", ");v({headline:"Version couldn't be released.",body:[...c,`${c.length>0?`
3
+
4
+ `:""}${m}`]})}else g({headline:"Version released to users.",body:c})}var t=b(y(),1);var f=class n extends C{static summary="Release an app version.";static usage="app release --version <version>";static descriptionWithMarkdown="Releases an existing app version. Pass the name of the version that you want to release using the `--version` flag.";static description=this.descriptionForHelp();static flags={...R,...k,"allow-updates":t.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. Required in non-interactive environments unless --allow-deletes is provided.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":t.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. Required in non-interactive environments unless --allow-updates is provided.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),version:t.Flags.string({hidden:!1,description:"The name of the app version to release.",env:"SHOPIFY_FLAG_VERSION",required:!0})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes"]}]}async run(){let{flags:e}=await this.parse(n),l=e["client-id"];await w(()=>({cmd_app_reset_used:e.reset}));let o=e["allow-updates"],r=e["allow-deletes"],s=!!(o&&r),{app:i,remoteApp:u,developerPlatformClient:d}=await x({directory:e.path,clientId:l,forceRelink:e.reset,userProvidedConfigName:e.config});return await P({app:i,remoteApp:u,developerPlatformClient:d,force:s,allowUpdates:o,allowDeletes:r,version:e.version}),{app:i}}};export{f as a};
@@ -1 +1 @@
1
- import{a as q,c as C}from"./chunk-WAZL37JY.js";import{d as x,f as k,u as N}from"./chunk-DKAWQBTI.js";import{a as J}from"./chunk-34PQ6LJC.js";import{a as A,c as E}from"./chunk-4JU7N2OF.js";import{b}from"./chunk-5N33O2RV.js";import{b as O}from"./chunk-2IZROVCY.js";import{k as I,l as y}from"./chunk-KYNXMDFU.js";import{B as v,I as f,z as d}from"./chunk-PSSOCUUD.js";import{h as l}from"./chunk-W3BNL2Q5.js";import{Ta as g,ma as h,qb as c,sb as s,ua as w,wb as S}from"./chunk-G5QSVBYP.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();var F=Q(I(),1);async function z(a,e){if(a)try{return JSON.parse(a)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new l(s`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await g(e))throw new l(s`Variable file not found at ${c.path(e)}. Please check the path and try again.`);let t=await h(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:"Unknown error";throw new l(s`Invalid JSON in variable file ${c.path(e)}: ${n}`,"Please provide valid JSON format.")}}}async function M(a){let{remoteApp:e,store:t,query:r,variables:n,variableFile:$,version:L,outputFile:u}=a,{adminSession:R,version:V}=await f({title:s`Authenticating`,task:async()=>{let o=await q(e,t.shopDomain),i=await k({adminSession:o,userSpecifiedVersion:L});return{adminSession:o,version:i}},renderOptions:{stdout:process.stderr}}),G=await z(n,$);x(r),C(r,t);try{let o=await f({title:s`Executing GraphQL operation`,task:async()=>b({query:(0,F.parse)(r),session:R,variables:G,version:V,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),i=JSON.stringify(o,null,2);u?(await w(u,i),d({headline:"Operation succeeded.",body:`Results written to ${u}`})):(d({headline:"Operation succeeded."}),S(i))}catch(o){if(o instanceof y){let i={errors:o.response.errors},P=JSON.stringify(i,null,2);v({headline:"GraphQL operation failed.",body:P});return}throw o}}var m=class a extends J{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static description=this.descriptionWithoutMarkdown();static flags={...O,...A,...E};async run(){let{flags:e}=await this.parse(a),{query:t,appContextResult:r,store:n}=await N(e);return await M({organization:r.organization,remoteApp:r.remoteApp,store:n,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{m as a};
1
+ import{a as F,c as q}from"./chunk-HSZC2LBB.js";import{d as x,f as A,u as N}from"./chunk-3AASYIOA.js";import{a as J}from"./chunk-YGFEUXKQ.js";import{a as k,c as E}from"./chunk-JTPVSO6Y.js";import{b}from"./chunk-NYABB6XW.js";import{b as O}from"./chunk-DGMRL5DQ.js";import{b as I,c as y}from"./chunk-L5XWYTHY.js";import{B as v,I as f,z as d}from"./chunk-SKRUMRB4.js";import{i as l}from"./chunk-FCULF3JA.js";import{Cb as c,Eb as s,Ib as S,Xa as g,qa as h,ya as w}from"./chunk-YJWNM4XO.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();var C=Q(I(),1);async function z(a,e){if(a)try{return JSON.parse(a)}catch(t){let r=t instanceof Error?t.message:"Unknown error";throw new l(s`Invalid JSON in ${c.yellow("--variables")} flag: ${r}`,"Please provide valid JSON format.")}else if(e){if(!await g(e))throw new l(s`Variable file not found at ${c.path(e)}. Please check the path and try again.`);let t=await h(e,{encoding:"utf8"});try{return JSON.parse(t)}catch(r){let n=r instanceof Error?r.message:"Unknown error";throw new l(s`Invalid JSON in variable file ${c.path(e)}: ${n}`,"Please provide valid JSON format.")}}}async function $(a){let{remoteApp:e,store:t,query:r,variables:n,variableFile:L,version:M,outputFile:u}=a,{adminSession:R,version:V}=await f({title:s`Authenticating`,task:async()=>{let o=await F(e,t.shopDomain),i=await A({adminSession:o,userSpecifiedVersion:M});return{adminSession:o,version:i}},renderOptions:{stdout:process.stderr}}),G=await z(n,L);x(r),q(r,t);try{let o=await f({title:s`Executing GraphQL operation`,task:async()=>b({query:(0,C.parse)(r),session:R,variables:G,version:V,responseOptions:{handleErrors:!1}}),renderOptions:{stdout:process.stderr}}),i=JSON.stringify(o,null,2);u?(await w(u,i),d({headline:"Operation succeeded.",body:`Results written to ${u}`})):(d({headline:"Operation succeeded."}),S(i))}catch(o){if(o instanceof y){let i={errors:o.response.errors},P=JSON.stringify(i,null,2);v({headline:"GraphQL operation failed.",body:P});return}throw o}}var m=class a extends J{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static description=this.descriptionForHelp();static flags={...O,...k,...E};async run(){let{flags:e}=await this.parse(a),{query:t,appContextResult:r,store:n}=await N(e);return await $({organization:r.organization,remoteApp:r.remoteApp,store:n,query:t,variables:e.variables,variableFile:e["variable-file"],outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:r.app}}};export{m as a};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-HSETBDXR.js";import{b as e}from"./chunk-UBTHWHPB.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static description="View the UI kit components prompts";static hidden=!0;async run(){await i()}};export{t as a};
1
+ import{a as i}from"./chunk-2W6M7YDY.js";import{b as e}from"./chunk-FW5HGFSZ.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static description="View the UI kit components prompts";static hidden=!0;async run(){await i()}};export{t as a};
@@ -1 +1 @@
1
- import{o as n}from"./chunk-5GUXN2RU.js";import{H as s}from"./chunk-PSSOCUUD.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
1
+ import{o as n}from"./chunk-6GA56I3E.js";import{H as s}from"./chunk-SKRUMRB4.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function c(e){await s([{title:"Installing dependencies",task:async()=>{await n({packageManager:e.packageManager,directory:e.directory,deep:3})}}])}export{c as a};
@@ -0,0 +1,16 @@
1
+ import{c as Ge}from"./chunk-KLYJDAP6.js";import{D as $e,E as He,H as te,L as D,X as Be,Z as E,_ as je,a as Pe,ca as b,da as K,e as qe,ga as V,ha as Ke,ia as A,j as Oe,k as ie,q as y,r as Me,s as ae,u as U}from"./chunk-L5XWYTHY.js";import{b as We}from"./chunk-ZDF5N422.js";import{w as oe}from"./chunk-6GA56I3E.js";import{b as Le}from"./chunk-QAXFCAOV.js";import{a as Ve}from"./chunk-RGIUP4FW.js";import{D as Je,E as Ze,F as Qe,I as Xe,J as en,T as nn,z as Ye}from"./chunk-SKRUMRB4.js";import{e as Ue,g as Ee}from"./chunk-YTJ3EPD3.js";import{a as we}from"./chunk-5RL6DKWR.js";import{i as c,l as T}from"./chunk-FCULF3JA.js";import{Cb as tn,Eb as P,Ib as on,Nb as se,R as C,X as W,Xa as ze,_a as Ce,b as t,ja as xe,qa as Re}from"./chunk-YJWNM4XO.js";import{i as re}from"./chunk-B4OMIONW.js";import{g as an}from"./chunk-SGBLCVUX.js";import{d as Ie,j}from"./chunk-3VYOLEQE.js";import{e as B,g as s}from"./chunk-VKWPEFWQ.js";s();function q(e,{httpsOnly:n=!1,message:i="Invalid URL"}={}){return e.refine(a=>de(a,n),{message:i}).refine(a=>!a.includes(`
2
+ `),{message:i})}function it(e,{message:n="URL must be HTTPS URL or start with /"}={}){return e.refine(i=>i.startsWith("/")||de(i,!0),{message:n})}var rn=/[\r\n\t]/;function sn(e){return de(e,!0)}function de(e,n){try{let i=new URL(e);return n?i.protocol==="https:":["http:","https:"].includes(i.protocol)}catch{return!1}}function at(e){return typeof e=="string"&&!e.startsWith("/")?`/${e}`:e}var wi=30;function tt(e){return e.length<=wi}s();s();s();function dn(e){return qe`
3
+ query OrganizationBetaFlags($organizationId: OrganizationID!) {
4
+ organization(organizationId: $organizationId) {
5
+ id
6
+ ${e.map(n=>`flag_${n}: hasFeatureFlag(handle: "${n}")`).join(`
7
+ `)}
8
+ }
9
+ }`}s();var ln={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OrganizationExpFlags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"flagHandles"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"enabledFlags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"flagHandles"},value:{kind:"Variable",name:{kind:"Name",value:"flagHandles"}}}]},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var le=class extends c{},w=class extends c{constructor(n,i){let a="unknown",o=d=>`an ${d}`;He(n)?(a=n.orgName,o=d=>`the ${d} organization`):$e(n)&&(a=n.email,o=d=>`the ${d} user`);let r=P`${tn.yellow(a)}`.value,l=[[`Your current active session is associated with ${o(r)} account. To start a new session with a different account, run`,{command:"shopify auth login"}],["Have you",{link:{label:"created a Shopify Partners organization",url:"https://partners.shopify.com/signup"}},{char:"?"}],["Does your account include",{subdued:"Manage app"},"permissions?, please contact the owner of the organization to grant you access."],"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"}]];i&&l.push(["Do you have access to the right Shopify Partners organization? The CLI is loading",{link:{label:"this organization",url:`https://partner.shopify.com/${i}`}}]),super("No Organization found",void 0,l)}};async function ft(){let e=mn(),n=await e.organizations();if(n.length===0){let i=await e.session();throw new w(i.accountInfo)}return n}async function Nt(e,n){let i=await n.orgFromId(e);if(!i)throw new w((await n.session()).accountInfo,e);return i}async function gt(e,n,i,a=["APP_DEVELOPMENT"]){let o=await i.storeByDomain(e.id,n,a);if(!o){let l=a.length===1&&a[0]==="APP_DEVELOPMENT"?"Ensure you have provided the correct store domain, that the store is a dev store, and that you have access to the store.":"Ensure you have provided the correct store domain and that you have access to the store.";throw new le(`Could not find store for domain ${n} in organization ${e.businessName}.`,l)}return o}s();var un={skipEsbuildReactDedeuplication:"SHOPIFY_CLI_SKIP_ESBUILD_REACT_DEDUPLICATION",disableGraphiQLExplorer:"SHOPIFY_CLI_DISABLE_GRAPHIQL",useDynamicConfigSpecifications:"SHOPIFY_CLI_DYNAMIC_CONFIG",enableAppLogPolling:"SHOPIFY_CLI_ENABLE_APP_LOG_POLLING",templatesJsonPath:"SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH",mkcertBinaryPath:"SHOPIFY_CLI_MKCERT_BINARY",disableMinificationOnDev:"SHOPIFY_CLI_DISABLE_MINIFICATION_ON_DEV"},Ii={app:"shopify.app.toml",web:"shopify.web.toml",appEnvironments:"shopify.environments.toml",lockFile:".shopify.lock",hiddenConfig:"project.json",hiddenFolder:".shopify"},yt={production:".env"},bt={reactTypes:"17.0.30"},cn={extensions:{directoryName:"extensions",defaultRegistrationLimit:1},web:{directoryName:"web",configurationName:Ii.web}},Ft={graphiql:3457,localhost:3458},_t=/^([a-zA-Z_$])([a-zA-Z0-9_$])*$/;s();var G;(function(e){e.Partners="Partners",e.BusinessPlatform="BusinessPlatform"})(G||(G={}));s();s();var pn=50,kn=250,xi=t.object({namespace:t.string(),key:t.string(),owner_type:t.string().optional()}),Ri=t.object({sms_marketing:t.boolean().optional(),customer_privacy:t.boolean().optional()}),zi=t.object({sources:t.array(t.string()).optional()}),Ci=t.object({network_access:t.boolean().optional(),block_progress:t.boolean().optional(),api_access:t.boolean().optional(),collect_buyer_consent:Ri.optional(),iframe:zi.optional(),bundle_size_exception:t.boolean().optional()}),Ui=t.object({runs_offline:t.boolean().optional()}),It=t.object({type:t.string().optional(),extensions:t.array(t.any()).optional()}),Ei=t.object({event:t.string(),blocking:t.boolean().default(!1),applies_to:t.array(t.string()).optional()}),Pi=t.object({allow_direct_linking:t.boolean().optional(),intercepts:t.array(Ei).optional()}),qi=t.object({module:t.string()}),Oi=t.object({target:t.string(),module:t.string(),should_render:qi.optional(),tools:t.string().optional(),instructions:t.string().optional(),intents:t.array(t.object({type:t.string(),action:t.string(),schema:t.string(),name:t.string().optional(),description:t.string().optional()})).optional(),metafields:t.array(xi).optional(),default_placement:t.string().optional(),urls:t.object({edit:t.string().optional()}).optional(),capabilities:Pi.optional(),preloads:t.object({chat:t.string().optional()}).optional(),assets:t.string().optional()}),xt=t.array(Oi),vn=t.string(),Li=t.object({key:t.string().optional(),name:t.string().optional(),description:t.string().optional(),required:t.boolean().optional(),default_value:t.any().optional(),type:t.string(),validations:t.array(t.any()).optional(),marketingActivityCreateUrl:t.string().optional(),marketingActivityDeleteUrl:t.string().optional()}),fn=t.object({fields:t.array(Li).optional()}),Nn=t.string().trim().nonempty("Handle can't be empty").max(pn,`Handle can't exceed ${pn} characters`).regex(/^[a-zA-Z0-9-]*$/,"Handle can only contain alphanumeric characters and hyphens").refine(e=>!e.startsWith("-")&&!e.endsWith("-"),"Handle can't start or end with a hyphen"),Mi=t.string().trim().nonempty("UID can't be empty").max(kn,`UID can't exceed ${kn} characters`).regex(/^[a-zA-Z0-9-${}.()_`]*$/,"UID can only contain alphanumeric characters and hyphens").refine(e=>!e.startsWith("-")&&!e.endsWith("-"),"UID can't start or end with a hyphen"),Y=t.object({name:t.string().optional(),type:t.string().optional(),handle:Nn.optional(),uid:Mi.optional(),description:t.string().optional(),api_version:vn.optional(),extension_points:t.any().optional(),capabilities:Ci.optional(),supported_features:Ui.optional(),settings:fn.optional()}),Rt=Y.extend({handle:Nn}),F=Y.omit({handle:!0}),zt=t.object({api_version:vn.optional(),description:t.string().optional(),extensions:t.array(t.any()),settings:fn.optional()});s();s();s();s();var $i=/^(https:\/\/)/,Hi=/^pubsub:\/\/(?<gcp_project_id>[^:]+):(?<gcp_topic>.+)$/,Bi=/^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>.+)$/,ji=/^kafka:\/\/(?<kafka_topic>[a-zA-Z0-9_.-]+)$/;function I(e){return typeof e=="string"&&e.endsWith("/")?e.replace(/\/+$/,""):e}var _=t.string({invalid_type_error:"Value must be string"}).refine(e=>e.startsWith("/")?!0:$i.test(e)||Hi.test(e)||Bi.test(e)||ji.test(e),{message:"URI format isn't correct. Valid formats include: relative path starting with a slash, HTTPS URL, pubsub://{project-id}:{topic-id}, kafka://{topic-id} or Eventbridge ARN"});function J(e,n){return!n||!e.startsWith("/")?e:`${I(n)}${e}`}var Wi=(e,n,i,a)=>{if(i.startsWith("//"))throw new c(`${e} ${n} is invalid: a URL relative to the app URL must start with a single slash.`);if(rn.test(i))throw new c(`${e} ${n} is invalid: a URL must not contain control characters such as newlines or tabs.`);let o=J(i,a);if(o.startsWith("/"))throw new c(`${e} ${n} is a relative URL, but no application_url is configured. Set application_url in your app configuration or use an absolute HTTPS URL.`);if(!sn(o))throw new c(`${e} ${n} must resolve to an HTTPS URL. Set application_url to an HTTPS URL or use an absolute HTTPS URL.`);return o};function me(e,n,i,a){let o=i;for(let r of n){let l=o[r];typeof l=="string"&&l.startsWith("/")&&(o[r]=Wi(e,r,l,a))}}s();import{isUtf8 as Ki}from"node:buffer";import gn from"fs";async function Sn(e,n){let i=await Ce(Ie(e,"locales/*.json"));if(!i||i.length===0)return{};let a=Gi(i);if(a.length===0)throw new c(`Missing default language in ${n} configuration`,"Make sure to have a {locale}.default.json file in your locales directory");if(a.length>1)throw new c(`Error loading ${n}`,'There must be one (and only one) locale identified as the default locale: e.g. "en.default.json"');for(let o of i)if(gn.statSync(o).size===0)throw new c(`Error loading ${n}`,`Locale file ${o} can't be empty`);return{default_locale:a[0],translations:Yi(i,n)}}function Gi(e){return e.filter(i=>j(i).endsWith(".default.json")).map(i=>j(i).split(".")[0])}function Yi(e,n){let i={};for(let a of e){let o=Ji(j(a).split(".")[0],"Locale code is unset"),r=gn.readFileSync(a);if(!Ki(r))throw new c(`Error loading ${n}`,`Locale file ${a} contains invalid UTF-8 byte sequences. Re-save the file using UTF-8 encoding.`);i[o]=r.toString("base64")}return i}function Ji(e,n){if(e===void 0)throw new T(n);return e}function Zi(e){return e.experience==="configuration"}var hn;(function(e){e.ShouldRender="should_render",e.Main="main",e.Tools="tools",e.Instructions="instructions",e.Intents="intents"})(hn||(hn={}));function yn(e){let i={...{externalIdentifier:`${e.identifier}_external`,additionalIdentifiers:[],externalName:W(e.identifier.replace(/_/g," ")),surface:"test-surface",partnersWebIdentifier:e.identifier,schema:Y,registrationLimit:cn.extensions.defaultRegistrationLimit,transform:e.transformLocalToRemote,reverseTransform:e.transformRemoteToLocal,experience:e.experience??"extension",uidStrategy:e.uidStrategy??(e.experience==="configuration"?"single":"uuid"),getDevSessionUpdateMessages:e.getDevSessionUpdateMessages,clientSteps:e.clientSteps},...e};return{...i,contributeToAppConfigurationSchema:a=>{let o=Zi(i),r=i.schema._def.shape!==void 0,l=i.uidStrategy==="single";return o&&r&&l?a.merge(i.schema):a},parseConfigurationObject:a=>{let o=i.schema.safeParse(a);return o.success?{state:"ok",data:o.data,errors:void 0}:{state:"error",data:void 0,errors:o.error.errors}}}}function S(e){let n=e.appModuleFeatures??(()=>[]);return yn({identifier:e.identifier,schema:e.schema,appModuleFeatures:n,transformLocalToRemote:Qi(e.transformConfig),transformRemoteToLocal:Xi(e.schema,e.transformConfig),experience:"configuration",uidStrategy:e.uidStrategy??"single",expandConfig:e.expandConfig,getIdentity:e.getIdentity,getTarget:e.getTarget,clientSteps:e.clientSteps,getDevSessionUpdateMessages:e.getDevSessionUpdateMessages,patchWithAppDevURLs:e.patchWithAppDevURLs})}function so(e){let n=e.appRelativeUrlFields;return yn({identifier:e.identifier,schema:t.any({}),appModuleFeatures:e.appModuleFeatures,experience:e.experience,clientSteps:e.clientSteps,uidStrategy:e.uidStrategy,transformRemoteToLocal:e.transformRemoteToLocal,devSessionWatchConfig:e.devSessionWatchConfig,appRelativeUrlFields:n,patchWithAppDevURLs:n?.length?(i,a)=>{me(W(e.identifier.replace(/_/g," ")),n,i,a.applicationUrl)}:void 0,deployConfig:async(i,a,o,r,l)=>{let d=ea(i);if(n?.length){let m=l?.appConfiguration?.application_url,p=typeof m=="string"?m:void 0;me(W(e.identifier.replace(/_/g," ")),n,d,p)}if(e.appModuleFeatures().includes("localization")){let m=await Sn(a,e.identifier);d={...d,localization:m}}return d}})}function Qi(e){return Object.keys(e).includes("forward")?e.forward:n=>bn(n,e)}function Xi(e,n){return n?Object.keys(n).includes("reverse")?n.reverse:i=>bn(i,n,!0):i=>Fn(e,i)}function bn(e,n,i=!1){let a={};for(let[o,r]of Object.entries(n)){let l=i?o:r,d=i?r:o,m=E(e,l);m!==void 0&&je(a,d,m)}return a}function Fn(e,n){return Object.keys(e._def.shape()).reduce((i,a)=>{let o=e._def.shape()[a];return o instanceof t.ZodOptional&&(o=o._def.innerType),o instanceof t.ZodObject?i[a]=Fn(o,n):(n[a]!==void 0&&(i[a]=n[a]),delete n[a]),i},{})}function ea(e){let{type:n,handle:i,uid:a,path:o,extensions:r,...l}=e;return l}var na=F.extend({application_url:q(t.string({required_error:"Valid URL is required"})),embedded:t.boolean({required_error:"Boolean is required",invalid_type_error:"Value must be Boolean"}),app_preferences:t.object({url:q(t.string().max(255,{message:"String must be less than 255 characters"}))}).optional()}),ia={app_url:"application_url",embedded:"embedded",preferences_url:"app_preferences.url"},ue="app_home",aa=S({identifier:ue,schema:na,transformConfig:ia,patchWithAppDevURLs:(e,n)=>{e.application_url=n.applicationUrl},getDevSessionUpdateMessages:async e=>[`Using URL: ${e.application_url}`]}),vo=aa;s();var ta=F.extend({name:t.string({required_error:"String is required"}).max(30,{message:"String must be less than 30 characters"}),handle:t.string({required_error:"String is required"}).max(256,{message:"String must be less than 256 characters long"}).refine(e=>e&&/^\w*(?!-)[_a-z0-9-]+(?<!-)$/.test(e),{message:"String can't contain special characters"}).optional()}),oa={name:"name",app_handle:"handle"},ce="branding",ra=S({identifier:ce,schema:ta,transformConfig:oa}),yo=ra;s();var sa=t.object({scopes:t.string().transform(e=>xe(e)??"").optional(),required_scopes:t.array(t.string()).optional(),optional_scopes:t.array(t.string()).optional(),use_legacy_install_flow:t.boolean().optional()}),da=t.object({redirect_urls:t.array(q(t.string()))}),la=F.extend({access:t.object({admin:t.object({direct_api_mode:t.union([t.literal("online"),t.literal("offline")]).optional(),embedded_app_direct_api_access:t.boolean().optional()}).optional()}).optional(),access_scopes:sa.optional(),auth:da}),pe="app_access",ma={access:"access",scopes:"access_scopes.scopes",required_scopes:"access_scopes.required_scopes",optional_scopes:"access_scopes.optional_scopes",use_legacy_install_flow:"access_scopes.use_legacy_install_flow",redirect_url_allowlist:"auth.redirect_urls"},ua=S({identifier:pe,schema:la,transformConfig:ma,getDevSessionUpdateMessages:async e=>{let n=e.access_scopes!==void 0,i=e.access_scopes?.use_legacy_install_flow===!0,a=e.access_scopes?.scopes==null&&e.access_scopes?.required_scopes==null;if(i||n&&a)return["Using legacy install flow - access scopes are not auto-granted"];let o=e.access_scopes?.scopes?e.access_scopes.scopes.split(",").map(r=>r.trim()).join(", "):e.access_scopes?.required_scopes?.join(", ");return o?[`Access scopes auto-granted: ${o}`]:["App has been installed"]},patchWithAppDevURLs:(e,n)=>{n.redirectUrlWhitelist&&(e.auth={redirect_urls:n.redirectUrlWhitelist})}}),wo=ua;s();var _n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"websocketUrl"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"assetsUrl"},value:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}}},{kind:"Argument",name:{kind:"Name",value:"websocketUrl"},value:{kind:"Variable",name:{kind:"Name",value:"websocketUrl"}}},{kind:"Argument",name:{kind:"Name",value:"isUnsafe"},value:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websocketUrl"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Dn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"manifest"}},type:{kind:"NamedType",name:{kind:"Name",value:"JSON"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"inheritedModuleUids"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"assetsUrl"},value:{kind:"Variable",name:{kind:"Name",value:"assetsUrl"}}},{kind:"Argument",name:{kind:"Name",value:"manifest"},value:{kind:"Variable",name:{kind:"Name",value:"manifest"}}},{kind:"Argument",name:{kind:"Name",value:"inheritedModuleUids"},value:{kind:"Variable",name:{kind:"Name",value:"inheritedModuleUids"}}},{kind:"Argument",name:{kind:"Name",value:"isUnsafe"},value:{kind:"Variable",name:{kind:"Name",value:"unsafeValidation"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSession"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websocketUrl"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"warnings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var An={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DevSessionDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devSessionDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Tn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchStoreByDomain"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"domain"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filters"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ShopFilterInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"Variable",name:{kind:"Name",value:"filters"}}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"domain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"externalId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"shortName"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPermissions"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Vn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListAppDevStores"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"accessibleShops"},arguments:[{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"ListValue",values:[{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_TYPE"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"app_development",block:!1}}]},{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"STORE_STATUS"}},{kind:"ObjectField",name:{kind:"Name",value:"operator"},value:{kind:"EnumValue",value:"EQUALS"}},{kind:"ObjectField",name:{kind:"Name",value:"value"},value:{kind:"StringValue",value:"ACTIVE",block:!1}}]}]}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"externalId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"storeType"}},{kind:"Field",name:{kind:"Name",value:"primaryDomain"}},{kind:"Field",name:{kind:"Name",value:"shortName"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"currentUser"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationPermissions"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var wn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DevStoreCapReached"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"devStoreCapReached"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var In={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProvisionShopAccess"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationUserProvisionShopAccessInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organizationUserProvisionShopAccess"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationUserProvisionShopAccessInput"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var xn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ActiveAppReleaseFromApiKey"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"app"},name:{kind:"Name",value:"appByKey"},arguments:[{kind:"Argument",name:{kind:"Name",value:"key"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AppVersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"AppVersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"App"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"organizationId"}},{kind:"Field",name:{kind:"Name",value:"activeRoot"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientCredentials"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secrets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"grantedShopifyApprovalScopes"}}]}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]}}]}}]};s();var ke={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ReleaseVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appReleaseCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"versionId"},value:{kind:"Variable",name:{kind:"Name",value:"versionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"release"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Rn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppVersion"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AppVersionInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"metadata"}},type:{kind:"NamedType",name:{kind:"Name",value:"VersionMetadataInput"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appVersionCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}},{kind:"Argument",name:{kind:"Name",value:"metadata"},value:{kind:"Variable",name:{kind:"Name",value:"metadata"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}}]};s();var zn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAssetURL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sourceExtension"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SourceExtension"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appRequestSourceUploadUrl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sourceExtension"},value:{kind:"Variable",name:{kind:"Name",value:"sourceExtension"}}},{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sourceUploadUrl"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Cn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"version"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"versionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"VersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Version"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}}]}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]};s();var Un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"versions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"20"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"createdBy"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"versionsCount"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var En={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppInstallCount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"appId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"installCount"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Pn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateApp"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"initialVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AppVersionInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"initialVersion"},value:{kind:"Variable",name:{kind:"Name",value:"initialVersion"}}},{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"app"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"activeRoot"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientCredentials"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"secrets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"on"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var qn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"fetchSpecifications"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"specifications"},arguments:[{kind:"Argument",name:{kind:"Name",value:"organizationId"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"features"}},{kind:"Field",name:{kind:"Name",value:"uidStrategy"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"appModuleLimit"}},{kind:"Field",name:{kind:"Name",value:"isClientProvided"}}]}},{kind:"Field",name:{kind:"Name",value:"validationSchema"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jsonSchema"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var On={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"listApps"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appsConnection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"activeRelease"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"version"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Ln={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"organizations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Mn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"availableTopics"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"availableTopics"},arguments:[{kind:"Argument",name:{kind:"Name",value:"apiVersion"},value:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}}}]}]}}]};s();var $n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CliTesting"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"address"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"deliveryMethod"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sharedSecret"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"topic"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cliTesting"},arguments:[{kind:"Argument",name:{kind:"Name",value:"address"},value:{kind:"Variable",name:{kind:"Name",value:"address"}}},{kind:"Argument",name:{kind:"Name",value:"apiKey"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}},{kind:"Argument",name:{kind:"Name",value:"apiVersion"},value:{kind:"Variable",name:{kind:"Name",value:"apiVersion"}}},{kind:"Argument",name:{kind:"Name",value:"deliveryMethod"},value:{kind:"Variable",name:{kind:"Name",value:"deliveryMethod"}}},{kind:"Argument",name:{kind:"Name",value:"sharedSecret"},value:{kind:"Variable",name:{kind:"Name",value:"sharedSecret"}}},{kind:"Argument",name:{kind:"Name",value:"topic"},value:{kind:"Variable",name:{kind:"Name",value:"topic"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"headers"}},{kind:"Field",name:{kind:"Name",value:"samplePayload"}},{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Hn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var Bn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SchemaDefinitionByTarget"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"handle"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"target"},arguments:[{kind:"Argument",name:{kind:"Name",value:"handle"},value:{kind:"Variable",name:{kind:"Name",value:"handle"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"api"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var jn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SchemaDefinitionByApiType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"version"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"api"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"version"},value:{kind:"Variable",name:{kind:"Name",value:"version"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();s();s();var O;(function(e){e.CustomersRedact="customers/redact",e.CustomersDataRequest="customers/data_request",e.ShopRedact="shop/redact"})(O||(O={}));var Wn=t.object({topics:t.array(t.string({invalid_type_error:"Values within array must be a string"}),{invalid_type_error:"Value must be string[]"}).optional(),actions:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),uri:t.preprocess(e=>I(e),_,{required_error:"Missing value at"}),include_fields:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),filter:t.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional(),compliance_topics:t.array(t.enum([O.CustomersRedact,O.CustomersDataRequest,O.ShopRedact]),{invalid_type_error:"Value must be an array containing values: customers/redact, customers/data_request or shop/redact"}).optional()});s();function Kn(e,n){let i=ca(e);if(i)return n.addIssue(i),t.NEVER}function ca(e){let{subscriptions:n=[]}=e,i=new Set,a=[];if(!n.length)return;if(e.privacy_compliance&&e.subscriptions?.some(r=>r.compliance_topics))return{code:t.ZodIssueCode.custom,message:"The privacy_compliance section can't be used if there are subscriptions including compliance_topics"};let o=n.flatMap(r=>r.compliance_topics).filter(Boolean);if(C(o).length!==o.length)return{code:t.ZodIssueCode.custom,message:"You can\u2019t have multiple subscriptions with the same compliance topic",fatal:!0,path:["subscriptions"]};for(let[r,{uri:l,topics:d=[],compliance_topics:m=[],filter:p=""}]of n.entries()){let k=["subscriptions",r];if(!d.length&&!m.length)return{code:t.ZodIssueCode.custom,message:"Either topics or compliance_topics must be added to the webhook subscription",path:k};d.forEach(u=>{let v=`${u}::${l}::${p}`;if(i.has(v)){let N=p?re.dim(`
10
+
11
+ topic: ${u}
12
+ uri: ${l}
13
+ filter: ${p}`):re.dim(`
14
+
15
+ topic: ${u}
16
+ uri: ${l}`);a.push(N)}i.add(v)})}if(a.length>0){let r=a.join("");return{code:t.ZodIssueCode.custom,message:`Multiple subscriptions with the exact same topic, uri, and filter. To resolve, remove or edit the duplicates ${r}`,path:["subscriptions"]}}}s();function Yn(e){let n=E(e,"webhooks");if(!n)return e;let{api_version:i}=n;return{api_version:i}}function Jn(e){let n={},i=E(e,"api_version");return n={...i?{webhooks:{api_version:i}}:{}},n}function Zn(e){if(e.length===0)return;let n=e.filter(r=>r.topics!==void 0).flatMap(({compliance_topics:r,topics:l,...d})=>Qn(l)?.map(p=>({topics:[p],...d}))??[]),i=e.filter(r=>r.topics===void 0||r.compliance_topics!==void 0).map(({compliance_topics:r,topics:l,...d})=>({compliance_topics:r,...d})),a=va(i,"compliance_topics"),o=pa(a);return[...Gn(o),...Gn(n)]}function Qn(e){return e?.sort((n,i)=>n.localeCompare(i))}function Gn(e){return e.sort((n,i)=>n.uri.localeCompare(i.uri))}function pa(e){return e.forEach(n=>n.compliance_topics=Qn(n.compliance_topics)),e}function ka(e,n){return e.find(i=>i.uri===n.uri&&Be(i.include_fields??[],n.include_fields??[])&&i.filter===n.filter)}function va(e,n){return e.reduce((i,a)=>{let o=ka(i,a);return o?n&&a?.[n]?.length?o[n]?.push(...a[n]):(a.topics&&(o.topics??=[],o.topics.push(...a.topics)),a.compliance_topics&&(o.compliance_topics??=[],o.compliance_topics.push(...a.compliance_topics))):i.push(a),i},[])}var fa=t.object({api_version:t.string({required_error:"String is required"}),privacy_compliance:t.object({customer_deletion_url:_.optional(),customer_data_request_url:_.optional(),shop_deletion_url:_.optional()}).optional(),subscriptions:t.array(Wn).optional().transform(e=>Zn(e??[]))}),Xn=F.extend({webhooks:fa.superRefine(Kn)});var ve="webhooks",Na={forward:Yn,reverse:e=>Jn(e)},ga=S({identifier:ve,schema:Xn,transformConfig:Na}),Kr=ga;s();var ei={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionByTag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"versionTag"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"versionByTag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tag"},value:{kind:"Variable",name:{kind:"Name",value:"versionTag"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VersionInfo"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ReleasedAppModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AppModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"userIdentifier"}},{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"config"}},{kind:"Field",name:{kind:"Name",value:"target"}},{kind:"Field",name:{kind:"Name",value:"specification"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"externalIdentifier"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"experience"}},{kind:"Field",name:{kind:"Name",value:"managementExperience"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"VersionInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Version"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"versionTag"}}]}},{kind:"Field",name:{kind:"Name",value:"appModules"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ReleasedAppModule"}}]}}]}}]};s();var ni={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AppLogsSubscribe"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopIds"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"apiKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appLogsSubscribe"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopIds"},value:{kind:"Variable",name:{kind:"Name",value:"shopIds"}}},{kind:"Argument",name:{kind:"Name",value:"apiKey"},value:{kind:"Variable",name:{kind:"Name",value:"apiKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"jwtToken"}},{kind:"Field",name:{kind:"Name",value:"success"}},{kind:"Field",name:{kind:"Name",value:"errors"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var fe="webhook_subscription",Sa=t.object({topic:t.string(),actions:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),api_version:t.string(),uri:t.preprocess(I,_,{required_error:"Missing value at"}),include_fields:t.array(t.string({invalid_type_error:"Value must be a string"})).optional(),filter:t.string({invalid_type_error:"Value must be a string"}).optional(),payload_query:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).optional(),name:t.string({invalid_type_error:"Value must be a string"}).trim().min(1).max(50).optional()});function ha(e){let{api_version:n,topic:i,...a}=e;return{webhooks:{subscriptions:[{topics:[i],...a}]}}}var ya={forward:(e,n)=>{let i=e,a;return"application_url"in n&&(a=n?.application_url),{...i,uri:J(i.uri,a)}},reverse:ha},ba=S({identifier:fe,schema:Sa,transformConfig:ya,uidStrategy:"dynamic"}),ts=ba;s();s();s();function x(e={}){return{type:"token_refresh",handler:async()=>({token:await D([],{noPrompt:e.noPrompt})})}}s();var ii={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindOrganization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OrganizationID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var ai={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListOrganizations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUserAccount"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uuid"}},{kind:"Field",name:{kind:"Name",value:"organizationsWithAccessToDestination"},arguments:[{kind:"Argument",name:{kind:"Name",value:"destination"},value:{kind:"EnumValue",value:"APPS_CLI"}}],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:"name"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"shopCount"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();function R(e){let n=e.match(/\/(\d+)$/);return n?n[1]:void 0}function Z(e){return R(Buffer.from(e,"base64").toString("utf8"))}function L(e){return Buffer.from(e).toString("base64")}async function M(){return(await ti()).organizations}async function Fa(e){return ti(e)}async function Ne(e,n,i){let a=n??await D(),r=(await V({query:ii,token:a,variables:{organizationId:_a(e)},unauthorizedHandler:i??x(),cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:Ue(a)}})).currentUserAccount?.organization;if(r)return{id:e,businessName:r.name}}function _a(e){let n=e.startsWith("gid://")?R(e):e;if(n===void 0||!/^\d+$/.test(n))throw new c(`Invalid organization ID: ${e}`);return L(`gid://organization/Organization/${n}`)}async function ti(e){let n=e??await D(),i=await V({query:ai,token:n,unauthorizedHandler:x()});return i.currentUserAccount?{organizations:i.currentUserAccount.organizationsWithAccessToDestination.nodes.map(o=>{let r=Z(o.id);if(r===void 0)throw new c(`Failed to decode organization ID from: ${o.id}`);return{id:r,businessName:o.name,status:o.status,shopCount:o.shopCount??null,url:o.url}}),currentUserResolved:!0}:{organizations:[],currentUserResolved:!1}}s();s();async function ge(e){if(e.length===1)return e[0];let i=new Set(e.map(o=>o.businessName)).size<e.length,a=await Qe({message:"Which organization do you want to use?",choices:e.map(o=>({label:i?`${o.businessName} (${o.id})`:o.businessName,value:o.id}))});return e.find(o=>o.id===a)}async function Da(e){let n=await M();if(n.length===0)throw new c("No organizations found.","Make sure you have access to a Shopify organization.");if(e){let i=n.find(a=>a.id===e);if(!i)throw new c(`Organization with ID ${e} not found.`,`Available organizations: ${n.map(a=>`${a.businessName} (${a.id})`).join(", ")}`);return i}return ge(n)}s();var Aa=["ACTIVE","LOCKED"];s();s();var Se={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},z=Object.keys(Se);s();s();var $=t.object({id:t.string(),name:t.string(),subdomain:t.string(),country:t.string().optional(),type:t.string().optional(),authScopes:t.array(t.string()).optional(),plan:t.string().optional(),organizationId:t.string(),organizationName:t.string()}),Q=t.object({id:t.string(),name:t.string()});var oi=$.pick({name:!0}).extend({domain:$.shape.subdomain,adminUrl:t.string().nullish(),plan:t.enum(z),featurePreview:t.string().optional(),country:$.shape.country,demoData:t.boolean()}),he=we({name:"CreateDevStoreResult",schema:t.object({store:oi,organization:Q}),definitions:{CreatedDevStore:oi,StoreOrganization:Q}});s();var ri={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateAppDevelopmentStore"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"country"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createAppDevelopmentStore"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopName"},value:{kind:"Variable",name:{kind:"Name",value:"shopName"}}},{kind:"Argument",name:{kind:"Name",value:"priceLookupKey"},value:{kind:"Variable",name:{kind:"Name",value:"priceLookupKey"}}},{kind:"Argument",name:{kind:"Name",value:"prepopulateTestData"},value:{kind:"Variable",name:{kind:"Name",value:"prepopulateTestData"}}},{kind:"Argument",name:{kind:"Name",value:"developerPreviewHandle"},value:{kind:"Variable",name:{kind:"Name",value:"developerPreviewHandle"}}},{kind:"Argument",name:{kind:"Name",value:"country"},value:{kind:"Variable",name:{kind:"Name",value:"country"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"shopAdminUrl"}},{kind:"Field",name:{kind:"Name",value:"shopDomain"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};s();var si={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PollStoreCreation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"storeCreation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopDomain"},value:{kind:"Variable",name:{kind:"Name",value:"shopDomain"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Ta=2,Va=300*1e3;function wa(e){switch(e){case"CALLING_CORE":return"Initiating store creation";case"AWAITING_CORE_STORE_READY":return"Waiting for store to be ready";case"FINALIZING":return"Finalizing store setup";case"COMPLETE":return"Store creation complete!";case"FAILED":return"Store creation failed.";case"TIMED_OUT":return"Store creation timed out.";case"USER_ERROR":return"Store creation encountered a user error.";default:return`Store creation status: ${e}`}}async function Ia(e){let{organization:n,name:i,plan:a}=e,o=await D(),r=x(),d=(await A({query:ri,token:o,organizationId:n.id,variables:{shopName:i,priceLookupKey:Se[a],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview,country:e.country},unauthorizedHandler:r})).createAppDevelopmentStore;if(!d)throw new c("Store creation failed: unexpected empty response.");let m=d.userErrors;if(m&&m.length>0){let u=m.map(v=>v.message).join(", ");throw new c(`Failed to create dev store: ${u}`)}let{shopDomain:p,shopAdminUrl:k}=d;if(!p)throw new c("Store creation succeeded but no shop domain was returned.");if(await Xe({title:P`Waiting for store to be ready`,task:async u=>{let v=Date.now();for(;;){if(Date.now()-v>Va)throw new c("Store creation timed out after 5 minutes.");let g=(await A({query:si,token:o,organizationId:n.id,variables:{shopDomain:p},unauthorizedHandler:r})).organization?.storeCreation?.status;if(!g)throw new c("Unable to determine store creation status.");if(g==="COMPLETE")return;if(g==="FAILED"||g==="TIMED_OUT"||g==="USER_ERROR")throw new c(`Store creation failed with status: ${g}`);u(P`${wa(g)}`),await nn(Ta)}},renderOptions:{stdout:process.stderr}}),e.json)on(he.encode({store:{name:i,domain:p,adminUrl:k,plan:a,...e.featurePreview?{featurePreview:e.featurePreview}:{},...e.country?{country:e.country}:{},demoData:e.withDemoData??!1},organization:{id:n.id,name:n.businessName}}));else if(e.summary!==!1){let u=[];H(u,"Domain",p),u.push(["Admin",k?{link:{label:k,url:k}}:"N/A"]),H(u,"Plan",a),H(u,"Feature preview",e.featurePreview),H(u,"Country",e.country),H(u,"Demo data",e.withDemoData?"enabled":"disabled"),Ye({headline:`Dev store "${i}" created successfully.`,customSections:[{body:{tabularData:u,firstColumnSubdued:!0}}]})}return p}function H(e,n,i){i!=null&&i!==""&&e.push([n,i])}s();var xa={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};function Ra(){return en({message:"Name for the new dev store"})}function za(){return Je({message:"Which Shopify plan do you want to use?",choices:z.map(e=>({label:xa[e],value:e}))})}function Ca(){return Ze({message:"Populate the store with demo data?",confirmationMessage:"Yes, add demo data",cancellationMessage:"No, start with an empty store",defaultValue:!0})}s();s();var di=(e,n,i)=>{let a=new URL(e);return n&&a.searchParams.append("cursor",n),i?.status&&a.searchParams.append("status",i.status),i?.source&&a.searchParams.append("source",i.source),a.toString()};var li=B(K()),Ua=new li.default({minTime:150,maxConcurrent:10});async function Ea(e){let n="App Management",a=`https://${await y()}/app_management/unstable/graphql.json`;return{token:e,api:n,url:a,responseOptions:{onResponse:be}}}var ye=e=>Pe(e),mi=async(e,n,i)=>{let o=`https://${await y()}/app_management/unstable/organizations/${e}/app_logs/poll`;return di(o,n,i)},ui=async(e,n)=>`https://${await y()}/app_management/unstable/organizations/${encodeURIComponent(e)}/apps/${encodeURIComponent(n)}/channel_spec_export.json`;async function ci(e){let n=e.cacheOptions?.cacheExtraKey??"",i=e.cacheOptions?{...e.cacheOptions,cacheExtraKey:n}:void 0;return Ua.schedule(async()=>b({...await Ea(e.token),query:e.query,variables:e.variables,cacheOptions:i,preferredBehaviour:e.requestOptions?.requestMode,unauthorizedHandler:e.unauthorizedHandler}))}function be(e){if(!e.extensions)return;let n=[];for(let i of e.extensions.deprecations)i.supportedUntilDate&&n.push(new Date(i.supportedUntilDate));We(n)}s();var pi=B(K()),Pa=new pi.default({minTime:150,maxConcurrent:10});async function ki(e){let n="App Dev",i=U(e.shopFqdn),o=`https://${await Me(i)}/app_dev/unstable/graphql.json`,r=Le()==="local"?{"x-forwarded-host":i}:void 0;return Pa.schedule(()=>b({query:e.query,api:n,url:o,token:e.token,addedHeaders:r,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler,preferredBehaviour:e.requestOptions?.requestMode}))}s();var vi=B(K()),qa=new vi.default({minTime:150,maxConcurrent:10});async function Oa(e,n,i){let a="Functions",r=`https://${await y()}/functions/unstable/organizations/${e}/${i}/graphql`;return{token:n,api:a,url:r,responseOptions:{onResponse:be}}}async function fi(e){return await qa.schedule(async()=>b({...await Oa(e.organizationId,e.token,e.appId),query:e.query,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}s();var Ni=B(K()),La=new Ni.default({minTime:150,maxConcurrent:10});async function gi(e){let n="Webhooks",a=`https://${await y()}/webhooks/unstable/organizations/${e.organizationId}/graphql.json`;return La.schedule(()=>b({query:e.query,api:n,url:a,token:e.token,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}import{randomUUID as Ma}from"crypto";var Si="https://cdn.shopify.com/static/cli/extensions/templates.json",$a=Ma(),ee=class e{static instance;static getInstance(n){return e.instance??=new e(n),e.instance}static resetInstance(){e.instance=void 0}clientName=ne.AppManagement;webUiName="Developer Dashboard";organizationSource=G.BusinessPlatform;bundleFormat="br";_session;constructor(n){this._session=n}async subscribeToAppLogs(n,i){return this.appManagementRequest({query:ni,variables:{shopIds:n.shopIds,apiKey:n.apiKey}})}async appLogs(n,i){let a=await Xa({organizationId:i,jwtToken:n.jwtToken,cursor:n.cursor,filters:n.filters});try{let o=await a.json();return a.ok?{app_logs:o.app_logs??[],cursor:o.cursor,status:a.status}:{errors:o.errors??[`Request failed with status ${a.status}`],status:a.status}}catch(o){return{errors:[`Failed to parse response: ${o}`],status:a.status}}}async channelSpecExport(n){let i=R(n.id)??n.id,a=await ui(n.organizationId,i),o=await ie(a,{method:"GET",headers:ye(await this.token())}),r;try{r=await o.json()}catch{r=void 0}let l=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:void 0;return o.ok&&l?{ok:!0,status:o.status,body:l}:{ok:!1,status:o.status,body:l}}async session(){if(!this._session){if(an())throw new Error("AppManagementClient.session() should not be invoked dynamically in a unit test");let n=await te(),{appManagementToken:i,businessPlatformToken:a,userId:o}=n,r=await V({query:Ln,cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:o},token:a,unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")});if(Ee()&&r.currentUserAccount){let l=r.currentUserAccount.organizations.nodes.map(d=>({name:d.name}));if(l.length>1)throw new T("Multiple organizations found for the CLI token");this._session={token:i,businessPlatformToken:a,accountInfo:{type:"ServiceAccount",orgName:l[0]?.name??"Unknown organization"},userId:o}}else r.currentUserAccount?this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UserAccount",email:r.currentUserAccount.email},userId:o}:this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UnknownAccount"},userId:o}}return this._session}async token(){return(await this.session()).token}async businessPlatformToken(){return(await this.session()).businessPlatformToken}async unsafeRefreshToken(){let n=await te({noPrompt:!0,forceRefresh:!0}),i=await this.session();return i.token=n.appManagementToken,i.businessPlatformToken=n.businessPlatformToken,i.token}async accountInfo(){return(await this.session()).accountInfo}async appFromIdentifiers(n){let{app:i}=await this.activeAppVersionRawResult(n);if(!i)return;let{name:a,appModules:o}=i.activeRelease.version,r=o.find(d=>d.specification.externalIdentifier==="app_home"),l=i.activeRoot.clientCredentials.secrets.map(d=>({secret:d.key}));return{id:i.id,title:a,apiKey:i.key,apiSecretKeys:l,organizationId:String(f(i.organizationId)),grantedScopes:i.activeRoot.grantedShopifyApprovalScopes,applicationUrl:r?.config?.app_url,embedded:r?.config?.embedded,flags:[],developerPlatformClient:this}}async organizations(){return(await M()).map(i=>({...i,source:this.organizationSource}))}async orgFromId(n){let i=await Ne(n,await this.businessPlatformToken(),this.createUnauthorizedHandler("businessPlatform"));if(i)return{...i,source:this.organizationSource}}async orgAndApps(n){let[i,{apps:a,hasMorePages:o}]=await Promise.all([this.orgFromId(n),this.appsForOrg(n)]);if(!i){let{accountInfo:r}=await this.session();throw new w(r,n)}return{organization:i,apps:a,hasMorePages:o}}async appsForOrg(n,i=""){let a=On,o={query:i.split(" ").filter(d=>d).map(d=>`title:${d}`).join(" "),organizationId:n},r=await this.appManagementRequest({query:a,variables:o});if(!r.appsConnection)throw new T("Server failed to retrieve apps");return{apps:r.appsConnection.edges.map(d=>{let m=d.node;return{id:m.id,apiKey:m.key,title:m.activeRelease.version.name,organizationId:n}}),hasMorePages:r.appsConnection.pageInfo.hasNextPage}}async specifications({organizationId:n}){let i=qn,a={organizationId:Fe(n)};return(await this.appManagementRequest({query:i,variables:a})).specifications.map(r=>({name:r.name,externalName:r.name,identifier:r.identifier,externalIdentifier:r.externalIdentifier,gated:!1,managementExperience:"cli",registrationLimit:r.uidStrategy.appModuleLimit,uidStrategy:Qa(r.uidStrategy.__typename),experience:_e(r.experience,r.identifier),validationSchema:r.validationSchema}))}async templateSpecifications({organizationId:n},i={}){let a,{templatesJsonPath:o}=un,r=process.env[o];if(r){if(!await ze(r))throw new c("There is no file at the path specified for template specifications");let u=await Re(r);a=JSON.parse(u)}else try{a=await(await Oe(Si)).json()}catch{throw new c(["Failed to fetch extension templates from",{link:{url:Si}},{char:"."},"This likely means a problem with your internet connection."])}let l=0,d=i.requestedTemplate?a.filter(u=>u.identifier===i.requestedTemplate):void 0,m=d&&d.length>0?d:a,p=(await Za(m,async u=>this.organizationBetaFlags(n,u),async u=>this.organizationExpFlags(n,u))).map(u=>({...u,sortPriority:l++})),k=[];for(let u of a)u.group&&!k.includes(u.group)&&k.push(u.group);return{templates:p,groupOrder:k}}async createApp(n,i){let o=(await this.apiVersions(n.id)).publicApiVersions.filter(u=>u!=="unstable").sort().at(-1)??"unstable",r=ja(i,n.id,o),l=Pn,d=await this.appManagementRequest({query:l,variables:r});if(!d.appCreate.app||d.appCreate.userErrors?.length>0){let u=d.appCreate.userErrors.map(v=>v.message).join(", ");throw new c(u)}let m=Di([]),p=d.appCreate.app,k=p.activeRoot.clientCredentials.secrets.map(u=>({secret:u.key}));return{...p,title:i.name,apiKey:p.key,apiSecretKeys:k,grantedScopes:i?.scopesArray??[],organizationId:n.id,newApp:!0,flags:m,developerPlatformClient:this}}async devStoresForOrg(n,i){let a=await this.businessPlatformOrganizationsRequest({query:Vn,organizationId:String(f(n)),variables:{searchTerm:i}}),o=a.organization;if(!o)throw new c("No organization found");let r=o.accessibleShops?.edges.map(d=>d.node)??[],l=_i(o.currentUser?.organizationPermissions??[]);return{stores:yi(r,l),hasMorePages:a.organization?.accessibleShops?.pageInfo.hasNextPage??!1}}async devStoreCapReached(n){return(await this.businessPlatformOrganizationsRequest({query:wn,organizationId:String(f(n)),variables:{}})).organization?.devStoreCapReached??!1}async appExtensionRegistrations(n,i){let a=i??await this.activeAppVersion(n),o=[],r=[],l=[];return a.appModuleVersions.forEach(d=>{let m={id:d.registrationId,uuid:d.registrationUuid,title:d.registrationTitle,type:d.type,activeVersion:d.config?{config:JSON.stringify(d.config),...d.target&&{context:d.target}}:void 0};d.specification?.experience==="configuration"?o.push(m):d.specification?.options?.managementExperience==="dashboard"?l.push(m):r.push(m)}),{app:{dashboardManagedExtensionRegistrations:l,configurationRegistrations:o,extensionRegistrations:r}}}async appVersions({id:n,organizationId:i,title:a}){let o=Un,r={appId:n},l=await this.appManagementRequest({query:o,variables:r});return l.app?{app:{id:l.app.id,organizationId:i,title:a,appVersions:{nodes:l.app.versions?.edges.map(d=>{let m=d.node;return{createdAt:m.createdAt,createdBy:{displayName:m.createdBy},versionTag:m.metadata.versionTag,status:m.id===l.app.activeRelease.version.id?"active":"inactive",versionId:m.id,message:m.metadata.message}})??[],pageInfo:{totalResults:l.app.versionsCount}}}}:{app:null}}async appInstallCount({id:n}){let i=En,a={appId:n};return(await this.appManagementRequest({query:i,variables:a})).app.installCount??0}async appVersionByTag({id:n,organizationId:i},a){let o=ei,r={versionTag:a},d=(await this.appManagementRequest({query:o,variables:r})).versionByTag;if(!d)throw new c(`Version not found for tag: ${a}`);return{id:parseInt(d.id,10),uuid:d.id,versionTag:d.metadata.versionTag,location:[await X({organizationId:i,id:n}),"versions",f(d.id)].join("/"),message:d.metadata.message??"",appModuleVersions:d.appModules.map(bi)}}async appVersionsDiff(n,{versionId:i}){let a={versionId:i},[o,r]=await Promise.all([this.activeAppVersionRawResult(n.apiKey),this.appManagementRequest({query:Cn,variables:a})]),l=o.app.activeRelease.version.appModules,d=r.version.appModules,{added:m,removed:p,updated:k}=Ja({currentModules:l,selectedVersionModules:d});function u(v){return{uuid:v.uuid,registrationTitle:v.handle,specification:{identifier:v.specification.identifier,experience:_e(v.specification.experience,v.specification.identifier),options:{managementExperience:"cli"}}}}return{app:{versionsDiff:{added:m.map(u),updated:k.map(u),removed:p.map(u)}}}}async activeAppVersion(n){let i=await this.activeAppVersionRawResult(n.apiKey);return{appModuleVersions:i.app.activeRelease.version.appModules.map(bi),...i.app.activeRelease}}async generateSignedUploadUrl({apiKey:n,organizationId:i}){let a={sourceExtension:"BR",organizationId:Fe(i)},o=await this.appManagementRequest({query:zn,variables:a,cacheOptions:{cacheTTL:{minutes:59},cacheExtraKey:`${n}-${$a}`}});return{assetUrl:o.appRequestSourceUploadUrl.sourceUploadUrl,userErrors:o.appRequestSourceUploadUrl.userErrors}}async deploy({appManifest:n,appId:i,organizationId:a,versionTag:o,message:r,commitReference:l,bundleUrl:d,skipPublish:m}){let u={appId:i,version:d?{sourceUrl:d}:{source:n},metadata:{versionTag:o,message:r,sourceControlUrl:l}},v=await this.appManagementRequest({query:Rn,variables:u,requestOptions:{requestMode:"slow-request"}}),{version:N}=v.appVersionCreate,g=v.appVersionCreate.userErrors.map(Fi)??[];if(!N)return{appDeploy:{userErrors:g}};let h={appDeploy:{appVersion:{uuid:N.id,id:parseInt(N.id,10),versionTag:N.metadata.versionTag,location:await Ya(a,i,N.id),appModuleVersions:N.appModules.map(Te=>({uuid:Te.uuid,registrationUuid:Te.uuid,validationErrors:[]})),message:N.metadata.message},userErrors:g}};if(m)return h;let Vi={appId:i,versionId:N.id},Ae=await this.appManagementRequest({query:ke,variables:Vi});return Ae.appReleaseCreate.userErrors&&(h.appDeploy.userErrors=(h.appDeploy.userErrors??[]).concat(Ae.appReleaseCreate.userErrors.map(Fi))),h}async release({app:{id:n,organizationId:i},version:{versionId:a}}){let o={appId:n,versionId:a},r=await this.appManagementRequest({query:ke,variables:o});return r.appReleaseCreate.release?{appRelease:{appVersion:{versionTag:r.appReleaseCreate.release.version.metadata.versionTag,message:r.appReleaseCreate.release.version.metadata.message,location:[await X({organizationId:i,id:n}),"versions",f(r.appReleaseCreate.release.version.id).toString()].join("/")}}}:{appRelease:{userErrors:r.appReleaseCreate.userErrors?.map(l=>({field:l.field,message:l.message,category:l.category,details:[],on:l.on}))??[]}}}async storeByDomain(n,i,a){let r=(await Promise.all(a.map(m=>this.businessPlatformOrganizationsRequest({query:Tn,organizationId:String(f(n)),variables:{domain:i,filters:et(m)}})))).map(m=>m.organization).filter(m=>m!=null);if(r.length===0)throw new c("No organization found");let l=r.flatMap(m=>{let p=m.accessibleShops?.edges.map(u=>u.node)??[],k=_i(m.currentUser?.organizationPermissions??[]);return yi(p,k)}),d=U(i);return l.find(m=>m.shopDomain===d)}async ensureUserAccessToStore(n,i){if(!i.provisionable)return;let o={input:{shopifyShopId:Ka(i.shopId)}},l=(await A({query:In,token:await this.businessPlatformToken(),organizationId:String(f(n)),variables:o,unauthorizedHandler:this.createUnauthorizedHandler()})).organizationUserProvisionShopAccess;if(!l.success){let d=l.userErrors?.map(m=>m.message).join(", ")??"";throw new T(`Failed to provision user access to store: ${d}`)}}async sendSampleWebhook(n,i){let a=$n,o={address:n.address,apiKey:n.api_key,apiVersion:n.api_version,deliveryMethod:n.delivery_method,sharedSecret:n.shared_secret,topic:n.topic},r=await this.webhooksRequest({organizationId:i,query:a,variables:o}),l={samplePayload:"{}",headers:"{}",success:!1,userErrors:[]},d=r.cliTesting;return d&&(l={samplePayload:d.samplePayload??"{}",headers:d.headers??"{}",success:d.success,userErrors:d.errors.map(m=>({message:m,fields:[]}))}),{sendSampleWebhook:l}}async apiVersions(n){return{publicApiVersions:(await this.webhooksRequest({organizationId:n,query:Hn,variables:{}})).publicApiVersions.map(a=>a.handle)}}async topics({api_version:n},i){let a=Mn,o={apiVersion:n};return{webhookTopics:(await this.webhooksRequest({organizationId:i,query:a,variables:o})).availableTopics??[]}}async updateURLs(n){return se("\u26A0\uFE0F updateURLs is not implemented"),{appUpdate:{userErrors:[]}}}async targetSchemaDefinition(n,i,a){try{let{app:o}=await this.activeAppVersionRawResult(i),r=String(f(o.id));return(await this.functionsRequest({organizationId:a,query:Bn,appId:r,variables:{handle:n.handle,version:n.version}}))?.target?.api?.schema?.definition??null}catch(o){throw new c(`Failed to fetch schema definition: ${o}`)}}async apiSchemaDefinition(n,i,a){try{let{app:o}=await this.activeAppVersionRawResult(i),r=String(f(o.id));return(await this.functionsRequest({organizationId:a,query:jn,appId:r,variables:n}))?.api?.schema?.definition??null}catch(o){throw new c(`Failed to fetch schema definition: ${o}`)}}toExtensionGraphQLType(n){return n.toLowerCase()}async appDeepLink({id:n,organizationId:i}){return X({id:n,organizationId:i})}async devSessionCreate({appId:n,assetsUrl:i,shopFqdn:a,websocketUrl:o,unsafeValidation:r}){let l=String(f(n));return this.appDevRequest({query:_n,shopFqdn:a,variables:{appId:l,assetsUrl:i??"",websocketUrl:o,unsafeValidation:r??!1},requestOptions:{requestMode:"slow-request"}})}async devSessionUpdate({appId:n,assetsUrl:i,shopFqdn:a,manifest:o,inheritedModuleUids:r,unsafeValidation:l}){let m={appId:String(f(n)),assetsUrl:i,manifest:JSON.stringify(o),inheritedModuleUids:r,unsafeValidation:l??!1};return this.appDevRequest({query:Dn,shopFqdn:a,variables:m})}async devSessionDelete({appId:n,shopFqdn:i}){let a=String(f(n));return this.appDevRequest({query:An,shopFqdn:i,variables:{appId:a}})}async getCreateDevStoreLink(n){let i=`https://${await ae()}/dashboard/${n.id}/stores`;return[`Looks like you don't have any dev stores associated with ${n.businessName}'s Dev Dashboard.`,{link:{url:i,label:"Create a store in Dev Dashboard"}}]}async activeAppVersionRawResult(n){return this.appManagementRequest({query:xn,variables:{apiKey:n}})}async organizationBetaFlags(n,i){let a={organizationId:hi(n)},o=await Ke({query:dn(i),token:await this.businessPlatformToken(),organizationId:n,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),r={};return i.forEach(l=>{r[l]=!!o.organization[`flag_${l}`]}),r}async organizationExpFlags(n,i){let a={organizationId:hi(n),flagHandles:i},o=await A({query:ln,token:await this.businessPlatformToken(),organizationId:n,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),r={},l=o.organization?.enabledFlags??[];return i.forEach((d,m)=>{r[d]=!!l[m]}),r}async appManagementRequest(n){return ci({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async appDevRequest(n){return ki({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async businessPlatformRequest(n){return V({...n,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async businessPlatformOrganizationsRequest(n){return A({...n,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async functionsRequest(n){return fi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async webhooksRequest(n){return gi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}createUnauthorizedHandler(n="default"){return Ai(this,n)}},Ha="https://shopify.dev/apps/default-app-home",Ba="https://shopify.dev/apps/default-app-home/api/auth";function ja(e,n,i){let{isLaunchable:a,scopesArray:o,name:r}=e;return{initialVersion:{source:{source:{name:r,modules:[{type:ue,config:{app_url:a?"https://example.com":Ha,embedded:!0}},{type:ce,config:{name:r}},{type:ve,config:{api_version:i}},{type:pe,config:{redirect_url_allowlist:[a?"https://example.com/api/auth":Ba],...o&&{scopes:o.map(p=>p.trim()).join(",")}}}]}}.source},organizationId:Fe(n)}}function Wa(e){let n=e.startsWith("gid://")?f(e):Number(e);if(Number.isNaN(n))throw new Error(`Invalid organization ID: ${e}`);return`gid://organization/Organization/${n}`}function hi(e){return L(Wa(e))}function Fe(e){return`gid://shopify/Organization/${e.startsWith("gid://")?f(e):Number(e)}`}function Ka(e){return L(`gid://organization/ShopifyShop/${e}`)}function Ga(e){let n=Z(e);if(n===void 0)throw new Error(`Invalid encoded GID: ${e}`);return n}function f(e){if(e.startsWith("gid://")){let n=R(e);if(n===void 0)throw new Error(`Invalid GID: ${e}`);return Number(n)}return Number(e)}async function X({id:e,organizationId:n}){let i=f(n).toString();return`https://${await ae()}/dashboard/${i}/apps/${f(e)}`}async function Ya(e,n,i){return`${await X({organizationId:e,id:n})}/versions/${f(i)}`}function Ja({currentModules:e,selectedVersionModules:n}){let i=e.map(m=>m.userIdentifier),a=n.map(m=>m.userIdentifier),o=n.filter(m=>!i.includes(m.userIdentifier)),r=e.filter(m=>!a.includes(m.userIdentifier)),l=r.map(m=>m.userIdentifier),d=e.filter(m=>!l.includes(m.userIdentifier));return{added:o,removed:r,updated:d}}async function Za(e,n,i,a=Ve){let o=C(e.flatMap(m=>m.organizationBetaFlags??[])),r=C(e.flatMap(m=>m.organizationExpFlags??[])),[l,d]=await Promise.all([o.length>0?n(o):Promise.resolve({}),r.length>0?i(r):Promise.resolve({})]);return e.filter(m=>{let p=!m.organizationBetaFlags||m.organizationBetaFlags.every(h=>l[h]),k=!m.organizationExpFlags||m.organizationExpFlags.every(h=>d[h]),u=!m.minimumCliVersion||oe(a,`>=${m.minimumCliVersion}`),v=!m.deprecatedFromCliVersion||oe(a,`<${m.deprecatedFromCliVersion}`),N=u&&v,g=Ge(a)&&m.deprecatedFromCliVersion===void 0;return p&&k&&(N||g)})}function _e(e,n){if(n===fe)return"configuration";switch(e){case"extension":case"configuration":case"deprecated":return e;default:return se(`Unknown specification experience value "${e}", defaulting to "extension"`),"extension"}}function Qa(e){switch(e){case"UidStrategiesDynamic":return"dynamic";case"UidStrategiesStatic":return"single";case"UidStrategiesClientProvided":return"uuid";default:return"uuid"}}function yi(e,n){return e.map(i=>{let{externalId:a,primaryDomain:o,name:r,url:l,storeType:d}=i,m=l??o;if(!m)throw new T("The selected store does not have a valid URL");return{shopId:a?Ga(a):void 0,link:o,shopDomain:U(m),shopName:r,transferDisabled:!0,convertableToPartnerTest:!0,provisionable:n,storeType:d}})}function bi(e){return{registrationId:e.userIdentifier===e.uuid?"":e.userIdentifier,registrationUuid:e.uuid,registrationTitle:e.handle,type:e.specification.externalIdentifier,config:e.config,target:e.target??"",specification:{...e.specification,identifier:e.specification.identifier,options:{managementExperience:e.specification.managementExperience},experience:_e(e.specification.experience,e.specification.externalIdentifier)}}}var Xa=async({organizationId:e,jwtToken:n,cursor:i,filters:a})=>{let o=await mi(e,i,a),r=ye(n);return ie(o,{method:"GET",headers:r})};function Fi(e){let n=[],i=e.on[0]?.user_identifier;return i&&n.push({extension_id:i}),{...e,details:n}}function et(e){return[{field:"STORE_TYPE",operator:"EQUALS",value:e.toLowerCase()},{field:"STORE_STATUS",operator:"EQUALS",value:"ACTIVE"}]}function _i(e){return e.includes("ondemand_access_to_stores")}var ne;(function(e){e.AppManagement="app-management",e.Partners="partners"})(ne||(ne={}));function mn(){return ee.getInstance()}var Ti;Ti||(Ti={});var nt={};function Di(e=[]){let n=[],i=e.map(a=>nt[a]);return n.filter(a=>!i.includes(a))}var De=new WeakMap;function Ai(e,n="default"){return{type:"token_refresh",handler:async()=>{let i=De.get(e);if(i)await i;else try{i=e.unsafeRefreshToken(),De.set(e,i),await i}finally{De.delete(e)}let a=await e.session();return{token:n==="businessPlatform"?a.businessPlatformToken:a.token}}}}export{x as a,Z as b,Fa as c,Ne as d,ge as e,Da as f,Aa as g,z as h,$ as i,Q as j,he as k,Ia as l,Ra as m,za as n,Ca as o,un as p,Ii as q,yt as r,bt as s,cn as t,Ft as u,_t as v,it as w,rn as x,at as y,wi as z,tt as A,pn as B,kn as C,xi as D,It as E,xt as F,Li as G,Y as H,Rt as I,F as J,zt as K,I as L,J as M,Wi as N,Sn as O,Zi as P,hn as Q,yn as R,S,so as T,fe as U,ts as V,O as W,Wn as X,Zn as Y,va as Z,Xn as _,G as $,ue as aa,vo as ba,ce as ca,yo as da,sa as ea,da as fa,pe as ga,wo as ha,ve as ia,Kr as ja,Wa as ka,ne as la,mn as ma,Ai as na,le as oa,w as pa,ft as qa,Nt as ra,gt as sa};