shopify 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{analytics-Q6QDIDYT.js → analytics-NMMVOF4B.js} +1 -1
- package/dist/{analytics-VKKJNJ62.js → analytics-UK77WNLG.js} +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-Q5MEFIMV.js → chunk-224UPIYS.js} +1 -1
- package/dist/{chunk-XBQDMGUN.js → chunk-26PWHH3B.js} +1 -1
- package/dist/{chunk-46MSIQ6Z.js → chunk-27NXPOAS.js} +1 -1
- package/dist/{chunk-SFPXYHHL.js → chunk-2A2JSAAA.js} +1 -1
- package/dist/{chunk-P33TONYG.js → chunk-2L6AN3QA.js} +1 -1
- package/dist/{chunk-43KLFFP7.js → chunk-2MT3LSMZ.js} +1 -1
- package/dist/{chunk-PGLWZMJU.js → chunk-2T4HDR6R.js} +1 -1
- package/dist/{chunk-5UWMXOHM.js → chunk-2WJOTJOD.js} +1 -1
- package/dist/{chunk-HIRTL45Q.js → chunk-2ZBXHCQZ.js} +1 -1
- package/dist/chunk-33ZE3DRQ.js +16 -0
- package/dist/{chunk-WFWISGLS.js → chunk-34MOWGRL.js} +1 -1
- package/dist/{chunk-AXC2MHHO.js → chunk-35XFNKNB.js} +1 -1
- package/dist/{chunk-LHKVXJPX.js → chunk-3JSKNXL7.js} +1 -1
- package/dist/{chunk-Q2SZCZE7.js → chunk-3KM5ZOW2.js} +1 -1
- package/dist/{chunk-KJQDS5HI.js → chunk-3MG4MTWQ.js} +1 -1
- package/dist/{chunk-MDRVCBDO.js → chunk-3MYDSQHF.js} +1 -1
- package/dist/{chunk-MYAIWSOO.js → chunk-3ODQKAEA.js} +1 -1
- package/dist/{chunk-6DXP7PQ7.js → chunk-3XRI3D44.js} +1 -1
- package/dist/{chunk-KGRIYAMA.js → chunk-3Z3MADXZ.js} +1 -1
- package/dist/{chunk-GB6E3ATN.js → chunk-4KECSZTL.js} +1 -1
- package/dist/{chunk-G6ZMSWEU.js → chunk-4WYKPIN3.js} +1 -1
- package/dist/{chunk-M3ACZWMR.js → chunk-5AEZJZNQ.js} +1 -1
- package/dist/chunk-5ED7SOQZ.js +20 -0
- package/dist/{chunk-FFHH5LOR.js → chunk-5IDJALJH.js} +1 -1
- package/dist/{chunk-GXORLBVN.js → chunk-62EOM3Y2.js} +1 -1
- package/dist/{chunk-EXFBZPZS.js → chunk-64G5TGFF.js} +1 -1
- package/dist/{chunk-QN3774QI.js → chunk-66TMIQMB.js} +1 -1
- package/dist/{chunk-L7MSPGDS.js → chunk-67L7FIB6.js} +1 -1
- package/dist/{chunk-7UOA4DI7.js → chunk-6ES4KRFW.js} +1 -1
- package/dist/{chunk-XMODGI45.js → chunk-74NRFUGQ.js} +1 -1
- package/dist/{chunk-YVY32DNA.js → chunk-7CCTPBCT.js} +1 -1
- package/dist/{chunk-2DID73ML.js → chunk-7GUMJ5E4.js} +1 -1
- package/dist/{chunk-IUTZIN2T.js → chunk-7NFTSBHQ.js} +1 -1
- package/dist/{chunk-TPSA4JN5.js → chunk-ACZNWIRY.js} +1 -1
- package/dist/{chunk-CCMDZX35.js → chunk-AQ6EVL73.js} +1 -1
- package/dist/{chunk-7WPUV7GY.js → chunk-AQKWPRZE.js} +1 -1
- package/dist/chunk-AUE7LM32.js +1 -0
- package/dist/{chunk-PIAD3F6M.js → chunk-AXL2VIWA.js} +1 -1
- package/dist/{chunk-CVVQQLCF.js → chunk-B2O3ANRZ.js} +1 -1
- package/dist/chunk-B3ZJGYZY.js +3 -0
- package/dist/{chunk-4SS6DXC7.js → chunk-BWN2QG6D.js} +1 -1
- package/dist/{chunk-6BNKBCCU.js → chunk-C3RFAKWR.js} +1 -1
- package/dist/{chunk-SNNZ4U2W.js → chunk-CCUQM4FX.js} +1 -1
- package/dist/{chunk-EITIW5OX.js → chunk-CGVROSPS.js} +1 -1
- package/dist/{chunk-7QUZWCJZ.js → chunk-CLUUA3HX.js} +1 -1
- package/dist/{chunk-X7HVAVSZ.js → chunk-CXI3RHPW.js} +1 -1
- package/dist/chunk-CYEEGTVZ.js +11 -0
- package/dist/{chunk-CZ22VZDA.js → chunk-D2KIGKBI.js} +108 -108
- package/dist/chunk-DBDTE3EE.js +5 -0
- package/dist/{chunk-YKS7MH3F.js → chunk-DLVB3237.js} +1 -1
- package/dist/{chunk-UZROQRLX.js → chunk-DN6X7SHW.js} +1 -1
- package/dist/{chunk-OGWPS55W.js → chunk-DZKFP6H2.js} +1 -1
- package/dist/{chunk-S67I4E7M.js → chunk-E5COIKGY.js} +1 -1
- package/dist/{chunk-CW2T7EOQ.js → chunk-E6RONHMT.js} +1 -1
- package/dist/{chunk-2CMEKSI7.js → chunk-EAZIQI2D.js} +1 -1
- package/dist/{chunk-FNLECT7B.js → chunk-EEY4FKAW.js} +1 -1
- package/dist/{chunk-YGYEM6QO.js → chunk-EKFPTBXC.js} +1 -1
- package/dist/{chunk-VW6QS7DO.js → chunk-ER6C5WS3.js} +1 -1
- package/dist/{chunk-MR2AUT7Q.js → chunk-ESFCYB46.js} +1 -1
- package/dist/{chunk-GRGFA26K.js → chunk-F3CK3EJJ.js} +1 -1
- package/dist/{chunk-M4BVLMPH.js → chunk-FEBOZ2XX.js} +1 -1
- package/dist/{chunk-5OMJFPQW.js → chunk-GNCVDN7U.js} +1 -1
- package/dist/{chunk-H4V55Y3Z.js → chunk-GQLNG537.js} +83 -83
- package/dist/{chunk-IEQ4UOH3.js → chunk-GVI3DWSB.js} +1 -1
- package/dist/{chunk-DFQ4WTET.js → chunk-GW7YIJPJ.js} +1 -1
- package/dist/{chunk-SFQEHDJY.js → chunk-H6GNKWYM.js} +1 -1
- package/dist/{chunk-5TB52UUV.js → chunk-H6GYBLVQ.js} +1 -1
- package/dist/chunk-HSKDFEXW.js +1 -0
- package/dist/{chunk-JYMDWR25.js → chunk-HTRJU4R4.js} +1 -1
- package/dist/{chunk-EMSF57ZB.js → chunk-HXZAY5OA.js} +1 -1
- package/dist/{chunk-WJSUIUBW.js → chunk-I4CEH7AK.js} +1 -1
- package/dist/{chunk-4ARCB6DT.js → chunk-I7PEEJVH.js} +1 -1
- package/dist/{chunk-CCQNP5YR.js → chunk-IHMATNOR.js} +1 -1
- package/dist/{chunk-N2RFDHRY.js → chunk-IHXGZW42.js} +1 -1
- package/dist/chunk-IJY3RJPJ.js +47 -0
- package/dist/{chunk-52FDK2LC.js → chunk-ISKQQXLZ.js} +1 -1
- package/dist/{chunk-UVRKTMF7.js → chunk-J55GQLP4.js} +1 -1
- package/dist/{chunk-3LVCG4JB.js → chunk-J5ERDFIC.js} +1 -1
- package/dist/{chunk-LWCTKI4Z.js → chunk-JLQRDFR5.js} +3 -3
- package/dist/{chunk-HCZG7YJ6.js → chunk-JPWRZ5SL.js} +1 -1
- package/dist/{chunk-BWRNXCVN.js → chunk-K7ZSPQKL.js} +1 -1
- package/dist/{chunk-4GCI2YCZ.js → chunk-KNWT7JLL.js} +1 -1
- package/dist/{chunk-U25W35TX.js → chunk-KZRLZWOU.js} +1 -1
- package/dist/chunk-L5TSPCSY.js +26 -0
- package/dist/{chunk-J6TW43TG.js → chunk-LEHBZKK3.js} +1 -1
- package/dist/chunk-LGXI7EGM.js +8 -0
- package/dist/{chunk-3A3DZVEJ.js → chunk-LHXFTFFM.js} +1 -1
- package/dist/{chunk-4RDFMBRG.js → chunk-LUGMXSRI.js} +1 -1
- package/dist/chunk-M2CWCOFU.js +11 -0
- package/dist/{chunk-2VSNFOKD.js → chunk-M5VIFG2V.js} +1 -1
- package/dist/{chunk-IWEKM5Y3.js → chunk-MADINS4Z.js} +1 -1
- package/dist/{chunk-VMMUJN4T.js → chunk-MEYVUHQH.js} +1 -1
- package/dist/{chunk-PEVIRAMR.js → chunk-MGHPF7HU.js} +1 -1
- package/dist/{chunk-ZT5WFUKJ.js → chunk-MHR5OHT5.js} +1 -1
- package/dist/{chunk-5NEGOQT6.js → chunk-MXEXP3HT.js} +1 -1
- package/dist/{chunk-IQVRP7CT.js → chunk-N57Y7THE.js} +1 -1
- package/dist/{chunk-FWB3GLMW.js → chunk-NVKJ7ZLP.js} +1 -1
- package/dist/{chunk-GQNOVEKP.js → chunk-NXAEBGMO.js} +1 -1
- package/dist/{chunk-PYIICTLX.js → chunk-OJULL7HT.js} +1 -1
- package/dist/{chunk-SL3VBI62.js → chunk-OMPQ7REW.js} +1 -1
- package/dist/{chunk-NK2MGR6A.js → chunk-OR4IJ4BQ.js} +1 -1
- package/dist/{chunk-CIK5BF7V.js → chunk-P2RMFHQP.js} +1 -1
- package/dist/{chunk-R7EMV77H.js → chunk-P4VZYOKO.js} +2 -2
- package/dist/{chunk-NDKSG4CC.js → chunk-PDZBKVWL.js} +1 -1
- package/dist/{chunk-QKVVJXWS.js → chunk-PF53E2DC.js} +1 -1
- package/dist/{chunk-XNNKLUTN.js → chunk-PLSS456F.js} +1 -1
- package/dist/{chunk-XM7YUXTF.js → chunk-PTSCGSQV.js} +2 -2
- package/dist/{chunk-KSDU4YOB.js → chunk-PWAT52M4.js} +1 -1
- package/dist/{chunk-NOH63WC6.js → chunk-Q2KWXZQB.js} +1 -1
- package/dist/{chunk-EGCWR5AS.js → chunk-Q4JYAUVL.js} +1 -1
- package/dist/{chunk-4CRBTSVP.js → chunk-Q5IC3IYY.js} +1 -1
- package/dist/{chunk-Z5SILNH2.js → chunk-QDCLL5OI.js} +1 -1
- package/dist/{chunk-VB7YQMAM.js → chunk-QEKGGTMN.js} +1 -1
- package/dist/{chunk-BJPDJIS4.js → chunk-QEVTBD33.js} +1 -1
- package/dist/{chunk-PZUGDE7N.js → chunk-QF5WKTPD.js} +1 -1
- package/dist/{chunk-7NSK77WG.js → chunk-QFSENE5T.js} +1 -1
- package/dist/{chunk-IUP7POIE.js → chunk-QQJNQNKP.js} +1 -1
- package/dist/{chunk-PSSYLJG4.js → chunk-QW52RPAU.js} +1 -1
- package/dist/{chunk-ULD7CIOY.js → chunk-R4UVIYZP.js} +1 -1
- package/dist/{chunk-M5TGCSUK.js → chunk-RLNIOJH3.js} +1 -1
- package/dist/{chunk-ZYQ2XWC5.js → chunk-RPCIFYCY.js} +1 -1
- package/dist/{chunk-C3KEDG33.js → chunk-RPVZ2JON.js} +1 -1
- package/dist/{chunk-I4OVLRQR.js → chunk-RW6G4ZPU.js} +1 -1
- package/dist/{chunk-4GOJQKY5.js → chunk-S4LOWCGS.js} +1 -1
- package/dist/{chunk-OQU3HLAE.js → chunk-S5P7KWY4.js} +1 -1
- package/dist/{chunk-UWMZ5CSB.js → chunk-SACNUF4I.js} +1 -1
- package/dist/chunk-SB27UOXX.js +1 -0
- package/dist/{chunk-YVVU4J5O.js → chunk-SHD4VV5V.js} +1 -1
- package/dist/{chunk-M7LPHCP2.js → chunk-SIL6HPMK.js} +2 -2
- package/dist/{chunk-AJMDF3QC.js → chunk-SK7EPN6C.js} +1 -1
- package/dist/{chunk-XITZIDCL.js → chunk-SLY27GDC.js} +1 -1
- package/dist/{chunk-C7V755IT.js → chunk-SNH4XZ6E.js} +1 -1
- package/dist/{chunk-POKY4RWR.js → chunk-T4XJKM6B.js} +1 -1
- package/dist/{chunk-7MVWDCI3.js → chunk-TAWCKJKP.js} +1 -1
- package/dist/{chunk-BCYTZ7LM.js → chunk-TFPW2VGN.js} +1 -1
- package/dist/{chunk-UOS2XLGG.js → chunk-TODZ3TJR.js} +1 -1
- package/dist/chunk-U2T5HPRD.js +319 -0
- package/dist/{chunk-XTREQ4A2.js → chunk-U6YOP562.js} +1 -1
- package/dist/{chunk-53BG3NLH.js → chunk-UBP3LQFY.js} +1 -1
- package/dist/{chunk-GFVKTWFT.js → chunk-UKWIWCOH.js} +1 -1
- package/dist/{chunk-GAMC2BNY.js → chunk-UPPO3BMT.js} +1 -1
- package/dist/{chunk-Q2XRITUG.js → chunk-URXM5A2K.js} +1 -1
- package/dist/chunk-USXIXANP.js +103 -0
- package/dist/{chunk-R2BDABJD.js → chunk-UUAKOX7E.js} +1 -1
- package/dist/{chunk-WGUOLSMG.js → chunk-UV5GAGAD.js} +1 -1
- package/dist/{chunk-AYL6KBPE.js → chunk-UXVXVI6O.js} +1 -1
- package/dist/{chunk-VWH3VPYI.js → chunk-UY6W2EVZ.js} +1 -1
- package/dist/{chunk-BVSKBX7T.js → chunk-UYELAINQ.js} +1 -1
- package/dist/{chunk-KDPQXURV.js → chunk-VAVXDIUX.js} +1 -1
- package/dist/{chunk-OX7UVDSU.js → chunk-VEUKT5EI.js} +1 -1
- package/dist/chunk-VGSH52JM.js +1 -0
- package/dist/chunk-VHZ6RL67.js +1 -0
- package/dist/{chunk-UK6576EO.js → chunk-VQA3X7O3.js} +1 -1
- package/dist/{chunk-TTEF7GTX.js → chunk-VZCMJRYV.js} +1 -1
- package/dist/{chunk-3G4HJO72.js → chunk-W37IFK3P.js} +1 -1
- package/dist/{chunk-LMQGNECW.js → chunk-W56ZGEQQ.js} +1 -1
- package/dist/{chunk-GCNA3HXH.js → chunk-WBVS5NBV.js} +1 -1
- package/dist/{chunk-XKRJKUA7.js → chunk-WCC52MR2.js} +1 -1
- package/dist/{chunk-LDU5T3DN.js → chunk-WESTVWWD.js} +1 -1
- package/dist/{chunk-24NUJTIH.js → chunk-WRZWHT6M.js} +1 -1
- package/dist/{chunk-4TI7U2PN.js → chunk-WSDKCQH6.js} +1 -1
- package/dist/{chunk-UIQL5ZF3.js → chunk-X2PFXSU4.js} +1 -1
- package/dist/{chunk-NB4BRW3H.js → chunk-X5NIAZA4.js} +1 -1
- package/dist/{chunk-RFGEM5JC.js → chunk-XBMD3FEZ.js} +1 -1
- package/dist/{chunk-I6FRVYGE.js → chunk-XDVPIGXE.js} +1 -1
- package/dist/chunk-XLIJYJ6Q.js +1 -0
- package/dist/chunk-XUHGWIWW.js +4 -0
- package/dist/{chunk-2ORRV7GH.js → chunk-XWSWXQCC.js} +1 -1
- package/dist/{chunk-Q66CI37F.js → chunk-Y55T4IIQ.js} +1 -1
- package/dist/{chunk-WMAFG2JD.js → chunk-Y5CVX5LJ.js} +1 -1
- package/dist/{chunk-VHUD3CBC.js → chunk-Y6J46XYF.js} +1 -1
- package/dist/{chunk-DJAZBPYA.js → chunk-YKMINHYY.js} +1 -1
- package/dist/{chunk-KKPOOIE4.js → chunk-YSWVYPWR.js} +1 -1
- package/dist/{chunk-D7NB7YR6.js → chunk-YV2TP44L.js} +1 -1
- package/dist/{chunk-7IFE4UQY.js → chunk-Z2WAW6MM.js} +1 -1
- package/dist/chunk-ZBL7XMJ6.js +25 -0
- package/dist/{chunk-YTUDXZLN.js → chunk-ZGBTO46A.js} +1 -1
- package/dist/{chunk-ZQDDRIBA.js → chunk-ZJOX5HW4.js} +4 -4
- package/dist/{chunk-MXJAH2GW.js → chunk-ZOOT3GBY.js} +1 -1
- package/dist/{chunk-ZAA2DXK5.js → chunk-ZRI3SSLG.js} +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import/channel-config.js +1 -1
- package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import/dashboard-extensions.js +1 -1
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/security/check.js +1 -1
- package/dist/cli/commands/app/security/clean.js +1 -1
- package/dist/cli/commands/app/security/instructions.js +1 -1
- package/dist/cli/commands/app/security/record.js +1 -1
- package/dist/cli/commands/app/security/review.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/send-analytics.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/{command-json-schema-2UMKY7MY.js → command-json-schema-F5XF7XHL.js} +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-RI3TL6I4.js → conf-store-5CBLWTOC.js} +1 -1
- package/dist/{custom-oclif-loader-IZCKN67O.js → custom-oclif-loader-UDVUFKMD.js} +1 -1
- package/dist/{deprecations-IFVUXXDB.js → deprecations-EOHPSTCS.js} +1 -1
- package/dist/dist-RNV3GFZ7.js +1 -0
- package/dist/dist-ZFKWJVNB.js +1 -0
- package/dist/{environments-CYMEN7NV.js → environments-4FLRZW4P.js} +1 -1
- package/dist/{error-IL6WQMSW.js → error-JY2ADS6S.js} +1 -1
- package/dist/{error-handler-74HKA23T.js → error-handler-4GCXKC6I.js} +1 -1
- package/dist/{fs-AINFLJ2E.js → fs-XS5YF34R.js} +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/index.js +12 -12
- package/dist/{is-global-2VLKV46Q.js → is-global-27MUENOK.js} +1 -1
- package/dist/{json-error-HZB5YIHV.js → json-error-S5XFS3UX.js} +1 -1
- package/dist/{local-KOZETREJ.js → local-OKPVB4NH.js} +1 -1
- package/dist/{metadata-IBPHZB7N.js → metadata-2YJBAKR7.js} +1 -1
- package/dist/{node-package-manager-DXSRNEDC.js → node-package-manager-B3OW3PFQ.js} +1 -1
- package/dist/{notifications-system-XA3EBOGJ.js → notifications-system-BWTDYBG2.js} +1 -1
- package/dist/{os-X73O7BAB.js → os-F6QKJCFW.js} +1 -1
- package/dist/{output-3OYXK3Z5.js → output-BRIPK7UC.js} +1 -1
- package/dist/{system-JWYYT4PM.js → system-466QKFDI.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-PCG5D6RZ.js → ui-VJTNGCS6.js} +1 -1
- package/dist/{upgrade-7U2TUNC4.js → upgrade-VHVJLXKX.js} +1 -1
- package/dist/{version-7DGU2KYH.js → version-FETZRLZO.js} +1 -1
- package/dist/version-T4XXTJMB.js +1 -0
- package/dist/{workerd-MQZ3NKJI.js → workerd-32DMKLMN.js} +1 -1
- package/oclif.manifest.json +6 -3
- package/package.json +7 -7
- package/dist/chunk-3C6VLJ5D.js +0 -319
- package/dist/chunk-4C2DAX5T.js +0 -1
- package/dist/chunk-7LAKWAKX.js +0 -25
- package/dist/chunk-7RPFJZLP.js +0 -1
- package/dist/chunk-CEIJKJOF.js +0 -11
- package/dist/chunk-DNMXVMJM.js +0 -47
- package/dist/chunk-FDXHQZTO.js +0 -26
- package/dist/chunk-JDR6UVZA.js +0 -8
- package/dist/chunk-JEA3C7ON.js +0 -3
- package/dist/chunk-JOJV5E2K.js +0 -1
- package/dist/chunk-LVLAOBJM.js +0 -103
- package/dist/chunk-OQ5CLM2H.js +0 -4
- package/dist/chunk-OVWUGAEU.js +0 -11
- package/dist/chunk-PMHP57MH.js +0 -20
- package/dist/chunk-RVQV6G5M.js +0 -1
- package/dist/chunk-T2IUXXCT.js +0 -1
- package/dist/chunk-WDFCOZAY.js +0 -16
- package/dist/chunk-X2H6I2WW.js +0 -5
- package/dist/chunk-ZGV3HNEV.js +0 -1
- package/dist/dist-4H2B7BMN.js +0 -1
- package/dist/dist-QNWOGQN3.js +0 -1
- package/dist/version-SXQTRBXB.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Y}from"./chunk-V75WUEFU.js";import{a as u,b as le,c as de}from"./chunk-HB3MJYBK.js";import{a as re}from"./chunk-NB4BRW3H.js";import{b as ue}from"./chunk-QN3774QI.js";import{D as te,F as ne,J as se,M as ie,O as p,P as j,R as y,S as $,T as R,U as S,V as b,W as oe,Y as C,Z as ce,_ as ae,a as V,d as A,k as l,l as X,m,n as Q,o as _,q as Z,t as ee}from"./chunk-LMQGNECW.js";import{b as G}from"./chunk-ZQDDRIBA.js";import{b as q,c as J}from"./chunk-Q2SZCZE7.js";import{A as B,B as M,C as H,z as U}from"./chunk-CZ22VZDA.js";import{a as W}from"./chunk-BN7ZXAZJ.js";import{h as K}from"./chunk-2VSNFOKD.js";import{ga as P,wb as z}from"./chunk-LWCTKI4Z.js";import{b as s,c as g,d as O}from"./chunk-FZCGRIOM.js";import{b as Be}from"./chunk-YTUUU33R.js";import{e as Ue,g as d}from"./chunk-VKWPEFWQ.js";d();d();var Me={resolveSelection:ne,loadResults:ue,recordMetadata:re};function He(e,t){let n=t.checkIds.length>0?{checkIds:t.checkIds}:null,i=e.sources.deterministic!==null||e.sources.agent!==null;n&&i&&Ge(n.checkIds,e.checks);let o=n?e.checks.filter(r=>n.checkIds.includes(r.id)):e.checks;return{resultsDirectory:t.resultsDirectory,sources:e.sources,allChecks:e.checks,checks:o,filter:n,scopeDiffers:Ke(e.sources),blocking:{level:t.blocking,blockedChecks:ze(o,t.blocking)}}}function Ke({deterministic:e,agent:t}){return!e||!t?!1:JSON.stringify(e.document.coverage.scope)!==JSON.stringify(t.document.scope)}function ze(e,t){return t==="none"?0:e.filter(n=>l(n).length>0&&A[n.severity]>=A[t]).length}function Ge(e,t){let n=new Set(t.map(c=>c.id)),i=e.filter(c=>!n.has(c));if(i.length===0)return;let o=i.length===1?"check ID":"check IDs",r=new K(`Unknown ${o}: ${i.join(", ")}.`,"Pass --check-id with one of the checks in the results files.",[],[{title:"Available check IDs",body:{list:{items:t.map(c=>c.id)}}}]);throw r.code="unknown-check-id",r.details={checkIds:i},r}async function x(e,t=Me){let n=await t.resolveSelection({path:e.directory,config:e.configName,clientId:e.clientId,withoutAppConfig:e.withoutAppConfig,allowPrompts:!1,validateClientIdFlag:!0}),i=await t.loadResults(n,e.directory),o=He(i,{resultsDirectory:ee(n.appDirectory,te(n)).resultsDirectory,checkIds:e.checkIds,blocking:e.blocking});if(o.sources.deterministic!==null||o.sources.agent!==null){let r=o.allChecks.reduce((c,a)=>c+l(a).length,0);await t.recordMetadata({num_security_findings:r})}return{selection:n,result:o,commands:se(n,e.directory,i.sources.deterministic?.document.coverage.scope)}}d();d();var F=()=>g.describe(`${g.description}`),ye=()=>s.enum(["executed","not-applicable","unresolved"]),pe=()=>s.enum(["union","prefer-agent"]),T=s.object({filePath:p().describe("The absolute path of the file."),line:s.number().int().positive().nullable().describe("The one-based line, or null for the whole file."),column:s.number().int().positive().nullable().describe("The one-based column, or null when none is recorded.")}).strict().describe("A place in a file."),Se=s.object({location:T,quote:s.string().min(1).nullable().describe("The quoted source, redacted, or null when none is recorded.")}).strict().describe("Source that supports a finding."),ve=()=>({disposition:s.enum(["active","suppressed","superseded"]).describe("Whether the finding counts: active; suppressed by the agent; or superseded, a deterministic finding that a check's prefer-agent agent result replaces."),location:T,message:s.string().describe("What the finding is, redacted."),snippet:s.string().min(1).nullable().describe("The flagged code, redacted, or null when none is recorded."),evidence:s.array(Se)}),ke=s.object({source:s.literal("deterministic"),...ve(),fix:s.object({description:s.string(),guide:s.string().min(1).nullable().describe("A guide to the fix, or null when none is recorded."),automated:s.boolean().describe("Whether the fix can be applied automatically.")}).strict().nullable().describe("How to fix the finding, or null when none is recorded.")}).strict().describe("A finding from deterministic-findings.json."),we=s.object({source:s.literal("agent"),...ve(),confidence:s.enum(["high","medium","low"]).nullable().describe("The agent's confidence, or null when it didn't report one."),reasoning:s.string().min(1).nullable().describe("The agent's reasoning, redacted, or null when none is recorded."),suppression:s.object({justification:s.string()}).strict().nullable().describe("Why the agent suppressed the finding, or null when it is not suppressed.")}).strict().describe("A finding from agent-findings.json."),Ae=s.discriminatedUnion("source",[ke,we]),D=s.object({version:s.number().int().positive().describe("The check version: the catalog version for deterministic results, the one the agent claimed for agent results."),status:ye().describe("The source's own status for the check."),reason:s.object({code:s.string().describe("A short code. Agent codes are free-form. Deterministic codes: capability_absent, no_relevant_files, unsupported_framework, unsupported_language, parser_unavailable, agent_investigation_required, input_rejected."),message:s.string()}).strict().nullable().describe("Why the check is unresolved or not applicable, or null when none is recorded."),analysisMode:s.enum(["regex","structured-config","ast"]).nullable().describe("How the deterministic check analyzed the files. Null for agent results."),generatedAt:F().nullable().describe("When the source recorded the check, or null when the recorded time is not a valid instant.")}).strict().describe("One source's own result for a check."),he=s.object({id:s.string().describe("The check ID, such as CREDENTIAL_LOG_LEAKAGE."),title:s.string(),severity:s.enum(["high","medium","low"]),description:s.string(),guide:s.string().min(1).nullable().describe("A guide to the check, or null when none is recorded."),docsUrl:s.string().url().nullable().describe("The check's page on shopify.dev, or null when the results files predate it."),precedence:pe().describe("How the sources combine: union keeps both sources' findings; prefer-agent lets the agent result replace the deterministic one."),appliedPrecedence:pe().describe("The precedence that applied: union when a prefer-agent agent result is older than the deterministic one."),status:ye().describe("The combined status. Under union, executed when either source executed the check."),bySource:s.object({deterministic:D.nullable(),agent:D.nullable()}).strict().describe("Each source's own result, or null when that source didn't record the check."),findings:s.array(Ae).describe("Every finding of both sources, including suppressed and superseded ones, whatever --verbose. Sorted by file, line, then source.")}).strict().describe("One check, combined from both results files."),fe=s.object({framework:s.enum(["react-router","none","unknown","mixed"]),surface:s.enum(["react-router","theme-app-extension","config-only","unknown","mixed"]),languages:s.array(s.object({name:s.string().describe("The language, such as typescript."),support:s.enum(["supported","unsupported"]).describe("Whether the deterministic checks analyze it."),files:s.array(s.object({path:p()}).strict())}).strict())}).strict().describe("What the latest check detected in the app."),ge=s.object({filesScanned:s.number().int().nonnegative().describe("The number of files scanned."),filesSkipped:s.array(s.object({path:p(),reason:s.enum(["too-large","unreadable"]),sizeBytes:s.number().int().nonnegative().nullable().describe("The file size, or null when unknown."),detail:s.string().min(1).nullable().describe("Why the file was unreadable, or null when none is recorded.")}).strict()),gaps:s.array(s.object({code:s.enum(["skipped-file","unsupported-framework","unsupported-language","unresolved-check"]),message:s.string(),checkId:s.string().nullable().describe("The check that the gap concerns, or null."),filePath:p().nullable().describe("The file that the gap concerns, or null.")}).strict()),scanDirectories:s.array($)}).strict().describe("What the latest check covered."),me=s.object({path:p().describe("The absolute path of deterministic-findings.json."),generatedAt:F().nullable().describe("When check wrote the file, or null when the recorded time is not a valid instant."),engine:s.object({name:s.string(),version:s.string(),ruleset:s.string()}).strict(),scope:y}).strict().describe("deterministic-findings.json, which check writes, with the scope of the scan."),be=s.object({path:p().describe("The absolute path of agent-findings.json."),generatedAt:F().nullable().describe("When record wrote the file, or null when the recorded time is not a valid instant."),engine:s.object({name:s.string(),version:s.string()}).strict(),scope:y}).strict().describe("agent-findings.json, which record writes, with the scope that the agent reported."),v=W({name:"AppSecurityReviewResult",schema:s.object({status:s.literal("success"),valid:s.boolean().describe("Whether --blocking passed: no check in checks has an active finding and a severity at or above the level. Unresolved checks never fail it, and --blocking none always passes."),app:j,resultsDirectory:p().describe("The absolute path of the results directory."),resultsFiles:s.object({deterministic:me.nullable(),agent:be.nullable()}).strict().describe("The results files that the review combines. Null when a file does not exist."),detection:fe.nullable().describe("What the latest check detected in the app, or null without deterministic-findings.json."),coverage:ge.nullable().describe("What the latest check covered, or null without deterministic-findings.json."),scopeDiffers:s.boolean().describe("Whether the agent reported another scope than the latest scan used. False unless both results files exist."),checks:s.array(he).describe("The checks after --check-id, most severe first, then by ID. Empty when no results file exists."),blocking:R}).strict().describe("The combined results of the app security check."),definitions:{AppSecurityApp:j,AppSecurityScope:y,AppSecurityScanDirectory:$,AppSecurityBlocking:R,AppSecurityDeterministicResultsFile:me,AppSecurityAgentResultsFile:be,AppSecurityDetection:fe,AppSecurityCoverage:ge,AppSecurityCheck:he,AppSecuritySourceResult:D,AppSecurityFinding:Ae,AppSecurityDeterministicFinding:ke,AppSecurityAgentFinding:we,AppSecurityLocation:T,AppSecurityEvidence:Se}});d();var Re={high:"High",medium:"Medium",low:"Low"},qe={executed:"passed",not_applicable:"not applicable",unresolved:"unresolved"},Je={executed:"executed",not_applicable:"not applicable",unresolved:"unresolved"},k=["deterministic","agent"],Ye={deterministic:"deterministic-findings.json",agent:"agent-findings.json"},_e=3,Ve="Agent findings were recorded for a different scope than the latest scan.",Ce="agent result stale",Xe="The agent result is older than the deterministic result, so both are shown.",Qe={info:U,success:B,warning:M,error:H};function xe(e){for(let t of Ze(e))Qe[t.type](t.options)}function Ze(e){let{checks:t}=e.result,n=t.filter(r=>r.status==="unresolved"&&l(r).length===0),i=t.filter(r=>r.status!=="unresolved"&&l(r).length===0),o=t.filter(r=>l(r).length>0);return[...n.length>0?[ht(n,e.verbose)]:[],...i.length>0?[ft(i,e.verbose)]:[],...o.map(r=>mt(r,e.verbose,e.now)),dt(et(e))]}function et(e){let{result:t}=e,n=t.sources.deterministic!==null||t.sources.agent!==null,i=_(t.checks),o=t.sources.deterministic?.document,r=t.blocking.blockedChecks>0,c=t.checks.filter(m).length;return{type:nt(t.checks,i,n),headline:st(t.checks,i,n),...t.filter&&n?{filterLine:`Showing ${t.checks.length} of ${t.allChecks.length} checks (--check-id).`}:{},checksWithFindings:t.checks.filter(a=>l(a).length>0).map(it),otherChecks:ot(i),...c>0?{staleAgentResults:tt(c)}:{},...o?{coverage:ct(o)}:{},scopeLines:at(t.sources),...t.scopeDiffers?{scopeNote:Ve}:{},resultsFiles:{directory:t.resultsDirectory,rows:k.map(a=>ut(a,t.sources[a]?.document,e.now))},...r?{blocking:`${u(t.blocking.blockedChecks,"check")} at or above ${t.blocking.level} (--blocking ${t.blocking.level}).`}:{nextSteps:lt(t,i,n,c,e.commands)}}}function tt(e){let t=e===1?"shows":"show";return`${u(e,"check")} ${t} both sources because the agent results are older than the deterministic results.`}function nt(e,t,n){return n?e.some(i=>i.severity==="high"&&l(i).length>0)?"error":t.withFindings>0||t.unresolved>0?"warning":"success":"info"}function st(e,t,n){if(!n)return"No app security check results to review.";if(t.withFindings===0)return`No findings in ${u(e.length,"check")}.`;let i=t.unresolved>0?` ${u(t.unresolved,"check")} unresolved.`:"";return`${le(t)}.${i}`}function it(e){return{severity:Re[e.severity],id:e.id,counts:rt(e)}}function rt(e){let t=l(e);return k.map(n=>[n,t.filter(i=>i.source===n).length]).filter(([,n])=>n>0).map(([n,i])=>`${i} ${n}`).join(", ")}function ot(e){return[w(de(e)),De(e)].filter(t=>t!=="")}function De(e){return w([e.suppressed>0?`${u(e.suppressed,"finding")} suppressed`:void 0,e.superseded>0?`${u(e.superseded,"finding")} superseded`:void 0])}function E(e){return De(_([e]))}function w(e){return e.filter(t=>t!==void 0).join(" \xB7 ")}function ct(e){let t=e.coverage.files_skipped,{too_large:n,unreadable:i}=Z(t),o=[n>0?`${n} too large`:void 0,i>0?`${i} unreadable`:void 0].filter(h=>h!==void 0),r=t.length===0?"none skipped":`${t.length} skipped (${o.join(", ")})`,c=e.detection.languages.filter(h=>h.support==="unsupported"),a=c.length===0?"":` Unsupported ${c.length===1?"language":"languages"}: ${c.map(h=>`${h.name} (${u(h.files.length,"file")})`).join(", ")}.`;return`Deterministic coverage: ${u(e.coverage.files_scanned,"file")} scanned, ${r}.${a}`}function je(e){let t=[...e.include_dirs.map(n=>`--include-dir ${n}`),...e.excludes.map(n=>`--exclude ${n}`),...e.no_git_ignore?["--no-git-ignore"]:[]];return t.length===0?"none":t.join(" ")}function at({deterministic:e,agent:t}){return[...e?[`Scan directories: ${e.document.coverage.scan_directories.map(({directory:n})=>n).join(", ")}`,`Scan scope: ${je(e.document.coverage.scope)}`]:[],...t?[`Scope reported by the agent: ${je(t.document.scope)}`]:[]]}function ut(e,t,n){let i=Ye[e];return t?{name:i,updated:Fe(t.generated_at,n),engine:t.engine.version}:{name:i,updated:"not found"}}function Fe(e,t){let n=Date.parse(e);return Number.isNaN(n)?"unknown":P(new Date(n),t)}function lt(e,t,n,i,o){let r={command:ie(o.scan)};if(!n)return[["Run",r,"or have your coding agent run it."]];let c=[];if(t.withFindings>0){let a=["Fix the issues, then run",r,"again."];e.sources.agent===null?c.push(a,"For a deeper review, have your agent run the same command and record its findings."):i>0?c.push(a):c.push([...a,"To refresh agent findings, have your agent run the command and record its findings."])}return i>0?c.push(["Agent results are older than the deterministic results. Have your coding agent run",r,"and record its findings again to refresh them."]):t.withFindings===0&&e.sources.agent===null&&c.push(["For a deeper review, have your coding agent run",r,{char:"."}]),c}function dt(e){let t=[];return e.filterLine&&t.push({body:{subdued:e.filterLine}}),e.checksWithFindings.length>0&&t.push({title:"Checks with findings",body:{tabularData:e.checksWithFindings.map(n=>[n.severity,n.id,n.counts]),firstColumnSubdued:!0}}),e.otherChecks.length>0&&t.push({title:"Other checks",body:e.otherChecks.join(`
|
|
1
|
+
import{a as Y}from"./chunk-V75WUEFU.js";import{a as u,b as le,c as de}from"./chunk-HB3MJYBK.js";import{a as re}from"./chunk-X5NIAZA4.js";import{b as ue}from"./chunk-66TMIQMB.js";import{D as te,F as ne,J as se,M as ie,O as p,P as j,R as y,S as $,T as R,U as S,V as b,W as oe,Y as C,Z as ce,_ as ae,a as V,d as A,k as l,l as X,m,n as Q,o as _,q as Z,t as ee}from"./chunk-W56ZGEQQ.js";import{b as G}from"./chunk-ZJOX5HW4.js";import{b as q,c as J}from"./chunk-3KM5ZOW2.js";import{A as B,B as M,C as H,z as U}from"./chunk-D2KIGKBI.js";import{a as W}from"./chunk-BN7ZXAZJ.js";import{h as K}from"./chunk-M5VIFG2V.js";import{ga as P,wb as z}from"./chunk-JLQRDFR5.js";import{b as s,c as g,d as O}from"./chunk-FZCGRIOM.js";import{b as Be}from"./chunk-YTUUU33R.js";import{e as Ue,g as d}from"./chunk-VKWPEFWQ.js";d();d();var Me={resolveSelection:ne,loadResults:ue,recordMetadata:re};function He(e,t){let n=t.checkIds.length>0?{checkIds:t.checkIds}:null,i=e.sources.deterministic!==null||e.sources.agent!==null;n&&i&&Ge(n.checkIds,e.checks);let o=n?e.checks.filter(r=>n.checkIds.includes(r.id)):e.checks;return{resultsDirectory:t.resultsDirectory,sources:e.sources,allChecks:e.checks,checks:o,filter:n,scopeDiffers:Ke(e.sources),blocking:{level:t.blocking,blockedChecks:ze(o,t.blocking)}}}function Ke({deterministic:e,agent:t}){return!e||!t?!1:JSON.stringify(e.document.coverage.scope)!==JSON.stringify(t.document.scope)}function ze(e,t){return t==="none"?0:e.filter(n=>l(n).length>0&&A[n.severity]>=A[t]).length}function Ge(e,t){let n=new Set(t.map(c=>c.id)),i=e.filter(c=>!n.has(c));if(i.length===0)return;let o=i.length===1?"check ID":"check IDs",r=new K(`Unknown ${o}: ${i.join(", ")}.`,"Pass --check-id with one of the checks in the results files.",[],[{title:"Available check IDs",body:{list:{items:t.map(c=>c.id)}}}]);throw r.code="unknown-check-id",r.details={checkIds:i},r}async function x(e,t=Me){let n=await t.resolveSelection({path:e.directory,config:e.configName,clientId:e.clientId,withoutAppConfig:e.withoutAppConfig,allowPrompts:!1,validateClientIdFlag:!0}),i=await t.loadResults(n,e.directory),o=He(i,{resultsDirectory:ee(n.appDirectory,te(n)).resultsDirectory,checkIds:e.checkIds,blocking:e.blocking});if(o.sources.deterministic!==null||o.sources.agent!==null){let r=o.allChecks.reduce((c,a)=>c+l(a).length,0);await t.recordMetadata({num_security_findings:r})}return{selection:n,result:o,commands:se(n,e.directory,i.sources.deterministic?.document.coverage.scope)}}d();d();var F=()=>g.describe(`${g.description}`),ye=()=>s.enum(["executed","not-applicable","unresolved"]),pe=()=>s.enum(["union","prefer-agent"]),T=s.object({filePath:p().describe("The absolute path of the file."),line:s.number().int().positive().nullable().describe("The one-based line, or null for the whole file."),column:s.number().int().positive().nullable().describe("The one-based column, or null when none is recorded.")}).strict().describe("A place in a file."),Se=s.object({location:T,quote:s.string().min(1).nullable().describe("The quoted source, redacted, or null when none is recorded.")}).strict().describe("Source that supports a finding."),ve=()=>({disposition:s.enum(["active","suppressed","superseded"]).describe("Whether the finding counts: active; suppressed by the agent; or superseded, a deterministic finding that a check's prefer-agent agent result replaces."),location:T,message:s.string().describe("What the finding is, redacted."),snippet:s.string().min(1).nullable().describe("The flagged code, redacted, or null when none is recorded."),evidence:s.array(Se)}),ke=s.object({source:s.literal("deterministic"),...ve(),fix:s.object({description:s.string(),guide:s.string().min(1).nullable().describe("A guide to the fix, or null when none is recorded."),automated:s.boolean().describe("Whether the fix can be applied automatically.")}).strict().nullable().describe("How to fix the finding, or null when none is recorded.")}).strict().describe("A finding from deterministic-findings.json."),we=s.object({source:s.literal("agent"),...ve(),confidence:s.enum(["high","medium","low"]).nullable().describe("The agent's confidence, or null when it didn't report one."),reasoning:s.string().min(1).nullable().describe("The agent's reasoning, redacted, or null when none is recorded."),suppression:s.object({justification:s.string()}).strict().nullable().describe("Why the agent suppressed the finding, or null when it is not suppressed.")}).strict().describe("A finding from agent-findings.json."),Ae=s.discriminatedUnion("source",[ke,we]),D=s.object({version:s.number().int().positive().describe("The check version: the catalog version for deterministic results, the one the agent claimed for agent results."),status:ye().describe("The source's own status for the check."),reason:s.object({code:s.string().describe("A short code. Agent codes are free-form. Deterministic codes: capability_absent, no_relevant_files, unsupported_framework, unsupported_language, parser_unavailable, agent_investigation_required, input_rejected."),message:s.string()}).strict().nullable().describe("Why the check is unresolved or not applicable, or null when none is recorded."),analysisMode:s.enum(["regex","structured-config","ast"]).nullable().describe("How the deterministic check analyzed the files. Null for agent results."),generatedAt:F().nullable().describe("When the source recorded the check, or null when the recorded time is not a valid instant.")}).strict().describe("One source's own result for a check."),he=s.object({id:s.string().describe("The check ID, such as CREDENTIAL_LOG_LEAKAGE."),title:s.string(),severity:s.enum(["high","medium","low"]),description:s.string(),guide:s.string().min(1).nullable().describe("A guide to the check, or null when none is recorded."),docsUrl:s.string().url().nullable().describe("The check's page on shopify.dev, or null when the results files predate it."),precedence:pe().describe("How the sources combine: union keeps both sources' findings; prefer-agent lets the agent result replace the deterministic one."),appliedPrecedence:pe().describe("The precedence that applied: union when a prefer-agent agent result is older than the deterministic one."),status:ye().describe("The combined status. Under union, executed when either source executed the check."),bySource:s.object({deterministic:D.nullable(),agent:D.nullable()}).strict().describe("Each source's own result, or null when that source didn't record the check."),findings:s.array(Ae).describe("Every finding of both sources, including suppressed and superseded ones, whatever --verbose. Sorted by file, line, then source.")}).strict().describe("One check, combined from both results files."),fe=s.object({framework:s.enum(["react-router","none","unknown","mixed"]),surface:s.enum(["react-router","theme-app-extension","config-only","unknown","mixed"]),languages:s.array(s.object({name:s.string().describe("The language, such as typescript."),support:s.enum(["supported","unsupported"]).describe("Whether the deterministic checks analyze it."),files:s.array(s.object({path:p()}).strict())}).strict())}).strict().describe("What the latest check detected in the app."),ge=s.object({filesScanned:s.number().int().nonnegative().describe("The number of files scanned."),filesSkipped:s.array(s.object({path:p(),reason:s.enum(["too-large","unreadable"]),sizeBytes:s.number().int().nonnegative().nullable().describe("The file size, or null when unknown."),detail:s.string().min(1).nullable().describe("Why the file was unreadable, or null when none is recorded.")}).strict()),gaps:s.array(s.object({code:s.enum(["skipped-file","unsupported-framework","unsupported-language","unresolved-check"]),message:s.string(),checkId:s.string().nullable().describe("The check that the gap concerns, or null."),filePath:p().nullable().describe("The file that the gap concerns, or null.")}).strict()),scanDirectories:s.array($)}).strict().describe("What the latest check covered."),me=s.object({path:p().describe("The absolute path of deterministic-findings.json."),generatedAt:F().nullable().describe("When check wrote the file, or null when the recorded time is not a valid instant."),engine:s.object({name:s.string(),version:s.string(),ruleset:s.string()}).strict(),scope:y}).strict().describe("deterministic-findings.json, which check writes, with the scope of the scan."),be=s.object({path:p().describe("The absolute path of agent-findings.json."),generatedAt:F().nullable().describe("When record wrote the file, or null when the recorded time is not a valid instant."),engine:s.object({name:s.string(),version:s.string()}).strict(),scope:y}).strict().describe("agent-findings.json, which record writes, with the scope that the agent reported."),v=W({name:"AppSecurityReviewResult",schema:s.object({status:s.literal("success"),valid:s.boolean().describe("Whether --blocking passed: no check in checks has an active finding and a severity at or above the level. Unresolved checks never fail it, and --blocking none always passes."),app:j,resultsDirectory:p().describe("The absolute path of the results directory."),resultsFiles:s.object({deterministic:me.nullable(),agent:be.nullable()}).strict().describe("The results files that the review combines. Null when a file does not exist."),detection:fe.nullable().describe("What the latest check detected in the app, or null without deterministic-findings.json."),coverage:ge.nullable().describe("What the latest check covered, or null without deterministic-findings.json."),scopeDiffers:s.boolean().describe("Whether the agent reported another scope than the latest scan used. False unless both results files exist."),checks:s.array(he).describe("The checks after --check-id, most severe first, then by ID. Empty when no results file exists."),blocking:R}).strict().describe("The combined results of the app security check."),definitions:{AppSecurityApp:j,AppSecurityScope:y,AppSecurityScanDirectory:$,AppSecurityBlocking:R,AppSecurityDeterministicResultsFile:me,AppSecurityAgentResultsFile:be,AppSecurityDetection:fe,AppSecurityCoverage:ge,AppSecurityCheck:he,AppSecuritySourceResult:D,AppSecurityFinding:Ae,AppSecurityDeterministicFinding:ke,AppSecurityAgentFinding:we,AppSecurityLocation:T,AppSecurityEvidence:Se}});d();var Re={high:"High",medium:"Medium",low:"Low"},qe={executed:"passed",not_applicable:"not applicable",unresolved:"unresolved"},Je={executed:"executed",not_applicable:"not applicable",unresolved:"unresolved"},k=["deterministic","agent"],Ye={deterministic:"deterministic-findings.json",agent:"agent-findings.json"},_e=3,Ve="Agent findings were recorded for a different scope than the latest scan.",Ce="agent result stale",Xe="The agent result is older than the deterministic result, so both are shown.",Qe={info:U,success:B,warning:M,error:H};function xe(e){for(let t of Ze(e))Qe[t.type](t.options)}function Ze(e){let{checks:t}=e.result,n=t.filter(r=>r.status==="unresolved"&&l(r).length===0),i=t.filter(r=>r.status!=="unresolved"&&l(r).length===0),o=t.filter(r=>l(r).length>0);return[...n.length>0?[ht(n,e.verbose)]:[],...i.length>0?[ft(i,e.verbose)]:[],...o.map(r=>mt(r,e.verbose,e.now)),dt(et(e))]}function et(e){let{result:t}=e,n=t.sources.deterministic!==null||t.sources.agent!==null,i=_(t.checks),o=t.sources.deterministic?.document,r=t.blocking.blockedChecks>0,c=t.checks.filter(m).length;return{type:nt(t.checks,i,n),headline:st(t.checks,i,n),...t.filter&&n?{filterLine:`Showing ${t.checks.length} of ${t.allChecks.length} checks (--check-id).`}:{},checksWithFindings:t.checks.filter(a=>l(a).length>0).map(it),otherChecks:ot(i),...c>0?{staleAgentResults:tt(c)}:{},...o?{coverage:ct(o)}:{},scopeLines:at(t.sources),...t.scopeDiffers?{scopeNote:Ve}:{},resultsFiles:{directory:t.resultsDirectory,rows:k.map(a=>ut(a,t.sources[a]?.document,e.now))},...r?{blocking:`${u(t.blocking.blockedChecks,"check")} at or above ${t.blocking.level} (--blocking ${t.blocking.level}).`}:{nextSteps:lt(t,i,n,c,e.commands)}}}function tt(e){let t=e===1?"shows":"show";return`${u(e,"check")} ${t} both sources because the agent results are older than the deterministic results.`}function nt(e,t,n){return n?e.some(i=>i.severity==="high"&&l(i).length>0)?"error":t.withFindings>0||t.unresolved>0?"warning":"success":"info"}function st(e,t,n){if(!n)return"No app security check results to review.";if(t.withFindings===0)return`No findings in ${u(e.length,"check")}.`;let i=t.unresolved>0?` ${u(t.unresolved,"check")} unresolved.`:"";return`${le(t)}.${i}`}function it(e){return{severity:Re[e.severity],id:e.id,counts:rt(e)}}function rt(e){let t=l(e);return k.map(n=>[n,t.filter(i=>i.source===n).length]).filter(([,n])=>n>0).map(([n,i])=>`${i} ${n}`).join(", ")}function ot(e){return[w(de(e)),De(e)].filter(t=>t!=="")}function De(e){return w([e.suppressed>0?`${u(e.suppressed,"finding")} suppressed`:void 0,e.superseded>0?`${u(e.superseded,"finding")} superseded`:void 0])}function E(e){return De(_([e]))}function w(e){return e.filter(t=>t!==void 0).join(" \xB7 ")}function ct(e){let t=e.coverage.files_skipped,{too_large:n,unreadable:i}=Z(t),o=[n>0?`${n} too large`:void 0,i>0?`${i} unreadable`:void 0].filter(h=>h!==void 0),r=t.length===0?"none skipped":`${t.length} skipped (${o.join(", ")})`,c=e.detection.languages.filter(h=>h.support==="unsupported"),a=c.length===0?"":` Unsupported ${c.length===1?"language":"languages"}: ${c.map(h=>`${h.name} (${u(h.files.length,"file")})`).join(", ")}.`;return`Deterministic coverage: ${u(e.coverage.files_scanned,"file")} scanned, ${r}.${a}`}function je(e){let t=[...e.include_dirs.map(n=>`--include-dir ${n}`),...e.excludes.map(n=>`--exclude ${n}`),...e.no_git_ignore?["--no-git-ignore"]:[]];return t.length===0?"none":t.join(" ")}function at({deterministic:e,agent:t}){return[...e?[`Scan directories: ${e.document.coverage.scan_directories.map(({directory:n})=>n).join(", ")}`,`Scan scope: ${je(e.document.coverage.scope)}`]:[],...t?[`Scope reported by the agent: ${je(t.document.scope)}`]:[]]}function ut(e,t,n){let i=Ye[e];return t?{name:i,updated:Fe(t.generated_at,n),engine:t.engine.version}:{name:i,updated:"not found"}}function Fe(e,t){let n=Date.parse(e);return Number.isNaN(n)?"unknown":P(new Date(n),t)}function lt(e,t,n,i,o){let r={command:ie(o.scan)};if(!n)return[["Run",r,"or have your coding agent run it."]];let c=[];if(t.withFindings>0){let a=["Fix the issues, then run",r,"again."];e.sources.agent===null?c.push(a,"For a deeper review, have your agent run the same command and record its findings."):i>0?c.push(a):c.push([...a,"To refresh agent findings, have your agent run the command and record its findings."])}return i>0?c.push(["Agent results are older than the deterministic results. Have your coding agent run",r,"and record its findings again to refresh them."]):t.withFindings===0&&e.sources.agent===null&&c.push(["For a deeper review, have your coding agent run",r,{char:"."}]),c}function dt(e){let t=[];return e.filterLine&&t.push({body:{subdued:e.filterLine}}),e.checksWithFindings.length>0&&t.push({title:"Checks with findings",body:{tabularData:e.checksWithFindings.map(n=>[n.severity,n.id,n.counts]),firstColumnSubdued:!0}}),e.otherChecks.length>0&&t.push({title:"Other checks",body:e.otherChecks.join(`
|
|
2
2
|
`)}),e.staleAgentResults&&t.push({body:e.staleAgentResults}),e.coverage&&t.push({body:{subdued:e.coverage}}),e.scopeLines.length>0&&t.push({body:{subdued:e.scopeLines.join(`
|
|
3
3
|
`)}}),e.scopeNote&&t.push({body:e.scopeNote}),t.push({title:`Results files in ${e.resultsFiles.directory}`,body:{tabularData:[["",{subdued:"Updated"},{subdued:"Engine"}],...e.resultsFiles.rows.map(pt)]}}),e.blocking===void 0?e.nextSteps.length>0&&t.push({title:"Next steps",body:{list:{items:e.nextSteps}}}):t.push({title:"Blocking",body:e.blocking}),{type:e.type,options:{headline:e.headline,customSections:t}}}function pt(e){return e.engine===void 0?[e.name,{subdued:e.updated}]:[e.name,e.updated,e.engine]}function ht(e,t){return{type:"warning",options:{headline:`${u(e.length,"check")} unresolved.`,customSections:e.flatMap(n=>[{title:`${n.id} \xB7 ${n.title}`,body:{tabularData:Te(n,{withDispositions:!0}),firstColumnSubdued:!0}},...t?n.findings.map(i=>I(i,t,`${n.id} \xB7 `)):[]])}}}function ft(e,t){let n=e.filter(X).length,i=e.length-n;return{type:"info",options:{headline:[n>0?`${u(n,"check")} passed.`:void 0,i>0?`${u(i,"check")} not applicable.`:void 0].filter(r=>r!==void 0).join(" "),customSections:[{body:{tabularData:e.map(gt)}},...t?e.flatMap(r=>r.findings.map(c=>I(c,t,`${r.id} \xB7 `))):[]]}}}function gt(e){let t=E(e);return[e.id,w([qe[e.status],t===""?void 0:t,m(e)?Ce:void 0])]}function mt(e,t,n){let i=E(e),o=t?e.findings:l(e);return{type:e.severity==="high"?"error":"warning",options:{headline:`${Re[e.severity]} \xB7 ${e.id} \xB7 ${e.title}`,...i===""?{}:{body:{subdued:i}},...e.docs_url?{link:{label:`${e.id} on shopify.dev`,url:e.docs_url}}:{},customSections:[...bt(e,n),...o.map(r=>I(r,t))]}}}function bt(e,t){if(m(e))return[{body:{tabularData:k.flatMap(c=>{let a=e.by_source[c];return a?[[c,Ee(a),Fe(a.generated_at,t)]]:[]}),firstColumnSubdued:!0}},{body:{subdued:Xe}}];let{deterministic:n,agent:i}=e.by_source;return n!==null&&i!==null&&n.status!==i.status?[{body:{tabularData:Te(e,{withDispositions:!1}),firstColumnSubdued:!0}}]:[]}function Te(e,t){let n=m(e),i=k.flatMap(r=>{let c=e.by_source[r];if(!c)return[];let a=n&&r==="agent"?Ce:void 0;return[[r,w([Ee(c),a])]]}),o=t.withDispositions?E(e):"";return o===""?i:[...i,["findings",o]]}function Ee(e){let t=Je[e.status];return e.reason?`${t} \u2014 ${e.reason.message}`:t}function I(e,t,n=""){let i=e.disposition==="active"?"":` (${e.disposition})`,o=[e.message];if(e.snippet&&o.push({subdued:`
|
|
4
4
|
Code: ${e.snippet}`}),e.source==="deterministic"){e.fix&&o.push({subdued:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s}from"./chunk-
|
|
1
|
+
import{b as s}from"./chunk-ZJOX5HW4.js";import{g as o}from"./chunk-3KM5ZOW2.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-BN7ZXAZJ.js";import{k as m}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-BN7ZXAZJ.js";import{k as m}from"./chunk-M5VIFG2V.js";import{wb as u}from"./chunk-JLQRDFR5.js";import{b as e}from"./chunk-FZCGRIOM.js";import{b as H}from"./chunk-YTUUU33R.js";import{e as b,g as n}from"./chunk-VKWPEFWQ.js";n();var p=e.object({id:e.string(),summary:e.string().optional(),hidden:e.boolean().default(!1)}),l=e.object({name:e.string(),description:e.string().optional(),hidden:e.boolean().default(!1)}),g=e.object({name:e.string(),description:e.string().optional(),required:e.boolean().default(!1),hidden:e.boolean().default(!1),options:e.array(e.string()).optional(),default:e.unknown().optional()}),h=e.object({name:e.string(),type:e.enum(["boolean","option"]),char:e.string().optional(),summary:e.string().optional(),description:e.string().optional(),env:e.string().optional(),required:e.boolean().default(!1),hidden:e.boolean().default(!1),options:e.array(e.string()).optional(),default:e.unknown().optional(),multiple:e.boolean().optional(),allowNo:e.boolean().optional(),aliases:e.array(e.string()).optional(),dependsOn:e.array(e.string()).optional(),exclusive:e.array(e.string()).optional(),exactlyOne:e.array(e.string()).optional()}),f=p.extend({description:e.string().optional(),aliases:e.array(e.string()),usage:e.union([e.string(),e.array(e.string())]).optional(),examples:e.array(e.union([e.string(),e.object({description:e.string(),command:e.string()})])).optional(),strict:e.boolean().default(!0),args:e.record(g),flags:e.record(h)}),a={commands:e.array(p),topics:e.array(l)},s=c({name:"HelpResult",schema:e.discriminatedUnion("kind",[e.object({kind:e.literal("root"),...a}),e.object({kind:e.literal("topic"),topic:l,...a}),e.object({kind:e.literal("command"),command:f,...a})]),definitions:{HelpCommandSummary:p,HelpTopic:l,HelpArgument:g,HelpFlag:h,HelpCommand:f}});n();var y=b(H(),1);async function k(r,o,i=!1){let t=new d(r,{all:i});if(await t.showHelp(o),!t.result)throw new m("Oclif did not resolve a help subject.");return t.result}var d=class extends y.Help{result;async showCommandHelp(o){let i=t=>this.opts.all===!0||!t.hidden;this.result=s.validate({kind:"command",command:{...o,args:Object.fromEntries(Object.entries(o.args).filter(([,t])=>i(t))),flags:Object.fromEntries(Object.entries(o.flags).filter(([,t])=>i(t)))},...this.listings(o.id)})}async showRootHelp(){this.result=s.validate({kind:"root",...this.listings()})}async showTopicHelp(o){this.result=s.validate({kind:"topic",topic:o,...this.listings(o.name)})}listings(o){let i=t=>o===void 0?this.opts.all===!0||!t.includes(":"):t.startsWith(`${o}:`)&&t.split(":").length===o.split(":").length+1;return{commands:this.sortedCommands.filter(t=>t.id&&i(t.id)).map(t=>({id:t.id,summary:t.summary??t.description?.split(`
|
|
2
2
|
`)[0],hidden:t.hidden??!1})),topics:this.sortedTopics.filter(t=>i(t.name))}}};n();function T(r){u(s.encode(r))}export{s as a,k as b,T as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as y,v}from"./chunk-
|
|
1
|
+
import{p as y,v}from"./chunk-YKMINHYY.js";import{a as w}from"./chunk-2T4HDR6R.js";import{da as b}from"./chunk-RLNIOJH3.js";import{b as P,c as k}from"./chunk-3KM5ZOW2.js";import{A as d}from"./chunk-D2KIGKBI.js";import{a as c}from"./chunk-BN7ZXAZJ.js";import{h as n}from"./chunk-M5VIFG2V.js";import{Sa as u,la as l,wb as g}from"./chunk-JLQRDFR5.js";import{b as r}from"./chunk-FZCGRIOM.js";import{e as m,g as p,m as f}from"./chunk-IWTNUJGY.js";import{e as T,g as s}from"./chunk-VKWPEFWQ.js";s();s();var _=T(b(),1),O=["AGENTS.md","DESIGN.md","assets/**","blocks/**","config/**","layout/**","listings/**/*","locales/**","sections/**","snippets/**","templates/**","templates/customers/**","release-notes.md","update_extension.json"].join("|");async function j(e){let t=await x(e),o=m(e,t),a=`${e}/(${O})`;return await w({inputDirectory:e,outputZipPath:o,matchFilePattern:a}),{path:o}}async function x(e){let t=m(e,"config/settings_schema.json");if(!await u(t))throw new n("Provide a config/settings_schema.json to package your theme.");let o=await z(t);if(o===void 0||o.theme_name===void 0)throw new n("Provide a theme_info.theme_name configuration in config/settings_schema.json.");let a=[o.theme_name,o.theme_version].filter(Boolean).join("-");if(/[/\\]/.test(a)||/^[a-z]:/i.test(a))throw new n("Theme name and version must not contain paths.");return`${a}.zip`}async function z(e){let t=(0,_.parseJSON)(await l(e),null,!0);if(!t)throw new n("The file config/settings_schema.json contains an error. Please check if the file is valid JSON and includes the theme_info.theme_name configuration.");return t.find(o=>o.name==="theme_info")}s();var i=c({name:"ThemePackageResult",schema:r.object({path:r.string().refine(p).describe("The absolute native path of the ZIP archive.")}).strict()});s();import{resolve as F}from"node:path";function S(e,t){if(t==="json"){g(i.encode({...e,path:F(e.path)}));return}d({body:["Your local theme was packaged in",{filePath:f(e.path)}]})}var h=class extends v{static get jsonOutputSchema(){return i}static summary="Package your theme into a .zip file, ready to upload to the Online Store.";static descriptionWithMarkdown=`Packages your local theme files into a ZIP file that can be uploaded to Shopify.
|
|
2
2
|
|
|
3
3
|
Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as oe}from"./chunk-3LVCG4JB.js";import{a as ie,b as ne,q as re}from"./chunk-NDKSG4CC.js";import{$ as te,F as ee}from"./chunk-CZ22VZDA.js";import{a as q,d as X}from"./chunk-335BUVBP.js";import{h as A}from"./chunk-2VSNFOKD.js";import{Sa as Z,la as Y}from"./chunk-LWCTKI4Z.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var Ce=/^gid:\/\/shopify\/Shop\/(\d+)$/,ve=/^\d+$/,se=250,De=new Set(ie),Re=new Set(ne);function le(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Be(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),ae(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),fe(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&ae(w)&&fe(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ue(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Ae(i,r),canonicalInput:a,inputDigest:ce(a)}}}function Be(i){let e=i?.trim();if(!e)return;let o=ve.test(e)?e:Ce.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function ae(i){return i!==void 0&&De.has(i)}function fe(i){return Re.has(i)}function ue(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Ae(i,e){let o=[];for(let t=0;t<e.length;t+=se){let n=e.slice(t,t+se),r=ue(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:ce(r)})}return o}function ce(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var de=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var _e=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Le(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Le=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var he=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},Te=13,$e=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:de(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
|
|
1
|
+
import{b as oe}from"./chunk-J5ERDFIC.js";import{a as ie,b as ne,q as re}from"./chunk-PDZBKVWL.js";import{$ as te,F as ee}from"./chunk-D2KIGKBI.js";import{a as q,d as X}from"./chunk-335BUVBP.js";import{h as A}from"./chunk-M5VIFG2V.js";import{Sa as Z,la as Y}from"./chunk-JLQRDFR5.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();d();var Ce=/^gid:\/\/shopify\/Shop\/(\d+)$/,ve=/^\d+$/,se=250,De=new Set(ie),Re=new Set(ne);function le(i,e){let o=[],t=[],n=new Map;for(let s of e){let f=Be(s.shopId),l=!0;if(f){let L=n.get(f);L===void 0?n.set(f,s.sourceRow):(o.push({row:s.sourceRow,field:"shop_id",message:`Duplicate shop ID; first seen on row ${L}`}),l=!1)}else o.push({row:s.sourceRow,field:"shop_id",message:"Shop ID must be a positive numeric ID or gid://shopify/Shop/<id>"}),l=!1;if(i==="unschedule"){l&&f&&t.push({action:i,shopId:f});continue}let h=s.targetPlanHandle?.trim(),w=s.priceBehavior?.trim(),S=s.notification?.trim(),O=S?.length?S:"WHEN_REQUIRED";h||(o.push({row:s.sourceRow,field:"target_plan_handle",message:"Target plan handle is required"}),l=!1),ae(w)||(o.push({row:s.sourceRow,field:"price_behavior",message:"Price behavior must be HONOR_BILLING_PRICE or PLAN_PRICE"}),l=!1),fe(O)||(o.push({row:s.sourceRow,field:"notification",message:"Notification must be OPT_OUT or WHEN_REQUIRED"}),l=!1),l&&f&&h&&ae(w)&&fe(O)&&t.push({action:i,shopId:f,targetPlanHandle:h,priceBehavior:w,notification:O})}if(o.length>0)return{ok:!1,errors:o};let r=[...t].sort((s,f)=>s.shopId<f.shopId?-1:s.shopId>f.shopId?1:0),a=ue(i,r);return{ok:!0,plan:{action:i,rows:r,batches:Ae(i,r),canonicalInput:a,inputDigest:ce(a)}}}function Be(i){let e=i?.trim();if(!e)return;let o=ve.test(e)?e:Ce.exec(e)?.[1];if(o===void 0)return;let t=BigInt(o);return t>0?`gid://shopify/Shop/${t}`:void 0}function ae(i){return i!==void 0&&De.has(i)}function fe(i){return Re.has(i)}function ue(i,e){return JSON.stringify({version:1,action:i,rows:e})}function Ae(i,e){let o=[];for(let t=0;t<e.length;t+=se){let n=e.slice(t,t+se),r=ue(i,n);o.push({index:o.length,rows:n,canonicalPayload:r,payloadDigest:ce(r)})}return o}function ce(i){return q(i).toString("hex")}d();d();d();d();d();var c=class i extends Error{constructor(e,o,t,...n){Array.isArray(o)&&(o=o.join(" ").trim()),super(o),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,i),this.code=e;for(let r of n)for(let a in r){let s=r[a];this[a]=Buffer.isBuffer(s)?s.toString(t.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}};d();var M=function(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)};var z=function(i){let e=[];for(let o=0,t=i.length;o<t;o++){let n=i[o];if(n==null||n===!1)e[o]={disabled:!0};else if(typeof n=="string"||typeof n=="number")e[o]={name:`${n}`};else if(M(n)){if(typeof n.name!="string")throw new c("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${o}`,"when column is an object literal"]);e[o]=n}else throw new c("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${o}`])}return e};d();d();var Q=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let o=this.length+e.length;if(o>=this.size&&(this.resize(),o>=this.size))throw Error("INVALID_BUFFER_STATE");let t=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),t.copy(this.buf,e.length),this.length+=e.length}else{let o=this.length++;o===this.size&&this.resize();let t=this.clone();this.buf[0]=e,t.copy(this.buf,1,0,o)}}append(e){let o=this.length++;o===this.size&&this.resize(),this.buf[o]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let o=Buffer.allocUnsafe(this.size);this.buf.copy(o,0,0,e),this.buf=o}toString(e){return e?this.buf.toString(e,0,this.length):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},H=Q;var de=function(i){let e=[32,9,10,13,12,11,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279].reduce((t,n)=>{let r=Buffer.from(String.fromCharCode(n),i.encoding);return n!==63&&r.length===1&&r[0]===63||t.push(r),t},[]),o=new Uint8Array(256);for(let t of e)o[t[0]]=1;return{bomSkipped:!1,bufBytesStart:0,castField:i.cast_function,commenting:!1,delimiterBufPrevious:void 0,delimiterDiscovered:!1,error:void 0,enabled:i.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(i.escape)&&Buffer.isBuffer(i.quote)&&Buffer.compare(i.escape,i.quote)===0,expectedRecordLength:Array.isArray(i.columns)?i.columns.length:void 0,field:new H(20),firstLineToHeaders:i.cast_first_line_to_header,needMoreDataSize:Math.max(i.comment!==null?i.comment.length:0,...i.delimiter?i.delimiter.map(t=>t.length):[],i.delimiter_auto?1:0,i.quote!==null?i.quote.length:0,...e.map(t=>t.length)),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new H(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:i.record_delimiter.length===0?0:Math.max(...i.record_delimiter.map(t=>t.length)),trimChars:[Buffer.from(" ",i.encoding)[0],Buffer.from(" ",i.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:e,timcharFirstBytes:o}};d();d();var me=function(i){return i.replace(/([A-Z])/g,function(e,o){return"_"+o.toLowerCase()})};var T=function(i){let e={};for(let t in i)e[me(t)]=i[t];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new c("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new c("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new c("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(t){let n=Date.parse(t);return isNaN(n)?t:new Date(n)};else if(typeof e.cast_date!="function")throw new c("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=void 0,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=z(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new c("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new c("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new c("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);if(e.delimiter_auto===void 0||e.delimiter_auto===null||e.delimiter_auto===!1)e.delimiter_auto=!1;else if(e.delimiter_auto===!0)e.delimiter_auto={};else if(!M(e.delimiter_auto))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","delimiter_auto must be a boolean or a configuration object,",`got ${JSON.stringify(e.delimiter_auto)}`],e);if(e.delimiter_auto){if(e.delimiter_auto.preferred===void 0)e.delimiter_auto.preferred={44:1.8,9:1.8,59:1.6,32:1.6,58:1.5,46:1.4,47:1.4};else if(!M(e.delimiter_auto.preferred))throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","preferred must be an object,",`got ${JSON.stringify(e.delimiter_auto.preferred)}`],e);if(e.delimiter_auto.score===void 0)e.delimiter_auto.score=(t,n)=>(t.total-t.std)*(n.preferred[t.char_code]||1);else if(typeof e.delimiter_auto.score!="function")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","score must be a function,",`got ${JSON.stringify(e.delimiter_auto.score)}`],e);if(e.delimiter_auto.size===void 0)e.delimiter_auto.size=2048;else if(typeof e.delimiter_auto.size!="number")throw new c("CSV_INVALID_OPTION_DELIMITER_AUTO",["Invalid option delimiter_auto:","size must be a number,",`got ${JSON.stringify(e.delimiter_auto.size)}`],e)}let o=JSON.stringify(e.delimiter);if(e.delimiter_auto!==!1&&(e.delimiter=[]),Array.isArray(e.delimiter)||((e.delimiter===void 0||e.delimiter===null||e.delimiter===!1)&&(e.delimiter=Buffer.from(",",e.encoding)),e.delimiter=[e.delimiter]),e.delimiter=e.delimiter.map(function(t){if(typeof t=="string"&&(t=Buffer.from(t,e.encoding)),!Buffer.isBuffer(t)||t.length===0)throw new c("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${o}`],e);return t}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(i.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(i.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(i.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new c("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new c("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new c("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(t,n){if(typeof t!="string"&&!Buffer.isBuffer(t))throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);if(t.length===0)throw new c("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${n},`,`got ${JSON.stringify(t)}`],e);return typeof t=="string"&&(t=Buffer.from(t,e.encoding)),t}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&i.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&i.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(e.to!==-1)if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(i.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(i.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(e.to_line!==-1)if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(i.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(i.to_line)}`);return e};d();var _e=function(i,e){e||({delimiter_auto:e}=T({delimiter_auto:!0})),typeof i=="string"&&(i=Buffer.from(i)),Buffer.isBuffer(i)&&(i=(n=>{let r=[],a=j({delimiter:[]}),s=h=>r.push(h),f=()=>{},l=a.parse(n,!0,s,f);if(l!==void 0)throw l;return r})(i));let o=Array(127).fill().map(()=>({lines:[]}));i.map(([n],r)=>{for(let a=0,s=n.length;a<s;a++){let f=n.charCodeAt(a);o[f].lines[r]===void 0&&(o[f].lines[r]=0),o[f].lines[r]++}}),o.map((n,r)=>{n.char_code=r,n.std=Le(n.lines),n.total=n.lines.reduce((a,s)=>a+s,0),n.preferred=!!e.preferred[r],n.score=e.score(n,e)});let t=o.reduce((n,r)=>n.score>r.score?n:r,{});return String.fromCharCode(t.char_code)},Le=function(i){let e=i.length;if(e===0)return 0;let o=i.reduce((t,n)=>t+n)/e;return Math.sqrt(i.map(t=>Math.pow(t-o,2)).reduce((t,n)=>t+n)/e)};var he=function(i){return i.every(e=>e==null||e.toString&&e.toString().trim()==="")},Te=13,$e=10,$={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},j=function(i={}){let e={bytes:0,bytes_records:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},o=T(i);return{info:e,original_options:i,options:o,state:de(o),__needMoreData:function(t,n,r){if(r)return!1;let{encoding:a,escape:s,quote:f}=this.options,{quoting:l,needMoreDataSize:h,recordDelimiterMaxLength:w}=this.state,S=n-t-1,O=Math.max(h,w===0?Buffer.from(`\r
|
|
2
2
|
`,a).length:w,l?(s===null?0:s.length)+f.length:0,l?f.length+w:0);return S<O},parse:function(t,n,r,a){let{bom:s,comment_no_infix:f,delimiter_auto:l,encoding:h,from_line:w,ltrim:S,max_record_size:O,raw:L,relax_quotes:I,rtrim:E,skip_empty_lines:y,to:g,to_line:p}=this.options,{comment:x,escape:C,quote:N,record_delimiter:F}=this.options,{bomSkipped:Se,delimiterDiscovered:Ne,delimiterBufPrevious:V,rawBuffer:Ee,escapeIsQuote:xe}=this.state;if(!Ne&&l){let _;if(V===void 0?_=t:V!==void 0&&t===void 0?_=V:_=Buffer.concat([V,t]),t=void 0,n||_.length>l.size)this.options.delimiter=[Buffer.from(_e(_,this.options.delimiter_auto))],this.state.previousBuf=_,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=_;return}}let{previousBuf:P}=this.state,m;if(P===void 0)if(t===void 0){a();return}else m=t;else P!==void 0&&t===void 0?m=P:m=Buffer.concat([P,t]);if(Se===!1)if(s===!1)this.state.bomSkipped=!0;else if(m.length<3){if(n===!1){this.state.previousBuf=m;return}}else{for(let _ in $)if($[_].compare(m,0,$[_].length)===0){let D=$[_].length;this.state.bufBytesStart+=D,m=m.slice(D);let k=T({...this.original_options,encoding:_});for(let b in k)this.options[b]=k[b];({comment:x,escape:C,quote:N}=this.options);break}this.state.bomSkipped=!0}let U=m.length,u;for(u=0;u<U&&!this.__needMoreData(u,U,n);u++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),p!==-1&&this.info.lines>p){this.state.stop=!0,a();return}this.state.quoting===!1&&F.length===0&&this.__autoDiscoverRecordDelimiter(m,u)&&(F=this.options.record_delimiter);let _=m[u];if(L===!0&&Ee.append(_),(_===Te||_===$e)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(C!==null&&this.state.quoting===!0&&this.__isEscape(m,u,_)&&u+C.length<U)if(xe){if(this.__isQuote(m,u+C.length)){this.state.escaping=!0,u+=C.length-1;continue}}else{this.state.escaping=!0,u+=C.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(m,u))if(this.state.quoting===!0){let b=m[u+N.length],R=E&&this.__isCharTrimable(m,u+N.length),v=x!==null&&this.__compareBytes(x,m,u+N.length,b),B=this.__isDelimiter(m,u+N.length,b),J=F.length===0?this.__autoDiscoverRecordDelimiter(m,u+N.length):this.__isRecordDelimiter(b,m,u+N.length);if(C!==null&&this.__isEscape(m,u,_)&&this.__isQuote(m,u+C.length))u+=C.length-1;else if(!b||B||J||v||R){this.state.quoting=!1,this.state.wasQuoting=!0,u+=N.length-1;continue}else if(I===!1){let W=this.__error(new c("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(b)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(W!==void 0)return W}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(N),u+=N.length-1}else if(this.state.field.length!==0){if(I===!1){let b=this.__infoField(),R=Object.keys($).map(B=>$[B].equals(this.state.field.toString())?B:!1).filter(Boolean)[0],v=this.__error(new c("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(b.column)} at line ${b.lines}, value is ${JSON.stringify(this.state.field.toString(h))}`,R?`(${R} bom)`:void 0],this.options,b,{field:this.state.field}));if(v!==void 0)return v}}else{this.state.quoting=!0,u+=N.length-1;continue}if(this.state.quoting===!1){let b=this.__isRecordDelimiter(_,m,u);if(b!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=w){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),u+=b-1;continue}if(y===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,u+=b-1;continue}this.info.bytes=this.state.bufBytesStart+u;let B=this.__onField();if(B!==void 0)return B;this.info.bytes=this.state.bufBytesStart+u+b;let J=this.__onRecord(r);if(J!==void 0)return J;if(g!==-1&&this.info.records>=g){this.state.stop=!0,a();return}}this.state.commenting=!1,u+=b-1;continue}if(this.state.commenting)continue;if(x!==null&&(f===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(x,m,u,_)!==0){this.state.commenting=!0;continue}let R=this.__isDelimiter(m,u,_);if(R!==0){this.info.bytes=this.state.bufBytesStart+u;let v=this.__onField();if(v!==void 0)return v;u+=R-1;continue}}}if(this.state.commenting===!1&&O!==0&&this.state.record_length+this.state.field.length>O)return this.__error(new c("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${O}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let D=S===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(m,u),k=E===!1||this.state.wasQuoting===!1;if(D===!0&&k===!0)this.state.field.append(_);else{if(E===!0&&!this.__isCharTrimable(m,u))return this.__error(new c("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));D===!1&&(u+=this.__isCharTrimable(m,u)-1);continue}}if(n===!0)if(this.state.quoting===!0){let _=this.__error(new c("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(_!==void 0)return _}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+u;let _=this.__onField();if(_!==void 0)return _;let D=this.__onRecord(r);if(D!==void 0)return D}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=u,this.state.previousBuf=m.slice(u);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(t){let{columns:n,group_columns_by_name:r,encoding:a,info:s,from:f,relax_column_count:l,relax_column_count_less:h,relax_column_count_more:w,raw:S,skip_records_with_empty_values:O}=this.options,{enabled:L,record:I}=this.state;if(L===!1)return this.__resetRecord();let E=I.length;if(n===!0){if(O===!0&&he(I)){this.__resetRecord();return}return this.__firstLineToColumns(I)}if(n===!1&&this.info.records===0&&(this.state.expectedRecordLength=E),E!==this.state.expectedRecordLength){let y=n===!1?new c("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I}):new c("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${n.length},`,`got ${E} on line ${this.info.lines}`],this.options,this.__infoField(),{record:I});if(l===!0||h===!0&&E<this.state.expectedRecordLength||w===!0&&E>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=y;else{let g=this.__error(y);if(g)return g}}if(O===!0&&he(I)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,f===1||this.info.records>=f){let{objname:y}=this.options;if(n!==!1){let g={};for(let p=0,x=I.length;p<x;p++)n[p]===void 0||n[p].disabled||(r===!0&&Object.hasOwn(g,n[p].name)?Array.isArray(g[n[p].name])?g[n[p].name]=g[n[p].name].concat(I[p]):g[n[p].name]=[g[n[p].name],I[p]]:Object.defineProperty(g,n[p].name,{value:I[p],enumerable:!0,writable:!0,configurable:!0}));if(S===!0||s===!0){let p=Object.assign({record:g},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),x=this.__push(y===void 0?p:[g[y],p],t);if(x)return x}else{let p=this.__push(y===void 0?g:[g[y],g],t);if(p)return p}}else if(S===!0||s===!0){let g=Object.assign({record:I},S===!0?{raw:this.state.rawBuffer.toString(a)}:{},s===!0?{info:this.__infoRecord()}:{}),p=this.__push(y===void 0?g:[I[y],g],t);if(p)return p}else{let g=this.__push(y===void 0?I:[I[y],I],t);if(g)return g}}this.__resetRecord()},__firstLineToColumns:function(t){let{firstLineToHeaders:n}=this.state;try{let r=n===void 0?t:n.call(null,t);if(!Array.isArray(r))return this.__error(new c("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}));let a=z(r);this.state.expectedRecordLength=a.length,this.options.columns=a,this.__resetRecord();return}catch(r){return r}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:t,encoding:n,rtrim:r,max_record_size:a}=this.options,{enabled:s,wasQuoting:f}=this.state;if(s===!1)return this.__resetField();let l=this.state.field.toString(n);if(r===!0&&f===!1&&(l=l.trimRight()),t===!0){let[h,w]=this.__cast(l);if(h!==void 0)return h;l=w}this.state.record.push(l),a!==0&&typeof l=="string"&&(this.state.record_length+=l.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(t,n){let{on_record:r}=this.options;if(r!==void 0){let a=this.__infoRecord();try{t=r.call(null,t,a)}catch(s){return s}if(t==null)return}this.info.bytes_records+=this.info.bytes,n(t)},__cast:function(t){let{columns:n,relax_column_count:r}=this.options;if(Array.isArray(n)===!0&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let s=this.__infoField();return[void 0,this.state.castField.call(null,t,s)]}catch(s){return[s]}if(this.__isFloat(t))return[void 0,parseFloat(t)];if(this.options.cast_date!==!1){let s=this.__infoField();return[void 0,this.options.cast_date.call(null,t,s)]}return[void 0,t]},__compareBytes:function(t,n,r,a){if(t[0]!==a)return 0;let s=t.length;for(let f=1;f<s;f++)if(t[f]!==n[r+f])return 0;return s},__isCharTrimable:function(t,n){let{timchars:r,timcharFirstBytes:a}=this.state,s=t[n];if(s===void 0||a[s]===0)return 0;e:for(let f=0;f<r.length;f++){let l=r[f];for(let h=0;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}return 0},__isDelimiter:function(t,n,r){let{delimiter:a,ignore_last_delimiters:s}=this.options;if(s===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(s!==!1&&typeof s=="number"&&this.state.record.length===s-1)return 0;e:for(let f=0;f<a.length;f++){let l=a[f];if(l[0]===r){for(let h=1;h<l.length;h++)if(l[h]!==t[n+h])continue e;return l.length}}return 0},__isEscape:function(t,n,r){let{escape:a}=this.options;if(a===null)return!1;let s=a.length;if(a[0]===r){for(let f=0;f<s;f++)if(a[f]!==t[n+f])return!1;return!0}return!1},__isFloat:function(t){return t-parseFloat(t)+1>=0},__isQuote:function(t,n){let{quote:r}=this.options;if(r===null)return!1;let a=r.length;for(let s=0;s<a;s++)if(r[s]!==t[n+s])return!1;return!0},__isRecordDelimiter:function(t,n,r){let{record_delimiter:a}=this.options,s=a.length;e:for(let f=0;f<s;f++){let l=a[f],h=l.length;if(l[0]===t){for(let w=1;w<h;w++)if(l[w]!==n[r+w])continue e;return l.length}}return 0},__autoDiscoverRecordDelimiter:function(t,n){let{encoding:r}=this.options,a=[Buffer.from(`\r
|
|
3
3
|
`,r),Buffer.from(`
|
|
4
4
|
`,r),Buffer.from("\r",r)];e:for(let s=0;s<a.length;s++){let f=a[s].length;for(let l=0;l<f;l++)if(a[s][l]!==t[n+l])continue e;return this.options.record_delimiter.push(a[s]),this.state.recordDelimiterMaxLength=a[s].length,a[s].length}return 0},__error:function(t){let{encoding:n,raw:r,skip_records_with_error:a}=this.options,s=typeof t=="string"?new Error(t):t;if(a){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(s,r?this.state.rawBuffer.toString(n):void 0)}catch(f){return f}return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:t,raw:n,encoding:r}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:t===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(r):void 0}},__infoField:function(){let{columns:t}=this.options,n=Array.isArray(t),r=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:r,column:n===!0?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var pe=function(i,e={}){typeof i=="string"&&(i=Buffer.from(i));let o=e&&e.objname?Object.create(null):[],t=j(e),n=s=>{t.options.objname===void 0?o.push(s):o[s[0]]=s[1]},r=()=>{},a=t.parse(i,!0,n,r);if(a!==void 0)throw a;return o};var Me=["shop_id","target_plan_handle","price_behavior","notification"],Ve={schedule:["shop_id","target_plan_handle","price_behavior"],unschedule:["shop_id"]};function ge(i,e){if(i.trim()==="")return{ok:!1,errors:[{message:"The CSV is empty"}]};let o=[],t;try{t=pe(i,{bom:!0,columns:r=>(o=r,r),info:!0,skip_empty_lines:!0,trim:!0})}catch(r){if(!(r instanceof c))throw r;return{ok:!1,errors:[{message:`Invalid CSV: ${r.message}`}]}}let n=Pe(o,e);return n.length>0?{ok:!1,errors:n}:t.length===0?{ok:!1,errors:[{message:"The CSV must contain at least one data row"}]}:{ok:!0,rows:t.map(({record:r,info:a})=>ke(r,a.lines,e))}}function Pe(i,e){let o=[],t=new Set(Me),n=new Set;for(let r of i)n.has(r)?o.push({field:r,message:`Duplicate CSV header: ${r}`}):n.add(r),t.has(r)||o.push({field:r,message:`Unknown CSV header: ${r}`});for(let r of Ve[e])i.includes(r)||o.push({field:r,message:`Missing required CSV header: ${r}`});return o}function ke(i,e,o){return o==="unschedule"?{sourceRow:e,shopId:i.shop_id}:{sourceRow:e,shopId:i.shop_id,...i.target_plan_handle===void 0?{}:{targetPlanHandle:i.target_plan_handle},...i.price_behavior===void 0?{}:{priceBehavior:i.price_behavior},...i.notification===void 0?{}:{notification:i.notification}}}d();var be={fileExists:Z,readFile:Y,readStdin:te};async function G(i,e=be){let o={...be,...e};if(i!=="-"){if(!await o.fileExists(i))throw new A(`CSV file not found: ${i}`);try{return await o.readFile(i)}catch(n){if(n instanceof A)throw n;let r=n instanceof Error?n.message:String(n);throw new A(`Couldn't read CSV file ${i}: ${r}`)}}let t=await o.readStdin();if(t===void 0||t==="")throw new A("Provide --input <path> or pipe CSV data to stdin.");return t}async function we(i,e,o){let t=o?await G(e,o):await G(e),n=ge(t,i);return n.ok?le(i,n.rows):n}d();d();var Je="shopify-subscription-migration:v1";function Ie(){return X()}function ye({appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t}){let n=JSON.stringify({namespace:Je,appIdentifier:i,action:e,invocationId:o,canonicalBatchPayload:t});return q(n).toString("hex")}var K=class extends Error{batchIndex;constructor(e){super(`Migration submission batch ${e} returned neither an operation nor user errors`),this.name="MigrationSubmissionProtocolError",this.batchIndex=e}};async function Oe({clientId:i,plan:e,invocationId:o=Ie(),createOperation:t=re}){let n={clientId:i,action:e.action,inputDigest:e.inputDigest,total:e.rows.length,operations:[]};for(let r of e.batches){let a=ye({appIdentifier:i,action:e.action,invocationId:o,canonicalBatchPayload:r.canonicalPayload}),s;try{s=await t({clientId:i,idempotencyKey:a,migrations:r.rows.map(qe)})}catch(f){if(n.operations.length===0)throw f;return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:[{message:f instanceof Error?f.message:"Migration request failed.",field:null}]}}}if(s.operation&&n.operations.push({batchIndex:r.index,batchPayloadDigest:r.payloadDigest,operation:s.operation}),s.userErrors.length>0)return{status:"failed",submission:n,failure:{type:"submission",batchIndex:r.index,userErrors:s.userErrors}};if(!s.operation)throw new K(r.index)}return{status:"success",submission:n}}function qe(i){return i.action==="unschedule"?{shopId:i.shopId,action:{cancelMigration:!0}}:{shopId:i.shopId,action:{scheduleMigration:ze(i)}}}function ze({targetPlanHandle:i,priceBehavior:e,notification:o}){return{targetPlanHandle:i,priceBehavior:e,notification:o}}async function ii(i){let e=await we(i.action,i.input);if(!e.ok)throw new A(Fe(e.errors));if(!i.skipConfirmation&&!await ee({message:`${i.action==="schedule"?"Schedule":"Unschedule"} ${e.plan.rows.length} subscriptions?`}))return{status:"cancelled",changed:!1,action:i.action,reason:"Confirmation declined."};let o=await Oe({clientId:i.clientId,plan:e.plan});if(o.status==="failed"||!i.watch)return o;i.onSubmissionAccepted?.(o.submission);let t=await oe({clientId:i.clientId,operationIds:o.submission.operations.map(({operation:a})=>a.id)}),n=je(o.submission,t),r=n.operations.filter(({operation:a})=>a.status==="FAILED").map(({operation:a})=>a.id);return r.length===0?{status:"success",submission:n}:{status:"failed",submission:n,failure:{type:"operations",operationIds:r}}}function je(i,e){let o=new Map(e.map(t=>[t.id,t]));return{...i,operations:i.operations.map(t=>({...t,operation:o.get(t.operation.id)??t.operation}))}}function Fe(i){return i.map(e=>{let o=[e.row===void 0?void 0:`row ${e.row}`,e.field].filter(t=>t!==void 0).join(", ");return o?`${o}: ${e.message}`:e.message}).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-ZJOX5HW4.js";import{z as t}from"./chunk-D2KIGKBI.js";import{k as r}from"./chunk-LHXFTFFM.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static description="Run CLI doctor-release tests";static hidden=!0;async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{da as j,la as W,ma as J,na as N,oa as q,pa as L,qa as B,ra as R,sa as K,ta as I,ua as Q,va as S,wa as Y,xa as O,ya as Z}from"./chunk-
|
|
1
|
+
import{da as j,la as W,ma as J,na as N,oa as q,pa as L,qa as B,ra as R,sa as K,ta as I,ua as Q,va as S,wa as Y,xa as O,ya as Z}from"./chunk-U2T5HPRD.js";import{E as f,t as A,w as z}from"./chunk-33ZE3DRQ.js";import{d as X}from"./chunk-TODZ3TJR.js";import{A as $,E as h}from"./chunk-D2KIGKBI.js";import{h as E,j as H}from"./chunk-M5VIFG2V.js";import{Sa as k,X as p,_ as w,pa as V,sb as G,va as U,xa as P}from"./chunk-JLQRDFR5.js";import{c as y,i as F}from"./chunk-IWTNUJGY.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();function ee(e){if(e.reason==="no-extensions")throw new E("No extensions to migrate");$({headline:["Imported the following extensions from the dashboard:"],body:e.extensions.map(({extension:t,directory:n})=>G`• "${t.title}" at: ${y("extensions",F(n))}`.value).join(`
|
|
2
2
|
`)})}s();s();function te(e){switch(e){case g.Offsite:return N;case g.CreditCard:return S;case g.CustomCreditCard:return I;case g.CustomOnsite:return R;case g.Redeemable:return L;case g.CardPresent:return O}}var g;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(g||(g={}));function ne(e,t){let n=e.activeVersion?.context??e.draftVersion?.context??te(e.type);switch(n){case N:return x(e,t,q);case S:return x(e,t,Y);case I:return x(e,t,Q);case R:return x(e,t,K);case L:return x(e,t,B);case O:return x(e,t,Z);default:throw new Error(`Unsupported extension: ${n}`)}}function x(e,t,n){let o=(e.activeVersion??e.draftVersion)?.config;if(!o)throw new Error("No config found for extension");let a=JSON.parse(o),c=n(a,t);c&&delete c.api_version;let l=e.activeVersion?.context??e.draftVersion?.context??te(e.type);return{api_version:a.api_version,extensions:[{name:e.title,type:"payments_extension",handle:p(e.title.substring(0,f)),...c,targeting:[{target:`${l}`}]}]}}s();s();var ue=new Map(J.map(e=>[e[1],e[0]])),me=(e,t)=>{let n=ue.get(e.uiType);if(!n)throw new E(`Field type ${e.uiType} is not supported`);let i={key:e.name,description:e.description??void 0,type:n};return t==="flow_action_definition"&&(i.name=e.label,i.required=e.required),i},de=(e,t)=>{let o={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(o.required=e.required),e.uiType==="marketing-activity-id"&&(o.marketingActivityCreateUrl=e.marketingActivityCreateUrl,o.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),o},ie=(e,t)=>t?t.map(i=>i.uiType==="commerce-object-id"||i.uiType==="marketing-activity-id"||W.includes(i.uiType)?de(i,e):me(i,e)):[];function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let n=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,i;if(e.type==="flow_trigger_discovery_webhook"){let o=JSON.parse(t);i={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:p(e.title.substring(0,f)),url:o.url}]}}else{let o=JSON.parse(t),a=ie(e.type,o.fields??[]);i={extensions:[{type:e.type.replace("_definition",""),name:o.title,handle:p(e.title.substring(0,f)),description:o.description,runtime_url:o.url??n,config_page_url:o.custom_configuration_page_url,config_page_preview_url:o.custom_configuration_page_preview_url,validation_url:o.validation_url}],settings:(a?.length??0)>0?{fields:a}:void 0}}return i}s();s();var re=e=>{let t=e.split("#");if(t.length!==2||t.some(c=>c===""||c===void 0))throw new Error("Invalid context");let n="admin",i=_e(t[0]??""),o=ge(t[1]??""),a="link";return o==="selection"?[n,`${i}-index`,`${o}-action`,a].join("."):[n,`${i}-${o}`,"action",a].join(".")},ge=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},_e=e=>e.toLocaleLowerCase()==="variants"?"product-variant":w(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function se(e,t,n){let i=e.activeVersion?.config??e.draftVersion?.config;if(!i)throw new Error("No config found for extension");let o=e.activeVersion?.context??e.draftVersion?.context;if(!o)throw new Error("No context found for link extension");let a=JSON.parse(i);if(n.embedded)try{let l=new URL(a.url),_=l.pathname.startsWith("/")?l.pathname.substring(1):l.pathname,r=new URL(`app://${_}`);r.search=l.search,r.hash=l.hash,a.url=r.toString()}catch{}return{extensions:[{type:"admin_link",name:a.text,handle:p(e.title.substring(0,f)),targeting:[{url:a.url,target:re(o)}]}]}}s();var ye={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},Ee={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function xe(e){let t=new URL(e);return t.pathname+t.search+t.hash}function ae(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let n=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:p(e.title.substring(0,f)),title:n.title,description:n.description,api_path:xe(n.app_api_url),tactic:n.tactic,marketing_channel:ye[n.platform]??"",referring_domain:Ee[n.platform]??"",is_automation:n.is_automation,use_external_editor:n.use_external_editor,preview_data:n.preview_data,fields:n.fields.map(({id:o,...a})=>a)}]}}s();function ce(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let n=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:p(e.title.substring(0,f)),pattern:n.pattern}]}}var M=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:ne},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:oe},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:ae},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:ce},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:se}];function le(e){return M.filter(t=>t.extensionTypes.some(n=>e.some(i=>i.type.toLowerCase()===n.toLowerCase())))}async function Et(e){if(e.length===1&&e[0])return e[0];let t=e.map(o=>({label:o.label,value:o.value})),n=await h({message:"Extension type to migrate",choices:t}),i=e.find(o=>o.value===n);if(i===void 0)throw new E("Invalid migration choice");return i}s();var St=M.flatMap(e=>e.extensionTypes),m;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(m||(m={}));async function he({name:e,app:t}){let n=w(e),i=y(t.directory,z.extensions.directoryName,n);if(await k(i)){let o=[{label:"Overwrite local TOML with remote configuration",value:m.Write},{label:"Keep local TOML",value:m.Skip},{label:"Cancel",value:m.Cancel}],a=await h({message:`Directory "${n}" already exists. What would you like to do?`,choices:o});return{directory:i,action:a}}return await U(i),await V(y(i,A.lockFile)),{directory:i,action:m.Write}}var C=class extends H{pendingImports;selectedExtensions;constructor(t,n){super(),this.pendingImports=t,this.selectedExtensions=n}completedImports(){return pe(this.pendingImports,this.selectedExtensions)}},b=class extends Error{originalError;pendingImports;selectedExtensions;constructor(t,n,i){super(t instanceof Error?t.message:"Dashboard extension import failed"),this.originalError=t,this.pendingImports=n,this.selectedExtensions=i}completedImports(){return pe(this.pendingImports,this.selectedExtensions)}};async function pe(e,t){let n=await Promise.allSettled(e);return{extensions:n.flatMap(i=>i.status==="fulfilled"?[i.value]:[]),failures:n.flatMap((i,o)=>i.status==="rejected"&&!(i.reason instanceof C)?[{extension:t[o],error:i.reason}]:[])}}async function Ce(e){let{app:t,extensionTypes:n,extensions:i,buildExtensionConfig:o,all:a}=e,c=i.filter(r=>n.includes(r.type.toLowerCase()));if(c=we(t,c),c.length===0)return{status:"skipped",reason:"no-extensions",extensions:[],extensionUuids:{}};if(!a){let r=c.map(u=>({label:u.title,value:u.uuid}));c.length>1&&r.push({label:"All",value:"All"});let d=await h({message:"Extensions to migrate",choices:r});d!=="All"&&(c=[c.find(u=>u?.uuid===d)])}let l={},_=c.map(async r=>{let{directory:d,action:u}=await he({app:t,name:r.title});if(u===m.Cancel)throw new C(_,c);let T=p(r.title.substring(0,f));l[T]=r.uuid;let v=y(d,"shopify.extension.toml");if(u===m.Write){let D=o(r,i,t.configuration);await new X(v,D).replace(D);let fe=y(d,A.lockFile);await P(fe)}return{extension:r,directory:d,configurationPath:u===m.Write||await k(v)?v:null,changed:u===m.Write}});try{return{status:"success",reason:null,extensions:await Promise.all(_),extensionUuids:l}}catch(r){throw r instanceof C?r:new b(r,_,c)}}function we(e,t){let n=e.dotenv?.variables??{},i=e.allExtensions.map(o=>n[o.idEnvironmentVariableName]);return t.filter(o=>!i.includes(o.uuid))}async function Ot(e){let t=le(e.extensions);await Promise.all(t.map(async n=>{let i=await Ce({...e,extensionTypes:n.extensionTypes,buildExtensionConfig:n.buildExtensionConfig,all:!0}).catch(o=>{throw o instanceof b?o.originalError:o});ee(i),await j({app:e.app,appApiKey:e.remoteApp.apiKey,extensionUuids:i.extensionUuids,command:"import-extensions"})}))}s();async function Ft({developerPlatformClient:e,apiKey:t,organizationId:n,extensionTypes:i,onlyDashboardManaged:o=!1}){let a=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:n}),{dashboardManagedExtensionRegistrations:c,extensionRegistrations:l}=a.app;return(o?c:l.concat(c)).filter(r=>{let d=i.includes(r.type.toLowerCase()),u=r.activeVersion&&r.activeVersion.config,T=r.draftVersion&&r.draftVersion.config;return d&&(u??T)})}export{ee as a,le as b,Et as c,St as d,C as e,b as f,Ce as g,we as h,Ot as i,Ft as j};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as J}from"./chunk-
|
|
1
|
+
import{a as J}from"./chunk-VHZ6RL67.js";import{a as x}from"./chunk-NVKJ7ZLP.js";import{A,E as S,I as E,J as F,K as R,Ma as k}from"./chunk-U2T5HPRD.js";import{a as f}from"./chunk-N57Y7THE.js";import{b as j,c as V}from"./chunk-3KM5ZOW2.js";import{A as y,C as u}from"./chunk-D2KIGKBI.js";import{a as C}from"./chunk-BN7ZXAZJ.js";import{j as h}from"./chunk-M5VIFG2V.js";import{wb as g,xb as v}from"./chunk-JLQRDFR5.js";import{b as i}from"./chunk-FZCGRIOM.js";import{g as w,i as m}from"./chunk-IWTNUJGY.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var M=i.object({filePath:i.string().refine(w,"Expected an absolute filesystem path.").nullable(),message:i.string(),fieldPath:i.array(i.union([i.string(),i.number().int().nonnegative()])).nullable(),code:i.string().nullable().describe("The upstream validation code, or null when unavailable.")}).strict(),c=C({name:"AppConfigValidateResult",schema:i.object({path:i.string().refine(w,"Expected an absolute filesystem path."),valid:i.boolean(),issues:i.array(M)}).strict(),definitions:{ValidationIssue:M}});r();function O(a,t){t==="json"?g(c.encode(a)):a.valid?y({headline:`App configuration '${m(a.path)}' is valid.`}):u({headline:"Validation errors found.",body:a.issues.map(e=>`\u2022 ${R({file:e.filePath??a.path,path:e.fieldPath??void 0,code:e.code??void 0,message:e.message})}`).join(`
|
|
2
2
|
`)})}r();import{resolve as z}from"node:path";async function B(a,t){let e=new Set(t.map(o=>o.file)).size;await f.addPublicMetadata(()=>({cmd_app_validate_valid:a,cmd_app_validate_issue_count:t.length,cmd_app_validate_file_count:e}))}async function I(a){let t=a.errors?.getErrors()??[];return await B(t.length===0,t),{path:z(a.configPath),valid:t.length===0,issues:t.map(({file:e,message:o,path:p,code:d})=>({filePath:z(e),message:o,fieldPath:p??null,code:d??null}))}}import{resolve as _}from"node:path";async function T(a,t){await f.addPublicMetadata(()=>({cmd_app_validate_valid:!1,cmd_app_validate_issue_count:a,cmd_app_validate_file_count:t}))}async function $(a,t){let e=new Set(t.map(o=>o.filePath)).size;throw await T(t.length,e),g(c.encode({path:_(a),valid:!1,issues:t})),await v(),new h}var b=class a extends J{static summary="Validate your app configuration and extensions.";static descriptionWithMarkdown="Validates the selected app configuration file and all extension configurations against their schemas and reports any errors found.";static get jsonOutputSchema(){return c}static description=this.descriptionForHelp();static flags={...j,...x,...V};async run(){let{flags:t}=await this.parse(a);await f.addPublicMetadata(()=>({cmd_app_validate_json:t.json}));let e=await A.load(t.path),o=await E(e,t.config,{clientId:t["client-id"],skipPrompts:!!t["client-id"]}),p=S(e,o.file);if(p.length>0){let n=p.map(s=>({filePath:_(s.path),message:s.message,fieldPath:null,code:null}));t.json&&await $(o.file.path,n);let l=new Set(p.map(s=>s.path)).size;throw await T(n.length,l),u({headline:"Validation errors found.",body:n.map(s=>`\u2022 ${s.message}`).join(`
|
|
3
3
|
`)}),new h}let d;try{d=(await k({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config??(t["client-id"]?m(o.file.path):void 0),unsafeTolerateErrors:!0})).app}catch(n){throw n instanceof F&&t.json&&await $(n.configurationPath,n.errors.map(l=>({filePath:_(l.file),message:l.message,fieldPath:l.path??null,code:l.code??null}))),n}let P=await I(d);if(O(P,t.json?"json":"text"),!P.valid)throw await v(),new h;return{app:d}}};export{b as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as O,n as W}from"./chunk-
|
|
1
|
+
import{l as O,n as W}from"./chunk-MHR5OHT5.js";import{T as v,a as S}from"./chunk-D2KIGKBI.js";import{f as y}from"./chunk-CXI3RHPW.js";import{h as u,k as L}from"./chunk-M5VIFG2V.js";import{Bb as d,Sa as w,Ta as i,Va as D,_a as F,la as x,lb as B,qb as c,sb as s,ta as _}from"./chunk-JLQRDFR5.js";import{c as r,h as k}from"./chunk-IWTNUJGY.js";import{a as I}from"./chunk-CX5CC6P5.js";import{e as R,g as f}from"./chunk-VKWPEFWQ.js";f();f();function b(e,n){try{return JSON.parse(e)}catch(a){let t=a instanceof Error?a.message:String(a),o=n?` from ${n}`:"";throw new u(`Failed to parse JSON${o}.
|
|
2
2
|
${t}`)}}var l=R(I(),1),N="yarn.lock",j="package-lock.json",$="pnpm-lock.yaml",C="bun.lockb",J="bun.lock",T="pnpm-workspace.yaml",we=[N,$,j,C,J],ye={yarn:[N],npm:[j],pnpm:[$],bun:[C,J],homebrew:[],unknown:[]},E=["yarn","npm","pnpm","bun","homebrew","unknown"],M=class extends u{constructor(){super("Unknown package manager")}},h=class extends u{constructor(n){super(s`The directory ${c.path(n)} doesn't have a package.json.`)}},P=class extends L{constructor(n){super(s`Couldn't find a a package.json traversing directories from ${c.path(n)}`)}};function V(e=process.env){let n=e.npm_config_user_agent;return["yarn","pnpm","bun","npm"].find(a=>n?.includes(a))??"unknown"}function U(e){return i(r(e,C))||i(r(e,J))}function G(e){switch(e){case"yarn":case"npm":case"pnpm":case"bun":return e;case"homebrew":case"unknown":return"npm"}}function K(e,n,...a){switch(e){case"npm":return{command:"npm",args:["exec","--",n,...a]};case"pnpm":return{command:"pnpm",args:["exec",n,...a]};case"yarn":return{command:"yarn",args:["run",n,...a]};case"bun":return{command:"bun",args:["x",n,...a]}}}async function A(e){let n=e;for(d(s`Looking for a lockfile in ${c.path(n)}...`);;){if(i(r(n,N)))return"yarn";if(i(r(n,$))||i(r(n,T)))return"pnpm";if(U(n))return"bun";if(i(r(n,j)))return"npm";let t=k(n);if(t===n)break;n=t}let a=V();return a!=="unknown"?a:"npm"}async function he(e,n,...a){let t=G(await A(e));return K(t,n,...a)}async function xe(e){let n=await D(r(e.directory,"**/package.json"),{ignore:[r(e.directory,"node_modules/**/package.json")],cwd:e.directory,onlyFiles:!0,deep:e.deep}),a=new S;try{await Promise.all(n.map(async t=>{let o=k(t);await z({directory:o,packageManager:e.packageManager,stdout:void 0,stderr:void 0,signal:a.signal,args:[]})}))}catch(t){throw a.abort(),t}}async function z(e){let n={cwd:e.directory,stdin:void 0,stdout:e.stdout,stderr:e.stderr,signal:e.signal},a=["install"];e.args&&(a=a.concat(e.args)),await y("cmd_all_timing_network_ms")(async()=>{await v(e.packageManager,a,n)})}async function ve(e){return(await m(e)).name}async function be(e){return(await m(e)).version}async function H(e){let n=await m(e),a=n.dependencies??{},t=n.devDependencies??{};return{...a,...t}}async function Me(e){let n=r(e,"package.json"),a=await m(n),t=r(e,T);return!!a.workspaces||w(t)}async function Pe(e,n,{cacheExpiryInHours:a=0}={}){let t=async()=>(d(s`Checking if there's a version of ${e} newer than ${n}`),ne(e)),o=`npm-package-${e}`,p;try{p=await O(o,t,a*3600*1e3)}catch{return}if(p&&new l.SemVer(n).compare(p)<0)return p}function Ne(e,n){let a=`npm-package-${e}`,t=W(a)?.value;if(t&&new l.SemVer(n).compare(t)<0)return t}function je(e,n){return(0,l.satisfies)(e,n)}async function m(e){if(!await w(e))throw new h(k(e));return b(await x(e),e)}async function Y(e,n){d(s`Adding the following dependencies if needed:
|
|
3
3
|
${c.json(e)}
|
|
4
4
|
With options:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as y}from"./chunk-
|
|
1
|
+
import{c as y}from"./chunk-H6GYBLVQ.js";import{xa as i}from"./chunk-GQLNG537.js";import{B as l,C as p,F as m,I as h,W as a}from"./chunk-D2KIGKBI.js";import{h as s}from"./chunk-M5VIFG2V.js";import{i as d,j as f}from"./chunk-FZCGRIOM.js";import{b as c}from"./chunk-43R5VGKT.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();function w(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function x(e){return{list:{items:e.map(w)}}}async function M(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return f()==="json"?d({type:"diagnostic",level:"error",message:`${o?`Environment: ${o}
|
|
2
2
|
`:""}${r}`}):p({headline:o?`Environment: ${o}`:"",body:r}),!1;if(l({body:r}),c())throw new s("This command must run from a theme directory when user input is unavailable.","Run the command from a theme directory, or use `--force` to continue.");if(!a())return!0;let t=await m({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function k(e,r,o){if(e.role!==y||o)return!0;if(!a())throw new s(`Can't ${r} on the live theme when user input is unavailable.`,"Use `--allow-live` to confirm that you want to continue.");let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await m({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function D(e,r,o=!1){e.length>0&&await h(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{w as a,x as b,M as c,k as d,D as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-VHZ6RL67.js";import{a as T}from"./chunk-NVKJ7ZLP.js";import{$ as j,Ma as y,aa as k,ca as V}from"./chunk-U2T5HPRD.js";import{ca as F}from"./chunk-33ZE3DRQ.js";import{b as I,c as S}from"./chunk-3KM5ZOW2.js";import{A as R,C as b,I as A}from"./chunk-D2KIGKBI.js";import{a as h}from"./chunk-BN7ZXAZJ.js";import{d as w}from"./chunk-CXI3RHPW.js";import{h as v,j as E}from"./chunk-M5VIFG2V.js";import{wb as x}from"./chunk-JLQRDFR5.js";import{b as n}from"./chunk-FZCGRIOM.js";import{b as U}from"./chunk-YTUUU33R.js";import{e as M,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function O(e){let{developerPlatformClient:s,app:a,remoteApp:r}=e,{extensionIdentifiersBreakdown:o,versionDetails:t}=await j(s,r,e.version),p=k({localApp:a,versionAppModules:t.appModuleVersions,activeAppVersion:await s.activeAppVersion(r)});if(!await V({configExtensionIdentifiersBreakdown:p,extensionIdentifiersBreakdown:o,appTitle:r.title,release:!0,allowUpdates:e.force||e.allowUpdates,allowDeletes:e.force||e.allowDeletes}))return{status:"cancelled"};let m=[{title:"Releasing version",task:async f=>{f.appRelease=await s.release({app:r,version:{versionId:t.uuid,appVersionId:t.id}})}}],{appRelease:{appRelease:l}}=await A(m);return l.userErrors&&l.userErrors.length>0?{status:"failed",version:t,userErrors:l.userErrors}:{status:"success",version:t}}i();var C=n.object({name:n.string(),clientId:n.string().min(1).describe("The client ID of the app receiving the release.")}).strict(),P=n.object({gid:n.string().regex(/^gid:\/\/shopify\/Version\/\d+$/).describe("The Shopify app version GID."),name:n.string().min(1).nullable().describe("The version tag, or null when no tag is available."),message:n.string().min(1).nullable().describe("The version message, or null when no message is available."),url:n.string().url().describe("The Developer Dashboard URL for this version.")}).strict(),L=n.object({version:P}).strict(),d=h({name:"AppReleaseResult",schema:n.discriminatedUnion("status",[n.object({status:n.literal("success"),app:C,release:L}).strict(),n.object({status:n.literal("cancelled")}).strict()]),definitions:{App:C,AppRelease:L,AppReleaseVersion:P}});i();function _(e,s){throw s==="text"&&e instanceof F?new v({bold:"Version couldn't be released."},["Version",{userInput:e.versionTag},"could not be found."]):e}function q(e,s,a){if(a==="json"){if(e.status==="failed"){let o=new v("Version couldn't be released.");throw o.details={userErrors:e.userErrors},o}x(d.encode(B(e,s)));return}if(e.status==="cancelled")throw new E;let r=[{link:{label:e.version.versionTag??void 0,url:e.version.location}},e.version.message?`
|
|
2
2
|
${e.version.message}`:""];if(e.status==="failed"){let o=e.userErrors.map(t=>t.message).join(", ");b({headline:"Version couldn't be released.",body:[...r,`${r.length>0?`
|
|
3
3
|
|
|
4
4
|
`:""}${o}`]})}else R({headline:"Version released to users.",body:r})}function B(e,s){return e.status==="cancelled"?{status:"cancelled"}:{status:"success",app:{name:s.title,clientId:s.apiKey},release:{version:{gid:e.version.uuid,name:e.version.versionTag===""?null:e.version.versionTag??null,message:e.version.message===""?null:e.version.message??null,url:e.version.location}}}}var c=M(U(),1);var g=class e extends D{static summary="Release an app version.";static usage="app release --version <version>";static descriptionWithMarkdown="Releases an existing app version. Pass the name of the version that you want to release using the `--version` flag.";static get jsonOutputSchema(){return d}static description=this.descriptionForHelp();static flags={...I,...T,...S,"allow-updates":c.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. Required in non-interactive environments unless --allow-deletes is provided.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":c.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. Required in non-interactive environments unless --allow-updates is provided.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),version:c.Flags.string({hidden:!1,description:"The name of the app version to release.",env:"SHOPIFY_FLAG_VERSION",required:!0})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes"]}]}async run(){let{flags:s}=await this.parse(e),a=s["client-id"];await w(()=>({cmd_app_reset_used:s.reset}));let r=s["allow-updates"],o=s["allow-deletes"],t=!!(r&&o),{app:p,remoteApp:u,developerPlatformClient:m}=await y({directory:s.path,clientId:a,forceRelink:s.reset,userProvidedConfigName:s.config}),l=await O({app:p,remoteApp:u,developerPlatformClient:m,force:t,allowUpdates:r,allowDeletes:o,version:s.version}).catch(f=>_(f,s.json?"json":"text"));return q(l,u,s.json?"json":"text"),{app:p}}};export{g as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as tx}from"./chunk-IWOTLFOY.js";import{a as b$}from"./chunk-FFSDGRAN.js";import{Aa as ex,d as Zw,za as v$}from"./chunk-
|
|
1
|
+
import{a as tx}from"./chunk-IWOTLFOY.js";import{a as b$}from"./chunk-FFSDGRAN.js";import{Aa as ex,d as Zw,za as v$}from"./chunk-GQLNG537.js";import{l as Xw}from"./chunk-QFYLJVJW.js";import{a as oe,b as we,c as x,d as Oy,e as Ia,f as Py,g as p}from"./chunk-VKWPEFWQ.js";var qy=x(Ny=>{"use strict";p();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.deepGet=k$;function k$(e,t){return t.reduce((r,n)=>r?.[n],e)}});var rx=x(fs=>{"use strict";p();Object.defineProperty(fs,"__esModule",{value:!0});fs.first=S$;fs.last=T$;fs.findLast=w$;fs.findLastIndex=Ly;fs.findLastAndIndex=x$;function S$(e){return e[0]}function T$(e,t=0){return e[e.length-1+t]}function w$(e,t){return e[Ly(e,t)]}function Ly(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}function x$(e,t){let r=Ly(e,t);return[e[r],r]}});var Cy=x((Ope,nx)=>{p();var E$={}.toString;nx.exports=Array.isArray||function(e){return E$.call(e)=="[object Array]"}});var sx=x((Npe,ix)=>{"use strict";p();var A$=Cy();ix.exports=function(t){return t!=null&&typeof t=="object"&&A$(t)===!1}});var Iy=x((Cpe,ax)=>{"use strict";p();var O$=Cy(),P$=sx(),Lpe=Array.prototype.slice;ax.exports=Ma;function Ma(e,t){if(!(this instanceof Ma))return typeof t=="number"?new Ma(e).fromIndex(t):new Ma(e,t);this.str=e||"",this.lineToIndex=N$(this.str),t=t||{},this.origin=typeof t.origin>"u"?1:t.origin}Ma.prototype.fromIndex=function(e){if(e<0||e>=this.str.length||isNaN(e))return null;var t=q$(e,this.lineToIndex);return{line:t+this.origin,col:e-this.lineToIndex[t]+this.origin}};Ma.prototype.toIndex=function(e,t){if(typeof t>"u")return O$(e)&&e.length>=2?this.toIndex(e[0],e[1]):P$(e)&&"line"in e&&("col"in e||"column"in e)?this.toIndex(e.line,"col"in e?e.col:e.column):-1;if(isNaN(e)||isNaN(t))return-1;if(e-=this.origin,t-=this.origin,e>=0&&t>=0&&e<this.lineToIndex.length){var r=this.lineToIndex[e],n=e===this.lineToIndex.length-1?this.str.length:this.lineToIndex[e+1];if(t<n-r)return r+t}return-1};function N$(e){for(var t=e.split(`
|
|
2
2
|
`),r=new Array(t.length),n=0,i=0,s=t.length;i<s;i++)r[i]=n,n+=t[i].length+1;return r}function q$(e,t){if(e>=t[t.length-1])return t.length-1;for(var r=0,n=t.length-2,i;r<n;)if(i=r+(n-r>>1),e<t[i])n=i-1;else if(e>=t[i+1])r=i+1;else{r=i;break}return r}});var cx=x(Ra=>{"use strict";p();var L$=Ra&&Ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ra,"__esModule",{value:!0});Ra.getPosition=C$;Ra.getOffset=I$;var ox=L$(Iy());function C$(e,t){let r=(0,ox.default)(e,{origin:0}).fromIndex(Math.min(t,e.length-1));return{index:t,line:r?r.line:-1,character:r?r.col:-1}}function I$(e,t,r){return(0,ox.default)(e,{origin:1}).toIndex(t,r)}});var df=x(pf=>{"use strict";p();Object.defineProperty(pf,"__esModule",{value:!0});pf.isError=R$;pf.asError=D$;var M$={1:"Invalid symbol found in the input.",2:"Invalid number format detected.",3:"Property name expected but not found.",4:"A value was expected but not found.",5:"Colon `:` expected after the property name.",6:"Comma `,` expected between elements and properties.",7:"Closing brace `}` expected.",8:"Closing bracket `]` expected.",9:"End of file expected.",10:"Invalid comment token found.",11:"Unexpected end of comment.",12:"Unexpected end of string.",13:"Unexpected end of number.",14:"Invalid Unicode escape sequence.",15:"Invalid escape character found.",16:"Invalid character found in the input."};function R$(e){return e instanceof Error}function D$(e){return e instanceof Error?e:typeof e=="string"?new Error(e):e&&typeof e=="object"&&"error"in e?new Error(j$(e)):e&&typeof e.toString=="function"?new Error(e.toString()):new Error("An unknown error occurred")}function j$(e){return M$[e.error]||"Unknown parse error."}});var Ry=x(My=>{"use strict";p();Object.defineProperty(My,"__esModule",{value:!0});My.assertNever=F$;function F$(e){throw new Error(`We should never reach this code, you are missing a case for ${e}`)}});var jy=x(hf=>{"use strict";p();Object.defineProperty(hf,"__esModule",{value:!0});hf.memo=B$;hf.memoize=V$;var Dy=Symbol("Unset");function B$(e){let t=Dy,r=(...n)=>(t===Dy&&(t=e(...n)),t);return r.clearCache=()=>{t=Dy},r}function V$(e,t){let r={},n=(...i)=>{let s=t(...i);return r[s]||(r[s]=e(...i)),r[s]};return n.force=(...i)=>(n.invalidate(...i),n(...i)),n.invalidate=(...i)=>{let s=t(...i);delete r[s]},n.clearCache=()=>{r={}},n}});var By=x(Fy=>{"use strict";p();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.indexBy=$$;function $$(e,t){let r={};for(let n of t)r[e(n)]=n;return r}});function ps(e,t=!1){let r=e.length,n=0,i="",s=0,a=16,o=0,c=0,l=0,f=0,m=0;function d(T,y){let A=0,O=0;for(;A<T||!y;){let P=e.charCodeAt(n);if(P>=48&&P<=57)O=O*16+P-48;else if(P>=65&&P<=70)O=O*16+P-65+10;else if(P>=97&&P<=102)O=O*16+P-97+10;else break;n++,A++}return A<T&&(O=-1),O}function g(T){n=T,i="",s=0,a=16,m=0}function v(){let T=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&Da(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&Da(e.charCodeAt(n)))for(n++;n<e.length&&Da(e.charCodeAt(n));)n++;else return m=3,e.substring(T,n);let y=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&Da(e.charCodeAt(n))){for(n++;n<e.length&&Da(e.charCodeAt(n));)n++;y=n}else m=3;return e.substring(T,y)}function b(){let T="",y=n;for(;;){if(n>=r){T+=e.substring(y,n),m=2;break}let A=e.charCodeAt(n);if(A===34){T+=e.substring(y,n),n++;break}if(A===92){if(T+=e.substring(y,n),n++,n>=r){m=2;break}switch(e.charCodeAt(n++)){case 34:T+='"';break;case 92:T+="\\";break;case 47:T+="/";break;case 98:T+="\b";break;case 102:T+="\f";break;case 110:T+=`
|
|
3
3
|
`;break;case 114:T+="\r";break;case 116:T+=" ";break;case 117:let P=d(4,!0);P>=0?T+=String.fromCharCode(P):m=4;break;default:m=5}y=n;continue}if(A>=0&&A<=31)if(xc(A)){T+=e.substring(y,n),m=2;break}else m=6;n++}return T}function _(){if(i="",m=0,s=n,c=o,f=l,n>=r)return s=r,a=17;let T=e.charCodeAt(n);if(Vy(T)){do n++,i+=String.fromCharCode(T),T=e.charCodeAt(n);while(Vy(T));return a=15}if(xc(T))return n++,i+=String.fromCharCode(T),T===13&&e.charCodeAt(n)===10&&(n++,i+=`
|
|
4
4
|
`),o++,l=n,a=14;switch(T){case 123:return n++,a=1;case 125:return n++,a=2;case 91:return n++,a=3;case 93:return n++,a=4;case 58:return n++,a=6;case 44:return n++,a=5;case 34:return n++,i=b(),a=10;case 47:let y=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!xc(e.charCodeAt(n));)n++;return i=e.substring(y,n),a=12}if(e.charCodeAt(n+1)===42){n+=2;let A=r-1,O=!1;for(;n<A;){let P=e.charCodeAt(n);if(P===42&&e.charCodeAt(n+1)===47){n+=2,O=!0;break}n++,xc(P)&&(P===13&&e.charCodeAt(n)===10&&n++,o++,l=n)}return O||(n++,m=1),i=e.substring(y,n),a=13}return i+=String.fromCharCode(T),n++,a=16;case 45:if(i+=String.fromCharCode(T),n++,n===r||!Da(e.charCodeAt(n)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=v(),a=11;default:for(;n<r&&k(T);)n++,T=e.charCodeAt(n);if(s!==n){switch(i=e.substring(s,n),i){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return i+=String.fromCharCode(T),n++,a=16}}function k(T){if(Vy(T)||xc(T))return!1;switch(T){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function w(){let T;do T=_();while(T>=12&&T<=15);return T}return{setPosition:g,getPosition:()=>n,scan:t?w:_,getToken:()=>a,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>n-s,getTokenStartLine:()=>c,getTokenStartCharacter:()=>s-f,getTokenError:()=>m}}function Vy(e){return e===32||e===9}function xc(e){return e===10||e===13}function Da(e){return e>=48&&e<=57}var ux,mf=we(()=>{"use strict";p();(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ux||(ux={}))});var ur,ja,$y,lx,fx=we(()=>{p();ur=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),ja=200,$y={" ":{"\n":new Array(ja).fill(0).map((e,t)=>`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as U}from"./chunk-
|
|
1
|
+
import{a as U}from"./chunk-TFPW2VGN.js";import{c as I,i as _,j as A,q as D}from"./chunk-IJY3RJPJ.js";import{e as k}from"./chunk-QW52RPAU.js";import{a as q}from"./chunk-2L6AN3QA.js";import{e as x}from"./chunk-QFWWCZOI.js";import{p as E,v as F}from"./chunk-YKMINHYY.js";import{b as O,c as j}from"./chunk-3KM5ZOW2.js";import{O as L}from"./chunk-D2KIGKBI.js";import{h as d}from"./chunk-M5VIFG2V.js";import{Bb as p,_a as v,ka as S,ta as R,wb as w}from"./chunk-JLQRDFR5.js";import{b as t}from"./chunk-FZCGRIOM.js";import{b as X}from"./chunk-YTUUU33R.js";import{c as h,h as $}from"./chunk-IWTNUJGY.js";import{e as z,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();var J=t.object({name:t.string(),file:t.string().optional(),line:t.number().optional(),col:t.number().optional()}).passthrough(),N=t.object({type:t.enum(["O","C"]),at:t.number(),frame:t.number()}).passthrough(),H=t.object({name:t.string(),unit:t.enum(["bytes","microseconds","milliseconds","nanoseconds","none","seconds"]),startValue:t.number(),endValue:t.number()}),B=H.extend({type:t.literal("evented"),events:t.array(N)}).passthrough(),M=H.extend({type:t.literal("sampled"),samples:t.array(t.array(t.number())),weights:t.array(t.number())}).passthrough(),C=t.object({frames:t.array(J)}).passthrough(),T=t.object({$schema:t.literal("https://www.speedscope.app/file-format-schema.json"),shared:C,profiles:t.array(t.discriminatedUnion("type",[B,M])),name:t.string().optional(),exporter:t.string().optional(),activeProfileIndex:t.number().optional()}).passthrough().describe("The native Speedscope file format, defined by its $schema URL. Original keys and extension fields are preserved."),u=x({name:"ThemeProfileResult",schema:T,project:o=>o,definitions:{ProfileFrame:J,ProfileEvent:N,ProfileShared:C,EventedProfile:B,SampledProfile:M}});var g="https://storefront.invalid",K=200;async function W(o,e,r,s,a){if(r.startsWith("//")||!URL.canParse(r,g))throw new d(`${r} isn't a valid storefront URL.`,"Pass the path of a storefront page to --url, for example /products/classic-leather-jacket.");let n=await I(o)?await U(a,o.storeFqdn):void 0;if(s)throw new d("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let f=await D(e,o,s,n),m=Y(r),i=await A(f,{method:"GET",path:m.pathname,query:[...m.searchParams],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(i.status>=300&&i.status<400)throw new d(`The page ${r} redirects (${i.status}) instead of rendering, so it can't be profiled.`,Z(m,i.headers.get("Location")));if(i.status!==200){let y=await ee(i);throw new d(`Can't profile ${r}. The storefront responded with ${i.status}.${y}`)}let c=await i.text();return{result:T.parse(JSON.parse(c)),source:c}}function Y(o){let e=new URL(o,g);return Object.keys(_).forEach(r=>e.searchParams.delete(r)),e}function G(o){return`${o.pathname}${o.search}`}function Z(o,e){if(!e||!URL.canParse(e,g))return null;let r=Y(e);if(r.pathname==="/password")return"It redirects to the storefront password page. Check the storefront password, and pass it with --store-password.";let s=G(r),a=r.origin===g,n=a?s:r.href;return s===G(o)?`It redirects to ${n}.`:a?`It redirects to ${n}. Run the command again with --url "${s}".`:`It redirects to ${n}. If that page is on your storefront, run the command again with --url "${s}".`}async function ee(o){let e=o.headers.get("x-request-id"),r=e?`
|
|
2
2
|
Request ID: ${e}`:"",s=(await o.text()).trim(),a=o.headers.get("Content-Type")?.includes("application/json")??!1,f=s.length>0&&(a||s.length<=K)?`
|
|
3
3
|
${s}`:"";return`${r}${f}`}l();l();import{fileURLToPath as te}from"node:url";async function V(...o){let e=await v("package.json",{cwd:te(import.meta.url),type:"file"});if(!e)throw new Error("Failed to find CLI root path");return e.endsWith("/packages/theme/package.json")?h($(e),"assets",...o):h($(e),"dist","assets",...o)}async function Q({result:o,source:e},r){u.validate(o),r==="json"?w(e):await re(e)}async function re(o){let e=process.env.WSL_DISTRO_NAME,r=e?`//wsl$/${e}`:"",s=await V("speedscope","index.html");p(`[Theme Profile] Resolved URL to open: ${s}`);let a="liquid-profile",n=Buffer.from(o).toString("base64"),f=`speedscope.loadFileFromBase64(${JSON.stringify(a)}, ${JSON.stringify(n)})`,m=`speedscope-${Number(new Date)}-${process.pid}`,i=h(S(),`${m}.js`);p(`[Theme Profile] writing JS file to: ${i}`),await R(i,f),p(`[Theme Profile] JS file created successfully: ${i}`),s=`${r}${s}`,i=`${r}${i}`,s+=`#localProfilePath=${i}`;let c=h(S(),`${m}.html`);p(`[Theme Profile] writing HTML file to: ${c}`),await R(c,`<script>window.location=${JSON.stringify(s)}</script>`),p(`[Theme Profile] HTML file created successfully: ${c}`),c=`${r}${c}`,s=`file://${c}`,p(`[Theme Profile] Opening URL: ${s}`);let y=await L(s);p(`[Theme Profile] URL opened successfully: ${y}`)}var P=z(X(),1);var b=class extends F{static get jsonOutputSchema(){return u}static summary="Profile the Liquid rendering of a theme page.";static usage=["theme profile","theme profile --url /products/classic-leather-jacket"];static descriptionWithMarkdown=`Profile the Shopify Liquid on a given page.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
1
|
+
import{b as m}from"./chunk-ZJOX5HW4.js";import{H as f}from"./chunk-D2KIGKBI.js";import{wb as c}from"./chunk-JLQRDFR5.js";import{b as N}from"./chunk-YTUUU33R.js";import{e as v,g}from"./chunk-VKWPEFWQ.js";g();var d=v(N(),1),i=class h extends m{static description="View all the available command flags";static hidden=!0;static flags={csv:d.Flags.boolean({description:"Output as CSV",env:"SHOPIFY_FLAG_OUTPUT_CSV",default:!1})};async run(){let{flags:p}=await this.parse(h),s=[];for(let[t,a]of this.config.plugins)for(let o of a.commands){let l=await o.load(),n;a.name.startsWith("@shopify")?n=a.name.substring(9):n=a.name.startsWith("@oclif")?a.name.substring(7):a.name;let e=l.flags;if(e)for(let[u,r]of Object.entries(e))s.push({pluginName:n,command:o.id,flagName:`--${u}`,flagChar:r.char?`-${r.char}`:"",flagEnv:r.env})}if(p.csv){let t=["pluginName","command","flagName","flagChar","flagEnv"],a=`${t.join(",")}
|
|
2
2
|
`,o=s.map(n=>t.map(e=>n[e]).join(",")).join(`
|
|
3
3
|
`),l=`${a}${o}
|
|
4
4
|
`;c(l)}else f({rows:s,columns:{pluginName:{header:"plugin",color:"red"},command:{},flagName:{header:"long flag",color:"green"},flagChar:{header:"short flag",color:"green"},flagEnv:{header:"env variable",color:"blueBright"}}})}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $,c as M}from"./chunk-
|
|
1
|
+
import{a as $,c as M}from"./chunk-AUE7LM32.js";import{d as N,f as Q,u as P}from"./chunk-DZKFP6H2.js";import{a as C}from"./chunk-VHZ6RL67.js";import{a as G,c as q}from"./chunk-NVKJ7ZLP.js";import{b as L}from"./chunk-SK7EPN6C.js";import{b as X,c as j}from"./chunk-GQLNG537.js";import{b as J,c as R}from"./chunk-3KM5ZOW2.js";import{A as w,C as k,J as x}from"./chunk-D2KIGKBI.js";import{a as S}from"./chunk-BN7ZXAZJ.js";import{h as p}from"./chunk-M5VIFG2V.js";import{Sa as A,la as b,qb as m,sb as c,ta as E,wb as f}from"./chunk-JLQRDFR5.js";import{b as a}from"./chunk-FZCGRIOM.js";import{e as y,g as O}from"./chunk-IWTNUJGY.js";import{e as K,g as i}from"./chunk-VKWPEFWQ.js";i();i();var V=K(X(),1);async function Y(o,e){if(o)try{return JSON.parse(o)}catch(r){let t=r instanceof Error?r.message:"Unknown error";throw new p(c`Invalid JSON in ${m.yellow("--variables")} flag: ${t}`,"Please provide valid JSON format.")}else if(e){if(!await A(e))throw new p(c`Variable file not found at ${m.path(e)}. Please check the path and try again.`);let r=await b(e,{encoding:"utf8"});try{return JSON.parse(r)}catch(t){let s=t instanceof Error?t.message:"Unknown error";throw new p(c`Invalid JSON in variable file ${m.path(e)}: ${s}`,"Please provide valid JSON format.")}}}async function F(o){let{remoteApp:e,store:r,query:t,variables:s,variableFile:h,version:U}=o,{adminSession:H,version:W}=await x({title:c`Authenticating`,task:async()=>{let n=await $(e,r.shopDomain),d=await Q({adminSession:n,userSpecifiedVersion:U});return{adminSession:n,version:d}},renderOptions:{stdout:process.stderr}}),B=await Y(s,h);N(t),M(t,r);try{let n;return{status:"success",result:{data:await x({title:c`Executing GraphQL operation`,task:async()=>L({query:(0,V.parse)(t),session:H,variables:B,version:W,responseOptions:{handleErrors:!1,onResponse:u=>{n=u.extensions}}}),renderOptions:{stdout:process.stderr}}),...n===void 0?{}:{extensions:n}}}}catch(n){if(n instanceof j){let{errors:d,extensions:u,data:v}=n.response;return{status:"failed",details:{...d===void 0?{}:{errors:d},...u===void 0?{}:{extensions:u},...v===void 0?{}:{data:v}}}}throw n}}i();var z=a.unknown().and(a.record(a.unknown())),I=a.object({data:z.nullable().describe("Native GraphQL query data, preserving fields and aliases."),extensions:z.optional().describe("Native GraphQL response extensions, when supplied.")}).strict(),D=a.object({path:a.string().refine(O,"Expected an absolute filesystem path."),format:a.literal("json")}).strict().describe("Receipt for a written JSON file containing the GraphQL result, including data and optional extensions."),l=S({name:"AppExecuteResult",schema:a.union([I,D]),definitions:{AppExecuteGraphQLResult:I,AppExecuteFileReceipt:D}});i();async function T(o,e,r){if(o.status==="failed"){if(e==="json"){let s=new p("GraphQL operation failed.");throw s.details=o.details,s}k({headline:"GraphQL operation failed.",body:JSON.stringify({errors:o.details.errors},null,2)});return}let t=e==="json"?l.encode(o.result):JSON.stringify(o.result.data,null,2);r?(await E(r,t),e==="json"?f(l.encode({path:y(r),format:"json"})):w({headline:"Operation succeeded.",body:`Results written to ${r}`})):e==="json"?f(t):(w({headline:"Operation succeeded."}),f(t))}var g=class o extends C{static summary="Execute GraphQL queries and mutations.";static descriptionWithMarkdown="Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores.\n\n For operations that process large amounts of data, use [`bulk execute`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead.";static get jsonOutputSchema(){return l}static description=this.descriptionForHelp();static flags={...J,...G,...q,...R};async run(){let{flags:e}=await this.parse(o),{query:r,appContextResult:t,store:s}=await P(e),h=await F({organization:t.organization,remoteApp:t.remoteApp,store:s,query:r,variables:e.variables,variableFile:e["variable-file"],...e.version&&{version:e.version}});return await T(h,e.json?"json":"text",e["output-file"]),{app:t.app}}};export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ma as j,o as P}from"./chunk-
|
|
1
|
+
import{Ma as j,o as P}from"./chunk-U2T5HPRD.js";import{G as A}from"./chunk-D2KIGKBI.js";import{a as y}from"./chunk-BN7ZXAZJ.js";import{h}from"./chunk-M5VIFG2V.js";import{Sa as u,sb as f,ta as b,wb as p,yb as x}from"./chunk-JLQRDFR5.js";import{b as r}from"./chunk-FZCGRIOM.js";import{a as I}from"./chunk-LHXFTFFM.js";import{b as q}from"./chunk-YTUUU33R.js";import{c as l,e as v,p as F}from"./chunk-IWTNUJGY.js";import{e as O,g as c}from"./chunk-VKWPEFWQ.js";c();async function C(t){let{extension:e,developerPlatformClient:n,app:a,orgId:i}=t,o=a.configuration.client_id,{api_version:s,type:m,targeting:d}=e.configuration,G=await(!!d?.length?z({localIdentifier:e.localIdentifier,developerPlatformClient:n,apiKey:o,target:d[0].target,version:s,orgId:i}):R({localIdentifier:e.localIdentifier,developerPlatformClient:n,apiKey:o,type:m,version:s,orgId:i}));return{definition:P(G,s),path:l(e.directory,"schema.graphql"),localIdentifier:e.localIdentifier}}async function z({localIdentifier:t,developerPlatformClient:e,apiKey:n,target:a,version:i,orgId:o}){let s={handle:a,version:i},m=await e.targetSchemaDefinition(s,n,o);if(!m)throw new h(f`A schema could not be generated for ${t}`,f`Check that the Function targets and version are valid.`);return m}async function R({localIdentifier:t,developerPlatformClient:e,apiKey:n,version:a,type:i,orgId:o}){let s={version:a,type:i},m=await e.apiSchemaDefinition(s,n,o);if(!m)throw new h(f`A schema could not be generated for ${t}`,f`Check that the Function API type and version are valid.`);return m}c();c();var g=r.string().regex(/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/).describe("An absolute native filesystem path."),V=r.object({handle:r.string().nullable().describe("Null when the extension does not configure a handle."),name:r.string(),directory:g}).strict();var T=r.object({path:g,format:r.literal("graphql").describe("The file contains native GraphQL SDL with the API-version header.")}).strict(),D=r.object({schema:r.string().describe("Native GraphQL SDL with the API-version header, returned with --stdout --json.")}).strict(),S=y({name:"FunctionSchemaResult",schema:r.union([T,D]),definitions:{FunctionSchemaFile:T,FunctionSchemaContent:D}});c();import{resolve as _}from"node:path";async function L(t,e){let n=e.stdout?{schema:t.definition}:{path:_(t.path),format:"graphql"};if(e.stdout){p(e.json?S.encode(n):t.definition);return}await b(t.path,t.definition),e.json?p(S.encode(n)):x(`GraphQL Schema for ${t.localIdentifier} written to ${t.path}`)}c();var E=O(q(),1);var pt={path:E.Flags.string({hidden:!1,description:"The path to your function directory.",parse:async t=>v(t),default:async()=>F(),noCacheDefault:!0,env:"SHOPIFY_FLAG_PATH"})};async function gt(t,e){let n=t.allExtensions.filter(i=>i.isFunctionExtension),a=n.find(i=>i.directory===e);if(a)return a;if(n.length===1&&n[0])return n[0];if(I())return await A({message:"Which function?",choices:n.map(o=>({label:o.handle,value:o}))});throw new h("Run this command from a function directory or use `--path` to specify a function directory.")}async function St(t,e,n,a,i){let o=l(t.directory,"schema.graphql");if(await u(o))return o;let{app:s,developerPlatformClient:m,organization:d}=await j({directory:e,clientId:n,forceRelink:a,userProvidedConfigName:i}),w=await C({app:s,developerPlatformClient:m,extension:t,orgId:d.id});return await L(w,{stdout:!1,json:!1}),await u(o)?o:void 0}export{C as a,g as b,V as c,S as d,L as e,pt as f,gt as g,St as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-XDVPIGXE.js";import{b as s}from"./chunk-ZJOX5HW4.js";import{Ea as i}from"./chunk-GQLNG537.js";import{b as m}from"./chunk-YTUUU33R.js";import{e as d,g as e}from"./chunk-VKWPEFWQ.js";e();var n=d(m(),1);var t=class c extends s{static description="List current notifications configured for the CLI.";static hidden=!0;static flags={"ignore-errors":n.Flags.boolean({hidden:!1,description:"Don't fail if an error occurs.",env:"SHOPIFY_FLAG_IGNORE_ERRORS"})};async run(){let{flags:f}=await this.parse(c);try{await a()}catch(r){let o="Error fetching notifications";if(r instanceof Error&&(o=o.concat(`: ${r.message}`)),await i(o,"expected_error"),!f["ignore-errors"])throw r}}};export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./chunk-
|
|
1
|
+
import{j as m}from"./chunk-GQLNG537.js";import{a as k,b as G}from"./chunk-F3CK3EJJ.js";import{f as H}from"./chunk-CXI3RHPW.js";import{h as u}from"./chunk-M5VIFG2V.js";import{Bb as h,Na as R,Oa as T,ja as g,qb as p,sb as l,ta as y,va as x}from"./chunk-JLQRDFR5.js";import{c as $,h as b}from"./chunk-IWTNUJGY.js";import{g as w}from"./chunk-VKWPEFWQ.js";w();var d=class extends Error{constructor(t,e,o){super(`The request to GitHub API URL ${t} failed with status code ${e} and the following error message: ${o.message}`)}};async function A(i,t,e={filter:()=>!0}){h(l`Getting the latest release of GitHub repository ${i}/${t}...`);let o=`https://api.github.com/repos/${i}/${t}/releases`,r=await m(o);try{let s=await r.text(),n=JSON.parse(s);if(r.status!==200)throw new d(o,r.status,n);return n.find(e.filter)}catch(s){throw s instanceof SyntaxError?new u(`Received invalid response from GitHub API (HTTP ${r.status}).`,"The response could not be parsed as JSON. The service may be temporarily unavailable. Please try again."):s}}function B(i){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(i);if(!t){let S=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return G(new Error(`Parsing the url ${i} failed. Supported formats are ${S.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",o=e==="github"?"github.com":e,r=t[4],s=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),a=t[7],f=a?`#${a}`:"",c=`git@${o}:${r}/${s}`,P=`https://${o}/${r}/${s}`,v=["https:/",o,r,s,n].join("/").concat(f);return k({full:v,site:o,user:r,name:s,ref:a,subDirectory:n,ssh:c,http:P})}function I(i){let t=new URL(i),e=t.hash?t.hash.slice(1):void 0,[o,r,s,...n]=t.pathname.split("/"),a=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${r}/${s}`,branch:e,filePath:a}}async function q(i,t,e,o){let r=`https://github.com/${i}/releases/download/${t}/${e}`;return H("cmd_all_timing_network_ms")(async()=>{h(l`Downloading ${p.link(e,r)}`),await g(async s=>{let n=$(s,e),a;try{if(a=await m(r,void 0,"slow-request"),!a.ok)throw new u(`Failed to download ${e}: ${a.statusText}`)}catch(c){throw new u(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let f=await a.arrayBuffer();await y(n,Buffer.from(f)),await T(n,493),await x(b(o)),await R(n,o)}),h(l`${p.successIcon()} Successfully downloaded ${p.path(o)}`)})}export{A as a,B as b,I as c,q as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-ZJOX5HW4.js";import{sa as r}from"./chunk-GQLNG537.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static hidden=!0;async run(){await r()}};export{t as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as D}from"./chunk-
|
|
1
|
+
import{b as D}from"./chunk-5ED7SOQZ.js";import{a as ee}from"./chunk-MEYVUHQH.js";import{k as K,l as Q,m as X,o as Z}from"./chunk-USXIXANP.js";import{a as re}from"./chunk-PWAT52M4.js";import{a as q,c as z}from"./chunk-QW52RPAU.js";import{a as W}from"./chunk-CGVROSPS.js";import{a as V,b as Y}from"./chunk-YY6TFARF.js";import{a as G}from"./chunk-2L6AN3QA.js";import{d as R,e as $,g as M,h as J}from"./chunk-QFWWCZOI.js";import{b as F,c as N,d as A,f as U,j as I,n as H,p as B}from"./chunk-H6GYBLVQ.js";import{r as g}from"./chunk-YKMINHYY.js";import{da as me}from"./chunk-RLNIOJH3.js";import{N as E,ua as P,va as _}from"./chunk-GQLNG537.js";import{A as k,B as O,F as L}from"./chunk-D2KIGKBI.js";import{h as v}from"./chunk-M5VIFG2V.js";import{wb as y}from"./chunk-JLQRDFR5.js";import{b as t,i as j}from"./chunk-FZCGRIOM.js";import{e as x,g as C,p as f}from"./chunk-IWTNUJGY.js";import{e as ie,g as d}from"./chunk-VKWPEFWQ.js";d();import{resolve as ae}from"node:path";var he=t.object({id:t.number(),name:t.string(),role:t.string(),shop:t.string(),editor_url:t.string(),preview_url:t.string()}),T=t.object({environment:t.string().optional(),directory:t.string().optional(),sourcePaths:t.record(t.string()).optional(),changed:t.boolean().optional(),theme:he,published:t.boolean(),hasErrors:t.boolean(),errors:t.record(t.array(t.string()))}),te=t.object({status:t.enum(["success","partial"]),changed:t.boolean(),theme:R,issues:t.array(t.object({filePath:t.string().refine(C,"Expected an absolute filesystem path."),message:t.string()}).strict())}).strict(),oe=t.object({status:t.literal("skipped"),reason:t.literal("unsafe-directory")}).strict();function w(e){let{theme:o,hasErrors:r,errors:s}=e;return{status:r?"partial":"success",changed:e.changed??!0,theme:{...J(o),storeDomain:M(o.shop),editorUrl:o.editor_url||null,previewUrl:o.preview_url||null},issues:Object.entries(s).flatMap(([m,i])=>i.map(n=>({filePath:ae(e.directory??f(),e.sourcePaths?.[m]??m),message:n})))}}var S=$({name:"ThemePushJsonResult",schema:t.union([te,oe]),definitions:{ThemePushTheme:R},project:e=>oe.safeParse(e).success||te.safeParse(e).success?e:w(T.parse(e))});d();var b=ie(me(),1);function se(e,o){if(o==="json"){y(S.encode(w(e)));return}let{environment:r,theme:s,hasErrors:m,published:i}=e,n=r?[{subdued:`Environment: ${r}
|
|
2
2
|
|
|
3
3
|
`}]:[],a=m?O:k;if(i){a({body:[...n,m?`Your theme was published with errors and is now live at https://${s.shop}`:`Your theme is now live at https://${s.shop}`]});return}a({body:[...n,"The theme",...q(s),m?"was pushed with errors":"was pushed successfully."],nextSteps:[[{link:{label:"View your theme",url:s.preview_url}}],[{link:{label:"Customize your theme at the theme editor",url:s.editor_url}}]]})}async function ne(e,o=!1){if(!e.strict)return;let r=e.environment?.[0],s=o?"json":"silent",m=e.json?s:"text",{offenses:i}=await D(e.path??f(),m);if(e.json&&!o)for(let n of i)j({type:"diagnostic",level:{[b.Severity.ERROR]:"error",[b.Severity.WARNING]:"warning",[b.Severity.INFO]:"info"}[n.severity],code:n.check,message:`${r?`[${r}] `:""}${n.uri}: ${n.message}`});if(i.some(n=>n.severity===b.Severity.ERROR))throw _(new v(`${r?`[${r}] `:""}Theme check failed. Please fix the errors before pushing.`))}function _e(e){let o=e.map(r=>{if("error"in r)return r;let s=r.result??{status:"skipped",reason:"unsafe-directory"};return T.safeParse(s).data?.hasErrors&&(process.exitCode=1),{...r,result:s}});y(S.encode({environments:o}))}d();async function ue(e,o,r,s){let m=e.environment?.[0],i=o??await E(g({store:e.store}),e.password);P("theme-service:push:setup"),re({verbose:e.verbose,noColor:e.noColor});let n=e.force??!1,a=e.path?x(e.path):f();if(!await Z(a)&&!await z(n,void 0,m,r))return;e.listing&&await Q(a,e.listing);let l=await le(i,e,r);if(l)return P("theme-service:push:setup"),ce(l,i,{allowLive:e.allowLive??!1,environment:m,force:n,ignore:e.ignore??[],multiEnvironment:r,nodelete:e.nodelete??!1,only:e.only??[],path:a,publish:e.publish??!1,listing:e.listing},s)}async function ce(e,o,r,s){P("theme-service:push:file-system");let m=await H(e.id,o),i=X(r.path,{filters:r,listing:r.listing});P("theme-service:push:file-system");let n;if(r.listing){let c=r.listing;await i.ready(),n=Object.fromEntries(await Promise.all([...i.files.keys()].map(async p=>[p,await K(r.path,c,p)??p])))}let a=ee(e,o,m,i,r,s);await a.renderThemeSyncProgress();let{uploadResults:l}=a;r.publish&&await B(e.id,o);let h={};for(let[c,p]of l)p.success||(h[c]=p.errors?.asset?.length?p.errors.asset:["File upload failed"]);let u=T.parse({environment:r.environment,directory:r.path,...n&&{sourcePaths:n},changed:e.createdAtRuntime===!0||r.publish===!0||a.hasChanges,theme:{id:e.id,name:e.name,role:e.role,shop:o.storeFqdn,editor_url:Y(e,o),preview_url:V(e,o)},published:r.publish??!1,hasErrors:[...l.values()].some(c=>!c.success),errors:h});if(u.hasErrors&&!u.changed){let c=new v(`The theme '${e.name}' could not be pushed.`);throw c.details={themeId:String(e.id),issues:w(u).issues},c}return u}async function le(e,o,r){let{live:s,development:m,unpublished:i,theme:n,environment:a,developmentContext:l}=o;if(m)return new W(e).findOrCreate(l,F);if(i){let h=n??await U("Name of the new theme"),u=await I({name:h,role:A},e);return u?{...u,createdAtRuntime:!0}:void 0}else{let h=await G(e,{create:!0,header:"Select a theme to push to:",filter:{live:s,theme:n}});return await pe(h.role,o.allowLive,e.storeFqdn,a,r)?h:void 0}}async function pe(e,o,r,s,m){if(e===N){if(o)return!0;if(m)throw new v(`Can't push theme files to the live theme on ${r}. Use the --allow-live flag.`);let i={message:`Push theme files to the ${e} theme on ${r}?`,confirmationMessage:"Yes, confirm changes",cancellationMessage:"Cancel"};return L(i)}return!0}async function Qe(e,o,r,s){let m=o??await E(g({store:e.store}),e.password);await ne(e,!0);let i=await ue(e,m,r,s);i&&se(i,e.json?"json":"text")}export{T as a,w as b,S as c,se as d,ne as e,_e as f,ue as g,Qe as h};
|