shopify 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-QFDTQYPM.js +1 -0
- package/dist/analytics-XADBBHOH.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/chunk-24Q6X53V.js +1 -0
- package/dist/{chunk-F3OM2YO6.js → chunk-25MYHE4W.js} +1 -1
- package/dist/{chunk-HP2ZAAY7.js → chunk-27JT4NA4.js} +1 -1
- package/dist/chunk-2BYW3BYX.js +1 -0
- package/dist/chunk-2KFYIYLI.js +1 -0
- package/dist/{chunk-V654BMS7.js → chunk-2KUM2RU4.js} +60 -60
- package/dist/chunk-2PD7TNFS.js +275 -0
- package/dist/{chunk-3JACWBUC.js → chunk-3C72S6LO.js} +1 -1
- package/dist/chunk-3FZ4LE6A.js +10 -0
- package/dist/{chunk-ZBVHPC6W.js → chunk-3GD5ESWN.js} +1 -1
- package/dist/chunk-3KGN6N7E.js +1 -0
- package/dist/{chunk-X4A5D3PZ.js → chunk-3MZ7ELHS.js} +2 -2
- package/dist/{chunk-VXL5FBE7.js → chunk-3PS52ZT4.js} +1 -1
- package/dist/chunk-3PYDIBTX.js +1 -0
- package/dist/chunk-3Z75BVGJ.js +1 -0
- package/dist/chunk-4FWPOGPQ.js +1 -0
- package/dist/chunk-4IP37MBX.js +1 -0
- package/dist/chunk-4NFX7YCT.js +1 -0
- package/dist/chunk-4TCXPHKN.js +1 -0
- package/dist/chunk-4WBWZIN5.js +6 -0
- package/dist/chunk-5534MHZW.js +97 -0
- package/dist/{chunk-C4EKNOLY.js → chunk-5C6CXU74.js} +1 -1
- package/dist/{chunk-56GKTWFF.js → chunk-5HOZDOJ7.js} +1 -1
- package/dist/{chunk-CX3ANDPI.js → chunk-5PSQFQL6.js} +1 -1
- package/dist/chunk-5T3ZT6CC.js +1 -0
- package/dist/chunk-62NW4EPI.js +17 -0
- package/dist/chunk-65NCQJYR.js +1 -0
- package/dist/{chunk-QGWC23HQ.js → chunk-6BYHL3DS.js} +1 -1
- package/dist/chunk-6I7DT7QR.js +3 -0
- package/dist/chunk-6IMTMS2S.js +3 -0
- package/dist/chunk-7A77JCED.js +11 -0
- package/dist/chunk-7ART2IKU.js +1 -0
- package/dist/{chunk-TTBNFGCW.js → chunk-7BPT5V24.js} +2 -2
- package/dist/{chunk-V7H7ITCF.js → chunk-7CT3NIXI.js} +1 -1
- package/dist/chunk-7DBKSSDK.js +1 -0
- package/dist/chunk-7HECBXSP.js +1 -0
- package/dist/chunk-7KID5BIR.js +4 -0
- package/dist/{chunk-63UKZLPC.js → chunk-7N7KRZOM.js} +1 -1
- package/dist/{chunk-NJVNGEOU.js → chunk-7NRHZG5Y.js} +102 -102
- package/dist/chunk-7PHDEILV.js +1 -0
- package/dist/chunk-A2NSORBM.js +2296 -0
- package/dist/chunk-A54TADAZ.js +1 -0
- package/dist/{chunk-YTUUU33R.js → chunk-AE3IQG7S.js} +1 -1
- package/dist/chunk-AGTUAQHX.js +4 -0
- package/dist/chunk-AHYI27QL.js +11 -0
- package/dist/chunk-ALINJ6J2.js +1 -0
- package/dist/chunk-AMVWKHNY.js +1 -0
- package/dist/{chunk-D4LFWIFE.js → chunk-ASKBYEO7.js} +1 -1
- package/dist/{chunk-LENSEW2F.js → chunk-AVJJGQOP.js} +1 -1
- package/dist/{chunk-QVVQUJQL.js → chunk-AY3AAV77.js} +1 -1
- package/dist/{chunk-DSKAIC7O.js → chunk-BFAOTQGH.js} +1 -1
- package/dist/{chunk-KGASGUDQ.js → chunk-BPKQA2EO.js} +1 -1
- package/dist/{chunk-KLYGMYXV.js → chunk-C2HJEGTS.js} +1 -1
- package/dist/chunk-C72QNK6O.js +4 -0
- package/dist/chunk-CDSDQTNB.js +16 -0
- package/dist/chunk-CEQGOCKX.js +1 -0
- package/dist/{chunk-QBE6XVU3.js → chunk-CIGWIKOW.js} +1 -1
- package/dist/chunk-CQAD5WML.js +1 -0
- package/dist/chunk-CRQQCT7F.js +1 -0
- package/dist/chunk-CZNUBAAG.js +3 -0
- package/dist/{chunk-WQOPLNDH.js → chunk-D7IMC2G4.js} +1 -1
- package/dist/{chunk-LGXNXAQA.js → chunk-DC7ITY6T.js} +1 -1
- package/dist/{chunk-7GHSE7SG.js → chunk-DDRP6QTC.js} +1 -1
- package/dist/{chunk-4EDE3UH7.js → chunk-DDZYIC76.js} +2 -2
- package/dist/chunk-DGIIUQH3.js +1 -0
- package/dist/{chunk-5AWELO3D.js → chunk-DMOLPSXF.js} +1 -1
- package/dist/{chunk-GSGCSBRN.js → chunk-DOLVBTCB.js} +1 -1
- package/dist/{chunk-MXXMIPUN.js → chunk-DTKGI43P.js} +2 -2
- package/dist/{chunk-37P5YOP2.js → chunk-DVD7I2TX.js} +2 -2
- package/dist/chunk-DVFVO6ZE.js +2 -0
- package/dist/{chunk-7U2MTK6I.js → chunk-DXEMSLI6.js} +1 -1
- package/dist/chunk-EDWIWZWM.js +15 -0
- package/dist/chunk-ELR6AZT4.js +9 -0
- package/dist/chunk-EVQPYZ7F.js +5 -0
- package/dist/chunk-F5QKMDP3.js +1 -0
- package/dist/{chunk-J5DUFSR4.js → chunk-F6IQWX2F.js} +1 -1
- package/dist/{chunk-XZLM4HLO.js → chunk-FAVPTYIR.js} +1 -1
- package/dist/{chunk-Q7BOSHWX.js → chunk-FDSNRKGQ.js} +1 -1
- package/dist/{chunk-DVW7NDVD.js → chunk-FHKK3QU7.js} +1 -1
- package/dist/chunk-FKKJQGYX.js +7 -0
- package/dist/chunk-FQLXQ7WN.js +16 -0
- package/dist/{chunk-6PUU6ZNQ.js → chunk-FRWQJAW2.js} +1 -1
- package/dist/{chunk-AIEVQSI3.js → chunk-FU7PYW7H.js} +1 -1
- package/dist/{chunk-5YUDEPEY.js → chunk-FYQE5E6U.js} +1 -1
- package/dist/chunk-G3EWGBXR.js +1 -0
- package/dist/chunk-G3RNO2TC.js +1 -0
- package/dist/{chunk-7NYCJG2U.js → chunk-GGCP2TIK.js} +1 -1
- package/dist/chunk-GSFWBFFH.js +1 -0
- package/dist/{chunk-NUCDRKDW.js → chunk-H2KGP2FM.js} +2 -2
- package/dist/{chunk-PVASYKSJ.js → chunk-H4K3F7PP.js} +1 -1
- package/dist/chunk-HGZ2HRPO.js +13 -0
- package/dist/chunk-HMPRWNGG.js +203 -0
- package/dist/chunk-HP4QYSBQ.js +1 -0
- package/dist/{chunk-LR4J4KYJ.js → chunk-HSTZV6H7.js} +2 -2
- package/dist/{chunk-ZHHTQRWU.js → chunk-HVUMVDUG.js} +1 -1
- package/dist/{chunk-IY5EI5V2.js → chunk-HYCNYUHW.js} +1 -1
- package/dist/{chunk-FHNJLON5.js → chunk-I3WRA2LH.js} +1 -1
- package/dist/{chunk-MS7DTL4U.js → chunk-IRLYC626.js} +2 -2
- package/dist/chunk-IWNFPBH2.js +33 -0
- package/dist/{chunk-EA5XVQJT.js → chunk-JALDNBTU.js} +1 -1
- package/dist/{chunk-ZTZGDZCE.js → chunk-JC37YZ4I.js} +1 -1
- package/dist/{chunk-DM7BTMFP.js → chunk-JG4FAT2T.js} +1 -1
- package/dist/chunk-JGLLABZR.js +8 -0
- package/dist/chunk-JIY6XWSC.js +1 -0
- package/dist/{chunk-VG2AESTZ.js → chunk-JIYCZXK5.js} +1 -1
- package/dist/chunk-JMSAHCBU.js +35 -0
- package/dist/{chunk-CWR3IFXD.js → chunk-JNSVKDBY.js} +1 -1
- package/dist/chunk-JQU2BJDH.js +3 -0
- package/dist/chunk-JVY6CCLE.js +3 -0
- package/dist/{chunk-BAHIL37I.js → chunk-K4QJEQI4.js} +1 -1
- package/dist/chunk-KCAWHJGF.js +1 -0
- package/dist/{chunk-M73IECPW.js → chunk-KFO2JNF5.js} +1 -1
- package/dist/chunk-KFR7HWCG.js +9 -0
- package/dist/{chunk-QYFU363G.js → chunk-KHZF73BL.js} +1 -1
- package/dist/{chunk-HT66BOEC.js → chunk-KM4LE7K4.js} +2 -2
- package/dist/{chunk-IILLQOUC.js → chunk-L2PUDV7Y.js} +1 -1
- package/dist/chunk-LFBFPK22.js +1 -0
- package/dist/{chunk-BN7ZXAZJ.js → chunk-LG3KEHGD.js} +2 -2
- package/dist/chunk-LGDWE3H3.js +1 -0
- package/dist/chunk-LPPEAMI6.js +1 -0
- package/dist/chunk-LXIWMYM4.js +1 -0
- package/dist/chunk-MGWCXTGD.js +1 -0
- package/dist/chunk-MGX7UG44.js +1 -0
- package/dist/chunk-MKFRKNHF.js +3 -0
- package/dist/chunk-MTT6EAQO.js +1 -0
- package/dist/{chunk-75LAVRRL.js → chunk-MU7IVBGI.js} +2 -2
- package/dist/{chunk-36TZ447N.js → chunk-MYMBHVC4.js} +1 -1
- package/dist/chunk-MZDBH4XV.js +4 -0
- package/dist/{chunk-3G2PEYPI.js → chunk-NUBJ2HK7.js} +1 -1
- package/dist/{chunk-K3YALQBQ.js → chunk-NY5N4ANL.js} +1 -1
- package/dist/{chunk-364BVGRY.js → chunk-NYMKGE3J.js} +1 -1
- package/dist/{chunk-CX5CC6P5.js → chunk-O472FAYX.js} +1 -1
- package/dist/chunk-O7HZ3EIP.js +1 -0
- package/dist/chunk-OJOF6IYG.js +9 -0
- package/dist/{chunk-EXTVC33U.js → chunk-ONZULPQH.js} +68 -66
- package/dist/chunk-ORMXPSJM.js +1 -0
- package/dist/chunk-ORYEDUKM.js +5 -0
- package/dist/{chunk-MZCIRMZJ.js → chunk-OTMYJWIP.js} +1 -1
- package/dist/chunk-OVJVFB5E.js +20 -0
- package/dist/chunk-OWQEFORZ.js +1 -0
- package/dist/{chunk-43HKFLOU.js → chunk-OXPEBT4I.js} +2 -2
- package/dist/chunk-OXZR2MB4.js +6 -0
- package/dist/chunk-OY5M52EF.js +6 -0
- package/dist/{chunk-FK5OFLSJ.js → chunk-PJZZZNWR.js} +1 -1
- package/dist/chunk-Q2LQJYRK.js +16 -0
- package/dist/chunk-QBRRFFMZ.js +1 -0
- package/dist/{chunk-KNQXCU3Y.js → chunk-QCLE5REL.js} +2 -2
- package/dist/chunk-QGQWVA7N.js +1 -0
- package/dist/chunk-QKPAB245.js +1 -0
- package/dist/chunk-QUPZOBTB.js +1 -0
- package/dist/chunk-R4E2E4NN.js +1 -0
- package/dist/{chunk-2M4BKFYF.js → chunk-R6US7F33.js} +1 -1
- package/dist/chunk-RKNVTEO3.js +5 -0
- package/dist/{chunk-2QQ7EBJD.js → chunk-RLOEI6VE.js} +1 -1
- package/dist/chunk-RSZAAN37.js +1 -0
- package/dist/{chunk-WBJ6ZHYH.js → chunk-S3RROJGG.js} +37 -37
- package/dist/chunk-S4KNPCW3.js +81 -0
- package/dist/{chunk-YFRI75U4.js → chunk-SBN3ILXO.js} +1 -1
- package/dist/chunk-SCDGLREP.js +1 -0
- package/dist/chunk-SHOMIS6Q.js +2 -0
- package/dist/chunk-SN3PMWUF.js +6 -0
- package/dist/chunk-SODCXZ5U.js +1 -0
- package/dist/chunk-SPJM7RTD.js +1 -0
- package/dist/chunk-SQL67BKI.js +5 -0
- package/dist/{chunk-MMUGP3WP.js → chunk-SURFUFAZ.js} +1 -1
- package/dist/{chunk-KOTZSPZA.js → chunk-SVQDMZJO.js} +1 -1
- package/dist/chunk-T4ZOTYOY.js +1 -0
- package/dist/chunk-T6C4WC3Z.js +2 -0
- package/dist/chunk-TD6JBHUS.js +1 -0
- package/dist/chunk-TIM4CIXZ.js +22 -0
- package/dist/{chunk-V2FCZC7U.js → chunk-TP7CTMMT.js} +1 -1
- package/dist/chunk-TSPJAMYB.js +1 -0
- package/dist/chunk-TSVEV2UD.js +26 -0
- package/dist/chunk-TTAT62N3.js +25 -0
- package/dist/{chunk-ZVEBXHEY.js → chunk-TUSS6PXB.js} +1 -1
- package/dist/chunk-TXP6KFWO.js +5 -0
- package/dist/chunk-TZHVCMZN.js +6 -0
- package/dist/chunk-UC4TOM36.js +3 -0
- package/dist/{chunk-2YGPWG3I.js → chunk-UFY4L5KQ.js} +1 -1
- package/dist/chunk-UU6UQ2QY.js +1 -0
- package/dist/chunk-V4FC72R6.js +1 -0
- package/dist/chunk-VA2S7W7H.js +10 -0
- package/dist/chunk-VE3IIC7H.js +1 -0
- package/dist/{chunk-EH22T4FI.js → chunk-VJG7VXFU.js} +2 -2
- package/dist/chunk-VQSRU5XL.js +4 -0
- package/dist/chunk-VRIFLMA3.js +70 -0
- package/dist/chunk-WBJFTCEJ.js +1 -0
- package/dist/chunk-WBPP6PO7.js +31 -0
- package/dist/chunk-WE5KY6T6.js +1 -0
- package/dist/chunk-WFPVT2IY.js +1 -0
- package/dist/{chunk-ETXBF6Q7.js → chunk-WLYXBQ2M.js} +1 -1
- package/dist/chunk-WNVOEE6T.js +7 -0
- package/dist/chunk-WPDJVUTY.js +47 -0
- package/dist/chunk-WWCYEZUU.js +1 -0
- package/dist/chunk-WWVDZ3GC.js +3 -0
- package/dist/{chunk-CXPYOLGM.js → chunk-WZBZ7FWP.js} +2 -2
- package/dist/chunk-XEZPN5TR.js +22 -0
- package/dist/{chunk-AQ34X5B3.js → chunk-XLMKHTJ5.js} +1 -1
- package/dist/chunk-XRNBCV2B.js +1 -0
- package/dist/{chunk-B4ISKIXN.js → chunk-XWLNCBAG.js} +1 -1
- package/dist/chunk-YF4AXKM4.js +1 -0
- package/dist/chunk-YKDRUAY3.js +857 -0
- package/dist/{chunk-FPOZMNT2.js → chunk-YNFQBYSL.js} +1 -1
- package/dist/{chunk-2CJQQQW4.js → chunk-YNZLLZU2.js} +1 -1
- package/dist/chunk-YOYPYB4H.js +1 -0
- package/dist/{chunk-HF4NDEX3.js → chunk-YR4J46US.js} +1 -1
- package/dist/chunk-YTL45RXR.js +103 -0
- package/dist/chunk-YVPB7OT6.js +6 -0
- package/dist/chunk-YYWSHRO2.js +89 -0
- package/dist/{chunk-5XOEMYEQ.js → chunk-Z5QEXS6F.js} +1 -1
- package/dist/chunk-Z5WFRYVQ.js +6 -0
- package/dist/{chunk-P5W5RVE6.js → chunk-Z6ZRS256.js} +1 -1
- package/dist/chunk-ZMOW2YZ4.js +18 -0
- package/dist/chunk-ZMU4EYXT.js +1 -0
- package/dist/{chunk-ACA2BGAD.js → chunk-ZNEPRGFY.js} +1 -1
- package/dist/chunk-ZXZWMXXK.js +7 -0
- 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-next.js +1 -0
- 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.d.ts +10 -10
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.d.ts +7 -7
- 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.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -7
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -7
- 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.d.ts +21 -21
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.d.ts +23 -23
- 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.d.ts +90 -90
- 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.d.ts +7 -7
- 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.d.ts +24 -24
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.d.ts +7 -7
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli-version-check-V25AVSZ6.js +1 -0
- package/dist/{command-event-context-LFUZ7UCA.js → command-event-context-ILIANB5Q.js} +1 -1
- package/dist/command-json-schema-C5UZXP2W.js +1 -0
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-OCGEEV4U.js +1 -0
- package/dist/custom-oclif-loader-ZVUKMRGH.js +1 -0
- package/dist/data/filters.json +41 -2
- package/dist/data/local_block_entry.json +1 -1
- package/dist/data/manifest_theme.json +1 -0
- package/dist/data/objects.json +78 -36
- package/dist/data/section.json +1 -1
- package/dist/data/shopify_system_translations.json +240 -23
- package/dist/data/strict_settings.json +24 -0
- package/dist/data/tags.json +57 -24
- package/dist/data/theme_block.json +1 -1
- package/dist/deprecations-A5AXXKIK.js +1 -0
- package/dist/dist-NORLLIHQ.js +1 -0
- package/dist/dist-XBM4XZS4.js +1 -0
- package/dist/environment-5P7JJ3GI.js +1 -0
- package/dist/environments-Y5JEI3U3.js +1 -0
- package/dist/error-GI4DXVDU.js +1 -0
- package/dist/error-handler-BS2ZENQV.js +1 -0
- package/dist/fs-UOOLPOHJ.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +2 -2
- 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/http-2OXOS2AW.js +1 -0
- package/dist/http-proxy-node16-NZZ674YW.js +38 -0
- package/dist/index.js +12 -12
- package/dist/is-global-CI77T7NE.js +1 -0
- package/dist/json-error-6PBUR4LQ.js +1 -0
- package/dist/latest-version-75YEFEMK.js +9 -0
- package/dist/lib-4JVADMNT.js +1 -0
- package/dist/lib-L4STV5B2.js +1 -0
- package/dist/lib-LEEN55OD.js +1 -0
- package/dist/{local-KA3IWOZ6.js → local-5NIWPWDS.js} +1 -1
- package/dist/metadata-IXPNNPNJ.js +1 -0
- package/dist/{morph-CRY35DIK.js → morph-H7XQP55V.js} +3 -3
- package/dist/node-package-manager-ALFEGGD6.js +1 -0
- package/dist/notifications-system-FQW3GKH2.js +1 -0
- package/dist/{npa-A4YSCQ5Q.js → npa-LVYMN7GE.js} +1 -1
- package/dist/os-6TNQTEUN.js +1 -0
- package/dist/output-LEOB5LAM.js +1 -0
- package/dist/{prettier-EGVCP5CY.js → prettier-VLTY4MIE.js} +1 -1
- package/dist/registry-auth-token-EDH77OOW.js +1 -0
- package/dist/registry-url-JMNV3LLX.js +1 -0
- package/dist/semver-HHZRKD6Y.js +1 -0
- package/dist/system-J4CTESP5.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-YDUI56E3.js +1 -0
- package/dist/upgrade-LBCZORG2.js +1 -0
- package/dist/version-2YL4YEQ2.js +1 -0
- package/dist/version-X2CPQVWQ.js +1 -0
- package/dist/workerd-5UPTEWNI.js +18 -0
- package/oclif.manifest.json +25622 -1132
- package/package.json +7 -7
- package/dist/analytics-RSUIYNLC.js +0 -1
- package/dist/analytics-V2SDYXQJ.js +0 -1
- package/dist/chunk-2AW3KBTP.js +0 -1
- package/dist/chunk-2M535QQJ.js +0 -6
- package/dist/chunk-2NZ7GDDR.js +0 -2
- package/dist/chunk-2RFCYZMG.js +0 -47
- package/dist/chunk-2S5NPJEJ.js +0 -5
- package/dist/chunk-2TPLPZA2.js +0 -3
- package/dist/chunk-32O27NE3.js +0 -1
- package/dist/chunk-335BUVBP.js +0 -1
- package/dist/chunk-46JYM3GH.js +0 -1
- package/dist/chunk-4GQEXVDT.js +0 -1
- package/dist/chunk-4IUXLUFD.js +0 -6
- package/dist/chunk-4QZ6OBXL.js +0 -4
- package/dist/chunk-4SDCXKYR.js +0 -31
- package/dist/chunk-5AQ5JT2V.js +0 -7
- package/dist/chunk-5D4FNAAD.js +0 -3
- package/dist/chunk-5TWYJQQO.js +0 -1
- package/dist/chunk-5YXYYQBX.js +0 -1
- package/dist/chunk-6JZC6UKY.js +0 -20
- package/dist/chunk-6Y6A2QGK.js +0 -3
- package/dist/chunk-7AWAOPLA.js +0 -1
- package/dist/chunk-7XAEI4XT.js +0 -3
- package/dist/chunk-A7LBGXWG.js +0 -1
- package/dist/chunk-ADVLRSSO.js +0 -1
- package/dist/chunk-AOBE6HN6.js +0 -31
- package/dist/chunk-B2VE7WOX.js +0 -1
- package/dist/chunk-BB7GAZP6.js +0 -1
- package/dist/chunk-BNTOGZLY.js +0 -1
- package/dist/chunk-BOAGJ6P5.js +0 -1
- package/dist/chunk-BU3JQM3W.js +0 -1
- package/dist/chunk-C3LL5CZA.js +0 -1
- package/dist/chunk-CFUZ6574.js +0 -15
- package/dist/chunk-CKVVJ4XO.js +0 -1
- package/dist/chunk-CNPBDSDL.js +0 -1
- package/dist/chunk-DTRENW4Q.js +0 -272
- package/dist/chunk-E3CTHNQS.js +0 -1
- package/dist/chunk-FFSDGRAN.js +0 -1
- package/dist/chunk-FNWXMCSD.js +0 -97
- package/dist/chunk-FS5PZCZ3.js +0 -1
- package/dist/chunk-FTHVOIK7.js +0 -4
- package/dist/chunk-FVRI7ZKE.js +0 -103
- package/dist/chunk-FZCGRIOM.js +0 -1
- package/dist/chunk-GCKGQFV7.js +0 -1
- package/dist/chunk-GGJUPL4W.js +0 -6
- package/dist/chunk-GHU6YEXH.js +0 -15
- package/dist/chunk-GNPIKPHB.js +0 -1
- package/dist/chunk-H57KYDEI.js +0 -16
- package/dist/chunk-HB3MJYBK.js +0 -1
- package/dist/chunk-HNU6R7RT.js +0 -7
- package/dist/chunk-HPT3UXZ5.js +0 -4
- package/dist/chunk-HXNGLDMU.js +0 -1
- package/dist/chunk-IAL6IQYW.js +0 -16
- package/dist/chunk-IULZYDCI.js +0 -9
- package/dist/chunk-IWTOC6DG.js +0 -1
- package/dist/chunk-J3JPJCWP.js +0 -1
- package/dist/chunk-J3UXIC23.js +0 -10
- package/dist/chunk-J7BTC45S.js +0 -1
- package/dist/chunk-JMVK2BIB.js +0 -3
- package/dist/chunk-JUTULEWW.js +0 -5
- package/dist/chunk-KT5QQOES.js +0 -3
- package/dist/chunk-KVF55INC.js +0 -5
- package/dist/chunk-L6VONMA2.js +0 -5
- package/dist/chunk-LWMKZJ4M.js +0 -1
- package/dist/chunk-M2KX3PXA.js +0 -1
- package/dist/chunk-M7NLCGCP.js +0 -6
- package/dist/chunk-MHWETFNT.js +0 -1
- package/dist/chunk-MNWT2SQO.js +0 -2265
- package/dist/chunk-MU2X7NGF.js +0 -11
- package/dist/chunk-MZWPIFAM.js +0 -70
- package/dist/chunk-NCPZVARH.js +0 -836
- package/dist/chunk-NMECLRGK.js +0 -11
- package/dist/chunk-NMLLRFZF.js +0 -1
- package/dist/chunk-NPB753M3.js +0 -1
- package/dist/chunk-OH7BQZQ7.js +0 -2
- package/dist/chunk-OLKLHVHA.js +0 -22
- package/dist/chunk-OPVXPDOQ.js +0 -1
- package/dist/chunk-OQUXGAF2.js +0 -1
- package/dist/chunk-OUMERKRE.js +0 -10
- package/dist/chunk-OYGIQDME.js +0 -1
- package/dist/chunk-PNZURX3S.js +0 -1
- package/dist/chunk-PRKJVU4Y.js +0 -1
- package/dist/chunk-PXFPVGWV.js +0 -1
- package/dist/chunk-Q2ORJEB2.js +0 -25
- package/dist/chunk-QFWWCZOI.js +0 -1
- package/dist/chunk-QFYLJVJW.js +0 -77
- package/dist/chunk-QX3T6G5X.js +0 -1
- package/dist/chunk-RDXLDCMI.js +0 -3
- package/dist/chunk-REDUS6EW.js +0 -1
- package/dist/chunk-RFZNFTVM.js +0 -1
- package/dist/chunk-RIG66DIQ.js +0 -18
- package/dist/chunk-RNUEPPVN.js +0 -1
- package/dist/chunk-RWTAPWLJ.js +0 -3
- package/dist/chunk-T5YVYVSW.js +0 -1
- package/dist/chunk-UDPYSL3M.js +0 -4
- package/dist/chunk-ULMNNGGX.js +0 -6
- package/dist/chunk-URCH4ITT.js +0 -1
- package/dist/chunk-UU2R56LN.js +0 -12
- package/dist/chunk-V75WUEFU.js +0 -1
- package/dist/chunk-VXD26GIG.js +0 -1
- package/dist/chunk-W7S6SYBM.js +0 -2
- package/dist/chunk-WAY723TL.js +0 -16
- package/dist/chunk-WFOU5M4H.js +0 -16
- package/dist/chunk-WGOSE3RL.js +0 -4
- package/dist/chunk-WQ6W725N.js +0 -1
- package/dist/chunk-X7DCL5LT.js +0 -1
- package/dist/chunk-XDXHSGDL.js +0 -1
- package/dist/chunk-XKKKMV46.js +0 -6
- package/dist/chunk-XRVJJG6W.js +0 -26
- package/dist/chunk-XV6XCOTG.js +0 -319
- package/dist/chunk-XYFYQWKW.js +0 -1
- package/dist/chunk-YCUEDZDA.js +0 -1
- package/dist/chunk-YQ63ZFYT.js +0 -1
- package/dist/chunk-YXIFSIRX.js +0 -1
- package/dist/chunk-ZDQO6CNY.js +0 -1
- package/dist/chunk-ZGASBRSQ.js +0 -5
- package/dist/command-json-schema-6EGXCM4B.js +0 -1
- package/dist/conf-store-E7ELDWBA.js +0 -1
- package/dist/custom-oclif-loader-FKFZJPHF.js +0 -1
- package/dist/deprecations-RNGBHZYB.js +0 -1
- package/dist/dist-VHIZZDYK.js +0 -1
- package/dist/dist-WXI5YQYP.js +0 -1
- package/dist/environment-O7ECODHU.js +0 -1
- package/dist/environments-WZJ6MRTH.js +0 -1
- package/dist/error-IFB626JA.js +0 -1
- package/dist/error-handler-OVJYVIOZ.js +0 -1
- package/dist/fs-7UOUHJDO.js +0 -1
- package/dist/http-proxy-node16-D3JUYA5D.js +0 -38
- package/dist/is-global-XW3CVHLK.js +0 -1
- package/dist/json-error-C2U7ZLCG.js +0 -1
- package/dist/latest-version-LDWU5F7A.js +0 -49
- package/dist/lib-PJHT4MKY.js +0 -1
- package/dist/lib-VKSQ65BQ.js +0 -1
- package/dist/lib-YEZOHXF3.js +0 -1
- package/dist/metadata-6JI7HF5B.js +0 -1
- package/dist/node-package-manager-X3QIEMMX.js +0 -1
- package/dist/notifications-system-OXGLT2R4.js +0 -1
- package/dist/os-NORIEVMI.js +0 -1
- package/dist/output-K3JTLRJD.js +0 -1
- package/dist/system-LTHR2T7L.js +0 -1
- package/dist/ui-MYUBVKCK.js +0 -1
- package/dist/upgrade-MFTWBXL3.js +0 -1
- package/dist/version-BNGPPAUU.js +0 -1
- package/dist/version-RCGFWSB4.js +0 -1
- package/dist/workerd-ISSXMKIH.js +0 -18
- /package/dist/{chunk-YLQ3LNNY.js → chunk-2S3FHQFS.js} +0 -0
- /package/dist/{chunk-YRHFPXC3.js → chunk-Z2AV4BWZ.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{a as U,b as F}from"./chunk-YF4AXKM4.js";import{a as at}from"./chunk-KHZF73BL.js";import{c as ct}from"./chunk-WBJFTCEJ.js";import{b as Xe,c as Qe,d as Ze,e as et,f as tt,h as rt,i as ot,l as nt,m as it,o as st}from"./chunk-YTL45RXR.js";import{a as Ue}from"./chunk-YNZLLZU2.js";import{d as je,f as j,p as qe,q as xe}from"./chunk-WPDJVUTY.js";import{c as Je,d as Ve,e as ze}from"./chunk-XLMKHTJ5.js";import{a as Ke}from"./chunk-R6US7F33.js";import{a as Be}from"./chunk-7N7KRZOM.js";import{k as Y,l as Ye,n as T}from"./chunk-DVFVO6ZE.js";import{p as We,s as X,u as M,v as Me}from"./chunk-CZNUBAAG.js";import{a as Ne,b as Ge}from"./chunk-BPKQA2EO.js";import{p as Re,t as De,u as _e,v as $e,x as He}from"./chunk-FDSNRKGQ.js";import{a as Dt}from"./chunk-7DBKSSDK.js";import{a as lt}from"./chunk-KFO2JNF5.js";import{Ca as ye,Ga as W}from"./chunk-YKDRUAY3.js";import{b as Oe,c as Ce,e as Le}from"./chunk-DMOLPSXF.js";import{B as Pe,C as Ee,M as Ae,S as Fe,U as Ie,v as be,x as ke,y as Se,z}from"./chunk-2KUM2RU4.js";import{c as we}from"./chunk-25MYHE4W.js";import{b as H,d as ue}from"./chunk-QBRRFFMZ.js";import{a as le}from"./chunk-LG3KEHGD.js";import{d as ge,e as ve}from"./chunk-I3WRA2LH.js";import{i as k}from"./chunk-TD6JBHUS.js";import{Aa as fe,Ba as he,Bb as B,Eb as S,Kb as Te,gb as N,hb as G,la as ce,tb as R,va as me,vb as K,xa as J,ya as de}from"./chunk-ZMOW2YZ4.js";import{i as I}from"./chunk-B4OMIONW.js";import{b as O,d as ae,e as C,i as pe,k as V}from"./chunk-3PYDIBTX.js";import{b as Rt}from"./chunk-AE3IQG7S.js";import{c as L}from"./chunk-IWTNUJGY.js";import{e as se,g as y}from"./chunk-VKWPEFWQ.js";y();y();y();import{AsyncLocalStorage as _t}from"node:async_hooks";import{Writable as $t}from"node:stream";import{format as Ht}from"node:util";var mt=new _t;async function dt(t,e,o=!1){let r=t.tee(new $t({write:(a,m,d)=>d()}),{stringWritesAreMessages:!0}),n=console.warn,s=!0;console.warn=c;try{return await mt.run(r,()=>N({consoleWarn:l},()=>pe({outputMode:o?"json":"text",sink:(a,m)=>{s&&a.message&&(o||a.type==="progress")&&r.write(a.message),!o&&!m?.alreadyRendered&&we(a)}},e)))}finally{s=!1,i()}function i(){console.warn=n}function c(...a){if(s&&mt.getStore()===r){l(Ht(...a));return}n(...a)}function l(a){if(s&&r.write(a),s&&o)return;(console.warn===c?n:console.warn)(a)}}y();y();y();var ft={workPromise:Promise.resolve()};async function ht(t,e,o,r,n){if(n.signal?.throwIfAborted(),o.length===0)return ft;S("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:s,filesOnlyPresentOnRemote:i,filesWithConflictingChecksums:c}=Nt(o,r),l=s.length===0&&i.length===0&&c.length===0;if(W(`theme-service:theme-reconciliation:manual:${l}`),l)return S("Local and remote checksums match - no need to reconcile theme assets"),ft;let a=await Yt({filesOnlyPresentLocally:s,filesOnlyPresentOnRemote:i,filesWithConflictingChecksums:c},n);return{workPromise:Mt(t,e,r,a,n.signal)}}function Nt(t,e){let o=new Set,r=[],n=[];for(let i of t){o.add(i.key);let c=e.files.get(i.key);c?i.checksum!==c.checksum&&n.push(i):r.push(i)}let s=Array.from(e.files.values()).filter(i=>!o.has(i.key));return{filesOnlyPresentOnRemote:Q(r,e),filesOnlyPresentLocally:Q(s,e),filesWithConflictingChecksums:Q(n,e)}}function Q(t,e){return e.applyIgnoreFilters(t).filter(r=>r.key.endsWith(".json"))}async function Z(t,e,o,r){if(t.length===0)return;if(r){Gt(t,o,r);return}ke({body:{list:{title:e,items:t.map(s=>s.key)}}}),await Ee({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:ee},{label:o.local.label,value:ut}]})===ee?o.remote.callback(t):o.local.callback(t)}function Gt(t,e,o){switch(o){case"keep-remote":e.remote.callback(t);break;case"keep-local":e.local.callback(t);break;case"abort":break}}function Wt(t){let e=[{title:"The files listed below are only present locally.",files:t.filesOnlyPresentLocally},{title:"The files listed below are only present on the remote theme.",files:t.filesOnlyPresentOnRemote},{title:"The files listed below differ between the local and remote versions.",files:t.filesWithConflictingChecksums}];throw new k("Theme JSON files need reconciliation.",e.filter(o=>o.files.length>0).map(o=>`${o.title}
|
|
2
|
+
${o.files.map(r=>`- ${r.key}`).join(`
|
|
3
|
+
`)}`).join(`
|
|
4
|
+
|
|
5
|
+
`))}async function Mt(t,e,o,r,n){n?.throwIfAborted();let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:c}=r,l=s.map(d=>o.delete(d.key)),a=U(i,M,async d=>{let h=await Y(t.id,d.map(w=>w.key),e);return n?.throwIfAborted(),F(h.map(async w=>{if(w)return o.write(w)}))}),m=Ye(t.id,c.map(d=>d.key),e);await F([...l,...a,m])}async function Yt(t,e){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:n}=t,{reconciliationStrategy:s}=e,i=[],c=[],l=[],a={filesOnlyPresentLocally:e.noDelete?[]:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:n},m=Object.values(a).some(d=>d.length>0);return s==="abort"&&m&&Wt(a),e.noDelete||await Z(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:d=>{i.push(...d)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}},s),await Z(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:d=>{c.push(...d)}},local:{label:"Delete files from the remote theme",callback:d=>{l.push(...d)}}},s),await Z(n,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:d=>{c.push(...d)}},local:{label:"Keep the local version",callback:d=>{l.push(...d)}}},s),{localFilesToDelete:i,filesToDownload:c,remoteFilesToDelete:l}}y();import{setTimeout as jt}from"node:timers/promises";var Ut=3e3,te=class extends Error{};function wt(t,e,o,r,n,s){S("Listening for changes in the theme editor");let i=5,c=0,l="",a=o,m=async()=>{await jt(Ut,void 0,{signal:n.signal}),!n.signal?.aborted&&(a=await qt(t,e,a,r,n).then(h=>(c=0,l="",h)).catch(h=>{if(n.signal?.aborted)return a;if(c++,h.message!==l&&(l=h.message,j("Error while polling for changes.",h)),c>=i){let w=new k("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");Pe(w),s(w)}return a}))};return(async()=>{for(;!n.signal?.aborted&&(await m(),!(c>=i)););})().catch(h=>{n.signal?.aborted||s(h)})}async function qt(t,e,o,r,n){n.signal?.throwIfAborted();let s=new Set(r.unsyncedFileKeys),i=pt(o,r,s),c=await T(t.id,e).then(m=>pt(m,r,s));n.signal?.throwIfAborted();let l=Jt(i,c),a=xt(c,i);return await Kt(r,l),n.signal?.throwIfAborted(),await Vt(t,e,r,l,n.signal),await zt(r,a,n),c}function xt(t,e){let o=new Map(t.map(n=>[n.key,n]));return e.filter(n=>o.get(n.key)===void 0)}function Jt(t,e){let o=new Map(t.map(n=>[n.key,n]));return e.filter(n=>{let s=o.get(n.key);if(!s||s.checksum!==n.checksum)return!0})}async function Vt(t,e,o,r,n){let s=r.filter(c=>o.files.get(c.key)?.checksum!==c.checksum),i=U(s,M,async c=>Y(t.id,c.map(l=>l.key),e).then(l=>(n?.throwIfAborted(),F(l.map(async a=>{a&&(await o.write(a),B(V()==="json"?`Synced download ${a.key} from remote theme`:K`• ${X.format(new Date)} Synced ${R.raw("\xBB")} ${R.gray(`download ${a.key} from remote theme`)}`))})))));await F(i)}async function zt(t,e,o){if(o.signal?.throwIfAborted(),!o.noDelete)return F(e.map(r=>t.files.get(r.key)?t.delete(r.key).then(()=>{B(V()==="json"?`Synced remove ${r.key} from local theme`:K`• ${X.format(new Date)} Synced ${R.raw("\xBB")} ${R.gray(`remove ${r.key} from local theme`)}`)}):Promise.resolve()))}async function Kt(t,e){let o=new Map(t.files);await Promise.all(e.map(r=>t.read(r.key)));for(let r of e){let n=o.get(r.key)?.checksum,s=t.files.get(r.key)?.checksum;if(n!==s)throw new te(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function pt(t,e,o){return e.applyIgnoreFilters(t).filter(n=>n.key.endsWith(".json")).filter(n=>!o.has(n.key))}var ut="local",ee="remote";async function yt(t,e,o,r,n,s){S("Initiating theme asset reconciliation process"),await r.ready(),n.signal?.throwIfAborted();let{workPromise:i}=await ht(t,e,o,r,n),c=i.then(async()=>{n.signal?.throwIfAborted();let a=await T(t.id,e);return n.signal?.throwIfAborted(),a}),l=c.then(a=>wt(t,e,a,r,n,s));return{updatedRemoteChecksumsPromise:c,workPromise:i,pollingPromise:l}}import{createServer as Bt}from"node:http";function gt(t,e){let{promise:o,resolve:r,reject:n}=Promise.withResolvers(),s=rt(t,e),i=Xt(t,e,n),c=Promise.all([s,i.workPromise]).then(()=>e.localThemeFileSystem.startWatcher(t.id.toString(),e.session)),l=Zt(t,e,c,n);return{workPromise:c,serverStart:l.start,serverStop:async()=>{await l.close(),await i.stopPromise},dispatchEvent:l.dispatch,renderDevSetupProgress:i.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Xt(t,e,o){let r=a=>(e.signal?.aborted||j("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),s=T(t.id,e.session).then(a=>(e.signal?.throwIfAborted(),Qt(t,e,a,o))),i=s.then(async({updatedRemoteChecksumsPromise:a})=>{let m=await a;return e.signal?.throwIfAborted(),at(t,e.session,m,e.localThemeFileSystem,{nodelete:e.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})}),c=i.then(a=>a.workPromise).catch(r),l=s.then(({workPromise:a,pollingPromise:m})=>Promise.allSettled([a,m])).catch(()=>{});return{workPromise:c,stopPromise:l,renderProgress:async()=>{if(e.options.themeEditorSync){let{workPromise:m}=await s;await ze([{title:"Performing file synchronization. This may take a while...",task:async()=>{await m}}])}let{renderThemeSyncProgress:a}=await i;await a()}}}function Qt(t,e,o,r){return e.options.themeEditorSync?yt(t,e.session,o,e.localThemeFileSystem,{noDelete:e.options.noDelete,ignore:e.options.ignore,only:e.options.only,reconciliationStrategy:e.options.reconciliationStrategy,signal:e.signal},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve(),pollingPromise:Promise.resolve()})}function Zt(t,e,o,r){let n=$e(),s=[`http://${e.options.host}:${e.options.port}`,`https://${e.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];n.use(et(e.options.host,e.options.port)),n.use(_e(async()=>(await o,De(l=>{l.node.req.headers.origin&&Re(l,{origin:m=>s.includes(m),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),e.options.liveReload!=="off"&&n.use(ot(t,e)),n.use(Ze(t,e)),n.use(Xe(t,e)),n.use(Qe(t,e,r));let i=Bt(He(n)),c=async()=>{i.closeAllConnections(),await new Promise(l=>i.close(()=>l()))};return{dispatch:n.handler.bind(n),close:c,start:async()=>(e.signal?.throwIfAborted(),new Promise((l,a)=>{i.once("error",a),i.listen({port:e.options.port,host:e.options.host,signal:e.signal},()=>{i.off("error",a),l({close:c})})}))}}y();y();import{createWriteStream as er}from"fs";import{Writable as tr}from"stream";import{finished as rr}from"stream/promises";import{StringDecoder as or}from"string_decoder";import{once as nr}from"events";var x=le({name:"DevInstanceLogEntry",schema:O.object({timestamp:ae,source:O.string().optional().describe("What produced the line, for example a process prefix like web or extensions, when needed."),level:O.enum(["debug","info","warning","error"]).optional(),message:O.string()}).strict()});function bt({logFile:t,logOutput:e,isActive:o,onError:r}){let n=er(t,{flags:"w",mode:384});n.on("error",r),e?.on("error",r);let s=nr(n,"open"),i=new Set,c=async l=>{if(!o())return;let a=x.validate({...l,timestamp:l.timestamp??C(new Date)}),m=`${JSON.stringify(a)}
|
|
6
|
+
`;try{await q(n,m),e&&await q(e,m)}catch(d){throw r(d),d}};return{opened:s,log:c,tee:(l,{source:a,stringWritesAreMessages:m=!1})=>{let d=new or("utf8"),h="",w=a,E=async p=>{let f=p.split(/\r?\n/);h=f.pop()??"",await Promise.all(f.map(async u=>{let v=Te(u).trimEnd();v.length>0&&await c({source:w,message:v})}))},P=()=>E(`${h}${d.end()}
|
|
7
|
+
`),b=new re({decodeStrings:!m,write(p,f,u){let v=a===void 0?void 0:G()?.outputPrefix??a,_=m&&typeof p=="string",$=v!==w||_?P():Promise.resolve();w=v,Promise.all([$,q(l,p,f),E(h+d.write(typeof p=="string"?Buffer.from(p,f):p)+(_?`
|
|
8
|
+
`:""))]).then(()=>u()).catch(u)},final(p){P().then(()=>p()).catch(p)}}),A=p=>b.destroy(p);return l.on("error",A),b.on("error",p=>r(p)),b.once("close",()=>{l.off("error",A)}),i.add(b),b},flush:()=>Promise.allSettled([...i].map(l=>vt(l))),close:async()=>{try{await vt(n),e&&!e.destroyed&&await q(e,"")}finally{e?.off("error",r)}}}}var re=class extends tr{contexts=[];constructor(e){super({...e,write:(o,r,n)=>{N(this.contexts.shift()??{},()=>e.write.call(this,o,r,n))}})}write(e,o,r){return this.contexts.push(G()),typeof o=="string"?super.write(e,o,r):super.write(e,o??r)}end(e,o,r){return e!=null&&typeof e!="function"&&this.contexts.push(G()),typeof e=="function"?super.end(e):typeof o=="string"?super.end(e,o,r):super.end(e,o??r)}};async function q(t,e,o="utf8"){await new Promise((r,n)=>{t.write(e,o,s=>s?n(s):r())})}async function vt(t){let e=rr(t,{cleanup:!0});t.end(),await e}var St=se(Dt());import oe,{readFileSync as ir}from"fs";import{mkdir as sr,rmdir as ar,writeFile as lr}from"fs/promises";var ne="dev_instance_already_running",cr="dev",mr=15e3;function dr(t){let e=L(t.directory,".shopify",cr),o=pr(t);return{folder:e,infoFile:L(e,`${o}.json`),lockFile:L(e,`${o}.lock`),logFile:L(e,`${o}.jsonl`)}}async function fr(t){let e=dr(t);await lt(t.directory),await me(e.folder);let o=`${e.lockFile}.acquire`;try{await sr(o,{mode:448})}catch(r){if(r.code!=="EEXIST")throw r;let n=new k(`Another \`shopify ${t.command}\` is starting, or a previous startup was interrupted.`,"Wait for other starts to finish. If none is running, remove the startup lock below and try again.",[["Startup lock",{filePath:o}]]);throw n.code=ne,n}try{return await hr(t,e)}catch(r){if(!ur(r))throw r;let n=await At(e.infoFile);throw It(t,n&&Et(n.pid)?n:void 0)}finally{await ar(o)}}async function Pt(t,e){let o=await fr(t);try{return await e(o)}finally{await o.release()}}async function hr(t,e){let o=await At(e.infoFile);if(o&&Et(o.pid))throw It(t,o);let r=ue(),n=new AbortController,s=!1,i=()=>{if(s)return!1;try{return JSON.parse(ir(e.infoFile,"utf8")).sessionId===r}catch{return!1}},c=!1,l=f=>{if(!(c&&!i()))try{oe.rmdirSync(f)}catch(u){if(u.code!=="ENOENT")throw u}},a={realpath:!1,lockfilePath:e.lockFile,stale:mr,retries:0,onCompromised:f=>{s=!0,S(`The ${t.command} instance lock was compromised: ${f.message}`),n.abort(new k(`The ${t.command} instance lost its lock.`,"Start the command again."))},fs:{...oe,rmdir:(f,u)=>{if(c&&!i())return u(null);oe.rmdir(f,u)},rmdirSync:l}};o&&await he(e.lockFile,{force:!0});let m=await St.default.lock(e.infoFile,a),d=C(new Date),h={schemaVersion:1,sessionId:r,command:t.command,...t.key?{key:t.key}:{},pid:process.pid,status:"starting",startedAt:d,updatedAt:d,directory:t.directory,logFile:e.logFile,details:{...t.details??{}}},w=Promise.resolve(),E=!1,P=bt({logFile:e.logFile,logOutput:t.logOutput,isActive:()=>!E&&!s,onError:f=>n.abort(f)}),b,A=()=>{!E&&i()&&(l(e.lockFile),fe(e.infoFile))};process.once("exit",A);let p={info:h,paths:e,abortSignal:n.signal,update:async f=>{if(b||s)return;f.status&&(h.status=f.status),f.details&&(h.details={...h.details,...f.details}),h.updatedAt=C(new Date);let u={...h,details:{...h.details}},v=w.then(async()=>{s||await kt(e.infoFile,u)});w=v.catch(()=>{}),await v},log:P.log,tee:P.tee,release:()=>(b??=(async()=>{try{let u=(await P.flush()).find(v=>v.status==="rejected");if(await w,u?.status==="rejected")throw u.reason}finally{E=!0,process.removeListener("exit",A);try{await P.close()}finally{let f=i();await m().catch(u=>S(`Failed to release the dev instance lock: ${u.message}`)),f&&await J(e.infoFile).catch(()=>{})}}})(),b)};try{return await P.opened,await kt(e.infoFile,h),c=!0,p}catch(f){throw await p.release().catch(u=>S(u.message)),await J(`${e.infoFile}.${r}.tmp`),f}}function Et(t){if(!Number.isInteger(t)||t<=0)return!1;try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}async function At(t){try{let e=JSON.parse(await ce(t));return typeof e?.pid=="number"?e:void 0}catch{return}}async function kt(t,e){let o=`${t}.${e.sessionId}.tmp`;await lr(o,`${JSON.stringify(e,null,2)}
|
|
9
|
+
`,{mode:384}),await Ft(o,t)}async function Ft(t,e,o=5){try{await de(t,e)}catch(r){let n=r?.code;if(process.platform!=="win32"||o===0||!["EPERM","EACCES","EBUSY"].includes(n??""))throw r;await Fe(.1),await Ft(t,e,o-1)}}function ur(t){return t?.code==="ELOCKED"}function pr({command:t,key:e}){let o=[t,e].filter(Boolean).join("-").toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,""),r=H(JSON.stringify([t,e??""])).slice(0,4);return`${o}-${r}`}function It(t,e){let o=`shopify ${t.command}`;if(!e){let i=new k(`Another \`${o}\` is starting for this project.`,"Wait a few seconds and try again, or stop the other process first.");return i.code=ne,i}let r=process.platform==="win32"?`taskkill /PID ${e.pid} /F`:`kill ${e.pid}`,n=Object.entries(e.details).filter(([,i])=>typeof i=="string"||typeof i=="number"||typeof i=="boolean").map(([i,c])=>[i,String(c)]),s=new k(`Another \`${o}\` is already running for this project.`,"Use the running instance, or stop it before starting a new one.",[["Read its output in",{filePath:e.logFile}],["Stop it with",{command:r}]],[{body:{tabularData:[["PID",String(e.pid)],["Started",e.startedAt],...n],firstColumnSubdued:!0}}]);return s.code=ne,s.details={instance:e},s}import wr from"readline";var yr="127.0.0.1",gr=9292,Tt=!1;async function Ot(t){!await st(t.directory)&&!await Je(t.force)||(t.password?.startsWith("shpat_")&&z({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
|
|
10
|
+
`,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),t.listing&&await nt(t.directory,t.listing),await Pt({command:"theme dev",directory:t.directory,key:`${t.store}:${t.theme.id}`,logOutput:t.json?process.stdout:void 0,details:{store:t.store,themeId:t.theme.id,themeName:t.theme.name,listing:t.listing}},async e=>{let o=new AbortController,r=()=>o.abort(),n=()=>o.abort(e.abortSignal.reason);process.on("shopify:signal",r),process.on("SIGINT",r),process.on("SIGTERM",r),e.abortSignal.addEventListener("abort",n,{once:!0});try{await dt(e,()=>vr(t,e,o).catch(s=>{if(!o.signal.aborted||s!==o.signal.reason)throw s}),t.json),e.abortSignal.throwIfAborted()}finally{o.abort(),process.off("shopify:signal",r),process.off("SIGINT",r),process.off("SIGTERM",r),e.abortSignal.removeEventListener("abort",n)}}),await br(t.commandConfig,t.adminSession),process.exit(0))}async function vr(t,e,o){let{signal:r}=o,[n,s]=await D(Promise.all([qe(t.adminSession),je(t.adminSession)]),r),i=s?await D(Ue(t.storePassword,t.adminSession.storeFqdn,n),r):void 0;if(r.aborted)return;let c=tt(),l=it(t.directory,{filters:t,listing:t.listing,noDelete:t.noDelete,notify:t.notify,signal:r}),a=t.host??yr,m;if(t.port){if(!await D(Ge(t.port),r))throw new k(`Port ${t.port} is not available. Try a different port or remove the --port flag to use an available port.`);m=t.port}else m=await D(Ne(gr),r);let d={local:`http://${a}:${m}`,giftCard:`http://${a}:${m}/gift_cards/[store_id]/preview`,themeEditor:`https://${t.store}/admin/themes/${t.theme.id}/editor?hr=${m}`,preview:`https://${t.store}/?preview_theme_id=${t.theme.id}`};await e.update({details:{host:a,port:m,urls:d}}),r.throwIfAborted();let h=await D(xe(t.theme.id.toString(),t.adminSession,t.password,i,n,r),r);if(r.aborted)return;let w={signal:r,session:h,localThemeFileSystem:l,localThemeExtensionFileSystem:c,directory:t.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:t["theme-editor-sync"],reconciliationStrategy:t.reconciliationStrategy,host:a,port:m,open:t.open,liveReload:t["live-reload"],standardEventsDevBundle:!0,standardEventsInspector:t["standard-events-inspector"],noDelete:t.noDelete,ignore:t.ignore,only:t.only,errorOverlay:t["error-overlay"]}},{serverStart:E,serverStop:P,workPromise:b,renderDevSetupProgress:A,backgroundJobPromise:p}=gt(t.theme,w),f=!t.json&&Ie(),u=kr(d,w,()=>o.abort()),{promise:v,resolve:_}=Promise.withResolvers(),$=()=>_();r.addEventListener("abort",$,{once:!0});try{f&&(wr.emitKeypressEvents(process.stdin),process.stdin.on("keypress",u));let Lt=async()=>{await A(),!r.aborted&&(await E(),!r.aborted&&(f&&process.stdin.setRawMode(!0),Pr(d),t.open&&Ct(d.local,"development server"),await b,!r.aborted&&await e.update({status:"running"})))};await Promise.race([Promise.all([p,Lt()]),v])}finally{o.abort(),r.removeEventListener("abort",$),process.stdin.off("keypress",u),f&&process.stdin.setRawMode(!1),await P()}}function D(t,e){let{promise:o,reject:r}=Promise.withResolvers(),n=()=>r(e.reason);return e.addEventListener("abort",n,{once:!0}),e.aborted&&n(),Promise.race([t,o]).finally(()=>e.removeEventListener("abort",n))}async function br(t,e){if(!Tt){Tt=!0;try{await ge(()=>({store_fqdn_hash:H(e.storeFqdn)})),await ve(()=>({store_fqdn:e.storeFqdn})),await ye({config:t,exitMode:"ok"})}catch{}}}function kr(t,e,o){let r=be(Ct,100,{leading:!0,trailing:!1});return(n,s)=>{if(s.ctrl&&s.name==="c"){o();return}switch(s.name){case void 0:break;case"t":r(t.local,"localhost");break;case"p":r(t.preview,"theme preview");break;case"e":r(e.lastRequestedPath==="/"?t.themeEditor:`${t.themeEditor}&previewPath=${encodeURIComponent(e.lastRequestedPath)}`,"theme editor");break;case"g":r(t.giftCard,"gift card preview");break;default:break}}}function Ct(t,e){Ae(t).catch(Sr(e))}function Sr(t){return e=>{z({headline:`Failed to open ${t}.`,body:e.stack??e.message})}}function Pr(t){Se({body:[{list:{title:I.bold("Preview your theme ")+I.cyan("(t)"),items:[{link:{url:t.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${I.cyan("(p)")}`,url:t.preview}},{subdued:t.preview}],[{link:{label:`Customize your theme at the theme editor ${I.cyan("(e)")}`,url:t.themeEditor}}],[{link:{label:`Preview your gift cards ${I.cyan("(g)")}`,url:t.giftCard}}]]})}var g=se(Rt(),1);var ie=class extends Me{static get requiresSyncAnalytics(){return!0}static summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";static descriptionWithMarkdown=`
|
|
11
|
+
Uploads the current theme as the specified theme, or a [development theme](https://shopify.dev/docs/themes/tools/cli#development-themes), to a store so you can preview it.
|
|
12
|
+
|
|
13
|
+
This command returns the following information:
|
|
14
|
+
|
|
15
|
+
- A link to your development theme at http://127.0.0.1:9292. This URL can hot reload local changes to CSS and sections, or refresh the entire page when a file changes, enabling you to preview changes in real time using the store's data.
|
|
16
|
+
|
|
17
|
+
You can specify a different network interface and port using \`--host\` and \`--port\`.
|
|
18
|
+
|
|
19
|
+
- A link to the [editor](https://shopify.dev/docs/themes/tools/online-editor) for the theme in the Shopify admin.
|
|
20
|
+
|
|
21
|
+
- A [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with other developers.
|
|
22
|
+
|
|
23
|
+
If you already have a development theme for your current environment, then this command replaces the development theme with your local theme. You can override this using the \`--theme-editor-sync\` flag.
|
|
24
|
+
|
|
25
|
+
> Note: You can't preview checkout customizations using http://127.0.0.1:9292.
|
|
26
|
+
|
|
27
|
+
Development themes are deleted when you run \`shopify auth logout\`. If you need a preview link that can be used after you log out, then you should [share](https://shopify.dev/docs/api/shopify-cli/theme/theme-share) your theme or [push](https://shopify.dev/docs/api/shopify-cli/theme/theme-push) to an unpublished theme on your store.
|
|
28
|
+
|
|
29
|
+
You can run this command only in a directory that matches the [default Shopify theme folder structure](https://shopify.dev/docs/themes/tools/cli#directory-structure).`;static jsonOutputSchema=x;static description=this.descriptionForHelp();static flags={...Oe,...We,...Ce,host:g.Flags.string({description:"Set which network interface the web server listens on. The default value is 127.0.0.1.",env:"SHOPIFY_FLAG_HOST"}),"live-reload":g.Flags.string({description:`The live reload mode switches the server behavior when a file is modified:
|
|
30
|
+
- hot-reload Hot reloads local changes to CSS and sections (default)
|
|
31
|
+
- full-page Always refreshes the entire page
|
|
32
|
+
- off Deactivate live reload`,default:"hot-reload",options:["hot-reload","full-page","off"],env:"SHOPIFY_FLAG_LIVE_RELOAD"}),"error-overlay":g.Flags.string({description:`Controls the visibility of the error overlay when an theme asset upload fails:
|
|
33
|
+
- silent Prevents the error overlay from appearing.
|
|
34
|
+
- default Displays the error overlay.
|
|
35
|
+
`,options:["silent","default"],default:"default",env:"SHOPIFY_FLAG_ERROR_OVERLAY"}),"theme-editor-sync":g.Flags.boolean({description:"Synchronize Theme Editor updates in the local theme files.",env:"SHOPIFY_FLAG_THEME_EDITOR_SYNC"}),"standard-events-inspector":g.Flags.boolean({description:"Inject the standard events inspector into storefront HTML.",env:"SHOPIFY_FLAG_STANDARD_EVENTS_INSPECTOR",default:!1}),"reconciliation-strategy":g.Flags.string({description:"How to resolve JSON conflicts when --theme-editor-sync is enabled. Use keep-local to keep local files, keep-remote to keep remote files, or abort to fail instead of prompting.",options:["keep-local","keep-remote","abort"],env:"SHOPIFY_FLAG_RECONCILIATION_STRATEGY",dependsOn:["theme-editor-sync"]}),port:Le({description:"Local port to serve theme preview from.",env:"SHOPIFY_FLAG_PORT"}),theme:g.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),listing:g.Flags.string({description:"The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.",env:"SHOPIFY_FLAG_LISTING"}),nodelete:g.Flags.boolean({char:"n",description:"Prevents files from being deleted in the remote theme when a file has been deleted locally. This applies to files that are deleted while the command is running, and files that have been deleted locally before the command is run.",env:"SHOPIFY_FLAG_NODELETE"}),only:g.Flags.string({char:"o",multiple:!0,description:"Hot reload only files that match the specified pattern.",env:"SHOPIFY_FLAG_ONLY"}),ignore:g.Flags.string({char:"x",multiple:!0,description:"Skip hot reloading any files that match the specified pattern.",env:"SHOPIFY_FLAG_IGNORE"}),force:g.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"}),notify:g.Flags.string({description:"The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",env:"SHOPIFY_FLAG_NOTIFY"}),open:g.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),"store-password":g.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),"allow-live":g.Flags.boolean({description:"Allow development on a live theme.",char:"a",env:"SHOPIFY_FLAG_ALLOW_LIVE",default:!1})};static multiEnvironmentsFlags=null;async command(e,o){let{ignore:r=[],only:n=[]}=e;W("theme-command:dev:single-env:authenticated");let s,i;if(e.theme){let l={filter:{theme:e.theme}};s=await Be(o,l),i={...e,theme:s.id.toString(),store:o.storeFqdn}}else{s=await new Ke(o).findOrCreate();let l=e["theme-editor-sync"]&&s.createdAtRuntime;i={...e,theme:s.id.toString(),store:o.storeFqdn,"overwrite-json":l}}await Ve(s,"start development mode",e["allow-live"])&&(await Ot({adminSession:o,commandConfig:this.config,directory:i.path,store:i.store,password:i.password,storePassword:i["store-password"],theme:s,listing:i.listing,host:i.host,port:i.port,"live-reload":i["live-reload"],"error-overlay":i["error-overlay"],force:i.force,open:i.open,"theme-editor-sync":i["theme-editor-sync"],"standard-events-inspector":i["standard-events-inspector"],reconciliationStrategy:i["reconciliation-strategy"],noDelete:i.nodelete,ignore:r,only:n,notify:i.notify,json:i.json}),await ct({path:i.path,password:i.password,store:i.store,force:i.force,verbose:i.verbose,noColor:i["no-color"],silent:!0}))}collectsEnvironmentResults(){return!1}};export{x as a,Pt as b,ie as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{p as a}from"./chunk-YKDRUAY3.js";import{i as s}from"./chunk-TD6JBHUS.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var n={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},p={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function c(t,e){let r=T(t);return r===n.LOCALHOST&&e===n.HTTP?!0:r===e}function l(t){return p.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function d(t,e){if(!c(t,e))throw new s(`Can't deliver your webhook payload to this address using '${e}'`,"Use a valid URL for address",f(e));let r=e;return l(t)&&(r=n.LOCALHOST),[t.trim(),r]}function f(t){return t===n.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===n.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===n.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function g(t,e){if(e.includes(t))return t;throw new s(`Api Version '${t}' does not exist`,`Allowed values: ${e.join(", ")}`,["Try again with a valid api-version value"])}function A(t,e,r){if(r.length===0)throw new s(`No topics found for '${e}'`);let o=h(t.trim(),r);if(o===void 0)throw new s(`Topic '${t}' does not exist for ApiVersion '${e}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return o}function h(t,e){return e.includes(t)?t:e.find(r=>r.toUpperCase().replace("/","_")===t)}function T(t){if(t){if(t.startsWith("pubsub:"))return n.PUBSUB;if(t.startsWith("arn:aws:events:"))return n.EVENTBRIDGE;if(l(t))return n.LOCALHOST;if(p.HTTP.test(t))return n.HTTP}}i();async function O(t,e,r){let{sendSampleWebhook:o}=await t.sendSampleWebhook(e,r);return o}i();async function H(t,e,r){let o={method:"POST",body:e,headers:{"Content-Type":"application/json",...JSON.parse(r)}},u=await a(t,o);return u.status>=200&&u.status<300}i();async function m(t,e){let{publicApiVersions:r}=await t.apiVersions(e),o=r.indexOf("unstable");return o===-1?r.sort().reverse():(r.splice(o,1),r.sort().reverse(),r.push("unstable")),r}export{m as a,O as b,H as c,n as d,c as e,d as f,g,A as h,T as i};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as D,b as _,d as W,g as z}from"./chunk-7NRHZG5Y.js";import{a as J}from"./chunk-BPKQA2EO.js";import{t as B}from"./chunk-Z5QEXS6F.js";import{a as Y}from"./chunk-RSZAAN37.js";import{a as H}from"./chunk-ASKBYEO7.js";import{d as K}from"./chunk-JGLLABZR.js";import{B as C,K as O,w as Q}from"./chunk-YKDRUAY3.js";import{b as V,c as N,e as M}from"./chunk-DMOLPSXF.js";import{M as R,a as P}from"./chunk-2KUM2RU4.js";import{a as A}from"./chunk-LG3KEHGD.js";import{Ab as U,Bb as b,Fb as j,tb as k,vb as x,zb as E}from"./chunk-ZMOW2YZ4.js";import{b as a,c as I,d as w,e as F,j as q}from"./chunk-3PYDIBTX.js";import{b as T}from"./chunk-QGQWVA7N.js";import{b as ee}from"./chunk-AE3IQG7S.js";import{e as Z,g as s}from"./chunk-VKWPEFWQ.js";s();s();s();s();var L=I.nullable().describe("The canonical *.myshopify.com hostname, or null when unknown."),y=w,g=A({name:"GraphiQLRecord",definitions:{GraphiQLTimestamp:y,GraphiQLStoreDomain:L},schema:a.discriminatedUnion("type",[a.object({type:a.literal("starting"),timestamp:y,storeDomain:L}).strict(),a.object({type:a.literal("ready"),timestamp:y,url:a.string().url().describe("Local browser URL, including the session authentication key."),storeDomain:L,api:a.literal("admin"),apiVersion:a.string().nullable().describe("Requested API version; null uses the latest stable version."),mutationsAllowed:a.boolean(),app:a.object({name:a.string(),url:a.string().url()}).strict().nullable()}).strict(),a.object({type:a.literal("stopped"),timestamp:y,reason:a.enum(["cancelled","sigint","sigterm","sigquit"])}).strict()])});import{randomBytes as re}from"crypto";function Le(){return re(32).toString("hex")}function te(e){let r=new URL(`http://localhost:${e.port}/graphiql`);return r.searchParams.set("key",e.key),e.query&&r.searchParams.set("query",e.query),e.variables&&r.searchParams.set("variables",e.variables),e.apiVersion&&r.searchParams.set("api_version",e.apiVersion),r.toString()}async function $(e){let r=e.outputFormat==="json",t=O(e.storeFqdn)?e.storeFqdn:null,n=ae(e.abortSignal),o,p=!1,d=!1,c,m=i=>{if(!r)return;let l=F(new Date);E(JSON.stringify(g.validate({...i,timestamp:l})))},f=i=>{c=i,n.controller.abort()},u=()=>{d||f(new Error("The GraphiQL server closed unexpectedly."))},G=()=>{if(c)throw c};try{if(n.controller.signal.aborted)return;m({type:"starting",storeDomain:t});let i=await J(e.port);if(n.controller.signal.aborted||(o=_({stdout:e.stdout??process.stdout,port:i,storeFqdn:e.storeFqdn,tokenProvider:e.tokenProvider,key:e.key,appContext:e.appContext,protectMutations:e.protectMutations,json:r,onRequestError:r?h=>q({type:"diagnostic",level:"error",code:"graphiql-request-failed",message:h}):void 0}),o.on("error",f),o.on("close",u),await oe(o),G(),n.controller.signal.aborted))return;let l=te({port:i,key:e.key,query:e.query,variables:e.variables,apiVersion:e.apiVersion});m({type:"ready",url:l,storeDomain:t,api:"admin",apiVersion:e.apiVersion??null,mutationsAllowed:!e.protectMutations,app:e.appContext?{name:e.appContext.appName,url:e.appContext.appUrl}:null}),r||(b(x`GraphiQL is running at ${k.link(l)}`),e.additionalReadyMessages?.forEach(h=>b(h)),b("Press Ctrl+C to stop.")),T()||await Promise.race([R(l),n.stopped.then(()=>!0)])||j("Browser did not open automatically. Open the URL above manually."),await n.stopped,G()}catch(i){throw p=!0,i}finally{try{if(o){d=!0;let i=o;await new Promise(l=>{i.close(()=>l()),i.closeAllConnections()}),o.removeListener("error",f),o.removeListener("close",u)}p||m({type:"stopped",reason:n.reason()}),r&&await U()}finally{n.dispose()}}}function oe(e){return new Promise(r=>{let t=()=>{e.removeListener("listening",t),e.removeListener("error",t),r()};e.once("listening",t),e.once("error",t)})}function ae(e){let r=new P,t="cancelled",n=process,o=u=>{if(!r.signal.aborted){switch(u){case"SIGINT":t="sigint",process.exitCode=130;break;case"SIGTERM":t="sigterm",process.exitCode=143;break;case"SIGQUIT":t="sigquit",process.exitCode=131;break;default:return}r.abort()}},p=()=>o("SIGINT"),d=()=>o("SIGTERM"),c=()=>o("SIGQUIT"),m=()=>r.abort();process.on("SIGINT",p),process.on("SIGTERM",d),process.on("SIGQUIT",c),n.on("shopify:signal",o),e?.addEventListener("abort",m,{once:!0});let f=new Promise(u=>r.signal.addEventListener("abort",()=>u(),{once:!0}));return e?.aborted&&r.abort(),{controller:r,stopped:f,reason:()=>t,dispose:()=>{process.removeListener("SIGINT",p),process.removeListener("SIGTERM",d),process.removeListener("SIGQUIT",c),n.removeListener("shopify:signal",o),e?.removeEventListener("abort",m)}}}async function X(e){let r=await K(e.remoteApp),t=D(void 0,r,e.store),n=z({apiKey:e.remoteApp.apiKey,apiSecret:r,storeFqdn:e.store}),o=await Q(),p=W(e.store,e.remoteApp.apiKey,o);await $({port:e.port,storeFqdn:e.store,tokenProvider:n,key:t,appContext:{appName:e.remoteApp.title,appUrl:p,apiSecret:r},variables:e.variables,apiVersion:e.apiVersion,outputFormat:e.outputFormat,abortSignal:e.abortSignal})}var v=Z(ee(),1);var S=class e extends Y{static summary="Open a local GraphiQL UI for your app and store.";static descriptionWithMarkdown=`Opens an authenticated Admin API GraphiQL UI for your app and selected store.
|
|
2
|
+
|
|
3
|
+
The app must be installed on the store.`;static jsonOutputSchema=g;static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --store shop.myshopify.com","<%= config.bin %> <%= command.id %> --store shop.myshopify.com --port 9123"];static flags={...V,...N,...H,store:v.Flags.string({char:"s",description:"The myshopify.com domain of the store to open GraphiQL against. The app must be installed on the store. If not specified, you will be prompted to select a store.",env:"SHOPIFY_FLAG_STORE",parse:async r=>C(r)}),port:M({description:"Local port for the GraphiQL server.",env:"SHOPIFY_FLAG_PORT"}),variables:v.Flags.string({char:"v",description:"The values for any GraphQL variables in your query or mutation, in JSON format.",env:"SHOPIFY_FLAG_VARIABLES"}),version:v.Flags.string({description:"The API version to use in GraphiQL. Defaults to the latest stable version.",env:"SHOPIFY_FLAG_VERSION"})};async run(){let{flags:r}=await this.parse(e);return this.runWithParsedOutput(r,async()=>{let{appContextResult:t,store:n}=await B(r);return await X({remoteApp:t.remoteApp,store:n.shopDomain,port:r.port,variables:r.variables,apiVersion:r.version,outputFormat:r.json?"json":"text"}),{app:t.app}})}};export{g as a,Le as b,$ as c,S as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as P}from"./chunk-FRWQJAW2.js";import{a as N}from"./chunk-Z6ZRS256.js";import{a as l}from"./chunk-XLMKHTJ5.js";import{a as U}from"./chunk-YY6TFARF.js";import{a as J,b as _}from"./chunk-7N7KRZOM.js";import{r as O}from"./chunk-DVFVO6ZE.js";import{b as E,c as h,e as R,g as C,h as T}from"./chunk-7HECBXSP.js";import{p as c,v as x}from"./chunk-CZNUBAAG.js";import{b as S,c as j,f as F}from"./chunk-DMOLPSXF.js";import{A as u,D,V as a,y}from"./chunk-2KUM2RU4.js";import{i as v}from"./chunk-TD6JBHUS.js";import{zb as q}from"./chunk-ZMOW2YZ4.js";import{b as t}from"./chunk-3PYDIBTX.js";import{b as k}from"./chunk-AE3IQG7S.js";import{e as L,g as i}from"./chunk-VKWPEFWQ.js";i();i();var d=t.object({id:t.number(),name:t.string(),role:t.string()}),G=d.extend({shop:t.string(),preview_url:t.string().optional()}),B=t.object({status:t.literal("failed"),message:t.string(),errors:t.array(t.string()),requestId:t.string().optional()}),z=t.discriminatedUnion("status",[P.extend({originalTheme:d,theme:G}),B]),p=R({name:"ThemeDuplicateResult",schema:t.object({status:t.literal("success"),changed:t.boolean(),originalTheme:h,theme:h.extend({storeDomain:E,previewUrl:t.string().url().nullable()}).strict()}).strict(),definitions:{Theme:h},project(e){let r=z.parse(e);if(r.status==="failed")throw new TypeError("Failed duplications use the shared fatal error document.");return{status:r.status,changed:!0,originalTheme:T(r.originalTheme),theme:{...T(r.theme),storeDomain:C(r.theme.shop),previewUrl:r.theme.preview_url??null}}}}),A=t.discriminatedUnion("status",[t.object({status:t.literal("missing-theme-id")}),t.object({status:t.literal("not-found"),themeId:t.string()}),t.object({status:t.literal("development-theme")}),t.object({status:t.literal("cancelled")}),t.object({status:t.literal("completed"),originalTheme:d.extend({createdAtRuntime:t.boolean().default(!1),processing:t.boolean().default(!1)}),shop:t.string(),previewUrl:t.string().optional(),theme:d.optional(),userErrors:t.array(t.object({field:t.array(t.string()).nullish(),message:t.string()})),requestId:t.string().optional()})]);i();function w(e){if(e.status==="cancelled")return{status:"cancelled"};let r=M(e);if(r.status==="failed"){let o=new v(r.message.trim());throw o.details={errors:r.errors,...r.requestId?{requestId:r.requestId}:{}},o}return r}function Y(e,r){if(r==="json"){q(p.encode(w(e)));return}if(e.status==="cancelled")return;let o=M(e);o.status==="failed"&&(process.exitCode=1),e.status==="completed"?V(e):"message"in o&&u({body:[o.message]})}function M(e){switch(e.status){case"missing-theme-id":return{status:"failed",message:"A theme ID is required to duplicate a theme, specify one with the --theme flag",errors:[]};case"not-found":return{status:"failed",message:`No theme with ID ${e.themeId} could be found. Use shopify theme list to find a theme ID.`,errors:[]};case"development-theme":return{status:"failed",message:"Development themes can't be duplicated. Use shopify theme push to upload it to the store first.",errors:[]};case"completed":{if(e.userErrors.length>0)return{status:"failed",message:`The theme '${e.originalTheme.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId};if(e.theme){let{id:r,name:o,role:s}=e.theme;return{status:"success",originalTheme:e.originalTheme,theme:{id:r,name:o,role:s,shop:e.shop,preview_url:e.previewUrl}}}return{status:"failed",message:`The theme '${e.originalTheme.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}}}}function V(e){let r=e.originalTheme;if(e.userErrors&&e.userErrors.length>0){let o=e.userErrors.map(s=>s.message).join(", ");u({body:["The theme",...l(r),"could not be duplicated due to errors: ",{subdued:o},{char:"."},...e.requestId?[`
|
|
2
|
+
Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?y({body:["The theme",...l(r),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:e.previewUrl}}]]}):u({body:["The theme",...l(r),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
|
|
3
|
+
Request ID: `,{subdued:e.requestId}]:[]]})}i();async function $(e,r,o,s=!1){let{name:m,force:H}=o,I=a()||!!H||s;if(I&&!r)return{status:"missing-theme-id"};let n=r?await _(e,r):await J(e,{header:"Select a theme to duplicate",filter:{theme:r}});if(!n)return{status:"not-found",themeId:r};if(n?.role==="development")return{status:"development-theme"};if(!I&&!await D({message:`Do you want to duplicate '${n.name}' on ${e.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${n.name}'`,cancellationMessage:"No, cancel duplicate"}))return{status:"cancelled"};let g=await O(n.id,m,e);return A.parse({status:"completed",originalTheme:n,shop:e.storeFqdn,previewUrl:g.theme?U(g.theme,e):void 0,...g})}var f=L(k(),1);var b=class extends x{static jsonOutputSchema=p;static summary="Duplicates a theme from your theme library.";static usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];static descriptionWithMarkdown="If you want to duplicate your local theme, you need to run `shopify theme push` first.\n\nIf no theme ID is specified, you're prompted to select the theme that you want to duplicate from the list of themes in your store. You're asked to confirm that you want to duplicate the specified theme.\n\nPrompts and confirmations are not shown when duplicate is run in a CI environment or the `--force` flag is used, therefore you must specify a theme ID using the `--theme` flag.\n\nYou can optionally name the duplicated theme using the `--name` flag.\n\nIf you use the `--json` flag, then theme information is returned in JSON format, which can be used as a machine-readable input for scripts or continuous integration.\n\nSuccessful JSON results include `status`, `changed`, and explicit `originalTheme` and `theme` resources with decimal string IDs. Failures use the shared `{error}` document.";static description=this.descriptionForHelp();static flags={...S,...j,password:c.password,theme:F(f.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})),name:f.Flags.string({char:"n",description:"Name of the newly duplicated theme.",env:"SHOPIFY_FLAG_NAME"}),store:c.store,environment:c.environment,force:f.Flags.boolean({char:"f",description:"Force the duplicate operation to run without prompts or confirmations. Required if non interactive outside CI.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=["store","password","theme"];static nonTTYFlagRequirements(){return[{flags:["force"],when:()=>!a()}]}async command(r,o,s=!1){N(r);let m=await $(o,r.theme,r,s);if(r.json&&s)return w(m);Y(m,r.json?"json":"text")}requiresEnvironmentConfirmation(r){return!a()&&super.requiresEnvironmentConfirmation(r)}};export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-LG3KEHGD.js";import{b as e}from"./chunk-3PYDIBTX.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();var o=e.object({url:e.string().url().describe("The requested shopify.dev document URL."),content:e.string().describe("The document in Markdown, with the requested language filter applied.")}).strict(),c=e.object({path:e.string().regex(/^(?:\/|[A-Za-z]:[\\/]|\\\\)/).describe("The absolute native path of the written file."),format:e.literal("markdown").describe("The file contains the original Markdown document, not a JSON wrapper.")}).strict(),u=t({name:"DocFetchResult",schema:e.union([e.object({document:o}).strict(),c]),definitions:{Document:o,DocumentFile:c}}),r=e.object({score:e.number().finite().describe("The relevance score returned by shopify.dev."),content:e.string().describe("The matching documentation chunk."),url:e.string().url().describe("The URL of the matching document."),title:e.string().describe("The title of the matching document."),domain:e.string().nullable().describe("The documentation domain, or null when unavailable.")}).strict(),a=e.object({hasNextPage:e.boolean().nullable().describe("Whether more results are available, or null when unknown.")}).strict(),h=t({name:"DocSearchResult",schema:e.object({results:e.array(r).describe("The top matching chunks from one search request."),pageInfo:a}).strict(),definitions:{DocumentationSearchEntry:r,PageInfo:a}});export{u as a,r as b,h as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e}from"./chunk-CZNUBAAG.js";import{b as n}from"./chunk-AE3IQG7S.js";import{e as m,g as t}from"./chunk-VKWPEFWQ.js";t();var l=m(n(),1);async function f(s){let o=s.indexOf("--"),r=(o<0?s:s.slice(0,o)).filter(c=>c==="--allow-custom-checks"||c==="--no-allow-custom-checks"),{flags:a}=await l.Parser.parse(r,{flags:{"allow-custom-checks":e["allow-custom-checks"]}});return{authorizeCustomChecks:()=>a["allow-custom-checks"]===!0}}export{f as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Eb as n,Sa as o,ta as d,tb as e,va as f,vb as r}from"./chunk-ZMOW2YZ4.js";import{c as i}from"./chunk-IWTNUJGY.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var g=".shopify";async function c(h){let t=i(h,g),a=i(t,".gitignore");return await o(t)||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await f(t)),await o(a)||(n(r`Creating .gitignore in ${e.path(t)}...`),await d(a,`# Ignore the entire ${g} directory
|
|
2
2
|
*`)),t}export{c as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as W,b as be,c as j,d as xe}from"./chunk-G3EWGBXR.js";import{f as ye,g as we}from"./chunk-5T3ZT6CC.js";import{q as Y}from"./chunk-TXP6KFWO.js";import{c as ge,d as D,e as P}from"./chunk-Z5WFRYVQ.js";import{a as he}from"./chunk-RSZAAN37.js";import{a as fe}from"./chunk-ASKBYEO7.js";import{P as de}from"./chunk-HMPRWNGG.js";import{b as le,c as pe,f as me}from"./chunk-DMOLPSXF.js";import{E as ae,a as k,d as G,e as x,f as g,g as ne,h as re,i as oe,l as ie,m as se,n as T,s as A}from"./chunk-2KUM2RU4.js";import{a as U}from"./chunk-LG3KEHGD.js";import{i as H,j as ce}from"./chunk-TD6JBHUS.js";import{a as te}from"./chunk-AY3AAV77.js";import{Kb as K,la as B,zb as z}from"./chunk-ZMOW2YZ4.js";import{b as f,d as N,e as Z,j as ee}from"./chunk-3PYDIBTX.js";import{g as ue}from"./chunk-DOLVBTCB.js";import{b as Ae}from"./chunk-AE3IQG7S.js";import{c as q}from"./chunk-IWTNUJGY.js";import{e as J,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();l();l();var E=J(G(),1);import{Writable as Ee}from"stream";function Se({selectedRun:e,abortController:t,app:n,extension:r,appWatcher:i}){let o={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[d,u]=(0,E.useState)([]),[m,c]=(0,E.useState)([o,o]),[w,y]=(0,E.useState)(void 0),{input:b,export:S}=e.payload,[F,R]=(0,E.useState)(`Watching for changes to ${e.source}...`);return(0,E.useEffect)(()=>{let C=new k;t.signal.addEventListener("abort",()=>{C.abort()});let O=async()=>{let a=await De(r,JSON.stringify(b),S);c(h=>[a,h[0]]),R(`Watching for changes to ${e.source}...`),u(h=>[...h,a])},I=async()=>{R("Replaying log with local function..."),await O()},p=async()=>{i.onEvent(async h=>{let L=h.extensionEvents.find(_=>_.extension.handle===r.handle);if(!(!L||L.type!==D.Updated)){if(L.buildResult?.status==="error"){y(`Error while reloading and building extension: ${L.buildResult?.error}`);return}y(void 0),R("Re-running with latest changes..."),await O()}});let a=new Ee({write(h,L,_){u(ke=>[...ke,{type:"systemMessage",message:h.toString()}]),_()}});await i.start({stdout:a,stderr:a,signal:C.signal},!1)};return I().then(()=>{p()}),()=>{C.abort()}},[b,S,n,r]),A(t.signal,async()=>{setTimeout(()=>{ue()||te(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:d,statusMessage:F,recentFunctionRuns:m,error:w}}async function De(e,t,n){let r="",i=new Ee({write(d,u,m){r+=d,m()}});return await be({functionExtension:e,input:t,export:n,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var s=J(G(),1);var Re=({selectedRun:e,abortController:t,app:n,extension:r})=>{let{isAborted:i}=A(t.signal),{isRawModeSupported:o}=re(),d=new P(n),{logs:u,statusMessage:m,recentFunctionRuns:c,error:w}=Se({selectedRun:e,abortController:t,app:n,extension:r,appWatcher:d});return oe((y,b)=>{se(y,b,()=>t.abort()),y==="q"&&t.abort()},{isActive:!!o}),s.default.createElement(s.default.Fragment,null,s.default.createElement(ne,{items:u},(y,b)=>s.default.createElement(x,{key:`replayOutputScrollerLog${b}`,flexDirection:"column"},s.default.createElement(_e,{log:y}))),i?null:s.default.createElement(x,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},o?s.default.createElement(x,{flexDirection:"column"},s.default.createElement(x,{flexDirection:"row"},s.default.createElement(g,null,T.pointerSmall," ",m)),s.default.createElement($e,{recentFunctionRuns:c}),s.default.createElement(g,null,T.pointerSmall," Press ",s.default.createElement(g,{bold:!0},"q")," ",T.lineVertical," quit")):null,w?s.default.createElement(g,{color:"red"},w):null))};function M({title:e,backgroundColor:t}){let n=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(n);return s.default.createElement(g,{backgroundColor:t,color:"black"},`
|
|
2
|
+
|
|
3
|
+
`,r,e,r,`
|
|
4
|
+
`)}function Pe({input:e}){return s.default.createElement(x,{flexDirection:"column"},s.default.createElement(M,{title:"Input",backgroundColor:"yellow"}),s.default.createElement(g,null,Y(e)))}function We({logs:e}){return s.default.createElement(x,{flexDirection:"column"},s.default.createElement(M,{title:"Logs",backgroundColor:"blueBright"}),s.default.createElement(g,null,e))}function je({output:e}){return s.default.createElement(x,{flexDirection:"column"},s.default.createElement(M,{title:"Output",backgroundColor:"greenBright"}),s.default.createElement(g,null,Y(e)))}function Me({functionRun:e}){return s.default.createElement(x,{flexDirection:"column"},s.default.createElement(M,{title:"Benchmark Results",backgroundColor:"green"}),s.default.createElement(g,null,"Name: ",e.name),s.default.createElement(g,null,"Linear Memory Usage: ",e.memory_usage,"KB"),s.default.createElement(g,null,"Instructions: ",e.instructions/1e3,"K"),s.default.createElement(g,null,"Size: ",e.size,"KB"))}function $e({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return s.default.createElement(x,{flexDirection:"column"},s.default.createElement(g,null,T.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function _e({log:e}){switch(e.type){case"functionRun":return s.default.createElement(x,{flexDirection:"column"},s.default.createElement(Pe,{input:e.input}),s.default.createElement(We,{logs:e.logs}),s.default.createElement(je,{output:e.output}),s.default.createElement(Me,{functionRun:e}),s.default.createElement(g,null,"\xA0"));case"systemMessage":return s.default.createElement(g,null,e.message);default:return null}}var Fe=J(G(),1);async function Ce({selectedRun:e,abortController:t,app:n,extension:r}){return ie(Fe.default.createElement(Re,{selectedRun:e,abortController:t,app:n,extension:r}),{exitOnCtrlC:!1})}l();l();l();import{AsyncResource as Ue}from"node:async_hooks";var $=class extends ge{replayContext;startupTask;rescanRequested=!1;startupComplete=!1;pendingChanges=0;changesSettled;observeScan;constructor(t,n){super(t,n),this.replayContext=n}onChange(t){super.onChange(n=>{this.replayContext.signal.aborted||(!this.startupComplete&&n.length>0&&this.pendingChanges++,t(n))})}changeProcessed(){this.pendingChanges>0&&this.pendingChanges--,this.pendingChanges===0&&this.changesSettled?.()}async waitForStartupChanges(){let{signal:t}=this.replayContext;this.pendingChanges>0&&!t.aborted&&await new Promise(n=>{let r=()=>{this.changesSettled=void 0,t.removeEventListener("abort",r),n()};this.changesSettled=r,t.addEventListener("abort",r,{once:!0})}),this.startupComplete=!0}start(){return this.replayContext.signal.aborted?Promise.resolve():(this.rescanRequested=!0,this.startupTask??=this.scan(),this.startupTask)}onWatcherCreated(t,n){return this.observeScan?.(t),Ue.bind(n)}async scan(){let{signal:t}=this.replayContext;try{do{this.rescanRequested=!1;let n=new Promise((r,i)=>{let o,d=()=>{o?.removeListener("ready",u),o?.removeListener("error",m),t.removeEventListener("abort",u)},u=()=>{d(),r()},m=c=>{d(),i(c)};t.addEventListener("abort",u,{once:!0}),this.observeScan=c=>{o=c,t.aborted?c.close().then(u).catch(m):(c.once("ready",u),c.once("error",m))},t.aborted&&u()});await Promise.all([super.start(),n])}while(this.rescanRequested&&!t.aborted)}finally{this.observeScan=void 0,this.startupTask=void 0}}};import{Writable as qe}from"stream";async function Oe({selectedRun:e,app:t,extension:n,abortController:r,onEvent:i}){let{signal:o}=r,d,u=Promise.resolve(),m=!1,c=n,w=!1,y=[],b=new qe({write(p,a,h){i({type:"diagnostic",message:p.toString()}),h()}}),S=new $(t,{stdout:b,stderr:b,signal:o}),F=new P(t,void 0,void 0,S),R=p=>{o.aborted||(d??=p,r.abort())},C=async p=>{if(o.aborted||(i({type:"status",status:"running"}),o.aborted))return;let a=await j({functionExtension:p,input:JSON.stringify(e.payload.input),export:e.payload.export,json:!0});if(!o.aborted){if(a.state!=="completed"){if(a.state==="completed-text")throw new Error("Expected a JSON Function execution.");let h=new ce(a.message,a.command,a.args);throw h.details={exitCode:a.exitCode,stderr:a.stderr},h}for(let h of a.diagnostics){if(o.aborted)return;i({type:"diagnostic",message:h})}o.aborted||i({type:"execution",resultJson:a.resultJson,exitCode:a.exitCode})}},O=p=>(u=u.then(()=>C(p)).catch(a=>{o.aborted||R(a)}),u),I=p=>{if(!o.aborted){if(p.buildResult?.status==="error"){w=!0,i({type:"build",status:"failed",error:p.buildResult.error});return}w=!1,c=p.extension,i({type:"build",status:"success"})}};F.onError(R),F.onEvent(p=>{if(S.changeProcessed(),o.aborted)return;let a=p.extensionEvents.find(({extension:h})=>h.handle===n.handle);if(!(!a||a.type!==D.Updated)){if(!m){y.push(a);return}if(I(a),!w)return O(c)}});try{if(o.aborted)return;if(await F.start({stdout:b,stderr:b,signal:o},!1),await S.waitForStartupChanges(),!o.aborted){i({type:"status",status:"watching"});for(let p of y)I(p);y.length=0,m=!0,w||await O(c),o.aborted||await new Promise(p=>o.addEventListener("abort",()=>p(),{once:!0}))}}finally{r.abort(),await u}if(d)throw d;i({type:"status",status:"cancelled"})}l();var Be=f.object({type:f.literal("status"),timestamp:N,status:f.enum(["watching","cancelled"])}).strict(),Ge=f.discriminatedUnion("status",[f.object({type:f.literal("build"),timestamp:N,status:f.literal("success")}).strict(),f.object({type:f.literal("build"),timestamp:N,status:f.literal("failed"),error:f.string().describe("The rebuild failure message.")}).strict()]),He=f.object({type:f.literal("execution"),timestamp:N,result:W.schema,exitCode:f.number().int().nonnegative().describe("The exit code of this Function run, not the replay process.")}).strict(),v=U({name:"FunctionReplayRecord",schema:f.union([Be,Ge,He])}),Le=U({name:"FunctionReplayOutput",schema:f.union([W.schema,v.schema]),definitions:{FunctionRunResult:W.schema,FunctionReplayRecord:v.schema}});import{AsyncResource as ze}from"node:async_hooks";async function Ne(e){let t=!1,n=o=>{o.code==="EPIPE"&&(t=!0,e.abortController.abort())},r=o=>{process.exitCode={SIGINT:130,SIGTERM:143,SIGQUIT:131}[o],e.abortController.abort()};process.on("shopify:signal",r),process.stdout.on("error",n);let i=ze.bind(o=>{t||Ke(o)});try{await Oe({...e,onEvent:i})}finally{process.removeListener("shopify:signal",r),process.stdout.removeListener("error",n)}}function Ke(e){if(e.type==="status"&&e.status==="running")return;let t=Z(new Date);if(e.type==="diagnostic"){let n=K(e.message);n.trim().length>0&&ee({type:"diagnostic",level:"warning",message:n});return}if(e.type==="execution"){v.validate({type:"execution",timestamp:t,result:JSON.parse(e.resultJson),exitCode:e.exitCode});let n=e.resultJson.replace(/("(?:\\.|[^"\\])*")|\s+/g,(r,i)=>i??"");z(`{"type":"execution","timestamp":${JSON.stringify(t)},"result":${n},"exitCode":${e.exitCode}}`)}else z(JSON.stringify(v.validate({type:e.type,timestamp:t,status:e.status,...e.type==="build"&&e.status==="failed"?{error:K(e.error)}:{}})))}l();async function Te(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),n=e.map(t);return await ae({message:"Which function run would you like to replay locally?",choices:n})}import{existsSync as Ye,readdirSync as Qe}from"fs";var Q=100;async function ve(e){let{watch:t,extension:n,app:r}=e,i=new k;try{let o=await Ve(e),{input:d,export:u}=o.payload;if(t){let m={selectedRun:o,abortController:i,app:r,extension:n};e.json?await Ne(m):await Ce(m)}else return await j({functionExtension:n,json:e.json,input:JSON.stringify(d),export:u})}catch(o){throw i.abort(),o}}async function Ve(e){let t=e.app.getLogsDir();return e.log?Xe(t,e.extension.handle,e.log):et(t,e.extension.handle)}async function Xe(e,t,n){let r=await Ze(e,t,n);if(r===void 0)throw new H(`No log found for '${n}'.
|
|
5
|
+
Searched ${e} for function ${t}.`);let i=await B(r);return JSON.parse(i)}function Ie(e){let t=e.split(/[_.]/);if(!(t.length<6))return{namespace:t[3],functionHandle:t[4],identifier:t[5]}}async function Ze(e,t,n){let r=Je(e).find(i=>{let o=Ie(i);return o?.namespace==="extensions"&&o?.functionHandle===t&&o?.identifier===n});return r?q(e,r):void 0}async function et(e,t){let n=await tt(e,t),r=await Te(n);if(r===void 0)throw new H(`No logs found in ${e}`);return r}async function tt(e,t){let n=Je(e).filter(i=>{let o=Ie(i);return o?.namespace==="extensions"&&o?.functionHandle===t}).reverse(),r=[];for(let i=0;i<n.length&&r.length<Q;i+=Q){let d=n.slice(i,i+Q).map(c=>q(e,c)),m=(await Promise.all(d.map(async c=>{let w=await B(c);return{...JSON.parse(w),identifier:nt(c)}}))).filter(c=>c.payload.input!=null);r=r.concat(m)}return r}function nt(e){return e.split("_").pop().substring(0,6)}function Je(e){return Ye(e)?Qe(e):[]}var V=J(Ae(),1),X=class e extends he{static get requiresSyncAnalytics(){return!0}static jsonOutputSchema=Le;static summary="Replays a function run from an app log.";static descriptionWithMarkdown=`Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).
|
|
6
|
+
|
|
7
|
+
Watches for changes by default. Use --no-watch to run once.
|
|
8
|
+
|
|
9
|
+
Use --json for JSONL output while watching, or --no-watch --json for a single JSON result.`;static description=this.descriptionForHelp();static flags={...le,...fe,...ye,...pe,log:me(V.Flags.string({char:"l",description:"Specifies a log identifier to replay instead of selecting from a list. The identifier is provided in the output of `shopify app dev` and is the suffix of the log file name.",env:"SHOPIFY_FLAG_LOG"})),watch:V.Flags.boolean({char:"w",hidden:!1,allowNo:!0,default:!0,description:"Re-run the function when the source code changes.",env:"SHOPIFY_FLAG_WATCH"})};async run(){let{flags:t}=await this.parse(e),{app:n}=await de({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),r=await we(n,t.path),i=await ve({app:n,extension:r,path:t.path,log:t.log,json:t.json,watch:t.watch});return i&&xe(i),{app:n}}};export{X as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _,j as B,n as $}from"./chunk-
|
|
1
|
+
import{a as _,j as B,n as $}from"./chunk-YTL45RXR.js";import{f as U,g as C}from"./chunk-WPDJVUTY.js";import{e as y}from"./chunk-XLMKHTJ5.js";import{l as v,m as P}from"./chunk-DVFVO6ZE.js";import{Ga as E}from"./chunk-YKDRUAY3.js";import{Eb as m}from"./chunk-ZMOW2YZ4.js";import{g as T}from"./chunk-VKWPEFWQ.js";T();var w=20,L=1024*1024,A=2;function re(t,e,r,s,o={},l){let n=_(r),i=new Map,c=!1,u=a=>{c||=a.success,i.set(a.key,a)},g=a=>a.total===0?"[100%]":`[${Math.round(a.current/a.total*100)}%]`,h=S(t,e,n).then(a=>{a.forEach(u)}),p=Promise.all([s.ready(),h]).then(()=>I(n,s,t,e,u)),d=p.then(a=>a.promise).then(()=>x(n,s,t,e,o,u)),f=o?.deferPartialWork?h:d.then(a=>a.promise);return o?.backgroundWorkCatch&&Promise.all([h,p.then(a=>a.promise),d.then(a=>a.promise)]).catch(o.backgroundWorkCatch),{uploadResults:i,get hasChanges(){return c},workPromise:f,renderThemeSyncProgress:async()=>{if(o?.deferPartialWork)return;let{progress:a,promise:F}=await p,k=o.multiEnvironment?4e3:1e3;await y(b({promise:F,titleGetter:()=>`Uploading files to remote theme ${g(a)}`,updateInterval:k}),l?.stderr,o?.multiEnvironment);let{progress:J,promise:j}=await d;await y(b({promise:j,titleGetter:()=>`Cleaning your remote theme ${g(J)}`,updateInterval:k}),l?.stderr,o?.multiEnvironment),await y([{title:"Theme upload complete",task:async()=>{}}],l?.stderr,o?.multiEnvironment),G(i,o?.environment)}}}function b({promise:t,titleGetter:e,updateInterval:r}){let s=[],o=()=>{s.push({title:e(),task:async(l,n)=>{await Promise.race([t,new Promise(c=>setTimeout(()=>c("timeout"),r))])==="timeout"?o():n.title=e()}})};return o(),s}function x(t,e,r,s,o,l){if(o.nodelete)return{progress:{current:0,total:0},promise:Promise.resolve()};let n=R(t,e),i=D(n),c={current:0,total:i.length};if(i.length===0)return{progress:c,promise:Promise.resolve()};let u=[];for(let h=0;h<i.length;h+=w){let p=i.slice(h,h+w),d=v(r.id,p.map(f=>f.key),s).then(f=>{f.forEach(a=>{if(l(a),!a.success){let F=a.errors?.asset?.map(k=>`-${k}`).join(`
|
|
2
2
|
`);C(a.key,"delete")(new Error(`Failed to delete ${a.key}: ${F}`))}}),c.current+=p.length});u.push(d)}let g=Promise.all(u).then(()=>{c.current=c.total});return{progress:c,promise:g}}function R(t,e){let s=e.applyIgnoreFilters(t).filter(o=>!e.files.has(o.key));return m(`Files to be deleted:
|
|
3
3
|
${s.map(o=>`-${o.key}`).join(`
|
|
4
4
|
`)}`),s}function D(t){let e=$(t);return[...e.contextualizedJsonFiles,...e.templateJsonFiles,...e.sectionJsonFiles,...e.otherJsonFiles,...e.sectionLiquidFiles,...e.blockLiquidFiles,...e.layoutFiles,...e.otherLiquidFiles,...e.configDataFile,...e.configStylesheetFiles,...e.documentationFiles,...e.configSchemaFile,...e.staticAssetFiles]}var q=[{key:"config/settings_schema.json",value:"[]"},{key:"layout/password.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"},{key:"layout/theme.liquid",value:"{{ content_for_header }}{{ content_for_layout }}"}];async function S(t,e,r){let s=new Set(r.map(l=>l.key)),o=q.filter(({key:l})=>!s.has(l));return o.length>0?P(t.id,o,e):[]}function I(t,e,r,s,o){let l=z(e,t);e.unsyncedFileKeys.clear(),l.forEach(d=>e.unsyncedFileKeys.add(d.key));let{independentFiles:n,dependentFiles:i}=K(l),c={current:0,total:l.length},u=d=>d.length===0?Promise.resolve():Promise.all(N(d).map(f=>H(f,e,s,r.id,o).then(()=>{c.current+=f.length,f.forEach(a=>e.unsyncedFileKeys.delete(a.key))}))).then(()=>{}),g=i.reduce((d,f)=>d.then(()=>u(f)),Promise.resolve()),h=Promise.resolve().then(()=>u(n.flat())),p=Promise.all([g,h]).then(()=>{c.current=c.total});return{progress:c,promise:p}}function z(t,e){let r=W(t),s=t.applyIgnoreFilters(r),o=new Map(e.map(n=>[n.key,n])),l=s.filter(n=>{let i=o.get(n.key);return!i||i.checksum!==n.checksum});return m(`Files to be uploaded:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{c as ae}from"./chunk-
|
|
1
|
+
import{c as ae}from"./chunk-VJG7VXFU.js";import{b as P}from"./chunk-EDWIWZWM.js";import{a as fe}from"./chunk-SBN3ILXO.js";import{a as ue}from"./chunk-RSZAAN37.js";import{a as ie}from"./chunk-ASKBYEO7.js";import{a as re}from"./chunk-WE5KY6T6.js";import{P as me}from"./chunk-HMPRWNGG.js";import{Q as pe,V as de,d as ce,e as le}from"./chunk-YYWSHRO2.js";import{u as k,w as oe,x as se}from"./chunk-OJOF6IYG.js";import{a as F}from"./chunk-HVUMVDUG.js";import{C as B,p as O,x as W,y as S}from"./chunk-4WBWZIN5.js";import{b as te,c as ne,f as A}from"./chunk-DMOLPSXF.js";import{C as X,E as K,G as R,I as Q,y as H,z}from"./chunk-2KUM2RU4.js";import{e as b}from"./chunk-QBRRFFMZ.js";import{a as G}from"./chunk-LG3KEHGD.js";import{i as u}from"./chunk-TD6JBHUS.js";import{Na as V,Sa as x,Ta as Y,Va as J,X as h,_ as q,ja as w,pa as U,ub as T,va as v,xa as E,zb as ee}from"./chunk-ZMOW2YZ4.js";import{b as f}from"./chunk-3PYDIBTX.js";import{f as Z}from"./chunk-DOLVBTCB.js";import{b as Re}from"./chunk-AE3IQG7S.js";import{c as d,e as N,g as D,m as L,p as $}from"./chunk-IWTNUJGY.js";import{e as Se,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();async function he(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}p();p();async function ye(e,t){let r=e?.path??"",n=d(t,r);if(!await x(n))throw new u(`
|
|
2
2
|
The extension is not available for ${e?.value}`);return n}async function xe({name:e,app:t}){let r=q(e),n=d(t.directory,se.extensions.directoryName,r);if(await x(n))throw new u(`
|
|
3
3
|
A directory with this name (${r}) already exists.
|
|
4
4
|
Choose a new name for your extension.`);return await v(n),await U(d(n,k.lockFile)),n}var ge=["vanilla-js","preact","react","typescript","typescript-react","rust","wasm","liquid","config-only"];function C(e){switch(e){case"vanilla-js":case"preact":case"react":case"typescript":case"typescript-react":return"javascript";case"rust":case"wasm":return e;case void 0:case"liquid":case"config-only":return}}async function we(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,n=e.extensionTemplate.supportedFlavors.find(o=>o.value===r),a=await xe({app:e.app,name:t}),i=e.cloneUrl??e.extensionTemplate.url,s={directory:a,url:i,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:n,onGetTemplateRepository:e.onGetTemplateRepository??(async(o,l)=>{await ae({repoUrl:o,destination:l,shallow:!0})})};return await Ae(s),{directory:L(a),extensionTemplate:e.extensionTemplate}}async function Ae(e){try{switch(e.type){case"theme":await Me(e);break;case"function":await je(e);break;default:await Ge(e);break}let t=d(e.directory,k.lockFile);await E(t)}catch(t){throw await Ce(e.directory),e.project.packageManager==="pnpm"&&Ie(t)?new u("Your extension couldn't be generated because pnpm blocked the build scripts of some of its dependencies.",null,[["Run",{command:"pnpm approve-builds"},"in your app directory to approve the build scripts."],["Run",{command:T(e.project.packageManager,"shopify app generate extension")},"again."]]):t}}async function Ce(e){try{await E(e,{maxRetries:10,retryDelay:100})}catch{z({headline:["Couldn't remove",{filePath:e},{char:"."}],body:"Delete this directory manually before generating an extension with the same name."})}}function Ie(e){return e instanceof Error&&e.message.includes("ERR_PNPM_IGNORED_BUILDS")}async function Me({directory:e,url:t,type:r,name:n,extensionFlavor:a,onGetTemplateRepository:i}){return w(async s=>{let o=await I(t,a,s,i);await P(o,e,{name:n,type:r,uid:b(h(n))})})}async function je({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=C(i?.value),l=[];l.push({title:"Generating function extension",task:async()=>{if(await w(async c=>{let m=await I(t,i,c,s);await P(m,e,{name:a,handle:h(a),flavor:i?.value,uid:b(h(a))})}),o==="javascript"){let c=ve(i?.value??"rust");await Ee(e,c,"!(*.graphql)")}}}),o==="javascript"&&l.push({title:"Installing additional dependencies",task:async()=>{n.usesWorkspaces&&await O({packageManager:n.packageManager,directory:n.directory});let c=Ne(o);await S(c,{packageManager:n.packageManager,type:"prod",directory:n.usesWorkspaces?e:n.directory})}}),o==="javascript"&&l.push({title:"Building GraphQL types",task:async()=>{let c=re();try{await le({directory:e,isJavaScript:!0},{...c,app:r})}finally{c.stdout!==process.stdout&&c.stdout.end(),c.stderr!==process.stderr&&c.stderr.end()}}}),await R(l)}async function Ge({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=C(i?.value),l=[{title:"Generating extension",task:async()=>{let c=ve(i?.value??"vanilla-js");await w(async m=>{let y=await I(t,i,m,s);await P(y,e,{srcFileExtension:c,name:a,handle:h(a),flavor:i?.value??"",uid:b(h(a))})}),o==="javascript"&&await Ee(e,c)}},{title:"Installing dependencies",task:async()=>{let c=n.packageManager;if(n.usesWorkspaces)C(i?.value)==="javascript"&&await O({packageManager:c,directory:n.directory});else{await De(n.directory,i?.value);let m=d(e,"package.json"),y=await Le(m);await S(y,{packageManager:c,type:"prod",directory:n.directory}),await E(m)}}}];l.push({title:"Update shared type definition",task:async()=>{await de(r)}}),await R(l)}function ve(e){return{"vanilla-js":"js",preact:"jsx",react:"jsx",typescript:"ts","typescript-react":"tsx",rust:"rs",wasm:"wasm",liquid:"liquid","config-only":""}[e]??"js"}function Ne(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${ce}.0.0`}),t}async function Ee(e,t,r="*"){let n=await J(d(e,"src",r)),a=[];for(let i of n)a.push(V(i,`${i}.${t}`));await Promise.all(a)}async function De(e,t){t==="typescript-react"&&await B(e,{"@types/react":oe.reactTypes})}async function Le(e){if(!await x(e))return[];let t=await W(e);return Object.entries(t?.dependencies??{}).map(([r,n])=>({name:r,version:n}))}async function I(e,t,r,n){let a=d(r,"download");return await v(a),await n(e,a),ye(t,a)}p();function $e(e,t=[]){let r=[...e.map(a=>({label:a.name,value:a.identifier,group:a.group||"Other",sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(a=>({label:`${a.name} (limit reached)`,value:a.identifier,group:a.group||"Other",disabled:!0,sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER}))],n=(a,i)=>a.sortPriority===i.sortPriority?a.label.localeCompare(i.label):a.sortPriority-i.sortPriority;return r.sort(n)}var qe=async e=>{let t=e.extensionTemplates,r=e.templateType,n=e.extensionFlavor;if(!r){if(n&&(t=t.filter(l=>l.supportedFlavors.map(c=>c.value).includes(n))),t.length===0)throw new u("You have reached the limit for the number of extensions you can create.");r=await K({message:"Type of extension?",choices:$e(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let a=t.find(l=>l.identifier===r),i=e.name||await be(e.directory,a.defaultName),s=e.extensionFlavor??await Ue(a);return{extensionTemplate:a,extensionContent:{name:i,flavor:s}}};async function be(e,t,r=1){let n=t.includes(" ")?" ":"-",a=r<=1?t:`${t}${n}${r}`,i=d(e,h(a));return Y(i)?be(e,t,r+1):Q({message:"Name your extension:",defaultValue:a})}async function Ue(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:X({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var Te=qe;async function Ve(e){let{app:t,developerPlatformClient:r,remoteApp:n,specifications:a,template:i}=e,s=a.map(Oe=>Oe.identifier),{templates:o,groupOrder:l}=await he(r,n,s,{requestedTemplate:i}),c=await Ye(o,l,a,t,e),m=await Te(c);await We(m,i);let y=Be(m,t,e,r),j=await we(y);return{status:"success",extension:{directory:j.directory,extensionTemplate:j.extensionTemplate,name:m.extensionContent.name,flavor:m.extensionContent.flavor},packageManager:e.project.packageManager}}async function Ye(e,t,r,n,a){let i=await ze(a.template,n,e,r);He(i?[i]:e,a.flavor);let{validTemplates:s,templatesOverlimit:o}=Je(e,r,n);return{templateType:i?.identifier,name:a.name,extensionFlavor:a.flavor,directory:d(a.directory,"extensions"),app:n,extensionTemplates:s??[],unavailableExtensions:o??[],reset:a.reset,groupOrder:t}}function Je(e,t,r){return fe(e,a=>!Pe(r,t,a)?"validTemplates":"templatesOverlimit")}function Pe(e,t,r){let n=r.type,a=t.find(s=>s.identifier===n||s.externalIdentifier===n);return e.extensionsForType({identifier:n,externalIdentifier:n}).length>=(a?.registrationLimit??1)}async function We(e,t){let{extensionContent:r}=e;return F.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function Be(e,t,r,n){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:n}}function He(e,t){if(t===void 0)return;let r=[...new Set(e.flatMap(n=>n.supportedFlavors.map(a=>a.value)))];if(!r.includes(t))throw new u("Invalid extension flavor",`Expected flavor to be one of the following: ${r.join(", ")}.`)}async function ze(e,t,r,n){if(!e)return;let a=r.find(i=>i.identifier===e);if(!a){let i=await Z(),s=r.map(l=>l.identifier),o=i?"You might need to enable some flags on your Organization or App":void 0;throw new u(`Unknown extension type: ${e}.
|
|
5
5
|
The following extension types are supported: ${s.join(", ")}`,o)}if(Pe(t,n,a))throw new u(`Invalid extension type: ${e}`,`You have reached the limit of extension(s) of type ${a.type} per app`);return a}var ke=Ve;p();var Fe=f.object({name:f.string().min(1).describe("The name selected for the generated extension."),type:f.string().min(1).describe("The extension type, such as function, theme, or ui_extension."),template:f.string().min(1).describe("The identifier of the selected extension template."),flavor:f.string().nullable().describe("The selected template flavor, or null when the template has no flavors."),directory:f.string().refine(D,"Expected an absolute filesystem path.").describe("The absolute native filesystem path of the generated extension directory.")}).strict(),_=G({name:"AppGenerateExtensionResult",schema:f.object({status:f.literal("success"),extension:Fe}).strict(),definitions:{GeneratedExtension:Fe}});p();function _e(e,t=!1){let{extension:r,packageManager:n}=e;if(t){ee(_.encode({status:e.status,extension:{name:r.name,type:r.extensionTemplate.type,template:r.extensionTemplate.identifier,flavor:r.flavor??null,directory:N($(),r.directory)}}));return}H(Xe(r.extensionTemplate,r.directory,n))}function Xe(e,t,r){let n={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&n.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:T(r,"shopify app dev")}]),e.supportLinks[0]&&n.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),n}var g=Se(Re(),1);var M=class e extends ue{static summary="Generate a new app Extension.";static descriptionWithMarkdown=`Generates a new [app extension](https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).
|
|
6
6
|
|
|
7
7
|
Each new app extension is created in a folder under \`extensions/\`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.
|
|
8
|
-
`;static
|
|
8
|
+
`;static jsonOutputSchema=_;static description=this.descriptionForHelp();static flags={...te,...ie,...ne,template:A(g.Flags.string({char:"t",hidden:!1,description:"Extension template",env:"SHOPIFY_FLAG_EXTENSION_TEMPLATE"})),name:A(g.Flags.string({char:"n",hidden:!1,description:"name of your Extension",env:"SHOPIFY_FLAG_NAME"})),"clone-url":g.Flags.string({hidden:!0,char:"u",description:"The Git URL to clone the function extensions templates from. Defaults to: https://github.com/Shopify/function-examples",env:"SHOPIFY_FLAG_CLONE_URL"}),flavor:g.Flags.string({hidden:!1,description:"Choose a starting template for your extension, where applicable. Supported flavors depend on the selected extension template. Required if non interactive when the selected extension template supports multiple flavors.",options:[...ge],env:"SHOPIFY_FLAG_FLAVOR"})};async run(){let{flags:t}=await this.parse(e);await F.addPublicMetadata(()=>({cmd_scaffold_required_auth:!0,cmd_scaffold_template_custom:t["clone-url"]!==void 0,cmd_scaffold_type_owner:"@shopify/app"})),await pe(t.path);let{app:r,project:n,specifications:a,remoteApp:i,developerPlatformClient:s}=await me({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=await ke({directory:t.path,reset:t.reset,name:t.name,cloneUrl:t["clone-url"],template:t.template,flavor:t.flavor,app:r,project:n,specifications:a,remoteApp:i,developerPlatformClient:s});return _e(o,t.json),{app:r}}};export{M as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as hS,b as Hp}from"./chunk-LQ7ENG4V.js";import{a as wR}from"./chunk-IWOTLFOY.js";import{a as Pf,b as fS,c as dS,e as Ip,f as Au,g as Pp,i as pS,j as vS,k as OR,l as tc,m as bR,n as mS,p as AR}from"./chunk-7Y7AZRL3.js";import{a as LR}from"./chunk-5HBIIYSK.js";import{a as yS}from"./chunk-AAK376RT.js";import{h as di,i as Zn}from"./chunk-B4OMIONW.js";import{b as DR}from"./chunk-YTUUU33R.js";import{a as NR,c as pa,e as nn,g as P}from"./chunk-VKWPEFWQ.js";var OS=pa(kt=>{"use strict";P();var Hf=Symbol.for("react.element"),UR=Symbol.for("react.portal"),MR=Symbol.for("react.fragment"),zR=Symbol.for("react.strict_mode"),FR=Symbol.for("react.profiler"),IR=Symbol.for("react.provider"),PR=Symbol.for("react.context"),HR=Symbol.for("react.forward_ref"),jR=Symbol.for("react.suspense"),kR=Symbol.for("react.memo"),BR=Symbol.for("react.lazy"),gS=Symbol.iterator;function VR(s){return s===null||typeof s!="object"?null:(s=gS&&s[gS]||s["@@iterator"],typeof s=="function"?s:null)}var TS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_S=Object.assign,xS={};function nc(s,o,p){this.props=s,this.context=o,this.refs=xS,this.updater=p||TS}nc.prototype.isReactComponent={};nc.prototype.setState=function(s,o){if(typeof s!="object"&&typeof s!="function"&&s!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,s,o,"setState")};nc.prototype.forceUpdate=function(s){this.updater.enqueueForceUpdate(this,s,"forceUpdate")};function CS(){}CS.prototype=nc.prototype;function Uh(s,o,p){this.props=s,this.context=o,this.refs=xS,this.updater=p||TS}var Mh=Uh.prototype=new CS;Mh.constructor=Uh;_S(Mh,nc.prototype);Mh.isPureReactComponent=!0;var ES=Array.isArray,RS=Object.prototype.hasOwnProperty,zh={current:null},NS={key:!0,ref:!0,__self:!0,__source:!0};function DS(s,o,p){var E,h={},C=null,R=null;if(o!=null)for(E in o.ref!==void 0&&(R=o.ref),o.key!==void 0&&(C=""+o.key),o)RS.call(o,E)&&!NS.hasOwnProperty(E)&&(h[E]=o[E]);var F=arguments.length-2;if(F===1)h.children=p;else if(1<F){for(var A=Array(F),N=0;N<F;N++)A[N]=arguments[N+2];h.children=A}if(s&&s.defaultProps)for(E in F=s.defaultProps,F)h[E]===void 0&&(h[E]=F[E]);return{$$typeof:Hf,type:s,key:C,ref:R,props:h,_owner:zh.current}}function WR(s,o){return{$$typeof:Hf,type:s.type,key:o,ref:s.ref,props:s.props,_owner:s._owner}}function Fh(s){return typeof s=="object"&&s!==null&&s.$$typeof===Hf}function GR(s){var o={"=":"=0",":":"=2"};return"$"+s.replace(/[=:]/g,function(p){return o[p]})}var SS=/\/+/g;function wh(s,o){return typeof s=="object"&&s!==null&&s.key!=null?GR(""+s.key):o.toString(36)}function kp(s,o,p,E,h){var C=typeof s;(C==="undefined"||C==="boolean")&&(s=null);var R=!1;if(s===null)R=!0;else switch(C){case"string":case"number":R=!0;break;case"object":switch(s.$$typeof){case Hf:case UR:R=!0}}if(R)return R=s,h=h(R),s=E===""?"."+wh(R,0):E,ES(h)?(p="",s!=null&&(p=s.replace(SS,"$&/")+"/"),kp(h,o,p,"",function(N){return N})):h!=null&&(Fh(h)&&(h=WR(h,p+(!h.key||R&&R.key===h.key?"":(""+h.key).replace(SS,"$&/")+"/")+s)),o.push(h)),1;if(R=0,E=E===""?".":E+":",ES(s))for(var F=0;F<s.length;F++){C=s[F];var A=E+wh(C,F);R+=kp(C,o,p,A,h)}else if(A=VR(s),typeof A=="function")for(s=A.call(s),F=0;!(C=s.next()).done;)C=C.value,A=E+wh(C,F++),R+=kp(C,o,p,A,h);else if(C==="object")throw o=String(s),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.");return R}function jp(s,o,p){if(s==null)return s;var E=[],h=0;return kp(s,E,"","",function(C){return o.call(p,C,h++)}),E}function YR(s){if(s._status===-1){var o=s._result;o=o(),o.then(function(p){(s._status===0||s._status===-1)&&(s._status=1,s._result=p)},function(p){(s._status===0||s._status===-1)&&(s._status=2,s._result=p)}),s._status===-1&&(s._status=0,s._result=o)}if(s._status===1)return s._result.default;throw s._result}var Ia={current:null},Bp={transition:null},QR={ReactCurrentDispatcher:Ia,ReactCurrentBatchConfig:Bp,ReactCurrentOwner:zh};function LS(){throw Error("act(...) is not supported in production builds of React.")}kt.Children={map:jp,forEach:function(s,o,p){jp(s,function(){o.apply(this,arguments)},p)},count:function(s){var o=0;return jp(s,function(){o++}),o},toArray:function(s){return jp(s,function(o){return o})||[]},only:function(s){if(!Fh(s))throw Error("React.Children.only expected to receive a single React element child.");return s}};kt.Component=nc;kt.Fragment=MR;kt.Profiler=FR;kt.PureComponent=Uh;kt.StrictMode=zR;kt.Suspense=jR;kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QR;kt.act=LS;kt.cloneElement=function(s,o,p){if(s==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+s+".");var E=_S({},s.props),h=s.key,C=s.ref,R=s._owner;if(o!=null){if(o.ref!==void 0&&(C=o.ref,R=zh.current),o.key!==void 0&&(h=""+o.key),s.type&&s.type.defaultProps)var F=s.type.defaultProps;for(A in o)RS.call(o,A)&&!NS.hasOwnProperty(A)&&(E[A]=o[A]===void 0&&F!==void 0?F[A]:o[A])}var A=arguments.length-2;if(A===1)E.children=p;else if(1<A){F=Array(A);for(var N=0;N<A;N++)F[N]=arguments[N+2];E.children=F}return{$$typeof:Hf,type:s.type,key:h,ref:C,props:E,_owner:R}};kt.createContext=function(s){return s={$$typeof:PR,_currentValue:s,_currentValue2:s,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},s.Provider={$$typeof:IR,_context:s},s.Consumer=s};kt.createElement=DS;kt.createFactory=function(s){var o=DS.bind(null,s);return o.type=s,o};kt.createRef=function(){return{current:null}};kt.forwardRef=function(s){return{$$typeof:HR,render:s}};kt.isValidElement=Fh;kt.lazy=function(s){return{$$typeof:BR,_payload:{_status:-1,_result:s},_init:YR}};kt.memo=function(s,o){return{$$typeof:kR,type:s,compare:o===void 0?null:o}};kt.startTransition=function(s){var o=Bp.transition;Bp.transition={};try{s()}finally{Bp.transition=o}};kt.unstable_act=LS;kt.useCallback=function(s,o){return Ia.current.useCallback(s,o)};kt.useContext=function(s){return Ia.current.useContext(s)};kt.useDebugValue=function(){};kt.useDeferredValue=function(s){return Ia.current.useDeferredValue(s)};kt.useEffect=function(s,o){return Ia.current.useEffect(s,o)};kt.useId=function(){return Ia.current.useId()};kt.useImperativeHandle=function(s,o,p){return Ia.current.useImperativeHandle(s,o,p)};kt.useInsertionEffect=function(s,o){return Ia.current.useInsertionEffect(s,o)};kt.useLayoutEffect=function(s,o){return Ia.current.useLayoutEffect(s,o)};kt.useMemo=function(s,o){return Ia.current.useMemo(s,o)};kt.useReducer=function(s,o,p){return Ia.current.useReducer(s,o,p)};kt.useRef=function(s){return Ia.current.useRef(s)};kt.useState=function(s){return Ia.current.useState(s)};kt.useSyncExternalStore=function(s,o,p){return Ia.current.useSyncExternalStore(s,o,p)};kt.useTransition=function(){return Ia.current.useTransition()};kt.version="18.3.1"});var bS=pa((Bt,Vp)=>{"use strict";P();process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var s="18.3.1",o=Symbol.for("react.element"),p=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),F=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),Le=Symbol.for("react.offscreen"),Re=Symbol.iterator,he="@@iterator";function Ee(y){if(y===null||typeof y!="object")return null;var L=Re&&y[Re]||y[he];return typeof L=="function"?L:null}var $e={current:null},st={transition:null},et={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},Xe={current:null},Xt={},qe=null;function Ve(y){qe=y}Xt.setExtraStackFrame=function(y){qe=y},Xt.getCurrentStack=null,Xt.getStackAddendum=function(){var y="";qe&&(y+=qe);var L=Xt.getCurrentStack;return L&&(y+=L()||""),y};var rn=!1,We=!1,gt=!1,Me=!1,G=!1,ce={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:st,ReactCurrentOwner:Xe};ce.ReactDebugCurrentFrame=Xt,ce.ReactCurrentActQueue=et;function Oe(y){{for(var L=arguments.length,B=new Array(L>1?L-1:0),X=1;X<L;X++)B[X-1]=arguments[X];Tt("warn",y,B)}}function oe(y){{for(var L=arguments.length,B=new Array(L>1?L-1:0),X=1;X<L;X++)B[X-1]=arguments[X];Tt("error",y,B)}}function Tt(y,L,B){{var X=ce.ReactDebugCurrentFrame,fe=X.getStackAddendum();fe!==""&&(L+="%s",B=B.concat([fe]));var nt=B.map(function(_e){return String(_e)});nt.unshift("Warning: "+L),Function.prototype.apply.call(console[y],console,nt)}}var je={};function Ct(y,L){{var B=y.constructor,X=B&&(B.displayName||B.name)||"ReactClass",fe=X+"."+L;if(je[fe])return;oe("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",L,X),je[fe]=!0}}var we={isMounted:function(y){return!1},enqueueForceUpdate:function(y,L,B){Ct(y,"forceUpdate")},enqueueReplaceState:function(y,L,B,X){Ct(y,"replaceState")},enqueueSetState:function(y,L,B,X){Ct(y,"setState")}},_t=Object.assign,rt={};Object.freeze(rt);function Gt(y,L,B){this.props=y,this.context=L,this.refs=rt,this.updater=B||we}Gt.prototype.isReactComponent={},Gt.prototype.setState=function(y,L){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,L,"setState")},Gt.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};{var Je={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},bn=function(y,L){Object.defineProperty(Gt.prototype,y,{get:function(){Oe("%s(...) is deprecated in plain JavaScript React classes. %s",L[0],L[1])}})};for(var Kt in Je)Je.hasOwnProperty(Kt)&&bn(Kt,Je[Kt])}function tt(){}tt.prototype=Gt.prototype;function w(y,L,B){this.props=y,this.context=L,this.refs=rt,this.updater=B||we}var J=w.prototype=new tt;J.constructor=w,_t(J,Gt.prototype),J.isPureReactComponent=!0;function Ke(){var y={current:null};return Object.seal(y),y}var Yt=Array.isArray;function vt(y){return Yt(y)}function Dt(y){{var L=typeof Symbol=="function"&&Symbol.toStringTag,B=L&&y[Symbol.toStringTag]||y.constructor.name||"Object";return B}}function Et(y){try{return Qt(y),!1}catch{return!0}}function Qt(y){return""+y}function Nn(y){if(Et(y))return oe("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt(y)),Qt(y)}function An(y,L,B){var X=y.displayName;if(X)return X;var fe=L.displayName||L.name||"";return fe!==""?B+"("+fe+")":B}function Bn(y){return y.displayName||"Context"}function gn(y){if(y==null)return null;if(typeof y.tag=="number"&&oe("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case E:return"Fragment";case p:return"Portal";case C:return"Profiler";case h:return"StrictMode";case N:return"Suspense";case le:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case F:var L=y;return Bn(L)+".Consumer";case R:var B=y;return Bn(B._context)+".Provider";case A:return An(y,y.render,"ForwardRef");case $:var X=y.displayName||null;return X!==null?X:gn(y.type)||"Memo";case xe:{var fe=y,nt=fe._payload,_e=fe._init;try{return gn(_e(nt))}catch{return null}}}return null}var $n=Object.prototype.hasOwnProperty,br={key:!0,ref:!0,__self:!0,__source:!0},ha,on,Ar;Ar={};function ir(y){if($n.call(y,"ref")){var L=Object.getOwnPropertyDescriptor(y,"ref").get;if(L&&L.isReactWarning)return!1}return y.ref!==void 0}function Pa(y){if($n.call(y,"key")){var L=Object.getOwnPropertyDescriptor(y,"key").get;if(L&&L.isReactWarning)return!1}return y.key!==void 0}function Ka(y,L){var B=function(){ha||(ha=!0,oe("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",L))};B.isReactWarning=!0,Object.defineProperty(y,"key",{get:B,configurable:!0})}function ya(y,L){var B=function(){on||(on=!0,oe("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",L))};B.isReactWarning=!0,Object.defineProperty(y,"ref",{get:B,configurable:!0})}function ga(y){if(typeof y.ref=="string"&&Xe.current&&y.__self&&Xe.current.stateNode!==y.__self){var L=gn(Xe.current.type);Ar[L]||(oe('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L,y.ref),Ar[L]=!0)}}var Ea=function(y,L,B,X,fe,nt,_e){var Ze={$$typeof:o,type:y,key:L,ref:B,props:_e,_owner:nt};return Ze._store={},Object.defineProperty(Ze._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ze,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(Ze,"_source",{configurable:!1,enumerable:!1,writable:!1,value:fe}),Object.freeze&&(Object.freeze(Ze.props),Object.freeze(Ze)),Ze};function ta(y,L,B){var X,fe={},nt=null,_e=null,Ze=null,St=null;if(L!=null){ir(L)&&(_e=L.ref,ga(L)),Pa(L)&&(Nn(L.key),nt=""+L.key),Ze=L.__self===void 0?null:L.__self,St=L.__source===void 0?null:L.__source;for(X in L)$n.call(L,X)&&!br.hasOwnProperty(X)&&(fe[X]=L[X])}var At=arguments.length-2;if(At===1)fe.children=B;else if(At>1){for(var Pt=Array(At),qt=0;qt<At;qt++)Pt[qt]=arguments[qt+2];Object.freeze&&Object.freeze(Pt),fe.children=Pt}if(y&&y.defaultProps){var mn=y.defaultProps;for(X in mn)fe[X]===void 0&&(fe[X]=mn[X])}if(nt||_e){var _n=typeof y=="function"?y.displayName||y.name||"Unknown":y;nt&&Ka(fe,_n),_e&&ya(fe,_n)}return Ea(y,nt,_e,Ze,St,Xe.current,fe)}function ye(y,L){var B=Ea(y.type,L,y.ref,y._self,y._source,y._owner,y.props);return B}function Ge(y,L,B){if(y==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+y+".");var X,fe=_t({},y.props),nt=y.key,_e=y.ref,Ze=y._self,St=y._source,At=y._owner;if(L!=null){ir(L)&&(_e=L.ref,At=Xe.current),Pa(L)&&(Nn(L.key),nt=""+L.key);var Pt;y.type&&y.type.defaultProps&&(Pt=y.type.defaultProps);for(X in L)$n.call(L,X)&&!br.hasOwnProperty(X)&&(L[X]===void 0&&Pt!==void 0?fe[X]=Pt[X]:fe[X]=L[X])}var qt=arguments.length-2;if(qt===1)fe.children=B;else if(qt>1){for(var mn=Array(qt),_n=0;_n<qt;_n++)mn[_n]=arguments[_n+2];fe.children=mn}return Ea(y.type,nt,_e,Ze,St,At,fe)}function dt(y){return typeof y=="object"&&y!==null&&y.$$typeof===o}var Ie=".",an=":";function ur(y){var L=/[=:]/g,B={"=":"=0",":":"=2"},X=y.replace(L,function(fe){return B[fe]});return"$"+X}var Pe=!1,ze=/\/+/g;function vn(y){return y.replace(ze,"$&/")}function Zt(y,L){return typeof y=="object"&&y!==null&&y.key!=null?(Nn(y.key),ur(""+y.key)):L.toString(36)}function ut(y,L,B,X,fe){var nt=typeof y;(nt==="undefined"||nt==="boolean")&&(y=null);var _e=!1;if(y===null)_e=!0;else switch(nt){case"string":case"number":_e=!0;break;case"object":switch(y.$$typeof){case o:case p:_e=!0}}if(_e){var Ze=y,St=fe(Ze),At=X===""?Ie+Zt(Ze,0):X;if(vt(St)){var Pt="";At!=null&&(Pt=vn(At)+"/"),ut(St,L,Pt,"",function(Ql){return Ql})}else St!=null&&(dt(St)&&(St.key&&(!Ze||Ze.key!==St.key)&&Nn(St.key),St=ye(St,B+(St.key&&(!Ze||Ze.key!==St.key)?vn(""+St.key)+"/":"")+At)),L.push(St));return 1}var qt,mn,_n=0,On=X===""?Ie:X+an;if(vt(y))for(var Gn=0;Gn<y.length;Gn++)qt=y[Gn],mn=On+Zt(qt,Gn),_n+=ut(qt,L,B,mn,fe);else{var zr=Ee(y);if(typeof zr=="function"){var cn=y;zr===cn.entries&&(Pe||Oe("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Pe=!0);for(var Si=zr.call(cn),aa,Yo=0;!(aa=Si.next()).done;)qt=aa.value,mn=On+Zt(qt,Yo++),_n+=ut(qt,L,B,mn,fe)}else if(nt==="object"){var Yl=String(y);throw new Error("Objects are not valid as a React child (found: "+(Yl==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":Yl)+"). If you meant to render a collection of children, use an array instead.")}}return _n}function lr(y,L,B){if(y==null)return y;var X=[],fe=0;return ut(y,X,"","",function(nt){return L.call(B,nt,fe++)}),X}function pi(y){var L=0;return lr(y,function(){L++}),L}function or(y,L,B){lr(y,function(){L.apply(this,arguments)},B)}function Ot(y){return lr(y,function(L){return L})||[]}function wr(y){if(!dt(y))throw new Error("React.Children.only expected to receive a single React element child.");return y}function Ur(y){var L={$$typeof:F,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};L.Provider={$$typeof:R,_context:L};var B=!1,X=!1,fe=!1;{var nt={$$typeof:F,_context:L};Object.defineProperties(nt,{Provider:{get:function(){return X||(X=!0,oe("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),L.Provider},set:function(_e){L.Provider=_e}},_currentValue:{get:function(){return L._currentValue},set:function(_e){L._currentValue=_e}},_currentValue2:{get:function(){return L._currentValue2},set:function(_e){L._currentValue2=_e}},_threadCount:{get:function(){return L._threadCount},set:function(_e){L._threadCount=_e}},Consumer:{get:function(){return B||(B=!0,oe("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),L.Consumer}},displayName:{get:function(){return L.displayName},set:function(_e){fe||(Oe("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",_e),fe=!0)}}}),L.Consumer=nt}return L._currentRenderer=null,L._currentRenderer2=null,L}var sr=-1,Vn=0,Mr=1,Za=2;function $i(y){if(y._status===sr){var L=y._result,B=L();if(B.then(function(nt){if(y._status===Vn||y._status===sr){var _e=y;_e._status=Mr,_e._result=nt}},function(nt){if(y._status===Vn||y._status===sr){var _e=y;_e._status=Za,_e._result=nt}}),y._status===sr){var X=y;X._status=Vn,X._result=B}}if(y._status===Mr){var fe=y._result;return fe===void 0&&oe(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
1
|
+
import{a as hS,b as Hp}from"./chunk-LQ7ENG4V.js";import{a as wR}from"./chunk-IWOTLFOY.js";import{a as Pf,b as fS,c as dS,e as Ip,f as Au,g as Pp,i as pS,j as vS,k as OR,l as tc,m as bR,n as mS,p as AR}from"./chunk-7Y7AZRL3.js";import{a as LR}from"./chunk-5HBIIYSK.js";import{a as yS}from"./chunk-AAK376RT.js";import{h as di,i as Zn}from"./chunk-B4OMIONW.js";import{b as DR}from"./chunk-AE3IQG7S.js";import{a as NR,c as pa,e as nn,g as P}from"./chunk-VKWPEFWQ.js";var OS=pa(kt=>{"use strict";P();var Hf=Symbol.for("react.element"),UR=Symbol.for("react.portal"),MR=Symbol.for("react.fragment"),zR=Symbol.for("react.strict_mode"),FR=Symbol.for("react.profiler"),IR=Symbol.for("react.provider"),PR=Symbol.for("react.context"),HR=Symbol.for("react.forward_ref"),jR=Symbol.for("react.suspense"),kR=Symbol.for("react.memo"),BR=Symbol.for("react.lazy"),gS=Symbol.iterator;function VR(s){return s===null||typeof s!="object"?null:(s=gS&&s[gS]||s["@@iterator"],typeof s=="function"?s:null)}var TS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_S=Object.assign,xS={};function nc(s,o,p){this.props=s,this.context=o,this.refs=xS,this.updater=p||TS}nc.prototype.isReactComponent={};nc.prototype.setState=function(s,o){if(typeof s!="object"&&typeof s!="function"&&s!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,s,o,"setState")};nc.prototype.forceUpdate=function(s){this.updater.enqueueForceUpdate(this,s,"forceUpdate")};function CS(){}CS.prototype=nc.prototype;function Uh(s,o,p){this.props=s,this.context=o,this.refs=xS,this.updater=p||TS}var Mh=Uh.prototype=new CS;Mh.constructor=Uh;_S(Mh,nc.prototype);Mh.isPureReactComponent=!0;var ES=Array.isArray,RS=Object.prototype.hasOwnProperty,zh={current:null},NS={key:!0,ref:!0,__self:!0,__source:!0};function DS(s,o,p){var E,h={},C=null,R=null;if(o!=null)for(E in o.ref!==void 0&&(R=o.ref),o.key!==void 0&&(C=""+o.key),o)RS.call(o,E)&&!NS.hasOwnProperty(E)&&(h[E]=o[E]);var F=arguments.length-2;if(F===1)h.children=p;else if(1<F){for(var A=Array(F),N=0;N<F;N++)A[N]=arguments[N+2];h.children=A}if(s&&s.defaultProps)for(E in F=s.defaultProps,F)h[E]===void 0&&(h[E]=F[E]);return{$$typeof:Hf,type:s,key:C,ref:R,props:h,_owner:zh.current}}function WR(s,o){return{$$typeof:Hf,type:s.type,key:o,ref:s.ref,props:s.props,_owner:s._owner}}function Fh(s){return typeof s=="object"&&s!==null&&s.$$typeof===Hf}function GR(s){var o={"=":"=0",":":"=2"};return"$"+s.replace(/[=:]/g,function(p){return o[p]})}var SS=/\/+/g;function wh(s,o){return typeof s=="object"&&s!==null&&s.key!=null?GR(""+s.key):o.toString(36)}function kp(s,o,p,E,h){var C=typeof s;(C==="undefined"||C==="boolean")&&(s=null);var R=!1;if(s===null)R=!0;else switch(C){case"string":case"number":R=!0;break;case"object":switch(s.$$typeof){case Hf:case UR:R=!0}}if(R)return R=s,h=h(R),s=E===""?"."+wh(R,0):E,ES(h)?(p="",s!=null&&(p=s.replace(SS,"$&/")+"/"),kp(h,o,p,"",function(N){return N})):h!=null&&(Fh(h)&&(h=WR(h,p+(!h.key||R&&R.key===h.key?"":(""+h.key).replace(SS,"$&/")+"/")+s)),o.push(h)),1;if(R=0,E=E===""?".":E+":",ES(s))for(var F=0;F<s.length;F++){C=s[F];var A=E+wh(C,F);R+=kp(C,o,p,A,h)}else if(A=VR(s),typeof A=="function")for(s=A.call(s),F=0;!(C=s.next()).done;)C=C.value,A=E+wh(C,F++),R+=kp(C,o,p,A,h);else if(C==="object")throw o=String(s),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.");return R}function jp(s,o,p){if(s==null)return s;var E=[],h=0;return kp(s,E,"","",function(C){return o.call(p,C,h++)}),E}function YR(s){if(s._status===-1){var o=s._result;o=o(),o.then(function(p){(s._status===0||s._status===-1)&&(s._status=1,s._result=p)},function(p){(s._status===0||s._status===-1)&&(s._status=2,s._result=p)}),s._status===-1&&(s._status=0,s._result=o)}if(s._status===1)return s._result.default;throw s._result}var Ia={current:null},Bp={transition:null},QR={ReactCurrentDispatcher:Ia,ReactCurrentBatchConfig:Bp,ReactCurrentOwner:zh};function LS(){throw Error("act(...) is not supported in production builds of React.")}kt.Children={map:jp,forEach:function(s,o,p){jp(s,function(){o.apply(this,arguments)},p)},count:function(s){var o=0;return jp(s,function(){o++}),o},toArray:function(s){return jp(s,function(o){return o})||[]},only:function(s){if(!Fh(s))throw Error("React.Children.only expected to receive a single React element child.");return s}};kt.Component=nc;kt.Fragment=MR;kt.Profiler=FR;kt.PureComponent=Uh;kt.StrictMode=zR;kt.Suspense=jR;kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QR;kt.act=LS;kt.cloneElement=function(s,o,p){if(s==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+s+".");var E=_S({},s.props),h=s.key,C=s.ref,R=s._owner;if(o!=null){if(o.ref!==void 0&&(C=o.ref,R=zh.current),o.key!==void 0&&(h=""+o.key),s.type&&s.type.defaultProps)var F=s.type.defaultProps;for(A in o)RS.call(o,A)&&!NS.hasOwnProperty(A)&&(E[A]=o[A]===void 0&&F!==void 0?F[A]:o[A])}var A=arguments.length-2;if(A===1)E.children=p;else if(1<A){F=Array(A);for(var N=0;N<A;N++)F[N]=arguments[N+2];E.children=F}return{$$typeof:Hf,type:s.type,key:h,ref:C,props:E,_owner:R}};kt.createContext=function(s){return s={$$typeof:PR,_currentValue:s,_currentValue2:s,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},s.Provider={$$typeof:IR,_context:s},s.Consumer=s};kt.createElement=DS;kt.createFactory=function(s){var o=DS.bind(null,s);return o.type=s,o};kt.createRef=function(){return{current:null}};kt.forwardRef=function(s){return{$$typeof:HR,render:s}};kt.isValidElement=Fh;kt.lazy=function(s){return{$$typeof:BR,_payload:{_status:-1,_result:s},_init:YR}};kt.memo=function(s,o){return{$$typeof:kR,type:s,compare:o===void 0?null:o}};kt.startTransition=function(s){var o=Bp.transition;Bp.transition={};try{s()}finally{Bp.transition=o}};kt.unstable_act=LS;kt.useCallback=function(s,o){return Ia.current.useCallback(s,o)};kt.useContext=function(s){return Ia.current.useContext(s)};kt.useDebugValue=function(){};kt.useDeferredValue=function(s){return Ia.current.useDeferredValue(s)};kt.useEffect=function(s,o){return Ia.current.useEffect(s,o)};kt.useId=function(){return Ia.current.useId()};kt.useImperativeHandle=function(s,o,p){return Ia.current.useImperativeHandle(s,o,p)};kt.useInsertionEffect=function(s,o){return Ia.current.useInsertionEffect(s,o)};kt.useLayoutEffect=function(s,o){return Ia.current.useLayoutEffect(s,o)};kt.useMemo=function(s,o){return Ia.current.useMemo(s,o)};kt.useReducer=function(s,o,p){return Ia.current.useReducer(s,o,p)};kt.useRef=function(s){return Ia.current.useRef(s)};kt.useState=function(s){return Ia.current.useState(s)};kt.useSyncExternalStore=function(s,o,p){return Ia.current.useSyncExternalStore(s,o,p)};kt.useTransition=function(){return Ia.current.useTransition()};kt.version="18.3.1"});var bS=pa((Bt,Vp)=>{"use strict";P();process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var s="18.3.1",o=Symbol.for("react.element"),p=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),F=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),Le=Symbol.for("react.offscreen"),Re=Symbol.iterator,he="@@iterator";function Ee(y){if(y===null||typeof y!="object")return null;var L=Re&&y[Re]||y[he];return typeof L=="function"?L:null}var $e={current:null},st={transition:null},et={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},Xe={current:null},Xt={},qe=null;function Ve(y){qe=y}Xt.setExtraStackFrame=function(y){qe=y},Xt.getCurrentStack=null,Xt.getStackAddendum=function(){var y="";qe&&(y+=qe);var L=Xt.getCurrentStack;return L&&(y+=L()||""),y};var rn=!1,We=!1,gt=!1,Me=!1,G=!1,ce={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:st,ReactCurrentOwner:Xe};ce.ReactDebugCurrentFrame=Xt,ce.ReactCurrentActQueue=et;function Oe(y){{for(var L=arguments.length,B=new Array(L>1?L-1:0),X=1;X<L;X++)B[X-1]=arguments[X];Tt("warn",y,B)}}function oe(y){{for(var L=arguments.length,B=new Array(L>1?L-1:0),X=1;X<L;X++)B[X-1]=arguments[X];Tt("error",y,B)}}function Tt(y,L,B){{var X=ce.ReactDebugCurrentFrame,fe=X.getStackAddendum();fe!==""&&(L+="%s",B=B.concat([fe]));var nt=B.map(function(_e){return String(_e)});nt.unshift("Warning: "+L),Function.prototype.apply.call(console[y],console,nt)}}var je={};function Ct(y,L){{var B=y.constructor,X=B&&(B.displayName||B.name)||"ReactClass",fe=X+"."+L;if(je[fe])return;oe("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",L,X),je[fe]=!0}}var we={isMounted:function(y){return!1},enqueueForceUpdate:function(y,L,B){Ct(y,"forceUpdate")},enqueueReplaceState:function(y,L,B,X){Ct(y,"replaceState")},enqueueSetState:function(y,L,B,X){Ct(y,"setState")}},_t=Object.assign,rt={};Object.freeze(rt);function Gt(y,L,B){this.props=y,this.context=L,this.refs=rt,this.updater=B||we}Gt.prototype.isReactComponent={},Gt.prototype.setState=function(y,L){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,L,"setState")},Gt.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};{var Je={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},bn=function(y,L){Object.defineProperty(Gt.prototype,y,{get:function(){Oe("%s(...) is deprecated in plain JavaScript React classes. %s",L[0],L[1])}})};for(var Kt in Je)Je.hasOwnProperty(Kt)&&bn(Kt,Je[Kt])}function tt(){}tt.prototype=Gt.prototype;function w(y,L,B){this.props=y,this.context=L,this.refs=rt,this.updater=B||we}var J=w.prototype=new tt;J.constructor=w,_t(J,Gt.prototype),J.isPureReactComponent=!0;function Ke(){var y={current:null};return Object.seal(y),y}var Yt=Array.isArray;function vt(y){return Yt(y)}function Dt(y){{var L=typeof Symbol=="function"&&Symbol.toStringTag,B=L&&y[Symbol.toStringTag]||y.constructor.name||"Object";return B}}function Et(y){try{return Qt(y),!1}catch{return!0}}function Qt(y){return""+y}function Nn(y){if(Et(y))return oe("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt(y)),Qt(y)}function An(y,L,B){var X=y.displayName;if(X)return X;var fe=L.displayName||L.name||"";return fe!==""?B+"("+fe+")":B}function Bn(y){return y.displayName||"Context"}function gn(y){if(y==null)return null;if(typeof y.tag=="number"&&oe("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case E:return"Fragment";case p:return"Portal";case C:return"Profiler";case h:return"StrictMode";case N:return"Suspense";case le:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case F:var L=y;return Bn(L)+".Consumer";case R:var B=y;return Bn(B._context)+".Provider";case A:return An(y,y.render,"ForwardRef");case $:var X=y.displayName||null;return X!==null?X:gn(y.type)||"Memo";case xe:{var fe=y,nt=fe._payload,_e=fe._init;try{return gn(_e(nt))}catch{return null}}}return null}var $n=Object.prototype.hasOwnProperty,br={key:!0,ref:!0,__self:!0,__source:!0},ha,on,Ar;Ar={};function ir(y){if($n.call(y,"ref")){var L=Object.getOwnPropertyDescriptor(y,"ref").get;if(L&&L.isReactWarning)return!1}return y.ref!==void 0}function Pa(y){if($n.call(y,"key")){var L=Object.getOwnPropertyDescriptor(y,"key").get;if(L&&L.isReactWarning)return!1}return y.key!==void 0}function Ka(y,L){var B=function(){ha||(ha=!0,oe("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",L))};B.isReactWarning=!0,Object.defineProperty(y,"key",{get:B,configurable:!0})}function ya(y,L){var B=function(){on||(on=!0,oe("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",L))};B.isReactWarning=!0,Object.defineProperty(y,"ref",{get:B,configurable:!0})}function ga(y){if(typeof y.ref=="string"&&Xe.current&&y.__self&&Xe.current.stateNode!==y.__self){var L=gn(Xe.current.type);Ar[L]||(oe('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L,y.ref),Ar[L]=!0)}}var Ea=function(y,L,B,X,fe,nt,_e){var Ze={$$typeof:o,type:y,key:L,ref:B,props:_e,_owner:nt};return Ze._store={},Object.defineProperty(Ze._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ze,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(Ze,"_source",{configurable:!1,enumerable:!1,writable:!1,value:fe}),Object.freeze&&(Object.freeze(Ze.props),Object.freeze(Ze)),Ze};function ta(y,L,B){var X,fe={},nt=null,_e=null,Ze=null,St=null;if(L!=null){ir(L)&&(_e=L.ref,ga(L)),Pa(L)&&(Nn(L.key),nt=""+L.key),Ze=L.__self===void 0?null:L.__self,St=L.__source===void 0?null:L.__source;for(X in L)$n.call(L,X)&&!br.hasOwnProperty(X)&&(fe[X]=L[X])}var At=arguments.length-2;if(At===1)fe.children=B;else if(At>1){for(var Pt=Array(At),qt=0;qt<At;qt++)Pt[qt]=arguments[qt+2];Object.freeze&&Object.freeze(Pt),fe.children=Pt}if(y&&y.defaultProps){var mn=y.defaultProps;for(X in mn)fe[X]===void 0&&(fe[X]=mn[X])}if(nt||_e){var _n=typeof y=="function"?y.displayName||y.name||"Unknown":y;nt&&Ka(fe,_n),_e&&ya(fe,_n)}return Ea(y,nt,_e,Ze,St,Xe.current,fe)}function ye(y,L){var B=Ea(y.type,L,y.ref,y._self,y._source,y._owner,y.props);return B}function Ge(y,L,B){if(y==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+y+".");var X,fe=_t({},y.props),nt=y.key,_e=y.ref,Ze=y._self,St=y._source,At=y._owner;if(L!=null){ir(L)&&(_e=L.ref,At=Xe.current),Pa(L)&&(Nn(L.key),nt=""+L.key);var Pt;y.type&&y.type.defaultProps&&(Pt=y.type.defaultProps);for(X in L)$n.call(L,X)&&!br.hasOwnProperty(X)&&(L[X]===void 0&&Pt!==void 0?fe[X]=Pt[X]:fe[X]=L[X])}var qt=arguments.length-2;if(qt===1)fe.children=B;else if(qt>1){for(var mn=Array(qt),_n=0;_n<qt;_n++)mn[_n]=arguments[_n+2];fe.children=mn}return Ea(y.type,nt,_e,Ze,St,At,fe)}function dt(y){return typeof y=="object"&&y!==null&&y.$$typeof===o}var Ie=".",an=":";function ur(y){var L=/[=:]/g,B={"=":"=0",":":"=2"},X=y.replace(L,function(fe){return B[fe]});return"$"+X}var Pe=!1,ze=/\/+/g;function vn(y){return y.replace(ze,"$&/")}function Zt(y,L){return typeof y=="object"&&y!==null&&y.key!=null?(Nn(y.key),ur(""+y.key)):L.toString(36)}function ut(y,L,B,X,fe){var nt=typeof y;(nt==="undefined"||nt==="boolean")&&(y=null);var _e=!1;if(y===null)_e=!0;else switch(nt){case"string":case"number":_e=!0;break;case"object":switch(y.$$typeof){case o:case p:_e=!0}}if(_e){var Ze=y,St=fe(Ze),At=X===""?Ie+Zt(Ze,0):X;if(vt(St)){var Pt="";At!=null&&(Pt=vn(At)+"/"),ut(St,L,Pt,"",function(Ql){return Ql})}else St!=null&&(dt(St)&&(St.key&&(!Ze||Ze.key!==St.key)&&Nn(St.key),St=ye(St,B+(St.key&&(!Ze||Ze.key!==St.key)?vn(""+St.key)+"/":"")+At)),L.push(St));return 1}var qt,mn,_n=0,On=X===""?Ie:X+an;if(vt(y))for(var Gn=0;Gn<y.length;Gn++)qt=y[Gn],mn=On+Zt(qt,Gn),_n+=ut(qt,L,B,mn,fe);else{var zr=Ee(y);if(typeof zr=="function"){var cn=y;zr===cn.entries&&(Pe||Oe("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Pe=!0);for(var Si=zr.call(cn),aa,Yo=0;!(aa=Si.next()).done;)qt=aa.value,mn=On+Zt(qt,Yo++),_n+=ut(qt,L,B,mn,fe)}else if(nt==="object"){var Yl=String(y);throw new Error("Objects are not valid as a React child (found: "+(Yl==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":Yl)+"). If you meant to render a collection of children, use an array instead.")}}return _n}function lr(y,L,B){if(y==null)return y;var X=[],fe=0;return ut(y,X,"","",function(nt){return L.call(B,nt,fe++)}),X}function pi(y){var L=0;return lr(y,function(){L++}),L}function or(y,L,B){lr(y,function(){L.apply(this,arguments)},B)}function Ot(y){return lr(y,function(L){return L})||[]}function wr(y){if(!dt(y))throw new Error("React.Children.only expected to receive a single React element child.");return y}function Ur(y){var L={$$typeof:F,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};L.Provider={$$typeof:R,_context:L};var B=!1,X=!1,fe=!1;{var nt={$$typeof:F,_context:L};Object.defineProperties(nt,{Provider:{get:function(){return X||(X=!0,oe("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),L.Provider},set:function(_e){L.Provider=_e}},_currentValue:{get:function(){return L._currentValue},set:function(_e){L._currentValue=_e}},_currentValue2:{get:function(){return L._currentValue2},set:function(_e){L._currentValue2=_e}},_threadCount:{get:function(){return L._threadCount},set:function(_e){L._threadCount=_e}},Consumer:{get:function(){return B||(B=!0,oe("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),L.Consumer}},displayName:{get:function(){return L.displayName},set:function(_e){fe||(Oe("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",_e),fe=!0)}}}),L.Consumer=nt}return L._currentRenderer=null,L._currentRenderer2=null,L}var sr=-1,Vn=0,Mr=1,Za=2;function $i(y){if(y._status===sr){var L=y._result,B=L();if(B.then(function(nt){if(y._status===Vn||y._status===sr){var _e=y;_e._status=Mr,_e._result=nt}},function(nt){if(y._status===Vn||y._status===sr){var _e=y;_e._status=Za,_e._result=nt}}),y._status===sr){var X=y;X._status=Vn,X._result=B}}if(y._status===Mr){var fe=y._result;return fe===void 0&&oe(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
2
|
|
|
3
3
|
Your code should look like:
|
|
4
4
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as K,b as _,c as z,d as N,e as f,f as d,g as W,h as G,j as H}from"./chunk-JG4FAT2T.js";import{a as x}from"./chunk-JALDNBTU.js";import{b as S,c as j}from"./chunk-ZNEPRGFY.js";import{a as R}from"./chunk-RSZAAN37.js";import{a as P}from"./chunk-ASKBYEO7.js";import{P as J,g as L}from"./chunk-HMPRWNGG.js";import{Ca as U,Na as A}from"./chunk-YKDRUAY3.js";import{b as D,c as v}from"./chunk-DMOLPSXF.js";import{y as F}from"./chunk-2KUM2RU4.js";import{a as C}from"./chunk-LG3KEHGD.js";import{k as O,n as k,o as M}from"./chunk-TD6JBHUS.js";import{Ab as g,zb as s}from"./chunk-ZMOW2YZ4.js";import{b as t}from"./chunk-3PYDIBTX.js";import{b as $}from"./chunk-AE3IQG7S.js";import{g as T}from"./chunk-IWTNUJGY.js";import{e as Z,g as m}from"./chunk-VKWPEFWQ.js";m();m();var B=t.string().refine(T,"Expected an absolute native filesystem path"),Y=t.object({id:t.string().uuid().describe("The dashboard extension registration UUID, not a Shopify GID."),name:t.string(),type:t.string().min(1).describe("The upstream dashboard extension type."),directory:B.describe("The absolute local extension directory."),configurationPath:B.nullable().describe("The absolute local TOML path, or null when no TOML file exists in a kept directory."),changed:t.boolean().describe("Whether this import wrote the local extension TOML.")}).strict(),q=t.object({extensionId:t.string().uuid().nullable().describe("The registration UUID, or null for identifier persistence."),error:S}).strict(),n=C({name:"ImportDashboardExtensionsResult",schema:t.object({status:t.enum(["success","partial","skipped","cancelled"]),reason:t.enum(["no-extensions","directory-selection-cancelled"]).nullable(),extensions:t.array(Y).describe("Completed extension imports and kept local directories, in selection order."),errors:t.array(q).describe("Failed selected imports or identifier persistence."),identifiersUpdated:t.boolean().describe("Whether the extension identifier persistence step completed.")}).strict(),definitions:{ImportedDashboardExtension:Y,ExtensionImportFailure:q,...j.definitions}});var Q=Z($(),1);var E=class u extends R{static descriptionWithMarkdown="Import dashboard-managed extensions into your app.";static jsonOutputSchema=n;static description=this.descriptionForHelp();static flags={...D,...P,...v,"client-id":Q.Flags.string({hidden:!1,description:"The Client ID of your app.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]})};async run(){let{flags:o}=await this.parse(u),r=await J({directory:o.path,clientId:o["client-id"],forceRelink:o.reset,userProvidedConfigName:o.config}),a=await H({developerPlatformClient:r.developerPlatformClient,apiKey:r.remoteApp.apiKey,organizationId:r.remoteApp.organizationId,extensionTypes:N}),l=_(o.json?G(r.app,a):a);if(l.length===0)o.json?s(n.encode({status:"skipped",reason:"no-extensions",extensions:[],errors:[],identifiersUpdated:!1})):F({headline:["No extensions to migrate."]});else{let y=await z(l),i;try{if(i=await W({...r,extensions:a,extensionTypes:y.extensionTypes,buildExtensionConfig:y.buildExtensionConfig}),o.json&&i.status==="skipped")return s(n.encode({status:i.status,reason:i.reason,extensions:[],errors:[],identifiersUpdated:!1})),{app:r.app};o.json||K(i),await L({app:r.app,appApiKey:r.remoteApp.apiKey,extensionUuids:i.extensionUuids,command:"import-extensions"})}catch(e){if(!o.json)throw e instanceof d?e.originalError:e;let I=e instanceof d?e.originalError:e;if(e instanceof f||e instanceof d){let p=await e.completedImports();if(e instanceof d&&p.extensions.length===0)throw e.originalError;let h=e instanceof f&&p.failures.length===0;if(s(n.encode({status:h?"cancelled":"partial",reason:h?"directory-selection-cancelled":null,extensions:b(p.extensions),errors:p.failures.map(({extension:V,error:X})=>({extensionId:V.uuid,error:x(X)})),identifiersUpdated:!1})),h)throw await g(),e;e instanceof f&&(I=p.failures[0].error)}else if(i)s(n.encode({status:"partial",reason:null,extensions:b(i.extensions),errors:[{extensionId:null,error:x(e)}],identifiersUpdated:!1}));else throw e;let c=await k(I),w=M(c)?"unexpected_error":"expected_error";throw await U({config:this.config,errorMessage:c instanceof Error?c.message:void 0,exitMode:w}),await A(c,w),await g(),new O}o.json&&s(n.encode({status:"success",reason:null,extensions:b(i.extensions),errors:[],identifiersUpdated:!0}))}return{app:r.app}}};function b(u){return u.map(({extension:o,directory:r,configurationPath:a,changed:l})=>({id:o.uuid,name:o.title,type:o.type,directory:r,configurationPath:a,changed:l}))}export{E as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{a as p}from"./chunk-3PYDIBTX.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();a();a();var j=Symbol("Let zodToJsonSchema decide on which parser to use");var T={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},N=e=>typeof e=="string"?{...T,name:e}:{...T,...e};a();var M=e=>{let t=N(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};a();function k(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function m(e,t,r,n,i){e[t]=r,k(e,t,n,i)}a();var A=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};a();a();a();function f(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?A(t,e.currentPath):t.join("/")}}a();function $(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==p.ZodAny&&(r.items=o(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&m(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&m(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(m(r,"minItems",e.exactLength.value,e.exactLength.message,t),m(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}a();function w(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?m(r,"minimum",n.value,n.message,t):m(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),m(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?m(r,"maximum",n.value,n.message,t):m(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),m(r,"maximum",n.value,n.message,t));break;case"multipleOf":m(r,"multipleOf",n.value,n.message,t);break}return r}a();function E(){return{type:"boolean"}}a();function v(e,t){return o(e.type._def,t)}a();var z=(e,t)=>o(e.innerType._def,t);a();function _(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,s)=>_(e,t,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return se(e,t)}}var se=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":m(r,"minimum",n.value,n.message,t);break;case"max":m(r,"maximum",n.value,n.message,t);break}return r};a();function R(e,t){return{...o(e.innerType._def,t),default:e.defaultValue()}}a();function L(e,t){return t.effectStrategy==="input"?o(e.schema._def,t):f(t)}a();function F(e){return{type:"string",enum:Array.from(e.values)}}a();var pe=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function I(e,t){let r=[o(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(s=>{if(pe(s))i.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;i.push(c)}}),i.length?{allOf:i,...n}:void 0}a();function C(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}a();a();a();var S,g={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(S===void 0&&(S=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function P(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":m(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":m(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":y(r,"email",n.message,t);break;case"format:idn-email":y(r,"idn-email",n.message,t);break;case"pattern:zod":d(r,g.email,n.message,t);break}break;case"url":y(r,"uri",n.message,t);break;case"uuid":y(r,"uuid",n.message,t);break;case"regex":d(r,n.regex,n.message,t);break;case"cuid":d(r,g.cuid,n.message,t);break;case"cuid2":d(r,g.cuid2,n.message,t);break;case"startsWith":d(r,RegExp(`^${Z(n.value,t)}`),n.message,t);break;case"endsWith":d(r,RegExp(`${Z(n.value,t)}$`),n.message,t);break;case"datetime":y(r,"date-time",n.message,t);break;case"date":y(r,"date",n.message,t);break;case"time":y(r,"time",n.message,t);break;case"duration":y(r,"duration",n.message,t);break;case"length":m(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),m(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{d(r,RegExp(Z(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&y(r,"ipv4",n.message,t),n.version!=="v4"&&y(r,"ipv6",n.message,t);break}case"base64url":d(r,g.base64url,n.message,t);break;case"jwt":d(r,g.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&d(r,g.ipv4Cidr,n.message,t),n.version!=="v4"&&d(r,g.ipv6Cidr,n.message,t);break}case"emoji":d(r,g.emoji(),n.message,t);break;case"ulid":{d(r,g.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{y(r,"binary",n.message,t);break}case"contentEncoding:base64":{m(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{d(r,g.base64,n.message,t);break}}break}case"nanoid":d(r,g.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Z(e,t){return t.patternStrategy==="escape"?me(e):e}var ue=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function me(e){let t="";for(let r=0;r<e.length;r++)ue.has(e[r])||(t+="\\"),t+=e[r];return t}function y(e,t,r,n){e.format||e.anyOf?.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):m(e,"format",t,r,n)}function d(e,t,r,n){e.pattern||e.allOf?.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:U(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):m(e,"pattern",U(t,n),r,n)}function U(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,i="",s=!1,c=!1,l=!1;for(let u=0;u<n.length;u++){if(s){i+=n[u],s=!1;continue}if(r.i){if(c){if(n[u].match(/[a-z]/)){l?(i+=n[u],i+=`${n[u-2]}-${n[u]}`.toUpperCase(),l=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(i+=n[u],l=!0):i+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){i+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(r.m){if(n[u]==="^"){i+=`(^|(?<=[\r
|
|
2
2
|
]))`;continue}else if(n[u]==="$"){i+=`($|(?=[\r
|
|
3
3
|
]))`;continue}}if(r.s&&n[u]==="."){i+=c?`${n[u]}\r
|
|
4
4
|
`:`[${n[u]}\r
|
|
5
|
-
]`;continue}i+=n[u],n[u]==="\\"?s=!0:c&&n[u]==="]"?c=!1:!c&&n[u]==="["&&(c=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function D(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===p.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,i)=>({...n,[i]:o(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",i]})??f(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:o(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===p.ZodString&&e.keyType._def.checks?.length){let{type:n,...i}=P(e.keyType._def,t);return{...r,propertyNames:i}}else{if(e.keyType?._def.typeName===p.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===p.ZodBranded&&e.keyType._def.type._def.typeName===p.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...i}=v(e.keyType._def,t);return{...r,propertyNames:i}}}return r}function B(e,t){if(t.mapStrategy==="record")return D(e,t);let r=o(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||f(t),n=o(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||f(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}a();function J(e){let t=e.values,n=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),i=Array.from(new Set(n.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}a();function V(e){return e.target==="openAi"?void 0:{not:f({...e,currentPath:[...e.currentPath,"not"]})}}a();function K(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a();a();var b={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function W(e,t){if(t.target==="openApi3")return q(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in b&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,s)=>{let c=b[s._def.typeName];return c&&!i.includes(c)?[...i,c]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...i,c];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:i.length>1?i:i[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(s=>!n.includes(s))],[])};return q(e,t)}var q=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,i)=>o(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function G(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:b[e.innerType._def.typeName],nullable:!0}:{type:[b[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=o(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=o(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}a();function H(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",k(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?m(r,"minimum",n.value,n.message,t):m(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),m(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?m(r,"maximum",n.value,n.message,t):m(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),m(r,"maximum",n.value,n.message,t));break;case"multipleOf":m(r,"multipleOf",n.value,n.message,t);break}return r}a();function Q(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},i=[],s=e.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let h=le(u);h&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),h=!1);let x=o(u._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});x!==void 0&&(n.properties[l]=x,h||i.push(l))}i.length&&(n.required=i);let c=ce(e,t);return c!==void 0&&(n.additionalProperties=c),n}function ce(e,t){if(e.catchall._def.typeName!=="ZodNever")return o(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function le(e){try{return e.isOptional()}catch{return!0}}a();var X=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return o(e.innerType._def,t);let r=o(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:f(t)},r]}:f(t)};a();var Y=(e,t)=>{if(t.pipeStrategy==="input")return o(e.in._def,t);if(t.pipeStrategy==="output")return o(e.out._def,t);let r=o(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=o(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}};a();function ee(e,t){return o(e.type._def,t)}a();function te(e,t){let n={type:"array",uniqueItems:!0,items:o(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&m(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&m(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}a();function re(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>o(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:o(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>o(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}a();function ne(e){return{not:f(e)}}a();function ae(e){return f(e)}a();var ie=(e,t)=>o(e.innerType._def,t);var oe=(e,t,r)=>{switch(t){case p.ZodString:return P(e,r);case p.ZodNumber:return H(e,r);case p.ZodObject:return Q(e,r);case p.ZodBigInt:return w(e,r);case p.ZodBoolean:return E();case p.ZodDate:return _(e,r);case p.ZodUndefined:return ne(r);case p.ZodNull:return K(r);case p.ZodArray:return $(e,r);case p.ZodUnion:case p.ZodDiscriminatedUnion:return W(e,r);case p.ZodIntersection:return I(e,r);case p.ZodTuple:return re(e,r);case p.ZodRecord:return D(e,r);case p.ZodLiteral:return C(e,r);case p.ZodEnum:return F(e);case p.ZodNativeEnum:return J(e);case p.ZodNullable:return G(e,r);case p.ZodOptional:return X(e,r);case p.ZodMap:return B(e,r);case p.ZodSet:return te(e,r);case p.ZodLazy:return()=>e.getter()._def;case p.ZodPromise:return ee(e,r);case p.ZodNaN:case p.ZodNever:return V(r);case p.ZodEffects:return L(e,r);case p.ZodAny:return f(r);case p.ZodUnknown:return ae(r);case p.ZodDefault:return R(e,r);case p.ZodBranded:return v(e,r);case p.ZodReadonly:return ie(e,r);case p.ZodCatch:return z(e,r);case p.ZodPipeline:return Y(e,r);case p.ZodFunction:case p.ZodVoid:case p.ZodSymbol:return;default:return(n=>{})(t)}};function o(e,t,r=!1){let n=t.seen.get(e);if(t.override){let l=t.override?.(e,t,n,r);if(l!==j)return l}if(n&&!r){let l=fe(n,t);if(l!==void 0)return l}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let s=oe(e,e.typeName,t),c=typeof s=="function"?o(s(),t):s;if(c&&de(e,t,c),t.postProcess){let l=t.postProcess(c,e,t);return i.jsonSchema=c,l}return i.jsonSchema=c,c}var fe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:A(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),f(t)):t.$refStrategy==="seen"?f(t):void 0}},de=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);a();a();var O=(e,t)=>{let r=M(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[h,x])=>({...u,[h]:o(x._def,{...r,currentPath:[...r.basePath,r.definitionPath,h]},!0)??f(r)}),{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,s=o(e._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??f(r),c=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=i===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l};function Hn(e){return{name:e.name,schema:e.schema,definitions:e.definitions??{},jsonSchema:O(e.schema,{name:e.name,nameStrategy:"title",...e.definitions?{definitions:e.definitions}:{},target:"jsonSchema7"}),validate:t=>e.schema.parse(t),encode:t=>ge(e.schema.parse(t))}}function ge(e){let t=JSON.stringify(e,null,2);if(t===void 0)throw new TypeError("JSON output must be serializable.");return t}export{Hn as a};
|
|
5
|
+
]`;continue}i+=n[u],n[u]==="\\"?s=!0:c&&n[u]==="]"?c=!1:!c&&n[u]==="["&&(c=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function D(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===p.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,i)=>({...n,[i]:o(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",i]})??f(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:o(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===p.ZodString&&e.keyType._def.checks?.length){let{type:n,...i}=P(e.keyType._def,t);return{...r,propertyNames:i}}else{if(e.keyType?._def.typeName===p.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===p.ZodBranded&&e.keyType._def.type._def.typeName===p.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...i}=v(e.keyType._def,t);return{...r,propertyNames:i}}}return r}function B(e,t){if(t.mapStrategy==="record")return D(e,t);let r=o(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||f(t),n=o(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||f(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}a();function J(e){let t=e.values,n=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),i=Array.from(new Set(n.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}a();function V(e){return e.target==="openAi"?void 0:{not:f({...e,currentPath:[...e.currentPath,"not"]})}}a();function K(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a();a();var b={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function W(e,t){if(t.target==="openApi3")return q(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in b&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,s)=>{let c=b[s._def.typeName];return c&&!i.includes(c)?[...i,c]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...i,c];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:i.length>1?i:i[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(s=>!n.includes(s))],[])};return q(e,t)}var q=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,i)=>o(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function G(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:b[e.innerType._def.typeName],nullable:!0}:{type:[b[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=o(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=o(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}a();function H(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",k(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?m(r,"minimum",n.value,n.message,t):m(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),m(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?m(r,"maximum",n.value,n.message,t):m(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),m(r,"maximum",n.value,n.message,t));break;case"multipleOf":m(r,"multipleOf",n.value,n.message,t);break}return r}a();function Q(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},i=[],s=e.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let h=le(u);h&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),h=!1);let x=o(u._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});x!==void 0&&(n.properties[l]=x,h||i.push(l))}i.length&&(n.required=i);let c=ce(e,t);return c!==void 0&&(n.additionalProperties=c),n}function ce(e,t){if(e.catchall._def.typeName!=="ZodNever")return o(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function le(e){try{return e.isOptional()}catch{return!0}}a();var X=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return o(e.innerType._def,t);let r=o(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:f(t)},r]}:f(t)};a();var Y=(e,t)=>{if(t.pipeStrategy==="input")return o(e.in._def,t);if(t.pipeStrategy==="output")return o(e.out._def,t);let r=o(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=o(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}};a();function ee(e,t){return o(e.type._def,t)}a();function te(e,t){let n={type:"array",uniqueItems:!0,items:o(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&m(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&m(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}a();function re(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>o(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:o(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>o(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}a();function ne(e){return{not:f(e)}}a();function ae(e){return f(e)}a();var ie=(e,t)=>o(e.innerType._def,t);var oe=(e,t,r)=>{switch(t){case p.ZodString:return P(e,r);case p.ZodNumber:return H(e,r);case p.ZodObject:return Q(e,r);case p.ZodBigInt:return w(e,r);case p.ZodBoolean:return E();case p.ZodDate:return _(e,r);case p.ZodUndefined:return ne(r);case p.ZodNull:return K(r);case p.ZodArray:return $(e,r);case p.ZodUnion:case p.ZodDiscriminatedUnion:return W(e,r);case p.ZodIntersection:return I(e,r);case p.ZodTuple:return re(e,r);case p.ZodRecord:return D(e,r);case p.ZodLiteral:return C(e,r);case p.ZodEnum:return F(e);case p.ZodNativeEnum:return J(e);case p.ZodNullable:return G(e,r);case p.ZodOptional:return X(e,r);case p.ZodMap:return B(e,r);case p.ZodSet:return te(e,r);case p.ZodLazy:return()=>e.getter()._def;case p.ZodPromise:return ee(e,r);case p.ZodNaN:case p.ZodNever:return V(r);case p.ZodEffects:return L(e,r);case p.ZodAny:return f(r);case p.ZodUnknown:return ae(r);case p.ZodDefault:return R(e,r);case p.ZodBranded:return v(e,r);case p.ZodReadonly:return ie(e,r);case p.ZodCatch:return z(e,r);case p.ZodPipeline:return Y(e,r);case p.ZodFunction:case p.ZodVoid:case p.ZodSymbol:return;default:return(n=>{})(t)}};function o(e,t,r=!1){let n=t.seen.get(e);if(t.override){let l=t.override?.(e,t,n,r);if(l!==j)return l}if(n&&!r){let l=fe(n,t);if(l!==void 0)return l}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let s=oe(e,e.typeName,t),c=typeof s=="function"?o(s(),t):s;if(c&&de(e,t,c),t.postProcess){let l=t.postProcess(c,e,t);return i.jsonSchema=c,l}return i.jsonSchema=c,c}var fe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:A(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),f(t)):t.$refStrategy==="seen"?f(t):void 0}},de=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);a();a();var O=(e,t)=>{let r=M(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[h,x])=>({...u,[h]:o(x._def,{...r,currentPath:[...r.basePath,r.definitionPath,h]},!0)??f(r)}),{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,s=o(e._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??f(r),c=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=i===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l};function Qn(e){return{name:e.name,schema:e.schema,definitions:e.definitions??{},jsonSchema:O(e.schema,{name:e.name,nameStrategy:"title",...e.definitions?{definitions:e.definitions}:{},target:"jsonSchema7"}),validate:t=>e.schema.parse(t),encode:t=>ge(e.schema.parse(t))}}function ge(e){let t=JSON.stringify(e,null,2);if(t===void 0)throw new TypeError("JSON output must be serializable.");return t}export{Qn as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as I,b as h,d as m}from"./chunk-T4ZOTYOY.js";import{m as f,n as L}from"./chunk-3FZ4LE6A.js";import{a as v}from"./chunk-JIY6XWSC.js";import{Eb as g}from"./chunk-ZMOW2YZ4.js";import{a as b}from"./chunk-O472FAYX.js";import{e as V,g as w}from"./chunk-VKWPEFWQ.js";w();var e=V(b(),1),S=300*1e3,$=3e3,K="@shopify/cli",o=`${new e.SemVer(v).major}.x`,y=new Map;function N(){return m(o)}async function D({includeCurrentMajor:n=!0}={}){try{let s=await I(),t=h(s,o),i=y.get(t);if(i)return i;let c=m(void 0,s),u=m(o,s);if(c&&(!n||u))return{latest:c,currentMajor:u};let l=L(`${t}-lookup-failure`);if(l&&Date.now()-l.timestamp<S)return{};let a=T(s).catch(()=>({})).finally(()=>{y.delete(t)});return y.set(t,a),a}catch{return g("Skipping the CLI version lookup after a registry or cache failure."),{}}}async function T(n){let s=h(n),t=h(n,o),i=`${t}-lookup-failure`;try{let[{fetch:c},{default:u}]=await Promise.all([import("./http-2OXOS2AW.js"),import("./registry-auth-token-EDH77OOW.js")]),l=new URL(encodeURIComponent(K).replace(/^%40/,"@"),n),a=u(n,{recursive:!0}),C={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};a&&(C.authorization=`${a.type} ${a.token}`);let k=await c(l.href,{headers:C,redirect:"error"},{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:$});if(!k.ok)throw new Error("The npm registry request failed.");let p=await k.json(),r=p["dist-tags"].latest;if(!r||!(0,e.valid)(r)||!p.versions[r])throw new Error("The npm registry did not return a stable latest CLI version.");let j=Object.keys(p.versions).filter(R=>!p.versions[R]?.deprecated),M=(0,e.satisfies)(r,o)?`${o} <=${r}`:o,d=(0,e.maxSatisfying)(j,M);if(!d)throw new Error("The npm registry did not return a stable CLI version in the current major.");return f(s,r),f(t,d),{latest:r,currentMajor:d}}catch{return g("Skipping the CLI version lookup after a registry or cache failure."),f(i,""),{}}}export{N as a,D as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,b as e,e as p}from"./chunk-SQL67BKI.js";import{b as a}from"./chunk-XEZPN5TR.js";import{b as o,c as r}from"./chunk-DMOLPSXF.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class m extends a{static summary="Upgrades Shopify CLI.";static descriptionWithMarkdown="Upgrades Shopify CLI using your package manager.";static jsonOutputSchema=i;static description=this.descriptionForHelp();static flags={...o,...r};async run(){let{flags:n}=await this.parse(m),c=await p();e(c,n.json?"json":"text")}};export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v,u as U,y as D}from"./chunk-JGLLABZR.js";import{$ as z,_ as $,aa as x,ca as L,ea as I}from"./chunk-YYWSHRO2.js";import{p as P}from"./chunk-OJOF6IYG.js";import{a as k}from"./chunk-HVUMVDUG.js";import{B as g,W as R}from"./chunk-YKDRUAY3.js";import{G as N,L as S,S as y,x as _,y as O}from"./chunk-2KUM2RU4.js";import{b as C}from"./chunk-QBRRFFMZ.js";import{g as A,i}from"./chunk-TD6JBHUS.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();l();l();async function b(e,t){if(t.clientName!==v.AppManagement||!t.devStoreCapReached)return!1;try{return await t.devStoreCapReached(e)}catch{return!1}}async function E(e,t,o,d="disabled"){let m=o.clientName===v.AppManagement,c=async f=>o.devStoresForOrg(t.id,f),s=d!=="disabled"&&o.clientName===v.AppManagement,n=async()=>{if(await b(t.id,o))throw new i(W,q(t.id));let f=await $(),h=await z(),M=await x(),u=await P({name:f,plan:h,withDemoData:M,organization:t,json:!1,summary:!1}),w=await H(t,u,o);return O({headline:`Dev store "${w.shopName}" created successfully.`}),w},a,r;if(s&&e.stores.length===0){if(await b(t.id,o))throw new i(W,q(t.id));if(S()===!1)throw new i("No development store was specified.",G(t.id));a=async()=>(_({body:j(t)}),n())}else if(s&&d==="selection-option"){if(S()===!1&&(e.stores.length>1||e.hasMorePages))throw new i("No development store was specified.","Run `shopify app dev --store <store-domain>` to select a development store.");S()&&!await b(t.id,o)&&(r=n)}let p=await L({onSearchForStoresByName:c,...e,showDomainOnPrompt:m,...a?{onCreateStoreWhenEmpty:a}:{},...r?{onCreateStore:r}:{}});if(!p){if(a)throw new A;if(_({body:await o.getCreateDevStoreLink(t)}),await y(5),!await I(t))throw new A;let h=await V(t.id,o);p=await E({stores:h,hasMorePages:!1},t,o,d)}return F(p),p}async function H(e,t,o){let c;if(await N([{title:"Fetching organization data",task:async()=>{for(let n=0;n<10;n++){try{let a=await D(e,t,o);if(a){c=a;return}}catch(a){if(!(a instanceof U))throw a}await y(3)}}}]),!c)throw new i(`The newly created development store (${t}) is not available yet.`,`Run \`shopify app dev --store ${t}\` to select it when it is ready.`);return c}async function V(e,t){let m=[];return await N([{title:"Fetching organization data",task:async()=>{for(let s=0;s<10;s++){let{stores:n}=await t.devStoresForOrg(e);if(n.length>0){m=n;return}await y(3)}}}]),m}var W="Your organization has reached its development store limit.";function j(e){return`You don't have any dev stores associated with ${e.businessName}'s Dev Dashboard. Let's create one.`}function B(e){return`shopify store create dev --organization-id ${e} --name <store-name> --plan <plan>`}function G(e){return`Create a development store with \`${B(e)}\`, then run \`shopify app dev --store <store-domain>\`.`}function q(e){return`Make a development store slot available in Dev Dashboard. Then create a development store with \`${B(e)}\`, then run \`shopify app dev --store <store-domain>\`.`}function F(e){if(!e.transferDisabled)throw!e.transferDisabled&&!e.convertableToPartnerTest?new i(`The store you specified (${e.shopDomain}) is not a dev store`,"Run dev --reset and select an eligible dev store."):new i(`The store you specified (${e.shopDomain}) is not transfer-disabled`,"Run dev --reset and select a transfer-disabled dev store.")}async function ve({appContextResult:e,storeFqdn:t,forceReselectStore:o,storeTypes:d=["APP_DEVELOPMENT"],storeCreationMode:m="disabled",devSession:c=!1}){let{app:s,organization:n,developerPlatformClient:a}=e,r,p=s.configuration.build?.dev_store_url,f=s.hiddenConfig.dev_store_url,h=p??f,u=t??(o?void 0:h),w=d.length===1&&d[0]==="APP_DEVELOPMENT",T=c&&w&&R();if(T)r=J(u);else if(u)r=await D(n,u,a,d),w&&F(r);else{let Y=await a.devStoresForOrg(n.id);r=await E(Y,n,a,m)}return r.shopDomain=g(r.shopDomain),await K(r,o),!T&&(r.shopDomain!==h||!f)&&await s.updateHiddenConfig({dev_store_url:r.shopDomain}),T||await a.ensureUserAccessToStore(n.id,r),r}function J(e){if(!e)throw new i("A service account needs a dev store to run this command.","Pass the dev store with --store, or set build.dev_store_url in the app configuration.");let t=g(e);return{shopId:"",link:"",shopDomain:t,shopName:t,transferDisabled:!0,convertableToPartnerTest:!1,provisionable:!1}}async function K(e,t){await k.addPublicMetadata(()=>({cmd_app_reset_used:t,store_fqdn_hash:C(e.shopDomain),store_domain:e.shopDomain})),await k.addSensitiveMetadata(()=>({store_fqdn:e.shopDomain}))}export{ve as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as j}from"./chunk-RSZAAN37.js";import{a as C}from"./chunk-ASKBYEO7.js";import{P as O,m as N}from"./chunk-HMPRWNGG.js";import{b as R,c as k}from"./chunk-DMOLPSXF.js";import{F as w}from"./chunk-2KUM2RU4.js";import{a as y}from"./chunk-LG3KEHGD.js";import{i as S}from"./chunk-TD6JBHUS.js";import{Bb as f,Kb as b,ba as v,tb as x,vb as E,zb as I}from"./chunk-ZMOW2YZ4.js";import{i as T}from"./chunk-B4OMIONW.js";import{b as o}from"./chunk-3PYDIBTX.js";import{i as L}from"./chunk-IWTNUJGY.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var B=o.object({createdAt:o.string(),createdBy:o.string(),versionTag:o.string().nullable().optional(),status:o.string(),versionId:o.string(),message:o.string()}),u=y({name:"AppVersionsListResult",schema:o.array(B),definitions:{AppVersion:B}});r();async function M(i,t){let n=await i.appVersions(t);if(!n.app)throw new S(`Shopify did not return app information for API key ${t.apiKey}.`);return{appVersions:n.app.appVersions.nodes.map(e=>({createdAt:v(new Date(e.createdAt)),createdBy:e.createdBy?.displayName??"",versionTag:e.versionTag,status:e.status,versionId:e.versionId,message:e.message??""})),totalResults:n.app.appVersions.pageInfo.totalResults}}r();var $=12;async function D({app:i,appVersions:t,totalResults:n,remoteApp:e,organization:p,developerPlatformClient:m},d){if(d==="json"){I(u.encode(t));return}if(N({org:p.businessName,appName:e.title,configFile:L(i.configPath)}),t.length===0){f("No app versions found for this app");return}let g=t.map(({versionId:s,...a})=>({...a,status:a.status==="active"?T.green(`\u2605 ${a.status}`):a.status})),l=(process.stdout.columns??75)-$,c=l;g.forEach(s=>{let a=s.message.length+(s.versionTag?.length??0)+b(s.status).length+s.createdAt.length+s.createdBy.length;if(a>l){let J=a-s.message.length,A=Math.max(l-J,10);A<c&&(c=A)}}),g.forEach(s=>{s.message.length>c&&(s.message=`${s.message.slice(0,c-3)}...`)}),w({rows:g,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let F=x.link(m.webUiName,[await m.appDeepLink(e),"versions"].join("/"));f(E`\nView all ${String(n)} app versions in the ${F}`)}var h=class i extends j{static summary="List deployed versions of your app.";static descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";static jsonOutputSchema=u;static description=this.descriptionForHelp();static flags={...R,...C,...k};async run(){let{flags:t}=await this.parse(i),{app:n,remoteApp:e,developerPlatformClient:p,organization:m}=await O({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),d=await M(p,e);return await D({app:n,remoteApp:e,organization:m,developerPlatformClient:p,...d},t.json?"json":"text"),{app:n}}};export{h as a};
|