shopify 5.0.2 → 5.1.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 (526) hide show
  1. package/dist/analytics-QFDTQYPM.js +1 -0
  2. package/dist/analytics-XADBBHOH.js +1 -0
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/chunk-24Q6X53V.js +1 -0
  5. package/dist/{chunk-LEHBZKK3.js → chunk-25MYHE4W.js} +1 -1
  6. package/dist/{chunk-TODZ3TJR.js → chunk-27JT4NA4.js} +1 -1
  7. package/dist/chunk-2BYW3BYX.js +1 -0
  8. package/dist/chunk-2KFYIYLI.js +1 -0
  9. package/dist/{chunk-D2KIGKBI.js → chunk-2KUM2RU4.js} +60 -60
  10. package/dist/chunk-2PD7TNFS.js +275 -0
  11. package/dist/{chunk-64G5TGFF.js → chunk-3C72S6LO.js} +1 -1
  12. package/dist/chunk-3FZ4LE6A.js +10 -0
  13. package/dist/{chunk-3MYDSQHF.js → chunk-3GD5ESWN.js} +1 -1
  14. package/dist/chunk-3KGN6N7E.js +1 -0
  15. package/dist/{chunk-KNWT7JLL.js → chunk-3MZ7ELHS.js} +2 -2
  16. package/dist/{chunk-PF53E2DC.js → chunk-3PS52ZT4.js} +1 -1
  17. package/dist/chunk-3PYDIBTX.js +1 -0
  18. package/dist/chunk-3Z75BVGJ.js +1 -0
  19. package/dist/chunk-4FWPOGPQ.js +1 -0
  20. package/dist/chunk-4IP37MBX.js +1 -0
  21. package/dist/chunk-4NFX7YCT.js +1 -0
  22. package/dist/chunk-4TCXPHKN.js +1 -0
  23. package/dist/chunk-4WBWZIN5.js +6 -0
  24. package/dist/chunk-5534MHZW.js +97 -0
  25. package/dist/{chunk-UKWIWCOH.js → chunk-5C6CXU74.js} +1 -1
  26. package/dist/{chunk-QEKGGTMN.js → chunk-5HOZDOJ7.js} +1 -1
  27. package/dist/{chunk-ER6C5WS3.js → chunk-5PSQFQL6.js} +1 -1
  28. package/dist/chunk-5T3ZT6CC.js +1 -0
  29. package/dist/chunk-62NW4EPI.js +17 -0
  30. package/dist/chunk-65NCQJYR.js +1 -0
  31. package/dist/{chunk-IHXGZW42.js → chunk-6BYHL3DS.js} +1 -1
  32. package/dist/chunk-6I7DT7QR.js +3 -0
  33. package/dist/chunk-6IMTMS2S.js +3 -0
  34. package/dist/chunk-7A77JCED.js +11 -0
  35. package/dist/chunk-7ART2IKU.js +1 -0
  36. package/dist/{chunk-I4CEH7AK.js → chunk-7BPT5V24.js} +2 -2
  37. package/dist/{chunk-Z2WAW6MM.js → chunk-7CT3NIXI.js} +1 -1
  38. package/dist/chunk-7DBKSSDK.js +1 -0
  39. package/dist/chunk-7HECBXSP.js +1 -0
  40. package/dist/chunk-7KID5BIR.js +4 -0
  41. package/dist/{chunk-2L6AN3QA.js → chunk-7N7KRZOM.js} +1 -1
  42. package/dist/{chunk-W37IFK3P.js → chunk-7NRHZG5Y.js} +102 -102
  43. package/dist/chunk-7PHDEILV.js +1 -0
  44. package/dist/chunk-A2NSORBM.js +2296 -0
  45. package/dist/chunk-A54TADAZ.js +1 -0
  46. package/dist/{chunk-YTUUU33R.js → chunk-AE3IQG7S.js} +1 -1
  47. package/dist/chunk-AGTUAQHX.js +4 -0
  48. package/dist/chunk-AHYI27QL.js +11 -0
  49. package/dist/chunk-ALINJ6J2.js +1 -0
  50. package/dist/chunk-AMVWKHNY.js +1 -0
  51. package/dist/{chunk-NVKJ7ZLP.js → chunk-ASKBYEO7.js} +1 -1
  52. package/dist/{chunk-62EOM3Y2.js → chunk-AVJJGQOP.js} +1 -1
  53. package/dist/{chunk-NXAEBGMO.js → chunk-AY3AAV77.js} +1 -1
  54. package/dist/{chunk-F3CK3EJJ.js → chunk-BFAOTQGH.js} +1 -1
  55. package/dist/{chunk-H6GNKWYM.js → chunk-BPKQA2EO.js} +1 -1
  56. package/dist/{chunk-WESTVWWD.js → chunk-C2HJEGTS.js} +1 -1
  57. package/dist/chunk-C72QNK6O.js +4 -0
  58. package/dist/chunk-CDSDQTNB.js +16 -0
  59. package/dist/chunk-CEQGOCKX.js +1 -0
  60. package/dist/{chunk-WCC52MR2.js → chunk-CIGWIKOW.js} +1 -1
  61. package/dist/chunk-CQAD5WML.js +1 -0
  62. package/dist/chunk-CRQQCT7F.js +1 -0
  63. package/dist/chunk-CZNUBAAG.js +3 -0
  64. package/dist/{chunk-ISKQQXLZ.js → chunk-D7IMC2G4.js} +1 -1
  65. package/dist/{chunk-6ES4KRFW.js → chunk-DC7ITY6T.js} +1 -1
  66. package/dist/{chunk-7GHSE7SG.js → chunk-DDRP6QTC.js} +1 -1
  67. package/dist/{chunk-SLY27GDC.js → chunk-DDZYIC76.js} +2 -2
  68. package/dist/chunk-DGIIUQH3.js +1 -0
  69. package/dist/{chunk-3KM5ZOW2.js → chunk-DMOLPSXF.js} +1 -1
  70. package/dist/{chunk-LHXFTFFM.js → chunk-DOLVBTCB.js} +1 -1
  71. package/dist/{chunk-WBVS5NBV.js → chunk-DTKGI43P.js} +2 -2
  72. package/dist/{chunk-2WJOTJOD.js → chunk-DVD7I2TX.js} +2 -2
  73. package/dist/chunk-DVFVO6ZE.js +2 -0
  74. package/dist/{chunk-3XRI3D44.js → chunk-DXEMSLI6.js} +1 -1
  75. package/dist/chunk-EDWIWZWM.js +15 -0
  76. package/dist/chunk-ELR6AZT4.js +9 -0
  77. package/dist/chunk-EVQPYZ7F.js +5 -0
  78. package/dist/chunk-F5QKMDP3.js +1 -0
  79. package/dist/{chunk-URXM5A2K.js → chunk-F6IQWX2F.js} +1 -1
  80. package/dist/{chunk-SACNUF4I.js → chunk-FAVPTYIR.js} +1 -1
  81. package/dist/{chunk-Q7BOSHWX.js → chunk-FDSNRKGQ.js} +1 -1
  82. package/dist/{chunk-Q4JYAUVL.js → chunk-FHKK3QU7.js} +1 -1
  83. package/dist/chunk-FKKJQGYX.js +7 -0
  84. package/dist/chunk-FQLXQ7WN.js +16 -0
  85. package/dist/{chunk-6PUU6ZNQ.js → chunk-FRWQJAW2.js} +1 -1
  86. package/dist/{chunk-J5ERDFIC.js → chunk-FU7PYW7H.js} +1 -1
  87. package/dist/{chunk-ESFCYB46.js → chunk-FYQE5E6U.js} +1 -1
  88. package/dist/chunk-G3EWGBXR.js +1 -0
  89. package/dist/chunk-G3RNO2TC.js +1 -0
  90. package/dist/{chunk-35XFNKNB.js → chunk-GGCP2TIK.js} +1 -1
  91. package/dist/chunk-GSFWBFFH.js +1 -0
  92. package/dist/{chunk-ZRI3SSLG.js → chunk-H2KGP2FM.js} +2 -2
  93. package/dist/{chunk-GW7YIJPJ.js → chunk-H4K3F7PP.js} +1 -1
  94. package/dist/chunk-HGZ2HRPO.js +13 -0
  95. package/dist/chunk-HMPRWNGG.js +203 -0
  96. package/dist/chunk-HP4QYSBQ.js +1 -0
  97. package/dist/{chunk-RPCIFYCY.js → chunk-HSTZV6H7.js} +2 -2
  98. package/dist/{chunk-N57Y7THE.js → chunk-HVUMVDUG.js} +1 -1
  99. package/dist/{chunk-XWSWXQCC.js → chunk-HYCNYUHW.js} +1 -1
  100. package/dist/{chunk-CXI3RHPW.js → chunk-I3WRA2LH.js} +1 -1
  101. package/dist/{chunk-UUAKOX7E.js → chunk-IRLYC626.js} +2 -2
  102. package/dist/chunk-IWNFPBH2.js +33 -0
  103. package/dist/{chunk-C3RFAKWR.js → chunk-JALDNBTU.js} +1 -1
  104. package/dist/{chunk-QDCLL5OI.js → chunk-JC37YZ4I.js} +1 -1
  105. package/dist/{chunk-QF5WKTPD.js → chunk-JG4FAT2T.js} +1 -1
  106. package/dist/chunk-JGLLABZR.js +8 -0
  107. package/dist/chunk-JIY6XWSC.js +1 -0
  108. package/dist/{chunk-3ODQKAEA.js → chunk-JIYCZXK5.js} +1 -1
  109. package/dist/chunk-JMSAHCBU.js +35 -0
  110. package/dist/{chunk-KZRLZWOU.js → chunk-JNSVKDBY.js} +1 -1
  111. package/dist/chunk-JQU2BJDH.js +3 -0
  112. package/dist/chunk-JVY6CCLE.js +3 -0
  113. package/dist/{chunk-BAHIL37I.js → chunk-K4QJEQI4.js} +1 -1
  114. package/dist/chunk-KCAWHJGF.js +1 -0
  115. package/dist/{chunk-YV2TP44L.js → chunk-KFO2JNF5.js} +1 -1
  116. package/dist/chunk-KFR7HWCG.js +9 -0
  117. package/dist/{chunk-MEYVUHQH.js → chunk-KHZF73BL.js} +1 -1
  118. package/dist/{chunk-LGXI7EGM.js → chunk-KM4LE7K4.js} +2 -2
  119. package/dist/{chunk-IILLQOUC.js → chunk-L2PUDV7Y.js} +1 -1
  120. package/dist/chunk-LFBFPK22.js +1 -0
  121. package/dist/{chunk-BN7ZXAZJ.js → chunk-LG3KEHGD.js} +2 -2
  122. package/dist/chunk-LGDWE3H3.js +1 -0
  123. package/dist/chunk-LPPEAMI6.js +1 -0
  124. package/dist/chunk-LXIWMYM4.js +1 -0
  125. package/dist/chunk-MGWCXTGD.js +1 -0
  126. package/dist/chunk-MGX7UG44.js +1 -0
  127. package/dist/chunk-MKFRKNHF.js +3 -0
  128. package/dist/chunk-MTT6EAQO.js +1 -0
  129. package/dist/{chunk-SIL6HPMK.js → chunk-MU7IVBGI.js} +2 -2
  130. package/dist/{chunk-QEVTBD33.js → chunk-MYMBHVC4.js} +1 -1
  131. package/dist/chunk-MZDBH4XV.js +4 -0
  132. package/dist/{chunk-Q5IC3IYY.js → chunk-NUBJ2HK7.js} +1 -1
  133. package/dist/{chunk-3Z3MADXZ.js → chunk-NY5N4ANL.js} +1 -1
  134. package/dist/{chunk-WRZWHT6M.js → chunk-NYMKGE3J.js} +1 -1
  135. package/dist/{chunk-CX5CC6P5.js → chunk-O472FAYX.js} +1 -1
  136. package/dist/chunk-O7HZ3EIP.js +1 -0
  137. package/dist/chunk-OJOF6IYG.js +9 -0
  138. package/dist/{chunk-UXVXVI6O.js → chunk-ONZULPQH.js} +68 -66
  139. package/dist/chunk-ORMXPSJM.js +1 -0
  140. package/dist/chunk-ORYEDUKM.js +5 -0
  141. package/dist/{chunk-T4XJKM6B.js → chunk-OTMYJWIP.js} +1 -1
  142. package/dist/chunk-OVJVFB5E.js +20 -0
  143. package/dist/chunk-OWQEFORZ.js +1 -0
  144. package/dist/{chunk-UBP3LQFY.js → chunk-OXPEBT4I.js} +2 -2
  145. package/dist/chunk-OXZR2MB4.js +6 -0
  146. package/dist/chunk-OY5M52EF.js +6 -0
  147. package/dist/{chunk-2A2JSAAA.js → chunk-PJZZZNWR.js} +1 -1
  148. package/dist/chunk-Q2LQJYRK.js +16 -0
  149. package/dist/chunk-QBRRFFMZ.js +1 -0
  150. package/dist/{chunk-AQKWPRZE.js → chunk-QCLE5REL.js} +2 -2
  151. package/dist/{chunk-43R5VGKT.js → chunk-QGQWVA7N.js} +1 -1
  152. package/dist/chunk-QKPAB245.js +1 -0
  153. package/dist/chunk-QUPZOBTB.js +1 -0
  154. package/dist/chunk-R4E2E4NN.js +1 -0
  155. package/dist/{chunk-CGVROSPS.js → chunk-R6US7F33.js} +1 -1
  156. package/dist/chunk-RKNVTEO3.js +5 -0
  157. package/dist/{chunk-7CCTPBCT.js → chunk-RLOEI6VE.js} +1 -1
  158. package/dist/chunk-RSZAAN37.js +1 -0
  159. package/dist/{chunk-WBJ6ZHYH.js → chunk-S3RROJGG.js} +37 -37
  160. package/dist/chunk-S4KNPCW3.js +81 -0
  161. package/dist/{chunk-26PWHH3B.js → chunk-SBN3ILXO.js} +1 -1
  162. package/dist/chunk-SCDGLREP.js +1 -0
  163. package/dist/chunk-SHOMIS6Q.js +2 -0
  164. package/dist/chunk-SN3PMWUF.js +6 -0
  165. package/dist/chunk-SODCXZ5U.js +1 -0
  166. package/dist/chunk-SPJM7RTD.js +1 -0
  167. package/dist/chunk-SQL67BKI.js +5 -0
  168. package/dist/{chunk-AQ6EVL73.js → chunk-SURFUFAZ.js} +1 -1
  169. package/dist/{chunk-SNH4XZ6E.js → chunk-SVQDMZJO.js} +1 -1
  170. package/dist/chunk-T4ZOTYOY.js +1 -0
  171. package/dist/chunk-T6C4WC3Z.js +2 -0
  172. package/dist/chunk-TD6JBHUS.js +1 -0
  173. package/dist/chunk-TIM4CIXZ.js +22 -0
  174. package/dist/{chunk-B2O3ANRZ.js → chunk-TP7CTMMT.js} +1 -1
  175. package/dist/chunk-TSPJAMYB.js +1 -0
  176. package/dist/chunk-TSVEV2UD.js +26 -0
  177. package/dist/{chunk-ZBL7XMJ6.js → chunk-TTAT62N3.js} +2 -2
  178. package/dist/{chunk-S5P7KWY4.js → chunk-TUSS6PXB.js} +1 -1
  179. package/dist/chunk-TXP6KFWO.js +5 -0
  180. package/dist/chunk-TZHVCMZN.js +6 -0
  181. package/dist/chunk-UC4TOM36.js +3 -0
  182. package/dist/{chunk-RPVZ2JON.js → chunk-UFY4L5KQ.js} +1 -1
  183. package/dist/chunk-UU6UQ2QY.js +1 -0
  184. package/dist/chunk-V4FC72R6.js +1 -0
  185. package/dist/chunk-VA2S7W7H.js +10 -0
  186. package/dist/chunk-VE3IIC7H.js +1 -0
  187. package/dist/{chunk-PTSCGSQV.js → chunk-VJG7VXFU.js} +2 -2
  188. package/dist/chunk-VQSRU5XL.js +4 -0
  189. package/dist/chunk-VRIFLMA3.js +70 -0
  190. package/dist/chunk-WBJFTCEJ.js +1 -0
  191. package/dist/chunk-WBPP6PO7.js +31 -0
  192. package/dist/chunk-WE5KY6T6.js +1 -0
  193. package/dist/chunk-WFPVT2IY.js +1 -0
  194. package/dist/{chunk-PLSS456F.js → chunk-WLYXBQ2M.js} +1 -1
  195. package/dist/chunk-WNVOEE6T.js +7 -0
  196. package/dist/chunk-WPDJVUTY.js +47 -0
  197. package/dist/chunk-WWCYEZUU.js +1 -0
  198. package/dist/chunk-WWVDZ3GC.js +3 -0
  199. package/dist/{chunk-4KECSZTL.js → chunk-WZBZ7FWP.js} +2 -2
  200. package/dist/chunk-XEZPN5TR.js +22 -0
  201. package/dist/{chunk-QW52RPAU.js → chunk-XLMKHTJ5.js} +1 -1
  202. package/dist/chunk-XRNBCV2B.js +1 -0
  203. package/dist/{chunk-67L7FIB6.js → chunk-XWLNCBAG.js} +1 -1
  204. package/dist/chunk-YF4AXKM4.js +1 -0
  205. package/dist/chunk-YKDRUAY3.js +857 -0
  206. package/dist/{chunk-YSWVYPWR.js → chunk-YNFQBYSL.js} +1 -1
  207. package/dist/{chunk-TFPW2VGN.js → chunk-YNZLLZU2.js} +1 -1
  208. package/dist/chunk-YOYPYB4H.js +1 -0
  209. package/dist/{chunk-HF4NDEX3.js → chunk-YR4J46US.js} +1 -1
  210. package/dist/chunk-YTL45RXR.js +103 -0
  211. package/dist/chunk-YVPB7OT6.js +6 -0
  212. package/dist/chunk-YYWSHRO2.js +89 -0
  213. package/dist/{chunk-DZKFP6H2.js → chunk-Z5QEXS6F.js} +1 -1
  214. package/dist/chunk-Z5WFRYVQ.js +6 -0
  215. package/dist/{chunk-PWAT52M4.js → chunk-Z6ZRS256.js} +1 -1
  216. package/dist/chunk-ZMOW2YZ4.js +18 -0
  217. package/dist/chunk-ZMU4EYXT.js +1 -0
  218. package/dist/{chunk-ACA2BGAD.js → chunk-ZNEPRGFY.js} +1 -1
  219. package/dist/chunk-ZXZWMXXK.js +7 -0
  220. package/dist/cli/commands/app/build.js +1 -1
  221. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  222. package/dist/cli/commands/app/bulk/execute.js +1 -1
  223. package/dist/cli/commands/app/bulk/status.js +1 -1
  224. package/dist/cli/commands/app/config/link.js +1 -1
  225. package/dist/cli/commands/app/config/pull.js +1 -1
  226. package/dist/cli/commands/app/config/use.js +1 -1
  227. package/dist/cli/commands/app/config/validate.js +1 -1
  228. package/dist/cli/commands/app/demo/watcher.js +1 -1
  229. package/dist/cli/commands/app/deploy.js +1 -1
  230. package/dist/cli/commands/app/dev/clean.js +1 -1
  231. package/dist/cli/commands/app/dev.js +1 -1
  232. package/dist/cli/commands/app/env/pull.js +1 -1
  233. package/dist/cli/commands/app/env/show.js +1 -1
  234. package/dist/cli/commands/app/execute.js +1 -1
  235. package/dist/cli/commands/app/function/build.js +1 -1
  236. package/dist/cli/commands/app/function/info.js +1 -1
  237. package/dist/cli/commands/app/function/replay.js +1 -1
  238. package/dist/cli/commands/app/function/run.js +1 -1
  239. package/dist/cli/commands/app/function/schema.js +1 -1
  240. package/dist/cli/commands/app/function/typegen.js +1 -1
  241. package/dist/cli/commands/app/generate/extension.js +1 -1
  242. package/dist/cli/commands/app/graphiql.js +1 -1
  243. package/dist/cli/commands/app/import/channel-config.js +1 -1
  244. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
  245. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
  246. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  247. package/dist/cli/commands/app/import-extensions.js +1 -1
  248. package/dist/cli/commands/app/info.js +1 -1
  249. package/dist/cli/commands/app/init.js +1 -1
  250. package/dist/cli/commands/app/logs-next.js +1 -0
  251. package/dist/cli/commands/app/logs.js +1 -1
  252. package/dist/cli/commands/app/release.js +1 -1
  253. package/dist/cli/commands/app/security/check.js +1 -1
  254. package/dist/cli/commands/app/security/clean.js +1 -1
  255. package/dist/cli/commands/app/security/instructions.js +1 -1
  256. package/dist/cli/commands/app/security/record.js +1 -1
  257. package/dist/cli/commands/app/security/review.js +1 -1
  258. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  259. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  260. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  261. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  262. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  263. package/dist/cli/commands/app/versions/list.js +1 -1
  264. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  265. package/dist/cli/commands/auth/login.d.ts +10 -10
  266. package/dist/cli/commands/auth/login.js +1 -1
  267. package/dist/cli/commands/auth/logout.d.ts +7 -7
  268. package/dist/cli/commands/auth/logout.js +1 -1
  269. package/dist/cli/commands/cache/clear.js +1 -1
  270. package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -7
  271. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  272. package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -7
  273. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  274. package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -7
  275. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  276. package/dist/cli/commands/debug/command-flags.js +1 -1
  277. package/dist/cli/commands/doc/fetch.d.ts +21 -21
  278. package/dist/cli/commands/doc/fetch.js +1 -1
  279. package/dist/cli/commands/doc/search.d.ts +23 -23
  280. package/dist/cli/commands/doc/search.js +1 -1
  281. package/dist/cli/commands/docs/generate.js +1 -1
  282. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  283. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  284. package/dist/cli/commands/help.d.ts +90 -90
  285. package/dist/cli/commands/help.js +1 -1
  286. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  287. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  288. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  289. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  290. package/dist/cli/commands/notifications/generate.js +1 -1
  291. package/dist/cli/commands/notifications/list.js +1 -1
  292. package/dist/cli/commands/organization/list.js +1 -1
  293. package/dist/cli/commands/search.d.ts +7 -7
  294. package/dist/cli/commands/search.js +1 -1
  295. package/dist/cli/commands/send-analytics.js +1 -1
  296. package/dist/cli/commands/theme/check.js +1 -1
  297. package/dist/cli/commands/theme/console.js +1 -1
  298. package/dist/cli/commands/theme/delete.js +1 -1
  299. package/dist/cli/commands/theme/dev.js +1 -1
  300. package/dist/cli/commands/theme/duplicate.js +1 -1
  301. package/dist/cli/commands/theme/info.js +1 -1
  302. package/dist/cli/commands/theme/init.js +1 -1
  303. package/dist/cli/commands/theme/language-server.js +1 -1
  304. package/dist/cli/commands/theme/list.js +1 -1
  305. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  306. package/dist/cli/commands/theme/open.js +1 -1
  307. package/dist/cli/commands/theme/package.js +1 -1
  308. package/dist/cli/commands/theme/preview.js +1 -1
  309. package/dist/cli/commands/theme/profile.js +1 -1
  310. package/dist/cli/commands/theme/publish.js +1 -1
  311. package/dist/cli/commands/theme/pull.js +1 -1
  312. package/dist/cli/commands/theme/push.js +1 -1
  313. package/dist/cli/commands/theme/rename.js +1 -1
  314. package/dist/cli/commands/theme/share.js +1 -1
  315. package/dist/cli/commands/upgrade.d.ts +24 -24
  316. package/dist/cli/commands/upgrade.js +1 -1
  317. package/dist/cli/commands/version.d.ts +7 -7
  318. package/dist/cli/commands/version.js +1 -1
  319. package/dist/cli/help.js +1 -1
  320. package/dist/cli-version-check-V25AVSZ6.js +1 -0
  321. package/dist/{command-event-context-LFUZ7UCA.js → command-event-context-ILIANB5Q.js} +1 -1
  322. package/dist/command-json-schema-C5UZXP2W.js +1 -0
  323. package/dist/command-registry.js +1 -1
  324. package/dist/conf-store-OCGEEV4U.js +1 -0
  325. package/dist/custom-oclif-loader-ZVUKMRGH.js +1 -0
  326. package/dist/data/filters.json +41 -2
  327. package/dist/data/local_block_entry.json +1 -1
  328. package/dist/data/manifest_theme.json +1 -0
  329. package/dist/data/objects.json +78 -36
  330. package/dist/data/section.json +1 -1
  331. package/dist/data/shopify_system_translations.json +240 -23
  332. package/dist/data/strict_settings.json +24 -0
  333. package/dist/data/tags.json +57 -24
  334. package/dist/data/theme_block.json +1 -1
  335. package/dist/deprecations-A5AXXKIK.js +1 -0
  336. package/dist/dist-NORLLIHQ.js +1 -0
  337. package/dist/dist-XBM4XZS4.js +1 -0
  338. package/dist/environment-5P7JJ3GI.js +1 -0
  339. package/dist/environments-Y5JEI3U3.js +1 -0
  340. package/dist/error-GI4DXVDU.js +1 -0
  341. package/dist/error-handler-BS2ZENQV.js +1 -0
  342. package/dist/fs-UOOLPOHJ.js +1 -0
  343. package/dist/hooks/did-you-mean.js +1 -1
  344. package/dist/hooks/hydrogen-init.js +1 -1
  345. package/dist/hooks/plugin-plugins.js +1 -1
  346. package/dist/hooks/postrun.js +1 -1
  347. package/dist/hooks/prerun.js +2 -2
  348. package/dist/hooks/public-metadata.js +1 -1
  349. package/dist/hooks/sensitive-metadata.js +1 -1
  350. package/dist/hooks/tunnel-provider.js +1 -1
  351. package/dist/hooks/tunnel-start.js +1 -1
  352. package/dist/http-2OXOS2AW.js +1 -0
  353. package/dist/http-proxy-node16-NZZ674YW.js +38 -0
  354. package/dist/index.js +12 -12
  355. package/dist/is-global-CI77T7NE.js +1 -0
  356. package/dist/json-error-6PBUR4LQ.js +1 -0
  357. package/dist/latest-version-75YEFEMK.js +9 -0
  358. package/dist/lib-4JVADMNT.js +1 -0
  359. package/dist/lib-L4STV5B2.js +1 -0
  360. package/dist/lib-LEEN55OD.js +1 -0
  361. package/dist/{local-OKPVB4NH.js → local-5NIWPWDS.js} +1 -1
  362. package/dist/metadata-IXPNNPNJ.js +1 -0
  363. package/dist/{morph-CRY35DIK.js → morph-H7XQP55V.js} +3 -3
  364. package/dist/node-package-manager-ALFEGGD6.js +1 -0
  365. package/dist/notifications-system-FQW3GKH2.js +1 -0
  366. package/dist/{npa-A4YSCQ5Q.js → npa-LVYMN7GE.js} +1 -1
  367. package/dist/os-6TNQTEUN.js +1 -0
  368. package/dist/output-LEOB5LAM.js +1 -0
  369. package/dist/{prettier-EGVCP5CY.js → prettier-VLTY4MIE.js} +1 -1
  370. package/dist/registry-auth-token-EDH77OOW.js +1 -0
  371. package/dist/registry-url-JMNV3LLX.js +1 -0
  372. package/dist/semver-HHZRKD6Y.js +1 -0
  373. package/dist/system-J4CTESP5.js +1 -0
  374. package/dist/tsconfig.tsbuildinfo +1 -1
  375. package/dist/ui-YDUI56E3.js +1 -0
  376. package/dist/upgrade-LBCZORG2.js +1 -0
  377. package/dist/version-2YL4YEQ2.js +1 -0
  378. package/dist/version-X2CPQVWQ.js +1 -0
  379. package/dist/workerd-5UPTEWNI.js +18 -0
  380. package/oclif.manifest.json +25622 -1132
  381. package/package.json +7 -7
  382. package/dist/analytics-NMMVOF4B.js +0 -1
  383. package/dist/analytics-UK77WNLG.js +0 -1
  384. package/dist/chunk-224UPIYS.js +0 -4
  385. package/dist/chunk-27NXPOAS.js +0 -1
  386. package/dist/chunk-2MT3LSMZ.js +0 -1
  387. package/dist/chunk-2T4HDR6R.js +0 -70
  388. package/dist/chunk-2ZBXHCQZ.js +0 -1
  389. package/dist/chunk-335BUVBP.js +0 -1
  390. package/dist/chunk-33ZE3DRQ.js +0 -16
  391. package/dist/chunk-34MOWGRL.js +0 -1
  392. package/dist/chunk-3JSKNXL7.js +0 -1
  393. package/dist/chunk-3MG4MTWQ.js +0 -1
  394. package/dist/chunk-4WYKPIN3.js +0 -1
  395. package/dist/chunk-5AEZJZNQ.js +0 -1
  396. package/dist/chunk-5ED7SOQZ.js +0 -20
  397. package/dist/chunk-5IDJALJH.js +0 -1
  398. package/dist/chunk-66TMIQMB.js +0 -1
  399. package/dist/chunk-74NRFUGQ.js +0 -1
  400. package/dist/chunk-7GUMJ5E4.js +0 -1
  401. package/dist/chunk-7NFTSBHQ.js +0 -10
  402. package/dist/chunk-ACZNWIRY.js +0 -1
  403. package/dist/chunk-AUE7LM32.js +0 -1
  404. package/dist/chunk-AXL2VIWA.js +0 -16
  405. package/dist/chunk-B3ZJGYZY.js +0 -3
  406. package/dist/chunk-BOAGJ6P5.js +0 -1
  407. package/dist/chunk-BWN2QG6D.js +0 -5
  408. package/dist/chunk-CCUQM4FX.js +0 -6
  409. package/dist/chunk-CLUUA3HX.js +0 -3
  410. package/dist/chunk-CYEEGTVZ.js +0 -11
  411. package/dist/chunk-DBDTE3EE.js +0 -5
  412. package/dist/chunk-DLVB3237.js +0 -31
  413. package/dist/chunk-DN6X7SHW.js +0 -2
  414. package/dist/chunk-E5COIKGY.js +0 -5
  415. package/dist/chunk-E6RONHMT.js +0 -1
  416. package/dist/chunk-EAZIQI2D.js +0 -1
  417. package/dist/chunk-EEY4FKAW.js +0 -1
  418. package/dist/chunk-EKFPTBXC.js +0 -1
  419. package/dist/chunk-FEBOZ2XX.js +0 -31
  420. package/dist/chunk-FFSDGRAN.js +0 -1
  421. package/dist/chunk-FZCGRIOM.js +0 -1
  422. package/dist/chunk-GNCVDN7U.js +0 -1
  423. package/dist/chunk-GQLNG537.js +0 -836
  424. package/dist/chunk-GVI3DWSB.js +0 -4
  425. package/dist/chunk-H6GYBLVQ.js +0 -2
  426. package/dist/chunk-HB3MJYBK.js +0 -1
  427. package/dist/chunk-HSKDFEXW.js +0 -1
  428. package/dist/chunk-HTRJU4R4.js +0 -1
  429. package/dist/chunk-HXZAY5OA.js +0 -1
  430. package/dist/chunk-I7PEEJVH.js +0 -1
  431. package/dist/chunk-IHMATNOR.js +0 -1
  432. package/dist/chunk-IJY3RJPJ.js +0 -47
  433. package/dist/chunk-J3JPJCWP.js +0 -1
  434. package/dist/chunk-J55GQLP4.js +0 -1
  435. package/dist/chunk-JLQRDFR5.js +0 -18
  436. package/dist/chunk-JPWRZ5SL.js +0 -16
  437. package/dist/chunk-K7ZSPQKL.js +0 -4
  438. package/dist/chunk-L5TSPCSY.js +0 -26
  439. package/dist/chunk-LUGMXSRI.js +0 -9
  440. package/dist/chunk-M2CWCOFU.js +0 -11
  441. package/dist/chunk-M5VIFG2V.js +0 -1
  442. package/dist/chunk-MADINS4Z.js +0 -1
  443. package/dist/chunk-MGHPF7HU.js +0 -6
  444. package/dist/chunk-MHR5OHT5.js +0 -10
  445. package/dist/chunk-MXEXP3HT.js +0 -15
  446. package/dist/chunk-OJULL7HT.js +0 -1
  447. package/dist/chunk-OMPQ7REW.js +0 -3
  448. package/dist/chunk-OR4IJ4BQ.js +0 -1
  449. package/dist/chunk-P2RMFHQP.js +0 -1
  450. package/dist/chunk-P4VZYOKO.js +0 -15
  451. package/dist/chunk-PDZBKVWL.js +0 -97
  452. package/dist/chunk-Q2KWXZQB.js +0 -12
  453. package/dist/chunk-QFSENE5T.js +0 -3
  454. package/dist/chunk-QFWWCZOI.js +0 -1
  455. package/dist/chunk-QFYLJVJW.js +0 -77
  456. package/dist/chunk-QQJNQNKP.js +0 -6
  457. package/dist/chunk-R4UVIYZP.js +0 -4
  458. package/dist/chunk-RLNIOJH3.js +0 -272
  459. package/dist/chunk-RW6G4ZPU.js +0 -1
  460. package/dist/chunk-S4LOWCGS.js +0 -1
  461. package/dist/chunk-SB27UOXX.js +0 -1
  462. package/dist/chunk-SHD4VV5V.js +0 -3
  463. package/dist/chunk-SK7EPN6C.js +0 -1
  464. package/dist/chunk-TAWCKJKP.js +0 -1
  465. package/dist/chunk-U2T5HPRD.js +0 -319
  466. package/dist/chunk-U6YOP562.js +0 -1
  467. package/dist/chunk-UPPO3BMT.js +0 -7
  468. package/dist/chunk-USXIXANP.js +0 -103
  469. package/dist/chunk-UV5GAGAD.js +0 -1
  470. package/dist/chunk-UY6W2EVZ.js +0 -1
  471. package/dist/chunk-UYELAINQ.js +0 -16
  472. package/dist/chunk-V75WUEFU.js +0 -1
  473. package/dist/chunk-VAVXDIUX.js +0 -6
  474. package/dist/chunk-VEUKT5EI.js +0 -6
  475. package/dist/chunk-VGSH52JM.js +0 -1
  476. package/dist/chunk-VHZ6RL67.js +0 -1
  477. package/dist/chunk-VQA3X7O3.js +0 -1
  478. package/dist/chunk-VZCMJRYV.js +0 -1
  479. package/dist/chunk-W56ZGEQQ.js +0 -2265
  480. package/dist/chunk-WSDKCQH6.js +0 -6
  481. package/dist/chunk-X2PFXSU4.js +0 -1
  482. package/dist/chunk-X5NIAZA4.js +0 -1
  483. package/dist/chunk-XBMD3FEZ.js +0 -3
  484. package/dist/chunk-XDVPIGXE.js +0 -2
  485. package/dist/chunk-XLIJYJ6Q.js +0 -1
  486. package/dist/chunk-XUHGWIWW.js +0 -4
  487. package/dist/chunk-Y55T4IIQ.js +0 -7
  488. package/dist/chunk-Y5CVX5LJ.js +0 -1
  489. package/dist/chunk-Y6J46XYF.js +0 -3
  490. package/dist/chunk-YKMINHYY.js +0 -3
  491. package/dist/chunk-ZDQO6CNY.js +0 -1
  492. package/dist/chunk-ZGASBRSQ.js +0 -5
  493. package/dist/chunk-ZGBTO46A.js +0 -1
  494. package/dist/chunk-ZJOX5HW4.js +0 -22
  495. package/dist/chunk-ZOOT3GBY.js +0 -5
  496. package/dist/command-json-schema-F5XF7XHL.js +0 -1
  497. package/dist/conf-store-5CBLWTOC.js +0 -1
  498. package/dist/custom-oclif-loader-UDVUFKMD.js +0 -1
  499. package/dist/deprecations-EOHPSTCS.js +0 -1
  500. package/dist/dist-RNV3GFZ7.js +0 -1
  501. package/dist/dist-ZFKWJVNB.js +0 -1
  502. package/dist/environment-O7ECODHU.js +0 -1
  503. package/dist/environments-4FLRZW4P.js +0 -1
  504. package/dist/error-JY2ADS6S.js +0 -1
  505. package/dist/error-handler-4GCXKC6I.js +0 -1
  506. package/dist/fs-XS5YF34R.js +0 -1
  507. package/dist/http-proxy-node16-D3JUYA5D.js +0 -38
  508. package/dist/is-global-27MUENOK.js +0 -1
  509. package/dist/json-error-S5XFS3UX.js +0 -1
  510. package/dist/latest-version-LDWU5F7A.js +0 -49
  511. package/dist/lib-PJHT4MKY.js +0 -1
  512. package/dist/lib-VKSQ65BQ.js +0 -1
  513. package/dist/lib-YEZOHXF3.js +0 -1
  514. package/dist/metadata-2YJBAKR7.js +0 -1
  515. package/dist/node-package-manager-B3OW3PFQ.js +0 -1
  516. package/dist/notifications-system-BWTDYBG2.js +0 -1
  517. package/dist/os-F6QKJCFW.js +0 -1
  518. package/dist/output-BRIPK7UC.js +0 -1
  519. package/dist/system-466QKFDI.js +0 -1
  520. package/dist/ui-VJTNGCS6.js +0 -1
  521. package/dist/upgrade-VHVJLXKX.js +0 -1
  522. package/dist/version-FETZRLZO.js +0 -1
  523. package/dist/version-T4XXTJMB.js +0 -1
  524. package/dist/workerd-32DMKLMN.js +0 -18
  525. /package/dist/{chunk-YLQ3LNNY.js → chunk-2S3FHQFS.js} +0 -0
  526. /package/dist/{chunk-YRHFPXC3.js → chunk-Z2AV4BWZ.js} +0 -0
@@ -1,16 +0,0 @@
1
- import{c as en}from"./chunk-Y5CVX5LJ.js";import{G as Ke,H as Ge,K as ue,O as _,P as Ye,a as $e,aa as Je,ca as P,da as Ze,e as He,ia as y,j as Be,ja as Z,k as le,ma as A,na as Xe,oa as T,q as h,r as We,s as me,u as E}from"./chunk-GQLNG537.js";import{b as Qe}from"./chunk-ZDF5N422.js";import{w as ce}from"./chunk-QQJNQNKP.js";import{b as je}from"./chunk-MHR5OHT5.js";import{a as ze}from"./chunk-HSKDFEXW.js";import{A as nn,E as an,F as tn,G as on,J as rn,K as sn,U as dn}from"./chunk-D2KIGKBI.js";import{e as Le,j as Me,k as J}from"./chunk-335BUVBP.js";import{a as Ee}from"./chunk-BN7ZXAZJ.js";import{h as c,k as D}from"./chunk-M5VIFG2V.js";import{Bb as ke,Cb as cn,N as z,Sa as qe,T as G,Va as Oe,fa as Y,la as Ue,qb as mn,sb as U,wb as un}from"./chunk-JLQRDFR5.js";import{i as pe}from"./chunk-B4OMIONW.js";import{b as t}from"./chunk-FZCGRIOM.js";import{g as ln}from"./chunk-LHXFTFFM.js";import{c as Pe,i as K}from"./chunk-IWTNUJGY.js";import{e as W,g as r}from"./chunk-VKWPEFWQ.js";r();function q(e,{httpsOnly:n=!1,message:i="Invalid URL"}={}){return e.refine(a=>ve(a,n),{message:i}).refine(a=>!a.includes(`
2
- `),{message:i})}function Nt(e,{message:n="URL must be HTTPS URL or start with /"}={}){return e.refine(i=>i.startsWith("/")||ve(i,!0),{message:n})}var pn=/[\r\n\t]/;function kn(e){return ve(e,!0)}function ve(e,n){try{let i=new URL(e);return n?i.protocol==="https:":["http:","https:"].includes(i.protocol)}catch{return!1}}function St(e){return typeof e=="string"&&!e.startsWith("/")?`/${e}`:e}var Oi=30;function ht(e){return e.length<=Oi}r();r();r();function vn(e){return He`
3
- query OrganizationBetaFlags($organizationId: OrganizationID!) {
4
- organization(organizationId: $organizationId) {
5
- id
6
- ${e.map(n=>`flag_${n}: hasFeatureFlag(handle: "${n}")`).join(`
7
- `)}
8
- }
9
- }`}r();var fn={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"}}]}}]}}]};r();var fe=class extends c{},w=class extends c{constructor(n,i){let a="unknown",o=d=>`an ${d}`;Ge(n)?(a=n.orgName,o=d=>`the ${d} organization`):Ke(n)&&(a=n.email,o=d=>`the ${d} user`);let s=U`${mn.yellow(a)}`.value,m=[[`Your current active session is associated with ${o(s)} 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&&m.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,m)}};async function Rt(){let e=gn(),n=await e.organizations();if(n.length===0){let i=await e.session();throw new w(i.accountInfo)}return n}async function Ct(e,n){let i=await n.orgFromId(e);if(!i)throw new w((await n.session()).accountInfo,e);return i}async function zt(e,n,i,a=["APP_DEVELOPMENT"]){let o=await i.storeByDomain(e.id,n,a);if(!o){let m=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 fe(`Could not find store for domain ${n} in organization ${e.businessName}.`,m)}return o}r();var O=class extends c{versionTag;constructor(n){super(`Version ${n} could not be found.`),this.versionTag=n}};r();var Nn={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"},Li={app:"shopify.app.toml",web:"shopify.web.toml",appEnvironments:"shopify.environments.toml",lockFile:".shopify.lock",hiddenConfig:"project.json",hiddenFolder:".shopify"},Lt={production:".env"},Mt={reactTypes:"17.0.30"},Sn={extensions:{directoryName:"extensions",defaultRegistrationLimit:1},web:{directoryName:"web",configurationName:Li.web}},$t={graphiql:3457,localhost:3458},Ht=/^([a-zA-Z_$])([a-zA-Z0-9_$])*$/;r();var Q;(function(e){e.Partners="Partners",e.BusinessPlatform="BusinessPlatform"})(Q||(Q={}));var Mi="https://dev.shopify.com",$i=["SHOPIFY_SERVICE_ACCOUNT_TOKEN","SHOPIFY_APP_AUTOMATION_TOKEN","SHOPIFY_CLI_PARTNERS_TOKEN"];async function Hi(e){let n=hn(e.apiSecretKeys);return n||hn(await e.developerPlatformClient.appClientSecrets(e))}async function Yt(e,n){let i=await Hi(e);if(i)return i;throw new c("This command needs the app's client secret, and the App Management API didn't return one for your credentials.",n??yn())}function yn(){let e=Me(),n=$i.filter(i=>e[i]!==void 0);return n.length>0?`The token in ${n[0]} might not have access to the app's client secret. To use your own account, unset ${n.join(" and ")}, log in with \`shopify auth login\`, and run the command again.`:`Check that your account can view the app's client credentials in the Developer Dashboard: ${Mi}`}function Jt(){cn(`SHOPIFY_API_SECRET isn't included because the App Management API didn't return the app's client secret for your credentials. ${yn()}`)}function hn(e){return e.find(n=>n.secret)?.secret}r();r();var bn=50,Fn=250,Bi=t.object({namespace:t.string(),key:t.string(),owner_type:t.string().optional()}),ji=t.object({sms_marketing:t.boolean().optional(),customer_privacy:t.boolean().optional()}),Wi=t.object({sources:t.array(t.string()).optional()}),Ki=t.object({network_access:t.boolean().optional(),block_progress:t.boolean().optional(),api_access:t.boolean().optional(),collect_buyer_consent:ji.optional(),iframe:Wi.optional(),bundle_size_exception:t.boolean().optional()}),Gi=t.object({runs_offline:t.boolean().optional()}),eo=t.object({type:t.string().optional(),extensions:t.array(t.any()).optional()}),Yi=t.object({event:t.string(),blocking:t.boolean().default(!1),applies_to:t.array(t.string()).optional()}),Ji=t.object({allow_direct_linking:t.boolean().optional(),intercepts:t.array(Yi).optional()}),Zi=t.object({module:t.string()}),Qi=t.object({target:t.string(),module:t.string(),should_render:Zi.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(Bi).optional(),default_placement:t.string().optional(),urls:t.object({edit:t.string().optional()}).optional(),capabilities:Ji.optional(),preloads:t.object({chat:t.string().optional()}).optional(),assets:t.string().optional()}),no=t.array(Qi),_n=t.string(),Xi=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()}),Dn=t.object({fields:t.array(Xi).optional()}),An=t.string().trim().nonempty("Handle can't be empty").max(bn,`Handle can't exceed ${bn} 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"),ea=t.string().trim().nonempty("UID can't be empty").max(Fn,`UID can't exceed ${Fn} 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"),X=t.object({name:t.string().optional(),type:t.string().optional(),handle:An.optional(),uid:ea.optional(),description:t.string().optional(),api_version:_n.optional(),extension_points:t.any().optional(),capabilities:Ki.optional(),supported_features:Gi.optional(),settings:Dn.optional()}),io=X.extend({handle:An}),b=X.omit({handle:!0}),ao=t.object({api_version:_n.optional(),description:t.string().optional(),extensions:t.array(t.any()),settings:Dn.optional()});r();r();r();r();var na=/^(https:\/\/)/,ia=/^pubsub:\/\/(?<gcp_project_id>[^:]+):(?<gcp_topic>.+)$/,aa=/^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>.+)$/,ta=/^kafka:\/\/(?<kafka_topic>[a-zA-Z0-9_.-]+)$/;function V(e){return typeof e=="string"&&e.endsWith("/")?e.replace(/\/+$/,""):e}var F=t.string({invalid_type_error:"Value must be string"}).refine(e=>e.startsWith("/")?!0:na.test(e)||ia.test(e)||aa.test(e)||ta.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 ee(e,n){return!n||!e.startsWith("/")?e:`${V(n)}${e}`}var oa=(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(pn.test(i))throw new c(`${e} ${n} is invalid: a URL must not contain control characters such as newlines or tabs.`);let o=ee(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(!kn(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 ge(e,n,i,a){let o=i;for(let s of n){let m=o[s];typeof m=="string"&&m.startsWith("/")&&(o[s]=oa(e,s,m,a))}}r();import{isUtf8 as ra}from"node:buffer";import Tn from"fs";async function wn(e,n){let i=await Oe(Pe(e,"locales/*.json"));if(!i||i.length===0)return{};let a=sa(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(Tn.statSync(o).size===0)throw new c(`Error loading ${n}`,`Locale file ${o} can't be empty`);return{default_locale:a[0],translations:da(i,n)}}function sa(e){return e.filter(i=>K(i).endsWith(".default.json")).map(i=>K(i).split(".")[0])}function da(e,n){let i={};for(let a of e){let o=la(K(a).split(".")[0],"Locale code is unset"),s=Tn.readFileSync(a);if(!ra(s))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]=s.toString("base64")}return i}function la(e,n){if(e===void 0)throw new D(n);return e}function ma(e){return e.experience==="configuration"}var Vn;(function(e){e.ShouldRender="should_render",e.Main="main",e.Tools="tools",e.Instructions="instructions",e.Intents="intents"})(Vn||(Vn={}));function In(e){let i={...{externalIdentifier:`${e.identifier}_external`,additionalIdentifiers:[],externalName:G(e.identifier.replace(/_/g," ")),surface:"test-surface",partnersWebIdentifier:e.identifier,schema:X,registrationLimit:Sn.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=ma(i),s=i.schema._def.shape!==void 0,m=i.uidStrategy==="single";return o&&s&&m?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 In({identifier:e.identifier,schema:e.schema,appModuleFeatures:n,transformLocalToRemote:ua(e.transformConfig),transformRemoteToLocal:ca(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 Ro(e){let n=e.appRelativeUrlFields;return In({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)=>{ge(G(e.identifier.replace(/_/g," ")),n,i,a.applicationUrl)}:void 0,deployConfig:async(i,a,o,s,m)=>{let d=pa(i);if(n?.length){let l=m?.appConfiguration?.application_url,p=typeof l=="string"?l:void 0;ge(G(e.identifier.replace(/_/g," ")),n,d,p)}if(e.appModuleFeatures().includes("localization")){let l=await wn(a,e.identifier);d={...d,localization:l}}return d}})}function ua(e){return Object.keys(e).includes("forward")?e.forward:n=>L(n,e)}function ca(e,n){return n?Object.keys(n).includes("reverse")?n.reverse:i=>L(i,n,!0):i=>xn(e,i)}function L(e,n,i=!1){let a={};for(let[o,s]of Object.entries(n)){let m=i?o:s,d=i?s:o,l=P(e,m);l!==void 0&&Ze(a,d,l)}return a}function xn(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]=xn(o,n):(n[a]!==void 0&&(i[a]=n[a]),delete n[a]),i},{})}function pa(e){let{type:n,handle:i,uid:a,path:o,extensions:s,...m}=e;return m}var ka=b.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()}),va={app_url:"application_url",embedded:"embedded",preferences_url:"app_preferences.url"},Ne="app_home",fa=S({identifier:Ne,schema:ka,transformConfig:va,patchWithAppDevURLs:(e,n)=>{e.application_url=n.applicationUrl},getDevSessionUpdateMessages:async e=>[`Using URL: ${e.application_url}`]}),Oo=fa;r();var ga=b.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()}),Na={name:"name",app_handle:"handle"},Se="branding",Sa=S({identifier:Se,schema:ga,transformConfig:Na}),jo=Sa;r();var ha=t.object({scopes:t.string().transform(e=>Y(e)??"").optional(),required_scopes:t.array(t.string()).optional(),optional_scopes:t.array(t.string()).optional(),use_legacy_install_flow:t.boolean().optional()}),ya=t.object({redirect_urls:t.array(q(t.string()))}),ba=b.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:ha.optional(),auth:ya}),he="app_access",Rn={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"};function Fa(e){let{shop_scopes:n,...i}=e,a=typeof n=="string"?Y(n):void 0;if(!a)return i;let o=typeof i.scopes=="string"?i.scopes:"";return{...i,scopes:Y([o,a].join(","))}}var _a={forward:e=>L(e,Rn),reverse:e=>L(Fa(e),Rn,!0)},Da=S({identifier:he,schema:ba,transformConfig:_a,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(s=>s.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})}}),Xo=Da;r();var Cn={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"}}]}}]}}]};r();var zn={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"}}]}}]}}]};r();var En={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"}}]}}]}}]};r();var Pn={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"}}]}}]}}]};r();var Un={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"}}]}}]}}]};r();var qn={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"}}]}}]}}]};r();var On={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"}}]}}]}}]};r();var Ln={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:"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"}}]}}]}}]}}]}}]};r();var Mn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppClientCredentials"},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:"Field",name:{kind:"Name",value:"id"}},{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"}}]}}]}}]};r();var ye={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"}}]}}]}}]};r();var $n={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"}}]}}]}}]};r();var Hn={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"}}]}}]}}]};r();var Bn={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"}}]}}]}}]};r();var jn={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"}}]}}]}}]};r();var Wn={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"}}]}}]}}]};r();var Kn={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:"__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"}}]}}]}}]};r();var Gn={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"}}]}}]}}]};r();var Yn={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"}}]}}]}}]};r();var Jn={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"}}]}}]}}]};r();var Zn={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"}}}]}]}}]};r();var Qn={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"}}]}}]}}]};r();var Xn={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"}}]}}]}}]};r();var ei={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"}}]}}]}}]};r();var ni={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"}}]}}]}}]};r();r();r();var M;(function(e){e.CustomersRedact="customers/redact",e.CustomersDataRequest="customers/data_request",e.ShopRedact="shop/redact"})(M||(M={}));var ii=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=>V(e),F,{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([M.CustomersRedact,M.CustomersDataRequest,M.ShopRedact]),{invalid_type_error:"Value must be an array containing values: customers/redact, customers/data_request or shop/redact"}).optional()});r();function ai(e,n){let i=Aa(e);if(i)return n.addIssue(i),t.NEVER}function Aa(e){let{subscriptions:n=[]}=e,i=new Set,a=[];if(!n.length)return;if(e.privacy_compliance&&e.subscriptions?.some(s=>s.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(s=>s.compliance_topics).filter(Boolean);if(z(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[s,{uri:m,topics:d=[],compliance_topics:l=[],filter:p=""}]of n.entries()){let k=["subscriptions",s];if(!d.length&&!l.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 f=`${u}::${m}::${p}`;if(i.has(f)){let N=p?pe.dim(`
10
-
11
- topic: ${u}
12
- uri: ${m}
13
- filter: ${p}`):pe.dim(`
14
-
15
- topic: ${u}
16
- uri: ${m}`);a.push(N)}i.add(f)})}if(a.length>0){let s=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 ${s}`,path:["subscriptions"]}}}r();function oi(e){let n=P(e,"webhooks");if(!n)return e;let{api_version:i}=n;return{api_version:i}}function ri(e){let n={},i=P(e,"api_version");return n={...i?{webhooks:{api_version:i}}:{}},n}function si(e){if(e.length===0)return;let n=e.filter(s=>s.topics!==void 0).flatMap(({compliance_topics:s,topics:m,...d})=>di(m)?.map(p=>({topics:[p],...d}))??[]),i=e.filter(s=>s.topics===void 0||s.compliance_topics!==void 0).map(({compliance_topics:s,topics:m,...d})=>({compliance_topics:s,...d})),a=Va(i,"compliance_topics"),o=Ta(a);return[...ti(o),...ti(n)]}function di(e){return e?.sort((n,i)=>n.localeCompare(i))}function ti(e){return e.sort((n,i)=>n.uri.localeCompare(i.uri))}function Ta(e){return e.forEach(n=>n.compliance_topics=di(n.compliance_topics)),e}function wa(e,n){return e.find(i=>i.uri===n.uri&&Je(i.include_fields??[],n.include_fields??[])&&i.filter===n.filter)}function Va(e,n){return e.reduce((i,a)=>{let o=wa(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 Ia=t.object({api_version:t.string({required_error:"String is required"}),privacy_compliance:t.object({customer_deletion_url:F.optional(),customer_data_request_url:F.optional(),shop_deletion_url:F.optional()}).optional(),subscriptions:t.array(ii).optional().transform(e=>si(e??[]))}),li=b.extend({webhooks:Ia.superRefine(ai)});var be="webhooks",xa={forward:oi,reverse:e=>ri(e)},Ra=S({identifier:be,schema:li,transformConfig:xa}),Ss=Ra;r();var mi={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AppVersionByTag"},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:"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:"appId"},value:{kind:"Variable",name:{kind:"Name",value:"appId"}}},{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"}}]}}]}}]};r();var ui={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"}}]}}]}}]};r();var Fe="webhook_subscription",Ca=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(V,F,{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 za(e){let{api_version:n,topic:i,...a}=e;return{webhooks:{subscriptions:[{topics:[i],...a}]}}}var Ea={forward:(e,n)=>{let i=e,a;return"application_url"in n&&(a=n?.application_url),{...i,uri:ee(i.uri,a)}},reverse:za},Pa=S({identifier:Fe,schema:Ca,transformConfig:Ea,uidStrategy:"dynamic"}),Is=Pa;r();r();r();function I(e={}){return{type:"token_refresh",handler:async()=>({token:await _([],{noPrompt:e.noPrompt,allowAutomationToken:!0})})}}function Ua(e){if(typeof e!="object"||e===null)return!1;let{statusCode:n,response:i}=e,a=n??i?.status;return a===401||a===403}var ne=class extends c{constructor(n){let i=n.businessName??`organization ${n.id}`,a="in the Shopify admin under Settings > Users > Security";Ye()?super(`This service account can't manage dev stores in ${i}.`,null,[`Give the service account Dev store management access ${a}.`,"Or use a token from a service account that has that access."]):J()?super(`This automation token can't manage dev stores in ${i}.`,null,[`Create a service account with Dev store management access ${a}.`,"Set its token in the SHOPIFY_SERVICE_ACCOUNT_TOKEN environment variable."]):super(`You don't have permission to manage dev stores in ${i}.`,null,["Check that you're logged in to the right account.","Or ask an organization admin for access."])}};async function ie(e,n){try{return await T({...n,organizationId:e.id})}catch(i){throw Ua(i)?new ne(e):i}}r();var ci={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"}}]}}]}}]};r();var pi={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"}}]}}]}}]};r();function x(e){let n=e.match(/\/(\d+)$/);return n?n[1]:void 0}function ae(e){return x(Buffer.from(e,"base64").toString("utf8"))}function $(e){return Buffer.from(e).toString("base64")}async function H(){return(await ki()).organizations}async function qa(e){return ki(e)}async function _e(e,n,i){let a=n??await _([],{allowAutomationToken:!0}),s=(await A({query:ci,token:a,variables:{organizationId:Oa(e)},unauthorizedHandler:i??I(),cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:Le(a)}})).currentUserAccount?.organization;if(s)return{id:e,businessName:s.name}}function Oa(e){let n=e.startsWith("gid://")?x(e):e;if(n===void 0||!/^\d+$/.test(n))throw new c(`Invalid organization ID: ${e}`);return $(`gid://organization/Organization/${n}`)}async function ki(e){let n=e??await _([],{allowAutomationToken:!0}),i=await A({query:pi,token:n,unauthorizedHandler:I()});return i.currentUserAccount?{organizations:i.currentUserAccount.organizationsWithAccessToDestination.nodes.map(o=>{let s=ae(o.id);if(s===void 0)throw new c(`Failed to decode organization ID from: ${o.id}`);return{id:s,businessName:o.name,status:o.status,shopCount:o.shopCount??null,url:o.url}}),currentUserResolved:!0}:{organizations:[],currentUserResolved:!1}}r();r();async function De(e){if(e.length===1)return e[0];let i=new Set(e.map(o=>o.businessName)).size<e.length,a=await on({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 La(e){let n=await H();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 De(n)}r();var Ma=["ACTIVE","LOCKED"];r();r();var Ae={basic:"BASIC_APP_DEVELOPMENT",grow:"PROFESSIONAL_APP_DEVELOPMENT",advanced:"UNLIMITED_APP_DEVELOPMENT",plus:"SHOPIFY_PLUS_APP_DEVELOPMENT"},R=Object.keys(Ae);r();r();var B=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()}),te=t.object({id:t.string(),name:t.string()});var vi=B.pick({name:!0}).extend({domain:B.shape.subdomain,adminUrl:t.string().nullish(),plan:t.enum(R),featurePreview:t.string().optional(),country:B.shape.country,demoData:t.boolean()}),Te=Ee({name:"CreateDevStoreResult",schema:t.object({store:vi,organization:te}),definitions:{CreatedDevStore:vi,StoreOrganization:te}});r();var fi={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"}}]}}]}}]};r();var gi={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 $a=2,Ha=300*1e3;function Ba(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 ja(e){let{organization:n,name:i,plan:a}=e,o=await _([],{allowAutomationToken:!0}),s=I(),d=(await ie(n,{query:fi,token:o,variables:{shopName:i,priceLookupKey:Ae[a],prepopulateTestData:e.withDemoData??!1,developerPreviewHandle:e.featurePreview,country:e.country},unauthorizedHandler:s})).createAppDevelopmentStore;if(!d)throw new c("Store creation failed: unexpected empty response.");let l=d.userErrors;if(l&&l.length>0){let u=l.map(f=>f.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 rn({title:U`Waiting for store to be ready`,task:async u=>{let f=Date.now(),N=!1;for(;;){if(Date.now()-f>Ha)throw N?new c("Store creation timed out after 5 minutes."):new c("Store creation timed out after 5 minutes without reporting a status.",null,[`Check whether ${p} was created with \`shopify store list\` before trying again.`]);let v=(await ie(n,{query:gi,token:o,variables:{shopDomain:p},unauthorizedHandler:s})).organization?.storeCreation?.status;if(v){if(N=!0,v==="COMPLETE")return;if(v==="FAILED"||v==="TIMED_OUT"||v==="USER_ERROR")throw new c(`Store creation failed with status: ${v}`)}u(U`${v?Ba(v):"Waiting for store creation to start"}`),await dn($a)}},renderOptions:{stdout:process.stderr}}),e.json)un(Te.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=[];j(u,"Domain",p),u.push(["Admin",k?{link:{label:k,url:k}}:"N/A"]),j(u,"Plan",a),j(u,"Feature preview",e.featurePreview),j(u,"Country",e.country),j(u,"Demo data",e.withDemoData?"enabled":"disabled"),nn({headline:`Dev store "${i}" created successfully.`,customSections:[{body:{tabularData:u,firstColumnSubdued:!0}}]})}return p}function j(e,n,i){i!=null&&i!==""&&e.push([n,i])}r();var Wa={basic:"Basic",grow:"Grow",advanced:"Advanced",plus:"Plus"};function Ka(){return sn({message:"Name for the new dev store"})}function Ga(){return an({message:"Which Shopify plan do you want to use?",choices:R.map(e=>({label:Wa[e],value:e}))})}function Ya(){return tn({message:"Populate the store with demo data?",confirmationMessage:"Yes, add demo data",cancellationMessage:"No, start with an empty store",defaultValue:!0})}r();r();var Ni=(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 Si=W(Z()),Ja=new Si.default({minTime:150,maxConcurrent:10});async function Za(e){let n="App Management",a=`https://${await h()}/app_management/unstable/graphql.json`;return{token:e,api:n,url:a,responseOptions:{onResponse:Ve}}}var we=e=>$e(e),hi=async(e,n,i)=>{let o=`https://${await h()}/app_management/unstable/organizations/${e}/app_logs/poll`;return Ni(o,n,i)},yi=async(e,n)=>`https://${await h()}/app_management/unstable/organizations/${encodeURIComponent(e)}/apps/${encodeURIComponent(n)}/channel_spec_export.json`;async function bi(e){let n=e.cacheOptions?.cacheExtraKey??"",i=e.cacheOptions?{...e.cacheOptions,cacheExtraKey:n}:void 0;return Ja.schedule(async()=>y({...await Za(e.token),query:e.query,variables:e.variables,cacheOptions:i,preferredBehaviour:e.requestOptions?.requestMode,unauthorizedHandler:e.unauthorizedHandler}))}function Ve(e){if(!e.extensions)return;let n=[];for(let i of e.extensions.deprecations)i.supportedUntilDate&&n.push(new Date(i.supportedUntilDate));Qe(n)}r();var Fi=W(Z()),Qa=new Fi.default({minTime:150,maxConcurrent:10});async function _i(e){let n="App Dev",i=E(e.shopFqdn),o=`https://${await We(i)}/app_dev/unstable/graphql.json`,s=je()==="local"?{"x-forwarded-host":i}:void 0;return Qa.schedule(()=>y({query:e.query,api:n,url:o,token:e.token,addedHeaders:s,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler,preferredBehaviour:e.requestOptions?.requestMode}))}r();var Di=W(Z()),Xa=new Di.default({minTime:150,maxConcurrent:10});async function et(e,n,i){let a="Functions",s=`https://${await h()}/functions/unstable/organizations/${e}/${i}/graphql`;return{token:n,api:a,url:s,responseOptions:{onResponse:Ve}}}async function Ai(e){return await Xa.schedule(async()=>y({...await et(e.organizationId,e.token,e.appId),query:e.query,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}r();var Ti=W(Z()),nt=new Ti.default({minTime:150,maxConcurrent:10});async function wi(e){let n="Webhooks",a=`https://${await h()}/webhooks/unstable/organizations/${e.organizationId}/graphql.json`;return nt.schedule(()=>y({query:e.query,api:n,url:a,token:e.token,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}import{randomUUID as it}from"crypto";var Vi="https://cdn.shopify.com/static/cli/extensions/templates.json",at=it(),tt=t.object({statusCode:t.literal(200),errors:t.array(t.object({path:t.tuple([t.literal("versionByTag")]),extensions:t.object({app_errors:t.object({errors:t.array(t.object({category:t.literal("not_found")})).nonempty()})})})).nonempty()}),re=class e{static instance;static getInstance(n){return e.instance??=new e(n),e.instance}static resetInstance(){e.instance=void 0}clientName=se.AppManagement;webUiName="Developer Dashboard";organizationSource=Q.BusinessPlatform;bundleFormat="br";_session;constructor(n){this._session=n}async subscribeToAppLogs(n,i){return this.appManagementRequest({query:ui,variables:{shopIds:n.shopIds,apiKey:n.apiKey}})}async appLogs(n,i){let a=await vt({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=x(n.id)??n.id,a=await yi(n.organizationId,i),o=await le(a,{method:"GET",headers:we(await this.token())}),s;try{s=await o.json()}catch{s=void 0}let m=typeof s=="object"&&s!==null&&!Array.isArray(s)?s:void 0;return o.ok&&m?{ok:!0,status:o.status,body:m}:{ok:!1,status:o.status,body:m}}async session(){if(!this._session){if(ln())throw new Error("AppManagementClient.session() should not be invoked dynamically in a unit test");let n=await ue(),{appManagementToken:i,businessPlatformToken:a,userId:o}=n,s=await A({query:Jn,cacheOptions:{cacheTTL:{hours:6},cacheExtraKey:o},token:a,unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")});if(J()&&s.currentUserAccount){let m=s.currentUserAccount.organizations.nodes.map(d=>({name:d.name}));if(m.length>1)throw new D("Multiple organizations found for the CLI token");this._session={token:i,businessPlatformToken:a,accountInfo:{type:"ServiceAccount",orgName:m[0]?.name??"Unknown organization"},userId:o}}else s.currentUserAccount?this._session={token:i,businessPlatformToken:a,accountInfo:{type:"UserAccount",email:s.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 ue({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,s=o.find(m=>m.specification.externalIdentifier==="app_home");return{id:i.id,title:a,apiKey:i.key,apiSecretKeys:[],organizationId:String(g(i.organizationId)),grantedScopes:i.activeRoot.grantedShopifyApprovalScopes,applicationUrl:s?.config?.app_url,embedded:s?.config?.embedded,flags:[],developerPlatformClient:this}}async appClientSecrets({apiKey:n}){let{app:i}=await this.appManagementRequest({query:Mn,variables:{apiKey:n}});return i?.activeRoot.clientCredentials?.secrets.map(o=>({secret:o.key}))??[]}async organizations(){return(await H()).map(i=>({...i,source:this.organizationSource}))}async orgFromId(n){let i=await _e(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:s}=await this.session();throw new w(s,n)}return{organization:i,apps:a,hasMorePages:o}}async appsForOrg(n,i=""){let a=Yn,o={query:i.split(" ").filter(d=>d).map(d=>`title:${d}`).join(" "),organizationId:n},s=await this.appManagementRequest({query:a,variables:o});if(!s.appsConnection)throw new D("Server failed to retrieve apps");return{apps:s.appsConnection.edges.map(d=>{let l=d.node;return{id:l.id,apiKey:l.key,title:l.activeRelease.version.name,organizationId:n}}),hasMorePages:s.appsConnection.pageInfo.hasNextPage}}async specifications({organizationId:n}){let i=Gn,a={organizationId:Ie(n)};return(await this.appManagementRequest({query:i,variables:a})).specifications.map(s=>({name:s.name,externalName:s.name,identifier:s.identifier,externalIdentifier:s.externalIdentifier,gated:!1,managementExperience:"cli",registrationLimit:s.uidStrategy.appModuleLimit,uidStrategy:kt(s.uidStrategy.__typename),experience:xe(s.experience,s.identifier),validationSchema:s.validationSchema}))}async templateSpecifications({organizationId:n},i={}){let a,{templatesJsonPath:o}=Nn,s=process.env[o];if(s){if(!await qe(s))throw new c("There is no file at the path specified for template specifications");let u=await Ue(s);a=JSON.parse(u)}else try{a=await(await Be(Vi)).json()}catch{throw new c(["Failed to fetch extension templates from",{link:{url:Vi}},{char:"."},"This likely means a problem with your internet connection."])}let m=0,d=i.requestedTemplate?a.filter(u=>u.identifier===i.requestedTemplate):void 0,l=d&&d.length>0?d:a,p=(await pt(l,async u=>this.organizationBetaFlags(n,u),async u=>this.organizationExpFlags(n,u))).map(u=>({...u,sortPriority:m++})),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(k=>k!=="unstable").sort().at(-1)??"unstable",s=st(i,n.id,o),m=Kn,d=await this.appManagementRequest({query:m,variables:s});if(!d.appCreate.app||d.appCreate.userErrors?.length>0){let k=d.appCreate.userErrors.map(u=>u.message).join(", ");throw new c(k)}let l=Ei([]),p=d.appCreate.app;return{...p,title:i.name,apiKey:p.key,apiSecretKeys:[],grantedScopes:i?.scopesArray??[],organizationId:n.id,newApp:!0,flags:l,developerPlatformClient:this}}async devStoresForOrg(n,i){let a=await this.businessPlatformOrganizationsRequest({query:Un,organizationId:String(g(n)),variables:{searchTerm:i}}),o=a.organization;if(!o)throw new c("No organization found");let s=o.accessibleShops?.edges.map(d=>d.node)??[],m=zi(o.currentUser?.organizationPermissions??[]);return{stores:xi(s,m),hasMorePages:a.organization?.accessibleShops?.pageInfo.hasNextPage??!1}}async devStoreCapReached(n){return(await this.businessPlatformOrganizationsRequest({query:qn,organizationId:String(g(n)),variables:{}})).organization?.devStoreCapReached??!1}async appExtensionRegistrations(n,i){let a=i??await this.activeAppVersion(n),o=[],s=[],m=[];return a.appModuleVersions.forEach(d=>{let l={id:d.registrationId,uuid:d.registrationUuid,title:d.handle,type:d.type,activeVersion:d.config?{config:JSON.stringify(d.config),...d.target&&{context:d.target}}:void 0};d.specification?.experience==="configuration"?o.push(l):d.specification?.options?.managementExperience==="dashboard"?m.push(l):s.push(l)}),{app:{dashboardManagedExtensionRegistrations:m,configurationRegistrations:o,extensionRegistrations:s}}}async appVersions({id:n,organizationId:i,title:a}){let o=jn,s={appId:n},m=await this.appManagementRequest({query:o,variables:s});return m.app?{app:{id:m.app.id,organizationId:i,title:a,appVersions:{nodes:m.app.versions?.edges.map(d=>{let l=d.node;return{createdAt:l.createdAt,createdBy:{displayName:l.createdBy},versionTag:l.metadata.versionTag,status:l.id===m.app.activeRelease.version.id?"active":"inactive",versionId:l.id,message:l.metadata.message}})??[],pageInfo:{totalResults:m.app.versionsCount}}}}:{app:null}}async appInstallCount({id:n}){let i=Wn,a={appId:n};return(await this.appManagementRequest({query:i,variables:a})).app.installCount??0}async appVersionByTag({id:n,organizationId:i},a){let o=mi,s={appId:n,versionTag:a},d=(await this.appManagementRequest({query:o,variables:s}).catch(l=>{throw tt.safeParse(l).success?new O(a):l})).versionByTag;if(!d)throw new O(a);return{id:parseInt(d.id,10),uuid:d.id,versionTag:d.metadata.versionTag,location:[await oe({organizationId:i,id:n}),"versions",g(d.id)].join("/"),message:d.metadata.message??"",appModuleVersions:d.appModules.map(Ri)}}async appVersionsDiff(n,{versionId:i}){let a={versionId:i},[o,s]=await Promise.all([this.activeAppVersionRawResult(n.apiKey),this.appManagementRequest({query:Bn,variables:a})]),m=o.app.activeRelease.version.appModules,d=s.version.appModules,{added:l,removed:p,updated:k}=ct({currentModules:m,selectedVersionModules:d});function u(f){return{uuid:f.uuid,handle:f.handle,specification:{identifier:f.specification.identifier,experience:xe(f.specification.experience,f.specification.identifier),options:{managementExperience:"cli"}}}}return{app:{versionsDiff:{added:l.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(Ri),...i.app.activeRelease}}async generateSignedUploadUrl({apiKey:n,organizationId:i}){let a={sourceExtension:"BR",organizationId:Ie(i)},o=await this.appManagementRequest({query:Hn,variables:a,cacheOptions:{cacheTTL:{minutes:59},cacheExtraKey:`${n}-${at}`}});return{assetUrl:o.appRequestSourceUploadUrl.sourceUploadUrl,userErrors:o.appRequestSourceUploadUrl.userErrors}}async deploy({appManifest:n,appId:i,organizationId:a,versionTag:o,message:s,commitReference:m,bundleUrl:d,skipPublish:l}){let u={appId:i,version:d?{sourceUrl:d}:{source:n},metadata:{versionTag:o,message:s,sourceControlUrl:m}},f=await this.appManagementRequest({query:$n,variables:u,requestOptions:{requestMode:"slow-request"}}),{version:N}=f.appVersionCreate,C=f.appVersionCreate.userErrors.map(Ci)??[];if(!N)return{appDeploy:{userErrors:C}};let v={appDeploy:{appVersion:{uuid:N.id,id:parseInt(N.id,10),versionTag:N.metadata.versionTag,location:await ut(a,i,N.id),appModuleVersions:N.appModules.map(Ce=>({uuid:Ce.uuid,registrationUuid:Ce.uuid,validationErrors:[]})),message:N.metadata.message},userErrors:C}};if(l)return v;let qi={appId:i,versionId:N.id},de=await this.appManagementRequest({query:ye,variables:qi});return de.appReleaseCreate.userErrors&&(v.appDeploy.userErrors=(v.appDeploy.userErrors??[]).concat(de.appReleaseCreate.userErrors.map(Ci))),!de.appReleaseCreate.release&&v.appDeploy.userErrors.length===0&&v.appDeploy.userErrors.push({message:"The API did not return a release for the created app version.",category:"",details:[]}),v}async release({app:{id:n,organizationId:i},version:{versionId:a}}){let o={appId:n,versionId:a},s=await this.appManagementRequest({query:ye,variables:o});if(s.appReleaseCreate.release&&!s.appReleaseCreate.userErrors?.length)return{appRelease:{appVersion:{versionTag:s.appReleaseCreate.release.version.metadata.versionTag,message:s.appReleaseCreate.release.version.metadata.message,location:[await oe({organizationId:i,id:n}),"versions",g(s.appReleaseCreate.release.version.id).toString()].join("/")}}};if(!s.appReleaseCreate.userErrors?.length)throw new c("The Developer Dashboard did not confirm the app version release.");return{appRelease:{userErrors:s.appReleaseCreate.userErrors?.map(m=>({field:m.field,message:m.message,category:m.category,details:[],on:m.on}))??[]}}}async storeByDomain(n,i,a){let s=(await Promise.all(a.map(l=>this.businessPlatformOrganizationsRequest({query:Pn,organizationId:String(g(n)),variables:{domain:i,filters:ft(l)}})))).map(l=>l.organization).filter(l=>l!=null);if(s.length===0)throw new c("No organization found");let m=s.flatMap(l=>{let p=l.accessibleShops?.edges.map(u=>u.node)??[],k=zi(l.currentUser?.organizationPermissions??[]);return xi(p,k)}),d=E(i);return m.find(l=>l.shopDomain===d)}async ensureUserAccessToStore(n,i){if(!i.provisionable)return;let o={input:{shopifyShopId:lt(i.shopId)}},m=(await T({query:On,token:await this.businessPlatformToken(),organizationId:String(g(n)),variables:o,unauthorizedHandler:this.createUnauthorizedHandler()})).organizationUserProvisionShopAccess;if(!m.success){let d=m.userErrors?.map(l=>l.message).join(", ")??"";throw new D(`Failed to provision user access to store: ${d}`)}}async sendSampleWebhook(n,i){let a=Qn,o={address:n.address,apiKey:n.api_key,apiVersion:n.api_version,deliveryMethod:n.delivery_method,sharedSecret:n.shared_secret,topic:n.topic},s=await this.webhooksRequest({organizationId:i,query:a,variables:o}),m={samplePayload:"{}",headers:"{}",success:!1,userErrors:[]},d=s.cliTesting;return d&&(m={samplePayload:d.samplePayload??"{}",headers:d.headers??"{}",success:d.success,userErrors:d.errors.map(l=>({message:l,fields:[]}))}),{sendSampleWebhook:m}}async apiVersions(n){return{publicApiVersions:(await this.webhooksRequest({organizationId:n,query:Xn,variables:{}})).publicApiVersions.map(a=>a.handle)}}async topics({api_version:n},i){let a=Zn,o={apiVersion:n};return{webhookTopics:(await this.webhooksRequest({organizationId:i,query:a,variables:o})).availableTopics??[]}}async updateURLs(n){return ke("\u26A0\uFE0F updateURLs is not implemented"),{appUpdate:{userErrors:[]}}}async targetSchemaDefinition(n,i,a){try{let{app:o}=await this.activeAppVersionRawResult(i),s=String(g(o.id));return(await this.functionsRequest({organizationId:a,query:ei,appId:s,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),s=String(g(o.id));return(await this.functionsRequest({organizationId:a,query:ni,appId:s,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 oe({id:n,organizationId:i})}async devSessionCreate({appId:n,assetsUrl:i,shopFqdn:a,websocketUrl:o,unsafeValidation:s}){let m=String(g(n));return this.appDevRequest({query:Cn,shopFqdn:a,variables:{appId:m,assetsUrl:i??"",websocketUrl:o,unsafeValidation:s??!1},requestOptions:{requestMode:"slow-request"}})}async devSessionUpdate({appId:n,assetsUrl:i,shopFqdn:a,manifest:o,inheritedModuleUids:s,unsafeValidation:m}){let l={appId:String(g(n)),assetsUrl:i,manifest:JSON.stringify(o),inheritedModuleUids:s,unsafeValidation:m??!1};return this.appDevRequest({query:zn,shopFqdn:a,variables:l})}async devSessionDelete({appId:n,shopFqdn:i}){let a=String(g(n));return this.appDevRequest({query:En,shopFqdn:i,variables:{appId:a}})}async getCreateDevStoreLink(n){let i=`https://${await me()}/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:Ln,variables:{apiKey:n}})}async organizationBetaFlags(n,i){let a={organizationId:Ii(n)},o=await Xe({query:vn(i),token:await this.businessPlatformToken(),organizationId:n,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),s={};return i.forEach(m=>{s[m]=!!o.organization[`flag_${m}`]}),s}async organizationExpFlags(n,i){let a={organizationId:Ii(n),flagHandles:i},o=await T({query:fn,token:await this.businessPlatformToken(),organizationId:n,variables:a,unauthorizedHandler:this.createUnauthorizedHandler()}),s={},m=o.organization?.enabledFlags??[];return i.forEach((d,l)=>{s[d]=!!m[l]}),s}async appManagementRequest(n){return bi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async appDevRequest(n){return _i({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async businessPlatformRequest(n){return A({...n,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async businessPlatformOrganizationsRequest(n){return T({...n,token:await this.businessPlatformToken(),unauthorizedHandler:this.createUnauthorizedHandler("businessPlatform")})}async functionsRequest(n){return Ai({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}async webhooksRequest(n){return wi({...n,token:await this.token(),unauthorizedHandler:this.createUnauthorizedHandler()})}createUnauthorizedHandler(n="default"){return Pi(this,n)}},ot="https://shopify.dev/apps/default-app-home",rt="https://shopify.dev/apps/default-app-home/api/auth";function st(e,n,i){let{isLaunchable:a,scopesArray:o,name:s}=e;return{initialVersion:{source:{source:{name:s,modules:[{type:Ne,config:{app_url:a?"https://example.com":ot,embedded:!0}},{type:Se,config:{name:s}},{type:be,config:{api_version:i}},{type:he,config:{redirect_url_allowlist:[a?"https://example.com/api/auth":rt],...o&&{scopes:o.map(p=>p.trim()).join(",")}}}]}}.source},organizationId:Ie(n)}}function dt(e){let n=e.startsWith("gid://")?g(e):Number(e);if(Number.isNaN(n))throw new Error(`Invalid organization ID: ${e}`);return`gid://organization/Organization/${n}`}function Ii(e){return $(dt(e))}function Ie(e){return`gid://shopify/Organization/${e.startsWith("gid://")?g(e):Number(e)}`}function lt(e){return $(`gid://organization/ShopifyShop/${e}`)}function mt(e){let n=ae(e);if(n===void 0)throw new Error(`Invalid encoded GID: ${e}`);return n}function g(e){if(e.startsWith("gid://")){let n=x(e);if(n===void 0)throw new Error(`Invalid GID: ${e}`);return Number(n)}return Number(e)}async function oe({id:e,organizationId:n}){let i=g(n).toString();return`https://${await me()}/dashboard/${i}/apps/${g(e)}`}async function ut(e,n,i){return`${await oe({organizationId:e,id:n})}/versions/${g(i)}`}function ct({currentModules:e,selectedVersionModules:n}){let i=e.map(l=>l.userIdentifier),a=n.map(l=>l.userIdentifier),o=n.filter(l=>!i.includes(l.userIdentifier)),s=e.filter(l=>!a.includes(l.userIdentifier)),m=s.map(l=>l.userIdentifier),d=e.filter(l=>!m.includes(l.userIdentifier));return{added:o,removed:s,updated:d}}async function pt(e,n,i,a=ze){let o=z(e.flatMap(l=>l.organizationBetaFlags??[])),s=z(e.flatMap(l=>l.organizationExpFlags??[])),[m,d]=await Promise.all([o.length>0?n(o):Promise.resolve({}),s.length>0?i(s):Promise.resolve({})]);return e.filter(l=>{let p=!l.organizationBetaFlags||l.organizationBetaFlags.every(v=>m[v]),k=!l.organizationExpFlags||l.organizationExpFlags.every(v=>d[v]),u=!l.minimumCliVersion||ce(a,`>=${l.minimumCliVersion}`),f=!l.deprecatedFromCliVersion||ce(a,`<${l.deprecatedFromCliVersion}`),N=u&&f,C=en(a)&&l.deprecatedFromCliVersion===void 0;return p&&k&&(N||C)})}function xe(e,n){if(n===Fe)return"configuration";switch(e){case"extension":case"configuration":case"deprecated":return e;default:return ke(`Unknown specification experience value "${e}", defaulting to "extension"`),"extension"}}function kt(e){switch(e){case"UidStrategiesDynamic":return"dynamic";case"UidStrategiesStatic":return"single";case"UidStrategiesClientProvided":return"uuid";default:return"uuid"}}function xi(e,n){return e.map(i=>{let{externalId:a,primaryDomain:o,name:s,url:m,storeType:d}=i,l=m??o;if(!l)throw new D("The selected store does not have a valid URL");return{shopId:a?mt(a):void 0,link:o,shopDomain:E(l),shopName:s,transferDisabled:!0,convertableToPartnerTest:!0,provisionable:n,storeType:d}})}function Ri(e){return{registrationId:e.userIdentifier===e.uuid?"":e.userIdentifier,registrationUuid:e.uuid,handle: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:xe(e.specification.experience,e.specification.externalIdentifier)}}}var vt=async({organizationId:e,jwtToken:n,cursor:i,filters:a})=>{let o=await hi(e,i,a),s=we(n);return le(o,{method:"GET",headers:s})};function Ci(e){let n=[],i=e.on[0]?.user_identifier;return i&&n.push({extension_id:i}),{...e,details:n}}function ft(e){return[{field:"STORE_TYPE",operator:"EQUALS",value:e.toLowerCase()},{field:"STORE_STATUS",operator:"EQUALS",value:"ACTIVE"}]}function zi(e){return e.includes("ondemand_access_to_stores")}var se;(function(e){e.AppManagement="app-management",e.Partners="partners"})(se||(se={}));function gn(){return re.getInstance()}var Ui;Ui||(Ui={});var gt={};function Ei(e=[]){let n=[],i=e.map(a=>gt[a]);return n.filter(a=>!i.includes(a))}var Re=new WeakMap;function Pi(e,n="default"){return{type:"token_refresh",handler:async()=>{let i=Re.get(e);if(i)await i;else try{i=e.unsafeRefreshToken(),Re.set(e,i),await i}finally{Re.delete(e)}let a=await e.session();return{token:n==="businessPlatform"?a.businessPlatformToken:a.token}}}}export{I as a,ie as b,x as c,ae as d,H as e,qa as f,_e as g,De as h,La as i,Ma as j,R as k,B as l,te as m,Te as n,ja as o,Ka as p,Ga as q,Ya as r,Nn as s,Li as t,Lt as u,Mt as v,Sn as w,$t as x,Ht as y,Nt as z,pn as A,St as B,Oi as C,ht as D,bn as E,Fn as F,Bi as G,eo as H,no as I,Xi as J,X as K,io as L,b as M,ao as N,V as O,ee as P,oa as Q,wn as R,ma as S,Vn as T,In as U,S as V,Ro as W,Fe as X,Is as Y,M as Z,ii as _,si as $,Va as aa,li as ba,O as ca,Q as da,Hi as ea,Yt as fa,yn as ga,Jt as ha,Ne as ia,Oo as ja,Se as ka,jo as la,ha as ma,ya as na,he as oa,Xo as pa,be as qa,Ss as ra,dt as sa,se as ta,gn as ua,Pi as va,fe as wa,w as xa,Rt as ya,Ct as za,zt as Aa};
@@ -1 +0,0 @@
1
- import{b as j,c as v,d as O}from"./chunk-JPWRZ5SL.js";import{D as n,F as b,J as k,O as p,P as a,Q as u,U as h,W as T,X as F,a as A,t as P}from"./chunk-W56ZGEQQ.js";import{b as w}from"./chunk-ZJOX5HW4.js";import{b as I,c as g}from"./chunk-3KM5ZOW2.js";import{a as f}from"./chunk-BN7ZXAZJ.js";import{wb as S}from"./chunk-JLQRDFR5.js";import{b as o}from"./chunk-FZCGRIOM.js";import{b as x}from"./chunk-YTUUU33R.js";import{e as d}from"./chunk-IWTNUJGY.js";import{e as _,g as i}from"./chunk-VKWPEFWQ.js";i();i();i();var R=o.object({path:p().describe("The absolute path of the file that the instructions were written to."),format:o.literal("markdown").describe("The file holds the instructions in Markdown, not a JSON result.")}).strict(),c=f({name:"AppSecurityInstructionsResult",schema:o.union([o.object({status:o.literal("success"),app:a,resultsDirectory:p().describe("The absolute path of the results directory that the instructions use. It may not exist yet: the instructions start by running check, which creates it."),instructions:u}).strict(),R]).describe("The instructions and the app they are for. With --write, only the file they were written to."),definitions:{AppSecurityApp:a,AppSecurityInstructions:u,AppSecurityInstructionsFile:R}});function C(r,t,e){if(e==="json"){S(c.encode(W(r,t)));return}O(r,t.delivery)}function W(r,{selection:t,delivery:e}){if(e.writePath)return{path:h(e.writePath),format:"markdown"};let{resultsDirectory:s}=P(t.appDirectory,n(t));return{status:"success",app:T(t),resultsDirectory:h(s),instructions:F(r,e)}}var l=_(x(),1);var m=class r extends w{static summary="Provide app security check instructions to a coding agent.";static descriptionWithMarkdown="Prints the complete workflow that a coding agent should follow to review app security check results.\n\nBy default, the instructions are printed to stdout. Use `--copy` to copy them to the clipboard or `--write` to write them to a file. Standalone instructions always start by running `shopify app security check`; only that invocation's generated review pack is trusted as workflow input.";static get jsonOutputSchema(){return c}static description=this.descriptionWithoutMarkdown();static flags={...I,...A,copy:l.Flags.boolean({description:"Copy the instructions to the clipboard instead of printing them. With --json, the result still includes them.",default:!1,exclusive:["write"],env:"SHOPIFY_FLAG_APP_SECURITY_INSTRUCTIONS_COPY"}),write:l.Flags.string({description:"Write the instructions to a file instead of printing them. With --json, stdout contains only the absolute path and Markdown format of the written file.",exclusive:["copy"],parse:async t=>d(t),env:"SHOPIFY_FLAG_APP_SECURITY_INSTRUCTIONS_WRITE"}),...g};async run(){let{flags:t}=await this.parse(r),e=await b({path:t.path,config:t.config,clientId:t["client-id"],withoutAppConfig:t["without-app-config"],allowPrompts:!1}),s=j({appDirectory:e.appDirectory,resultsKey:n(e),commands:k(e,t.path)}),y={copy:t.copy,writePath:t.write};await v(s,y),C(s,{selection:e,delivery:y},t.json?"json":"text")}};export{m as a};
@@ -1 +0,0 @@
1
- import{h as a}from"./chunk-H6GYBLVQ.js";import{N as l}from"./chunk-GQLNG537.js";import{h}from"./chunk-M5VIFG2V.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();var i=["live","unpublished","development"];async function A(e,r){let t=await l(e,r);return d(t)}async function d(e,{allowEmpty:r=!1}={}){let t=e.storeFqdn,o=(await a(e)).filter(w);if(o.length===0&&!r)throw new h(`There are no themes in the ${t} store`);return o.sort(y)}function w(e){return i.includes(e.role)}function y(e,r){return i.indexOf(e.role)-i.indexOf(r.role)}u();function E(e,r,t,{allowEmpty:o=!1}={}){return T(e,r,t,o)??L(e,r,t,o)}function T(e,r,t,o){let n=t.role;if(!n)return;let s=`No themes on the store ${e} match the role "${n}"`;return p(r,f=>f.role===n).orThrow(s,o)}function L(e,r,t,o){return t.themeIdentifiers.flatMap(s=>{let f=`No themes on the store ${e} match the ID or name "${s}"`;return p(r,c=>`${c.id}`===s||c.name.toLowerCase()===s.toLowerCase()?!0:g(c.name.toLowerCase(),s.toLowerCase())).orThrow(f,o)})}function p(e,r){let t=e.filter(r);return t.length>0?{orThrow:o=>t}:{orThrow:(o,n)=>{if(n)return[];throw new h(o)}}}var m=class{queryProps;constructor(r){this.queryProps=r}get role(){for(let r of i)if(this.queryProps[r])return r}get themeIdentifiers(){return[this.queryProps.theme,this.queryProps.themes].flat().filter(t=>!!t)}any(){return Object.values(this.queryProps).some(r=>r?.length!==void 0?r.length>0:!!r)}};function g(e,r){let t=r.replace(/(^\*)|(\*$)/g,"");return r.startsWith("*")&&r.endsWith("*")?e.includes(t):r.startsWith("*")?e.endsWith(t):r.endsWith("*")?e.startsWith(t):!1}export{i as a,A as b,d as c,E as d,m as e};
@@ -1 +0,0 @@
1
- import{a as K,b as _,c as z,d as N,e as f,f as d,g as W,h as G,j as H}from"./chunk-QF5WKTPD.js";import{a as x}from"./chunk-C3RFAKWR.js";import{b as S,c as j}from"./chunk-ACA2BGAD.js";import{a as R}from"./chunk-VHZ6RL67.js";import{a as P}from"./chunk-NVKJ7ZLP.js";import{Ma as J,da as L}from"./chunk-U2T5HPRD.js";import{Ea as A,ta as U}from"./chunk-GQLNG537.js";import{b as D,c as v}from"./chunk-3KM5ZOW2.js";import{A as F}from"./chunk-D2KIGKBI.js";import{a as C}from"./chunk-BN7ZXAZJ.js";import{j as O,m as k,n as M}from"./chunk-M5VIFG2V.js";import{wb as s,xb as g}from"./chunk-JLQRDFR5.js";import{b as t}from"./chunk-FZCGRIOM.js";import{b as $}from"./chunk-YTUUU33R.js";import{g as T}from"./chunk-IWTNUJGY.js";import{e as Z,g as m}from"./chunk-VKWPEFWQ.js";m();m();var B=t.string().refine(T,"Expected an absolute native filesystem path"),Y=t.object({id:t.string().uuid().describe("The dashboard extension registration UUID, not a Shopify GID."),name:t.string(),type:t.string().min(1).describe("The upstream dashboard extension type."),directory:B.describe("The absolute local extension directory."),configurationPath:B.nullable().describe("The absolute local TOML path, or null when no TOML file exists in a kept directory."),changed:t.boolean().describe("Whether this import wrote the local extension TOML.")}).strict(),q=t.object({extensionId:t.string().uuid().nullable().describe("The registration UUID, or null for identifier persistence."),error:S}).strict(),n=C({name:"ImportDashboardExtensionsResult",schema:t.object({status:t.enum(["success","partial","skipped","cancelled"]),reason:t.enum(["no-extensions","directory-selection-cancelled"]).nullable(),extensions:t.array(Y).describe("Completed extension imports and kept local directories, in selection order."),errors:t.array(q).describe("Failed selected imports or identifier persistence."),identifiersUpdated:t.boolean().describe("Whether the extension identifier persistence step completed.")}).strict(),definitions:{ImportedDashboardExtension:Y,ExtensionImportFailure:q,...j.definitions}});var Q=Z($(),1);var E=class u extends R{static descriptionWithMarkdown="Import dashboard-managed extensions into your app.";static get jsonOutputSchema(){return n}static description=this.descriptionForHelp();static flags={...D,...P,...v,"client-id":Q.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};async run(){let{flags:o}=await this.parse(u),r=await J({directory:o.path,clientId:o["client-id"],forceRelink:o.reset,userProvidedConfigName:o.config}),a=await H({developerPlatformClient:r.developerPlatformClient,apiKey:r.remoteApp.apiKey,organizationId:r.remoteApp.organizationId,extensionTypes:N}),l=_(o.json?G(r.app,a):a);if(l.length===0)o.json?s(n.encode({status:"skipped",reason:"no-extensions",extensions:[],errors:[],identifiersUpdated:!1})):F({headline:["No extensions to migrate."]});else{let y=await z(l),i;try{if(i=await W({...r,extensions:a,extensionTypes:y.extensionTypes,buildExtensionConfig:y.buildExtensionConfig}),o.json&&i.status==="skipped")return s(n.encode({status:i.status,reason:i.reason,extensions:[],errors:[],identifiersUpdated:!1})),{app:r.app};o.json||K(i),await L({app:r.app,appApiKey:r.remoteApp.apiKey,extensionUuids:i.extensionUuids,command:"import-extensions"})}catch(e){if(!o.json)throw e instanceof d?e.originalError:e;let I=e instanceof d?e.originalError:e;if(e instanceof f||e instanceof d){let p=await e.completedImports();if(e instanceof d&&p.extensions.length===0)throw e.originalError;let h=e instanceof f&&p.failures.length===0;if(s(n.encode({status:h?"cancelled":"partial",reason:h?"directory-selection-cancelled":null,extensions:b(p.extensions),errors:p.failures.map(({extension:V,error:X})=>({extensionId:V.uuid,error:x(X)})),identifiersUpdated:!1})),h)throw await g(),e;e instanceof f&&(I=p.failures[0].error)}else if(i)s(n.encode({status:"partial",reason:null,extensions:b(i.extensions),errors:[{extensionId:null,error:x(e)}],identifiersUpdated:!1}));else throw e;let c=await k(I),w=M(c)?"unexpected_error":"expected_error";throw await U({config:this.config,errorMessage:c instanceof Error?c.message:void 0,exitMode:w}),await A(c,w),await g(),new O}o.json&&s(n.encode({status:"success",reason:null,extensions:b(i.extensions),errors:[],identifiersUpdated:!0}))}return{app:r.app}}};function b(u){return u.map(({extension:o,directory:r,configurationPath:a,changed:l})=>({id:o.uuid,name:o.title,type:o.type,directory:r,configurationPath:a,changed:l}))}export{E as a};
@@ -1 +0,0 @@
1
- import{b as f,c as r,d as h}from"./chunk-MGHPF7HU.js";import{a as l}from"./chunk-VHZ6RL67.js";import{a as c}from"./chunk-NVKJ7ZLP.js";import{Ma as m}from"./chunk-U2T5HPRD.js";import{b as d}from"./chunk-3KM5ZOW2.js";import{yb as e}from"./chunk-JLQRDFR5.js";import{i as n}from"./chunk-B4OMIONW.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var s=class g extends l{static summary="Watch and prints out changes to an app.";static hidden=!0;static flags={...d,...c};async run(){let{flags:t}=await this.parse(g),{app:o}=await m({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),i=new h(o);return await i.start(),e(`Watching for changes in ${o.name}...`),i.onEvent(async({app:y,extensionEvents:u,startTime:w,path:x})=>{e(`\u{1F195} Event [${f(w)}ms]`),e(` \u{1F4C2} ${x}`),u.forEach(a=>{switch(a.type){case r.Created:e(` \u2705 Extension created - ${n.green(a.extension.handle)}`);break;case r.Deleted:e(` \u274C Extension deleted: ${n.red(a.extension.handle)}`);break;case r.Updated:e(` \u{1F504} Updated: ${n.yellow(a.extension.handle)}`);break}})}),setInterval(()=>{},1<<30),{app:o}}};export{s as a};
@@ -1 +0,0 @@
1
- import{c as i,f as v,g as C}from"./chunk-S4LOWCGS.js";import{a as T}from"./chunk-VGSH52JM.js";import{a as F}from"./chunk-NVKJ7ZLP.js";import{Na as S,e as w}from"./chunk-U2T5HPRD.js";import{b as y,c as g}from"./chunk-3KM5ZOW2.js";import{A as l,y as d}from"./chunk-D2KIGKBI.js";import{c as f}from"./chunk-LEHBZKK3.js";import{a as u}from"./chunk-BN7ZXAZJ.js";import{wb as h}from"./chunk-JLQRDFR5.js";import{b as s,h as m}from"./chunk-FZCGRIOM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();e();import{resolve as O}from"node:path";async function b(o,t){return await w(o,t),{status:"success",function:{handle:o.configuration.handle??null,name:o.name,directory:O(o.directory)}}}e();var n=u({name:"FunctionTypegenResult",schema:s.object({status:s.literal("success"),function:i}).strict(),definitions:{Function:i}});e();function j(o,t){t?h(n.encode(o)):l({headline:"GraphQL types generated successfully."})}var a=class o extends T{static get jsonOutputSchema(){return n}static summary="Generate GraphQL types for a function.";static descriptionWithMarkdown="Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.";static description=this.descriptionForHelp();static flags={...y,...F,...v,...g};async run(){let{flags:t}=await this.parse(o),{app:r}=await S({directory:t.path,userProvidedConfigName:t.config}),p=await C(r,t.path),c=async(x,J)=>{let G=await b(p,{stdout:x,stderr:J,app:r});j(G,t.json)};return t.json?await m({outputMode:"json",sink:f},()=>d({processes:[{prefix:p.localIdentifier,action:c}],showTimestamps:!1})):await c(process.stdout,process.stderr),{app:r}}};export{a};
@@ -1,20 +0,0 @@
1
- import{e as ce}from"./chunk-QFWWCZOI.js";import{p as P,v as ie}from"./chunk-YKMINHYY.js";import{ca as xe,da as se}from"./chunk-RLNIOJH3.js";import{r as Z}from"./chunk-QQJNQNKP.js";import{b as re,c as L}from"./chunk-3KM5ZOW2.js";import{A as ee,z as T}from"./chunk-D2KIGKBI.js";import{c as X}from"./chunk-LEHBZKK3.js";import{h as E}from"./chunk-M5VIFG2V.js";import{Bb as oe,Da as D,N as A,Sa as N,_a as V,na as q,ta as j,wb as g,yb as te,zb as ne}from"./chunk-JLQRDFR5.js";import{b as m,h as z,i as K,j as Q}from"./chunk-FZCGRIOM.js";import{b as Te}from"./chunk-YTUUU33R.js";import{c as O,e as I,g as B,o as M}from"./chunk-IWTNUJGY.js";import{e as b,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();import{AsyncLocalStorage as Se}from"node:async_hooks";import{format as Fe}from"node:util";var ae=new Se,x=0,$;async function ue(t){if(Q()!=="json")return t();x===0&&($=console.error,console.error=(...e)=>{ae.getStore()?K({type:"diagnostic",level:"warning",message:Fe(...e)}):$(...e)}),x++;try{return await ae.run(!0,t)}finally{_e()}}function _e(){x--,x===0&&(console.error=$)}var i=b(se(),1),k=b(xe(),1);function Re(t,e){return t instanceof Error&&"code"in t&&t.code==="ENOENT"&&"path"in t&&typeof t.path=="string"&&I(t.path)===I(e)}async function Ie(t){if(!(t===void 0||i.ModernIdentifiers.some(e=>e===t))&&await N(t)&&await D(await q(t)))throw new E(`Theme Check config must be a file, but ${t} is a directory.`,"Pass the path to a .theme-check.yml file to --config, or omit --config to use the .theme-check.yml in your theme root. To choose the theme directory, use --path.")}async function G(t,e){await Ie(t);try{return await e()}catch(r){throw t!==void 0&&Re(r,t)?new E(`Theme Check config file not found: ${t}`):r}}function Ae(t){switch(t){case"error":return i.Severity.ERROR;case"suggestion":case"warning":return i.Severity.WARNING;case"style":case"info":return i.Severity.INFO;case"crash":return}}function me(t){switch(t){case i.Severity.ERROR:return"error";case i.Severity.WARNING:return"warning";case i.Severity.INFO:return"info"}}function je(t){return new Map(t.map(e=>[e.uri,e.source]))}function Ne(t,e,r){let o=t.split(`
2
- `).slice(e,r+1),s=o.length===1;return o.map((c,a)=>{let u=e+a+1,h=s?c.trim():c;return`${u} ${h}`}).join(`
3
- `)}function Ee(t){switch(t){case i.Severity.ERROR:return{error:`
4
- [error]:`};case i.Severity.WARNING:return{warn:`
5
- [warning]:`};case i.Severity.INFO:return{info:`
6
- [info]:`}}}function Le(t,e){return t.map((n,o)=>{let{message:s,uri:c,start:a,end:u,check:h,severity:y}=n,f=e.get(c),p=f===void 0?[]:[`
7
-
8
- ${Ne(f,a.line,u.line)}`],v=o===t.length-1?"":`
9
-
10
- `;return[Ee(y),{bold:h},{subdued:`
11
- ${s}`},...p,v]}).flat()}var Pe=(t,e)=>t.severity-e.severity;function H(t){let e=t.reduce((r,n)=>{let{uri:o}=n,s=i.path.fsPath(o);return r[s]??=[],r[s].push(n),r},{});return Object.keys(e).reduce((r,n)=>(r[n]=e[n].sort(Pe),r),{})}function he(t){return t.reduce((e,r)=>(e[r.severity]=(e[r.severity]??0)+1,e),{})}function fe(t,e,r){let n=[`${r.length} files inspected`];if(t.length===0)n.push("with no offenses found.");else{n.push(`with ${t.length} total offenses found across ${Object.keys(e).length} files.`);let o=he(t);o[i.Severity.ERROR]&&n.push(`
12
- ${o[i.Severity.ERROR]} errors.`),o[i.Severity.WARNING]&&n.push(`
13
- ${o[i.Severity.WARNING]} warnings.`),o[i.Severity.INFO]&&n.push(`
14
- ${o[i.Severity.INFO]} info issues.`)}return n}function le(t,e,r,n){let o=je(r);Object.keys(t).sort().forEach(c=>{let a=c.replace(e,"").slice(1);T({headline:n?`[${n}] ${a}`:a,body:Le(t[c],o)})})}function $e(t,e){return Object.entries(t).map(([r,n])=>{let o=n.map(c=>({check:c.check,severity:me(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=he(n);return{environment:e,path:r,offenses:o,errorCount:s[i.Severity.ERROR]??0,warningCount:s[i.Severity.WARNING]??0,infoCount:s[i.Severity.INFO]??0}})}function de(t,e){process.exit(W(t,e)?1:0)}function W(t,e){let r=e?Ae(e):void 0;return r!==void 0&&t.some(n=>n.severity<=r)}function Ge(t){return t.split(`
15
- `).map(e=>`# ${e}`).join(`
16
- `)}async function pe(t){let e=".theme-check.yml",r=O(t,e);if(await N(r)){te(`${e} already exists at ${t}`);return}let{settings:n}=await(0,i.loadConfig)(void 0,t),o=Ge(k.default.stringify(n)),s=k.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await j(r,`${s}${o}`),ne(`Created ${e} at ${t}`)}var He=async(t,e)=>{let r=(0,i.applyFixToString)(t.source,e),n=i.path.fsPath(t.uri);await j(n,r)};async function ge(t,e){await(0,i.autofix)(t,e,He)}async function ye(t,e,r){let{ignore:n,settings:o,rootUri:s}=await G(e,()=>(0,i.loadConfig)(e,t)),c={extends:[],ignore:A(n??[]),rootUri:s,...o},a=r?{[r]:c}:c;g(k.default.stringify(a))}async function ve(t,e,r){let{settings:n,ignore:o,checks:s}=await G(e,()=>(0,i.loadConfig)(e,t)),c=A(o??[]),u=Object.keys(n).reduce((y,f)=>{let{severity:p,enabled:v,...C}=n[f];if(!v)return y;let we=me(p??i.Severity.INFO),w=s.find(Oe=>Oe.meta.code===f),be=w&&w.meta?{description:w.meta.docs.description,doc:w.meta.docs.url}:{};return y[f]={severity:we,...be,ignored_patterns:`[${c.join(", ")}]`,...C},y},{}),h=r?{[r]:u}:u;g(k.default.stringify(h))}function ke(t){return"_handle"in t&&typeof t._handle=="object"&&t._handle!==null&&typeof t._handle.setBlocking=="function"}async function Y(t,e,r){let{offenses:n,theme:o}=await G(e,()=>ue(()=>(0,i.themeCheckRun)(t,e,c=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&oe(c)})));return{result:$e(H(n),r),offenses:n,theme:o}}l();l();import{resolve as We}from"node:path";var Ce=m.object({filePath:m.string().refine(B).describe("The absolute native path of the file."),check:m.string(),severity:m.enum(["error","warning","info"]),startRow:m.number().int().positive().describe("The one-based starting line."),startColumn:m.number().int().positive().describe("The one-based starting column."),endRow:m.number().int().positive().describe("The one-based ending line."),endColumn:m.number().int().positive().describe("The one-based ending column."),message:m.string()}).strict(),Ye=m.object({valid:m.boolean().describe("Whether the validation passes the selected blocking policy."),issues:m.array(Ce),errorCount:m.number().int().nonnegative(),warningCount:m.number().int().nonnegative(),infoCount:m.number().int().nonnegative()}).strict();function S(t){return Math.max(t+1,1)}var F=ce({name:"ThemeCheckResult",schema:Ye,definitions:{ThemeCheckIssue:Ce},project:t=>{let{files:e,valid:r}=Array.isArray(t)?{files:t,valid:void 0}:t;return{valid:r??e.every(n=>n.errorCount===0),issues:e.flatMap(n=>n.offenses.map(o=>({filePath:We(n.path),check:o.check,severity:o.severity,startRow:S(o.start_row),startColumn:S(o.start_column),endRow:S(o.end_row),endColumn:S(o.end_column),message:o.message}))),errorCount:e.reduce((n,o)=>n+o.errorCount,0),warningCount:e.reduce((n,o)=>n+o.warningCount,0),infoCount:e.reduce((n,o)=>n+o.infoCount,0)}}});function J(t){return JSON.stringify(JSON.parse(F.encode(t)))}function _({result:t,offenses:e,theme:r,valid:n},o,s,c){let a=H(e);if(o==="text"&&(le(a,s,r,c),(e.length?T:ee)({headline:c?`[${c}] Theme Check Summary.`:"Theme Check Summary.",body:fe(e,a,r)})),o==="json"){let u=process.stdout;ke(u)&&u._handle.setBlocking(!0),g(J(n===void 0?t:{files:t,valid:n}))}}var d=b(Te(),1);var U=b(se(),1);var R=class extends ie{static get jsonOutputSchema(){return F}static summary="Validate the theme.";static descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";static description=this.descriptionForHelp();static flags={...re,...L,json:d.Flags.boolean({...L.json,env:"SHOPIFY_FLAG_JSON",exclusive:["init","version","print","list"]}),path:P.path,"auto-correct":d.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:d.Flags.string({char:"C",required:!1,description:`Path to a config file to use, overriding .theme-check.yml if present
17
- Use --path to set the theme directory
18
- Supports all theme-check: config values, e.g., theme-check:theme-app-extension,
19
- theme-check:recommended, theme-check:all
20
- For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":d.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:d.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:d.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:d.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:d.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:d.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:P.environment};static multiEnvironmentsFlags=["path"];async command(e,r,n){let o=e.path,s=e.environment?.[0],a=e.config?.startsWith(":")&&U.LegacyIdentifiers.has(e.config.slice(1))?U.LegacyIdentifiers.get(e.config.slice(1)):e.config;if(e.init){await pe(o);return}if(e.version){let v=await V(O("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:M(import.meta.url)}),C="unknown";v&&(C=await Z(v)??"unknown"),g(C);return}if(e.print){await ye(o,a,s);return}if(e.list){await ve(o,a,s);return}let u=await Y(o,a,s),{offenses:h,theme:y}=u,f=e.json||e.output==="json",p=!W(h,e["fail-level"]);if(f||_({...u,valid:p},e.output,o,s),e["auto-correct"]&&await ge(y,h),f&&!n&&_({...u,valid:p},"json",o,s),f)return p||(process.exitCode=1),{files:u.result,valid:p};if(!n)return de(h,e["fail-level"])}async _run(){let e=this.argv.indexOf("--"),r=e<0?this.argv:this.argv.slice(0,e),n=Je(r)==="json";return n&&!r.includes("--json")&&(this.argv=[...r,"--json",...e<0?[]:this.argv.slice(e)]),n?z({outputMode:"json",sink:X},()=>super._run()):super._run()}collectsEnvironmentResults(e){return!!e.json||e.output==="json"}validateCommandFlags(e){if(!this.collectsEnvironmentResults(e))return;let r=["init","version","print","list"].find(n=>e[n]);r&&this.error(`JSON output can't be used with --${r}.`,{exit:2})}renderEnvironmentResults(e){g(J({environments:e}))}};function Je(t){let e=process.env.SHOPIFY_FLAG_OUTPUT,r=Object.entries(R.flags);for(let n=0;n<t.length;n++){let o=t[n];if(o.startsWith("--")){let[s,...c]=o.slice(2).split("=");if(r.find(([h])=>h===s)?.[1]?.type!=="option")continue;let u=c.length?c.join("="):t[++n];s==="output"&&(e=u)}else if(o.startsWith("-"))for(let s=1;s<o.length;s++){let c=r.find(([,u])=>u.char===o[s]);if(!c)break;if(c[1].type!=="option")continue;let a=o.slice(s+1).replace(/^=/,"")||t[++n];c[0]==="output"&&(e=a);break}}return e}async function St(t,e,r,n){let o=await Y(t,r,n);return _(o,e,t,n),{offenses:o.offenses,theme:o.theme}}export{R as a,St as b};
@@ -1 +0,0 @@
1
- import{a as u}from"./chunk-NXAEBGMO.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();var m=!1;function v(){return m}function y(){let t=0,e=!1,i=setInterval(()=>{if(!e){if(v()||t>=12e4){e=!0,clearInterval(i),u(process.pid,"SIGINT",!1,()=>{process.exit(0)});return}t+=100}},100)}var k=async({config:a,Command:o})=>{await I(o);let t=await import("./metadata-2YJBAKR7.js"),{commandStartOptions:e}=t.getAllSensitiveMetadata();e&&await t.addSensitiveMetadata(()=>({commandStartOptions:{...e,endTime:new Date().getTime()}}));let{postrun:i}=await import("./deprecations-EOHPSTCS.js");i(o);let{outputDebug:n}=await import("./output-BRIPK7UC.js"),r=o.id.replace(/:/g," ");n(`Completed command ${r}`),!r.includes("notifications")&&!r.includes("upgrade")&&!r.includes("send-analytics")&&await M();let{reportAnalyticsEvent:c}=await import("./analytics-NMMVOF4B.js");await c({config:a,exitMode:"ok"}),m=!0};async function M(){let{versionToAutoUpgrade:a,warnIfUpgradeAvailable:o}=await import("./upgrade-VHVJLXKX.js"),t=a();if(!t){await o();return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")await l(t);else{let{runAtMinimumInterval:i}=await import("./conf-store-5CBLWTOC.js");await i("auto-upgrade",{days:1},async()=>{await l(t)})}}async function l(a){let[{CLI_KIT_VERSION:o},{isMajorVersionChange:t},{outputWarn:e,outputDebug:i},{getOutputUpdateCLIReminder:n,runCLIUpgrade:r,hasBlockingAutoUpgradeNotification:c},s]=await Promise.all([import("./version-T4XXTJMB.js"),import("./version-FETZRLZO.js"),import("./output-BRIPK7UC.js"),import("./upgrade-VHVJLXKX.js"),import("./metadata-2YJBAKR7.js")]);if(t(o,a)){e(n(a,!0)),await s.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}if(await c()){await s.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"blocked_by_notification"}));return}try{await r({autoupgrade:!0}),await s.addPublicMetadata(()=>({env_auto_upgrade_success:!0}))}catch(f){let p=`Auto-upgrade failed: ${f}`;i(p),e(n(a)),await s.addPublicMetadata(()=>({env_auto_upgrade_success:!1}));let[{sendErrorToBugsnag:g},{inferPackageManagerForGlobalCLI:w}]=await Promise.all([import("./error-handler-4GCXKC6I.js"),import("./is-global-27MUENOK.js")]),_=Object.assign(new Error(p),{packageManager:w(),platform:process.platform,cliVersion:o});await g(_,"expected_error")}}async function I(a){let o=new Date().getTime();if(a&&"analyticsStopCommand"in a&&typeof a.analyticsStopCommand=="function"){let t=a.analyticsStopCommand();if(t){let e=await import("./metadata-2YJBAKR7.js"),{commandStartOptions:i}=e.getAllSensitiveMetadata();if(!i)return;await e.addSensitiveMetadata(()=>({commandStartOptions:{...i,startTime:o,startCommand:t}}))}}}export{y as a,k as b};
@@ -1 +0,0 @@
1
- import{D as c,J as p,M as o,U as S,j as f,t as h,w as y,z as g}from"./chunk-W56ZGEQQ.js";import{h as a}from"./chunk-M5VIFG2V.js";import{i as d}from"./chunk-IWTNUJGY.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();async function A(t,e){let r=c(t);if(await y(t.appDirectory,r))return;let{scan:s}=p(t,e),n=new a(`No app security check results for ${r} in ${t.appDirectory}.`,`Run \`${o(s)}\`.`);throw n.code="results-directory-not-found",n}async function q(t,e){await A(t,e);let r=h(t.appDirectory,c(t)),[s,n]=await Promise.all([b(r.deterministicFindingsPath,"deterministic"),b(r.agentFindingsPath,"agent")]),i=[v(s,"deterministic"),v(n,"agent")].filter(k=>k!==void 0);i.length>0&&D(i,p(t,e));let u=w(s),l=w(n);return{sources:{deterministic:u,agent:l},checks:f({deterministic:u?.document??null,agent:l?.document??null})}}async function b(t,e){return{path:t,result:await g(t,e)}}function v(t,e){if(t.result.status==="invalid")return{source:e,path:t.path,errors:t.result.errors}}function w(t){return t.result.status!=="ok"?null:{path:t.path,document:t.result.value}}function D(t,e){let r=t.length===1?"The app security check results could not be loaded because a results file is invalid.":"The app security check results could not be loaded because both results files are invalid.",s=[...t.map(i=>R(i.source,e,`${d(i.path)}.`)),["Or run",{command:o(e.clean)},"to delete both results files and start over."]],n=new a(r,null,s,t.map($));throw n.code="results-file-invalid",n.details={files:t.map(({path:i,errors:u})=>({path:S(i),errors:u}))},n}function R(t,e,r){return t==="deterministic"?["Run",{command:o(e.scan)},`to regenerate ${r}`]:["Have your coding agent run",{command:o(e.record)},`again to regenerate ${r}`]}function $(t){return{title:t.path,body:{list:{items:t.errors}}}}export{A as a,q as b};
@@ -1 +0,0 @@
1
- import{b as l}from"./chunk-67L7FIB6.js";import{a as m}from"./chunk-XLIJYJ6Q.js";import{b as c}from"./chunk-7GHSE7SG.js";import{a as p}from"./chunk-VHZ6RL67.js";import{a as s}from"./chunk-NVKJ7ZLP.js";import{Ma as r}from"./chunk-U2T5HPRD.js";import{b as i,c as n}from"./chunk-3KM5ZOW2.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static get jsonOutputSchema(){return c}static description=this.descriptionForHelp();static flags={...i,...n,...s};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:f,organization:u}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),g=await m(a,f,u);return l(g,t.json?"json":"text"),{app:a}}};export{e as a};
@@ -1 +0,0 @@
1
- import{c as b}from"./chunk-62EOM3Y2.js";import{e as f,g as h,h as g,s as y}from"./chunk-PDZBKVWL.js";import{a as m}from"./chunk-VHZ6RL67.js";import{Ma as u}from"./chunk-U2T5HPRD.js";import{c as l}from"./chunk-3KM5ZOW2.js";import{h as d}from"./chunk-M5VIFG2V.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();n();var s=class extends Error{operationId;constructor(t){super(`Migration cancellation for ${t} returned neither an operation nor user errors`),this.name="MigrationCancellationProtocolError",this.operationId=t}};async function w({clientId:o,operationIds:t,cancelOperation:a=y}){let r=t.filter(e=>!h.safeParse(e).success);if(r.length>0)throw new d(`Invalid subscription migration operation IDs: ${r.join(", ")}.`,"Use Shopify AppSubscriptionMigrationOperation GIDs returned by a migration submission.");return{outcomes:await Promise.all(t.map(async e=>{try{let i=await a({clientId:o,operationId:e});if(i.userErrors.length>0)return{status:"failed",operationId:e,operation:i.operation,userErrors:i.userErrors};if(!i.operation)throw new s(e);return{status:"success",operationId:e,operation:i.operation}}catch(i){if(t.length===1)throw i;return{status:"failed",operationId:e,operation:null,error:i}}}))}}var p=class o extends m{static summary="Cancels app subscription migration operations.";static descriptionWithMarkdown="Cancels app subscription migration operations.\n\nCanceling stops additional unprocessed shops, but does not undo shops that have already been scheduled or migrated. Use `unschedule` for reversible schedules.\n\nRepeat `--id` to cancel every operation GID returned by a multi-batch submission. Use `--json` to output the resulting operation states and per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2>","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...f,...l};static get jsonOutputSchema(){return g}async run(){let{flags:t}=await this.parse(o),{app:a,remoteApp:r}=await u({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),c=await w({clientId:r.apiKey,operationIds:t.id}),e=b(c,{json:t.json});return e!==0&&(process.exitCode=e),{app:a}}};export{p as a};
@@ -1,10 +0,0 @@
1
- import{c as ke}from"./chunk-SACNUF4I.js";import{a as Ie,c as Pe}from"./chunk-PTSCGSQV.js";import{b as ve}from"./chunk-P4VZYOKO.js";import{a as ze}from"./chunk-VHZ6RL67.js";import{Ha as je,M as Te,Ma as Ge,U as xe,W as Ce,Y as Fe,ea as _e,h as Ae,ha as $e}from"./chunk-U2T5HPRD.js";import{D as Re,c as be,ua as Le,za as Se}from"./chunk-33ZE3DRQ.js";import{B as ee}from"./chunk-GQLNG537.js";import{B as ne,D as se,E as pe,f as F,g as ie,i as oe,p as re}from"./chunk-QQJNQNKP.js";import{e as J}from"./chunk-MHR5OHT5.js";import{a as E}from"./chunk-HSKDFEXW.js";import{b as ge,c as ye,f as we}from"./chunk-3KM5ZOW2.js";import{A as de,E as j,I as fe,z as me}from"./chunk-D2KIGKBI.js";import{b as le}from"./chunk-GW7YIJPJ.js";import{a as M}from"./chunk-BN7ZXAZJ.js";import{d as ce}from"./chunk-CXI3RHPW.js";import{h as d}from"./chunk-M5VIFG2V.js";import{Ba as T,Ia as W,Na as B,Sa as x,Ta as C,Ua as Z,Va as Q,_ as q,_a as X,ja as Y,jb as te,kb as ae,la as K,qb as g,ra as _,rb as L,sb as v,ta as $,va as V,wb as he}from"./chunk-JLQRDFR5.js";import{b as h}from"./chunk-FZCGRIOM.js";import{f as ue}from"./chunk-LHXFTFFM.js";import{b as Qe}from"./chunk-YTUUU33R.js";import{c as p,d as R,e as O,o as H,p as U}from"./chunk-IWTNUJGY.js";import{e as Ze,g as l}from"./chunk-VKWPEFWQ.js";l();l();var y={reactRouter:{url:"https://github.com/Shopify/shopify-app-template-react-router",label:"Build a React Router app (recommended)",visible:!0,branches:{prompt:"For your React Router template, which language do you want?",options:{javascript:{branch:"javascript-cli",label:"JavaScript"},typescript:{branch:"main-cli",label:"TypeScript"}}}},remix:{url:"https://github.com/Shopify/shopify-app-template-remix",label:"Build a Remix app",visible:!1,branches:{prompt:"For your Remix template, which language do you want?",options:{javascript:{branch:"javascript",label:"JavaScript"},typescript:{branch:"main",label:"TypeScript"}}}},none:{url:"https://github.com/Shopify/shopify-app-template-extension-only",label:"Build an extension-only app",visible:!0},node:{url:"https://github.com/Shopify/shopify-app-template-node",visible:!1},ruby:{url:"https://github.com/Shopify/shopify-app-template-ruby",visible:!1}},G=Object.keys(y),S=G.filter(e=>y[e].visible),Xe=["reactRouter","none"],Je=async e=>{let t=e.template,a=e.flavor,i={template:y.reactRouter.url};t??=await j({choices:Xe.map(r=>({label:y[r].label||r,value:r})),message:"Get started building your app:",defaultValue:G.find(r=>y[r].url===i.template)});let o={...e,template:t,templateType:P(t)?t:"custom",globalCLIResult:{install:!1,alreadyInstalled:!1}},n,s;if(o.templateType!=="custom"){let r=y[o.templateType];n=r.url,r.branches&&(a?s=r.branches.options[a]?.branch:s=await j({message:r.branches.prompt||"Choose a flavor:",choices:Object.entries(r.branches.options).map(([m,u])=>({value:u.branch,label:u.label}))}))}return s&&(n=`${n}#${s}`),o.template=n||o.template||i.template,o.globalCLIResult=await ae(),o},Ne=Je;function P(e){return G.includes(e)}function De(e){return e!==void 0&&P(e)&&y[e].branches!==void 0}l();l();import{platform as et}from"os";async function Ee({packageJSON:e,local:t,useGlobalCLI:a}){if(e.dependencies=e.dependencies??{},a?delete e.dependencies["@shopify/cli"]:e.dependencies["@shopify/cli"]=E,delete e.dependencies["@shopify/app"],t){let i=await tt("cli");e.dependencies["@shopify/cli"]=i;let o={"@shopify/cli":i};e.overrides=e.overrides?{...e.overrides,...o}:o,e.resolutions=e.resolutions?{...e.resolutions,...o}:o}return e}async function tt(e){return`file:${await X(`packages/${e}`,{type:"directory",cwd:H(import.meta.url)})}`}async function Me({from:e,packageManager:t}){let a=et()==="win32"&&t==="yarn"?["--network-concurrency","1"]:[];return re({directory:R(e),packageManager:t,args:a})}l();async function z(e,t){let i=(await Q([p(e,"**",".git"),p(e,"**",".github"),p(e,"**",".gitmodules"),p(e,"**",".cli-liquid-bypass"),p(e,"LICENSE*"),p(e,"**","frontend/LICENSE*"),p(e,"package.json.cli2")],{dot:!0,onlyFiles:!1,onlyDirectories:!1,ignore:["**/node_modules/**"]})).map(s=>T(s,{force:!0})),o=new Set(ie[t]),n=F.filter(s=>!o.has(s)).map(s=>{let r=p(e,s);if(C(r))return W(r)});return Promise.all([...i,...n])}async function at(e){let t=e.packageManager,a=q(e.name),i=p(e.directory,a),o=ke(e.template);await Oe(i,a),await it(i),me({body:["Initializing project with",{command:t},`
2
- Use the`,{command:"--package-manager"},"flag to select a different package manager."]}),await Y(async r=>{let m=p(r,"download"),u=o.filePath?p(m,o.filePath):m,f=p(r,"app"),A=o.branch?`${o.baseURL}#${o.branch}`:o.baseURL;await V(m);let b=[{title:`Downloading template from ${A}`,task:async()=>{await Pe({repoUrl:A,destination:m,shallow:!0})}}];b.push({title:"Parsing liquid",task:async()=>{await ve(u,f,{dependency_manager:t,app_name:e.name})}},{title:"Updating package.json",task:async()=>{let c=(await ne(f)).content;c.name=a,c.author=await le()??"",c.private=!0;let I=["extensions/*"].concat(ot(f));switch(t){case"npm":case"yarn":case"bun":c.workspaces=I;break;case"pnpm":{await rt(f,I),await _(p(f,".npmrc"),`auto-install-peers=true
3
- `);break}case"homebrew":case"unknown":throw new oe}await Ee({packageJSON:c,local:e.local,directory:f,useGlobalCLI:e.useGlobalCLI}),await se(f,c)}}),e.postCloneActions.removeLockfilesFromGitignore&&b.push({title:"Removing lockfiles from .gitignore",task:async()=>{let c=p(f,".gitignore");if(await x(c)){let I=await K(c);F.forEach(We=>{let Be=new RegExp(`^${We.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`,"gm");I=I.replace(Be,"")}),await $(c,I.trim())}}}),await ue()&&b.push({title:"[Shopifolks-only] Configuring the project's NPM registry",task:async()=>{let c=p(f,".npmrc");await _(c,`@shopify:registry=https://registry.npmjs.org
4
- `)}});let D=!1;b.push({title:"Preparing project directory",task:async()=>{await Oe(i,a),D=!0,await B(f,i)}}),b.push({title:`Installing dependencies with ${t}`,task:async()=>{await Me({from:i,packageManager:t})}},{title:"Cleaning up",task:async()=>{await z(i,t)}},{title:"Initializing a Git repository...",task:async()=>{await Ie(i)}});try{await fe(b)}catch(c){throw D&&await T(i).catch(()=>{}),c}});let n;if(e.selectedAppOrNameResult.result==="new"){let r=await Te(i,e.name),m=e.selectedAppOrNameResult.org;n=await e.developerPlatformClient.createApp(m,r)}else n=e.selectedAppOrNameResult.app;return await je({directory:i,apiKey:n.apiKey,appId:n.id,organizationId:n.organizationId,configName:"shopify.app.toml",developerPlatformClient:e.developerPlatformClient,isNewApp:!0},!1),{app:(await Ge({directory:i,clientId:void 0,forceRelink:!1,userProvidedConfigName:void 0})).app,remoteApp:n,projectName:a,packageManager:t,template:e.template}}async function Oe(e,t){if(await x(e))throw new d(`
5
- A directory with this name (${t}) already exists.
6
- Choose a new name for your app.`)}async function it(e){let t=new J({projectName:"shopify-cli-app"}),a=R(e);t.delete(a)}function ot(e){return["web","web/frontend"].filter(t=>C(p(e,t)))}async function rt(e,t){let a=p(e,"pnpm-workspace.yaml");if(await x(a))return;let i=t.map(o=>` - '${o}'`).join(`
7
- `);await $(a,`packages:
8
- ${i}`)}var He=at;l();var Ue=h.string().regex(/^(?:\/|[A-Za-z]:[\\/]|\\\\)/),qe=h.object({id:h.string().regex(/^\d+$/).describe("The decimal App ID, not a Shopify GID."),name:h.string().min(1).describe("The name of the linked remote app."),clientId:h.string().min(1).describe("The client ID of the linked remote app."),organizationId:h.string().regex(/^\d+$/).describe("The decimal organization ID, not a Shopify GID."),directory:Ue.describe("The absolute filesystem path of the created app project."),configurationPath:Ue.describe("The absolute filesystem path of the linked app configuration.")}).strict(),k=M({name:"AppInitResult",schema:h.object({status:h.literal("success"),app:qe,packageManager:h.enum(["npm","yarn","pnpm","bun"]),template:h.string().url().describe("The selected GitHub template reference, including its branch and subpath.")}).strict(),definitions:{InitializedApp:qe}});l();function nt({app:e,remoteApp:t,packageManager:a,template:i}){return k.validate({status:"success",app:{id:t.id.startsWith("gid://shopify/App/")?be(t.id)??t.id:t.id,name:t.title,clientId:t.apiKey,organizationId:t.organizationId,directory:e.directory,configurationPath:e.configPath},packageManager:a,template:i})}function Ye(e,t=!1){if(t){he(k.encode(nt(e)));return}let{projectName:a,packageManager:i}=e;de({headline:[{userInput:a},"is ready for you to build!"],nextSteps:[["Run",{command:`cd ${a}`}],["For extensions, run",{command:L(i,"shopify app generate extension")}],["To see your app, run",{command:L(i,"shopify app dev")}]],reference:[{link:{label:"Shopify docs",url:"https://shopify.dev"}},[{link:{label:"Shopify Dev MCP,",url:"https://shopify.dev/docs/apps/build/devmcp"}},"connect your AI assistant to development resources"],["For an overview of commands, run",{command:L(i,"shopify app","--help")}]]})}l();function Ke(e){if(!e)return;let t=ee(e);if(t&&t.origin!=="https://github.com")throw new d("Only GitHub repository references are supported, e.g., https://github.com/Shopify/<repository>/[subpath]#[branch]");if(!t&&!P(e))throw new d(v`Only ${S.map(a=>v`${g.yellow(a)}`.value).join(", ")} template aliases are supported, please provide a valid URL`)}function Ve(e,t){if(!e){if(t)throw new d(v`The ${g.yellow("--flavor")} flag requires the ${g.yellow("--template")} flag to be set`);return}if(!t)return;if(!P(e))throw new d(v`The ${g.yellow("--flavor")} flag is not supported for custom templates`);let a=y[e];if(!a.branches)throw new d(v`The ${g.yellow(e)} template does not support flavors`);if(!a.branches.options[t])throw new d(v`Invalid option for ${g.yellow("--flavor")}\nThe ${g.yellow("--flavor")} flag for ${g.yellow(e)} accepts only ${Object.keys(a.branches.options).map(i=>v`${g.yellow(i)}`.value).join(", ")}`)}var w=Ze(Qe(),1);var N=class e extends ze{static get requiresSyncAnalytics(){return!0}static summary="Create a new app project";static get jsonOutputSchema(){return k}static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --name my-app --organization-id 123 --template reactRouter --flavor typescript","<%= config.bin %> <%= command.id %> --client-id 123 --template none"];static flags={...ge,...ye,name:w.Flags.string({char:"n",env:"SHOPIFY_FLAG_NAME",hidden:!1,description:"The name for the new app. When provided, skips the app selection prompt and creates a new app with this name. Required in non-interactive environments unless --client-id is provided."}),path:w.Flags.string({char:"p",env:"SHOPIFY_FLAG_PATH",parse:async t=>O(t),default:async()=>U(),hidden:!1}),template:we(w.Flags.string({description:`The app template. Accepts one of the following:
9
- - <${S.join("|")}>
10
- - Any GitHub repo with optional branch and subpath, e.g., https://github.com/Shopify/<repository>/[subpath]#[branch]`,env:"SHOPIFY_FLAG_TEMPLATE"})),flavor:w.Flags.string({description:"Which flavor of the given template to use. Required in non-interactive environments when the selected template offers multiple flavors.",env:"SHOPIFY_FLAG_TEMPLATE_FLAVOR"}),"package-manager":w.Flags.string({char:"d",env:"SHOPIFY_FLAG_PACKAGE_MANAGER",hidden:!1,options:["npm","yarn","pnpm","bun"]}),local:w.Flags.boolean({char:"l",env:"SHOPIFY_FLAG_LOCAL",default:!1,hidden:!0}),"client-id":w.Flags.string({hidden:!1,description:"The Client ID of your app. Use this to automatically link your new project to an existing app. In non-interactive environments, provide this flag or both --name and --organization-id.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]}),"organization-id":w.Flags.string({hidden:!1,description:"The organization ID. Your organization ID can be found in your Dev Dashboard URL: https://dev.shopify.com/dashboard/<organization-id>. Required in non-interactive environments unless --client-id is provided.",env:"SHOPIFY_FLAG_ORGANIZATION_ID",exclusive:["client-id"]})};static nonTTYFlagRequirements(){return[{flags:["name","client-id"]},{flags:["organization-id","client-id"]},{flags:["flavor"],when:t=>De(t.template)}]}async run(){let{flags:t}=await this.parse(e);if(Ke(t.template),Ve(t.template,t.flavor),t.name!==void 0&&t.name.trim()==="")throw new d("The --name flag can't be empty","Provide a valid app name, for example: --name my-app");let a=pe(t["package-manager"]),i=t.name??await st(t.path),o=Le();await o.session();let n=await Ne({template:t.template,flavor:t.flavor}),s,r;if(t["client-id"]){let u=await _e({apiKey:t["client-id"]});r=u.title,s={result:"existing",app:u}}else{let u;t["organization-id"]?u=await Se(t["organization-id"],o):u=await $e();let{organization:f,apps:A,hasMorePages:b}=await o.orgAndApps(u.id);s=await pt(t.name!==void 0,i,A,b,f,o),r=s.result==="new"?s.name:s.app.title}n.globalCLIResult.install&&await te(a),await ce(()=>({cmd_create_app_template:n.templateType,cmd_create_app_template_url:n.template}));let m=await He({name:r,selectedAppOrNameResult:s,packageManager:a,template:n.template,local:t.local,directory:t.path,useGlobalCLI:n.globalCLIResult.alreadyInstalled||n.globalCLIResult.install,developerPlatformClient:o,postCloneActions:{removeLockfilesFromGitignore:n.templateType!=="custom"}});return Ye(m,t.json),{app:m.app}}};async function st(e){for(let t=0;t<3;t++){let a=await Z({suffix:"app",directory:e});if(Re(a))return a}return""}async function pt(e,t,a,i,o,n){let s=a.length===0||e;if(s||(s=await Fe()),s)return{result:"new",name:e?t:await Ce(t),org:o};{let r=await xe(Ae(n,o.id),a,i);if(!r)throw new d("Unable to select an app: the selection prompt was interrupted.");let m=await n.appFromIdentifiers(r.apiKey);if(!m)throw new d(`App with id ${r.id} not found`);return{result:"existing",app:m}}}export{N as a};
@@ -1 +0,0 @@
1
- import{a as d}from"./chunk-QEKGGTMN.js";import{a as p,b as m}from"./chunk-62EOM3Y2.js";import{d as r,j as c}from"./chunk-PDZBKVWL.js";import{a as s}from"./chunk-VHZ6RL67.js";import{Ma as a}from"./chunk-U2T5HPRD.js";import{c as n}from"./chunk-3KM5ZOW2.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class u extends s{static summary="Reverses app subscription migrations that are still scheduled.";static descriptionWithMarkdown="Reverses scheduled app subscription migrations that have not migrated yet.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV header: `shop_id`.\n- Example row: `123456789`.\n\nThe CSV can contain only the `shop_id` header, or it can reuse the complete CSV supplied to `schedule`; schedule-only columns are ignored.\n\nUnscheduling is not a rollback after a subscription has migrated. The command validates the entire CSV before sending any mutation. Use `--force` to skip confirmation and immediately submit every valid row.\n\nOperations are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...r,...n};static get jsonOutputSchema(){return c}async run(){let{flags:t}=await this.parse(u),{app:h,remoteApp:l}=await a({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),f=await d({action:"unschedule",input:t.input??"-",clientId:l.apiKey,skipConfirmation:t.force,watch:t.watch,...t.watch&&!t.json?{onSubmissionAccepted:p}:{}}),i=m(f,{json:t.json,watch:t.watch});return i!==0&&(process.exitCode=i),{app:h}}};export{e as a};
@@ -1 +0,0 @@
1
- import{e as s}from"./chunk-DZKFP6H2.js";import{fa as p}from"./chunk-33ZE3DRQ.js";import{S as i}from"./chunk-GQLNG537.js";import{h as a}from"./chunk-M5VIFG2V.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();async function x(t,e){return i(e,t.apiKey,await p(t))}function S(t){let{organization:e,remoteApp:m,storeFqdn:u,version:o}=t,r=[`Organization: ${e.businessName}`,`App: ${m.title}`,`Store: ${u}`];return o&&r.push(`API version: ${o}`),r}function y(t,e){if(s(t)&&e.storeType!=="APP_DEVELOPMENT")throw new a("Mutations can only be executed on dev stores.")}export{x as a,S as b,y as c};
@@ -1,16 +0,0 @@
1
- import{f as A,g as R,h as j}from"./chunk-S4LOWCGS.js";import{a as T}from"./chunk-VGSH52JM.js";import{a as S}from"./chunk-NVKJ7ZLP.js";import{Na as N,b as I,c as w}from"./chunk-U2T5HPRD.js";import{b as y,c as x}from"./chunk-3KM5ZOW2.js";import{z as m}from"./chunk-D2KIGKBI.js";import{a as d}from"./chunk-BN7ZXAZJ.js";import{qb as b,sb as g,wb as P}from"./chunk-JLQRDFR5.js";import{b as r}from"./chunk-FZCGRIOM.js";import{c as h}from"./chunk-IWTNUJGY.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();import{resolve as u}from"node:path";function v(t,{functionRunnerPath:n,schemaPath:e}){let i=t.configuration;return{function:{handle:i.handle??null,name:t.name,apiVersion:i.api_version??null,directory:u(t.directory),targets:(i.targeting??[]).filter(({target:o})=>!!o).map(o=>({target:o.target,inputQueryPath:o.input_query?u(h(t.directory,o.input_query)):null,export:o.export===""?null:o.export??null})),schemaPath:e?u(e):null,wasmPath:u(h(t.directory,i.build?.path??t.outputRelativePath)),functionRunnerPath:u(n)}}}a();var s=r.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/).describe("An absolute native filesystem path."),C=r.object({target:r.string().min(1),inputQueryPath:s.nullable().describe("Null when no input query is configured."),export:r.string().min(1).nullable().describe("Null when no WebAssembly export is configured.")}).strict(),O=r.object({handle:r.string().nullable().describe("Null when the extension does not configure a handle."),name:r.string(),apiVersion:r.string().nullable().describe("The configured API version, or null when unavailable."),directory:s,targets:r.array(C).describe("All configured targets; empty when none are configured."),schemaPath:s.nullable().describe("Null when a GraphQL schema is unavailable."),wasmPath:s,functionRunnerPath:s}).strict(),l=d({name:"FunctionInfoResult",schema:r.object({function:O}).strict(),definitions:{FunctionInfo:O,FunctionTarget:C}});a();function B(t,n){return{title:`CONFIGURATION
2
- `,body:{tabularData:[["Handle",t.handle??"N/A"],["Name",n??"N/A"],["API Version",t.api_version??"N/A"]],firstColumnSubdued:!0}}}function E(t){if(Object.keys(t).length===0)return null;let n=[];return Object.entries(t).forEach(([e,i])=>{n.push([g`${b.cyan(e)}`.value,""]),i.inputQueryPath&&n.push([{subdued:" Input Query Path"},{filePath:i.inputQueryPath}]),i.export&&n.push([{subdued:" Export"},i.export])}),{title:`
3
- TARGETING
4
- `,body:{tabularData:n}}}function G(t,n){return{title:`
5
- BUILD
6
- `,body:{tabularData:[["Schema Path",{filePath:n??"N/A"}],["Wasm Path",{filePath:t}]],firstColumnSubdued:!0}}}function U(t){return{title:`
7
- FUNCTION RUNNER
8
- `,body:{tabularData:[["Path",{filePath:t}]],firstColumnSubdued:!0}}}function F(t,n){if(n==="json"){P(l.encode(t));return}let e=t.function,i=Object.fromEntries(e.targets.map(({target:f,inputQueryPath:Q,export:D})=>[f,{inputQueryPath:Q??void 0,export:D??void 0}])),o=[B({handle:e.handle??void 0,api_version:e.apiVersion??void 0},e.name)],c=E(i);c&&o.push(c),o.push(G(e.wasmPath,e.schemaPath??void 0)),o.push(U(e.functionRunnerPath)),m({customSections:o})}var p=class t extends T{static get jsonOutputSchema(){return l}static summary="Print basic information about your function.";static descriptionWithMarkdown=`The information returned includes the following:
9
-
10
- - The function handle
11
- - The function name
12
- - The function API version
13
- - The targeting configuration
14
- - The schema path
15
- - The WASM path
16
- - The function runner path`;static description=this.descriptionForHelp();static flags={...y,...S,...A,...x};async run(){let{flags:n}=await this.parse(t),{app:e}=await N({directory:n.path,userProvidedConfigName:n.config}),i=await R(e,n.path),o=I();await w(o);let c=await j(i,n.path,n["client-id"],n.reset,n.config),f=v(i,{functionRunnerPath:o.path,schemaPath:c});return F(f,n.json?"json":"text"),{app:e}}};export{p as a};
@@ -1,3 +0,0 @@
1
- import{a as L,b as g,d as w,g as I}from"./chunk-W37IFK3P.js";import{a as A}from"./chunk-H6GNKWYM.js";import{t as P}from"./chunk-DZKFP6H2.js";import{a as G}from"./chunk-VHZ6RL67.js";import{a as S}from"./chunk-NVKJ7ZLP.js";import{fa as F}from"./chunk-33ZE3DRQ.js";import{p as c,u as d}from"./chunk-GQLNG537.js";import{b as v,e as b}from"./chunk-3KM5ZOW2.js";import{O as u,a as l}from"./chunk-D2KIGKBI.js";import{Cb as y,qb as f,sb as h,yb as i}from"./chunk-JLQRDFR5.js";import{b as q}from"./chunk-YTUUU33R.js";import{e as C,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();import{randomBytes as x}from"crypto";function K(){return x(32).toString("hex")}function T(r){let e=new URL(`http://localhost:${r.port}/graphiql`);return e.searchParams.set("key",r.key),r.query&&e.searchParams.set("query",r.query),r.variables&&e.searchParams.set("variables",r.variables),r.apiVersion&&e.searchParams.set("api_version",r.apiVersion),e.toString()}async function k(r){let e=await A(r.port),t=g({stdout:r.stdout??process.stdout,port:e,storeFqdn:r.storeFqdn,tokenProvider:r.tokenProvider,key:r.key,appContext:r.appContext,protectMutations:r.protectMutations}),a=T({port:e,key:r.key,query:r.query,variables:r.variables,apiVersion:r.apiVersion});try{i(h`GraphiQL is running at ${f.link(a)}`),r.additionalReadyMessages?.forEach(s=>i(s)),i("Press Ctrl+C to stop."),await u(a)||y("Browser did not open automatically. Open the URL above manually."),await O(r.abortSignal)}finally{t.close()}}async function O(r){let e=new l,t=()=>e.abort();process.once("SIGINT",t);try{await new Promise(a=>{if(e.signal.aborted||r?.aborted){a();return}e.signal.addEventListener("abort",()=>a(),{once:!0}),r?.addEventListener("abort",()=>e.abort(),{once:!0})})}finally{process.removeListener("SIGINT",t)}}async function Q(r){let e=await F(r.remoteApp),t=L(void 0,e,r.store),a=I({apiKey:r.remoteApp.apiKey,apiSecret:e,storeFqdn:r.store}),m=await c(),s=w(r.store,r.remoteApp.apiKey,m);await k({port:r.port,storeFqdn:r.store,tokenProvider:a,key:t,appContext:{appName:r.remoteApp.title,appUrl:s,apiSecret:e},variables:r.variables,apiVersion:r.apiVersion,abortSignal:r.abortSignal})}var n=C(q(),1),p=class r extends G{static summary="Open a local GraphiQL UI for your app and store.";static descriptionWithMarkdown=`Opens an authenticated Admin API GraphiQL UI for your app and selected store.
2
-
3
- The app must be installed on the store.`;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];static flags={...v,...S,store:n.Flags.string({char:"s",description:"The myshopify.com domain of the store to open GraphiQL against. The app must be installed on the store. If not specified, you will be prompted to select a store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>d(e)}),port:b({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),variables:n.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:n.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};async run(){let{flags:e}=await this.parse(r),{appContextResult:t,store:a}=await P(e);return await Q({remoteApp:t.remoteApp,store:a.shopDomain,port:e.port,variables:e.variables,apiVersion:e.version}),{app:t.app}}};export{K as a,k as b,p as c};
@@ -1 +0,0 @@
1
- import{c as s,g as h}from"./chunk-VKWPEFWQ.js";var v=s((O,x)=>{"use strict";h();x.exports=p;function p(i,f,e){i instanceof RegExp&&(i=o(i,e)),f instanceof RegExp&&(f=o(f,e));var n=d(i,f,e);return n&&{start:n[0],end:n[1],pre:e.slice(0,n[0]),body:e.slice(n[0]+i.length,n[1]),post:e.slice(n[1]+f.length)}}function o(i,f){var e=f.match(i);return e?e[0]:null}p.range=d;function d(i,f,e){var n,a,c,u,g,l=e.indexOf(i),t=e.indexOf(f,l+1),r=l;if(l>=0&&t>0){if(i===f)return[l,t];for(n=[],c=e.length;r>=0&&!g;)r==l?(n.push(r),l=e.indexOf(i,r+1)):n.length==1?g=[n.pop(),t]:(a=n.pop(),a<c&&(c=a,u=t),t=e.indexOf(f,r+1)),r=l<t&&l>=0?l:t;n.length&&(g=[c,u])}return g}});export{v as a};
@@ -1,5 +0,0 @@
1
- import{a as re,b as oe,c as ie,d as ae}from"./chunk-EAZIQI2D.js";import{f as te,g as ne}from"./chunk-S4LOWCGS.js";import{q as v}from"./chunk-ZOOT3GBY.js";import{c as Z,d as ee}from"./chunk-MGHPF7HU.js";import{a as X}from"./chunk-VHZ6RL67.js";import{a as V}from"./chunk-NVKJ7ZLP.js";import{Ma as Q}from"./chunk-U2T5HPRD.js";import{b as K,c as z,f as Y}from"./chunk-3KM5ZOW2.js";import{G,a as b,f as O,g as u,h as s,i as j,j as B,k as J,n as H,o as q,p as x,u as C}from"./chunk-D2KIGKBI.js";import{h as R}from"./chunk-M5VIFG2V.js";import{a as $}from"./chunk-NXAEBGMO.js";import{la as N}from"./chunk-JLQRDFR5.js";import{g as U}from"./chunk-LHXFTFFM.js";import{b as Fe}from"./chunk-YTUUU33R.js";import{c as I}from"./chunk-IWTNUJGY.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(O(),1);import{Writable as se}from"stream";function ce({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},[m,p]=(0,h.useState)([]),[d,l]=(0,h.useState)([a,a]),[y,f]=(0,h.useState)(void 0),{input:w,export:W}=e.payload,[he,A]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let k=new b;t.signal.addEventListener("abort",()=>{k.abort()});let _=async()=>{let E=await xe(r,JSON.stringify(w),W);l(g=>[E,g[0]]),A(`Watching for changes to ${e.source}...`),p(g=>[...g,E])},ye=async()=>{A("Replaying log with local function..."),await _()},we=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==Z.Updated)){if(F.buildResult?.status==="error"){f(`Error while reloading and building extension: ${F.buildResult?.error}`);return}f(void 0),A("Re-running with latest changes..."),await _()}});let E=new se({write(g,F,L){p(Ee=>[...Ee,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:E,stderr:E,signal:k.signal},!1)};return ye().then(()=>{we()}),()=>{k.abort()}},[w,W,o,r]),C(t.signal,async()=>{setTimeout(()=>{U()||$(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:m,statusMessage:he,recentFunctionRuns:d,error:y}}async function xe(e,t,o){let r="",i=new se({write(m,p,d){r+=m,d()}});return await oe({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(O(),1);var ue=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=C(t.signal),{isRawModeSupported:a}=B(),m=new ee(o),{logs:p,statusMessage:d,recentFunctionRuns:l,error:y}=ce({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:m});return J((f,w)=>{q(f,w,()=>t.abort()),f==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:p},(f,w)=>n.default.createElement(u,{key:`replayOutputScrollerLog${w}`,flexDirection:"column"},n.default.createElement(Ae,{log:f}))),i?null:n.default.createElement(u,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(u,{flexDirection:"column"},n.default.createElement(u,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",d)),n.default.createElement(De,{recentFunctionRuns:l}),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
-
3
- `,r,e,r,`
4
- `)}function Re({input:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,v(e)))}function Se({logs:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function be({output:e}){return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,v(e)))}function Ce({functionRun:e}){return n.default.createElement(u,{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 De({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(s,null,x.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Ae({log:e}){switch(e.type){case"functionRun":return n.default.createElement(u,{flexDirection:"column"},n.default.createElement(Re,{input:e.input}),n.default.createElement(Se,{logs:e.logs}),n.default.createElement(be,{output:e.output}),n.default.createElement(Ce,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var le=S(O(),1);async function me({selectedRun:e,abortController:t,app:o,extension:r}){return H(le.default.createElement(ue,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function pe(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await G({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as ke,readdirSync as Le}from"fs";var M=100;async function fe(e){let{watch:t,extension:o,app:r}=e,i=new b;try{let a=await Ie(e),{input:m,export:p}=a.payload;if(t)await me({selectedRun:a,abortController:i,app:r,extension:o});else return await ie({functionExtension:o,json:e.json,input:JSON.stringify(m),export:p})}catch(a){throw i.abort(),a}}async function Ie(e){let t=e.app.getLogsDir();return e.log?Ne(t,e.extension.handle,e.log):ve(t,e.extension.handle)}async function Ne(e,t,o){let r=await Oe(e,t,o);if(r===void 0)throw new R(`No log found for '${o}'.
5
- Searched ${e} for function ${t}.`);let i=await N(r);return JSON.parse(i)}function de(e){let t=e.split(/[_.]/);if(!(t.length<6))return{namespace:t[3],functionHandle:t[4],identifier:t[5]}}async function Oe(e,t,o){let r=ge(e).find(i=>{let a=de(i);return a?.namespace==="extensions"&&a?.functionHandle===t&&a?.identifier===o});return r?I(e,r):void 0}async function ve(e,t){let o=await Me(e,t),r=await pe(o);if(r===void 0)throw new R(`No logs found in ${e}`);return r}async function Me(e,t){let o=ge(e).filter(i=>{let a=de(i);return a?.namespace==="extensions"&&a?.functionHandle===t}).reverse(),r=[];for(let i=0;i<o.length&&r.length<M;i+=M){let m=o.slice(i,i+M).map(l=>I(e,l)),d=(await Promise.all(m.map(async l=>{let y=await N(l);return{...JSON.parse(y),identifier:Te(l)}}))).filter(l=>l.payload.input!=null);r=r.concat(d)}return r}function Te(e){return e.split("_").pop().substring(0,6)}function ge(e){return ke(e)?Le(e):[]}var T=S(Fe(),1);var P=class e extends X{static get requiresSyncAnalytics(){return!0}static get jsonOutputSchema(){return re}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={...K,...V,...te,...z,log:Y(T.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:T.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);if(t.json&&t.watch)throw new R("JSON output requires a finite replay. Use --no-watch with --json.");let{app:o}=await Q({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),r=await ne(o,t.path),i=await fe({app:o,extension:r,path:t.path,log:t.log,json:t.json,watch:t.watch});return i&&ae(i),{app:o}}};export{P as a};
@@ -1,6 +0,0 @@
1
- import{b as s,c as i,d as p}from"./chunk-XWSWXQCC.js";import{b as o}from"./chunk-ZJOX5HW4.js";import{b as e,c as r}from"./chunk-3KM5ZOW2.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class n extends o{static summary="Enable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
2
-
3
- When auto-upgrade is enabled, Shopify CLI automatically updates to the latest version once per day. Major version upgrades are skipped and must be done manually.
4
-
5
- To disable auto-upgrade, run \`shopify config autoupgrade off\`.
6
- `;static description=this.descriptionForHelp();static flags={...e,...r};static get jsonOutputSchema(){return i}async run(){let{flags:u}=await this.parse(n),d=s(!0);p(d,u.json?"json":"text")}};export{t as a};
@@ -1,3 +0,0 @@
1
- import{b as f}from"./chunk-AUE7LM32.js";import{D as c}from"./chunk-GQLNG537.js";import{z as m}from"./chunk-D2KIGKBI.js";import{a}from"./chunk-BN7ZXAZJ.js";import{k as d}from"./chunk-M5VIFG2V.js";import{yb as h}from"./chunk-JLQRDFR5.js";import{b as t,c as l,d as s}from"./chunk-FZCGRIOM.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();var u=t.string().regex(/^gid:\/\/shopify\/BulkOperation\/[^/]+$/).describe("The Shopify global ID of a bulk operation."),n=t.object({gid:u,type:t.string(),status:t.string(),errorCode:t.string().nullable(),createdAt:l,completedAt:l.nullable(),objectCount:t.string().regex(/^\d+$/).describe("A nonnegative decimal count, without loss of integer precision."),url:t.string().url().nullable(),partialDataUrl:t.string().url().nullable()}).strict(),i=t.object({storeDomain:t.string().regex(/^[^.]+\.myshopify\.com$/).nullable(),apiVersion:t.string().nullable().describe("The API version selected for the request.")}).strict();var B=n.omit({type:!0}),O=i.extend({operationGid:u,operation:n.nullable()}),b=i.extend({operations:t.array(B),pageInfo:t.object({hasNextPage:t.boolean().nullable().describe("Unknown when the API result reaches the fetch limit.")}).strict()}),D=a({name:"BulkOperationStatusResult",schema:t.union([O,b]),definitions:{GetBulkOperationStatusResult:O,ListBulkOperationsResult:b,BulkOperation:n,ListedBulkOperation:B}}),J=a({name:"CancelBulkOperationResult",schema:i.extend({status:t.literal("success"),operation:n}),definitions:{BulkOperation:n}}),k=i.extend({status:t.enum(["success","partial","cancelled"]),reason:t.literal("watch-aborted").optional(),operation:n,resultsJsonl:t.string().optional().describe("Downloaded results in their native JSONL format.")}),g=t.object({path:t.string().describe("The absolute path of the downloaded results file."),format:t.literal("jsonl")}).strict(),R=a({name:"ExecuteBulkOperationResult",schema:t.union([k,g]),definitions:{BulkOperation:n,ExecuteBulkOperationResult:k,BulkOperationFile:g}});o();function U(e,r,S){let p=[...r.operationId?[`ID: ${r.operationId}`]:[],...f(r)];if(S==="json"){h(`${e}
2
- ${p.join(`
3
- `)}`);return}m({headline:e,body:[{list:{items:p}}]})}o();function F(e){let r=c(e.store);return{storeDomain:r?`${r}.myshopify.com`:null,apiVersion:e.apiVersion??null}}function q(e){if(typeof e.objectCount=="number"&&!Number.isSafeInteger(e.objectCount))throw new d("Shopify returned a bulk operation count that can't be represented exactly.");return{gid:e.id,..."type"in e?{type:e.type}:{},status:e.status,errorCode:e.errorCode??null,createdAt:s(new Date(String(e.createdAt))),completedAt:e.completedAt?s(new Date(String(e.completedAt))):null,objectCount:String(e.objectCount),url:e.url??null,partialDataUrl:e.partialDataUrl??null}}export{D as a,J as b,R as c,F as d,q as e,U as f};