cf 1.0.0-beta.27 → 1.0.0-beta.28
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/_meta/commands.json +5787 -1914
- package/dist/_meta/hand-written-commands.json +2 -2
- package/dist/_meta/schemas.json +796 -557
- package/dist/{abuse-reports-RxXqfDEW.mjs → abuse-reports-D9edOyag.mjs} +5 -5
- package/dist/{access-BxEprr2f.mjs → access-CKCCSrrU.mjs} +1 -1
- package/dist/{accounts-DU2ZNYqP.mjs → accounts-CNb9U9bK.mjs} +22 -22
- package/dist/{acm-CBCIKBJ4.mjs → acm-CdKTAToZ.mjs} +3 -3
- package/dist/{addressing-BKxiLRHk.mjs → addressing-eZI_C-b0.mjs} +18 -18
- package/dist/{agent-memory-DkBpQYUL.mjs → agent-memory-BBHCEE7h.mjs} +7 -7
- package/dist/{ai-DqEN_hhg.mjs → ai-Csl_QNwv.mjs} +7 -7
- package/dist/ai-audit-DlqWsQi-.mjs +6 -0
- package/dist/{ai-gateway-B0uiYVHq.mjs → ai-gateway-Lj4On37s.mjs} +13 -13
- package/dist/{ai-search-DbZIxdio.mjs → ai-search-BxyhS3X7.mjs} +17 -17
- package/dist/{ai-security-CvZfP2JC.mjs → ai-security-DvU2iYkY.mjs} +3 -3
- package/dist/{alerting-BjGwBxZT.mjs → alerting-r0G2X9y9.mjs} +10 -10
- package/dist/{analytics-C7kT_H-W.mjs → analytics-C6bfqm-W.mjs} +7 -7
- package/dist/analytics-engine-BlIecoOe.mjs +4 -0
- package/dist/api-Dnt6lRJG.mjs +3 -0
- package/dist/{api-security-BbcvDtff.mjs → api-security-DZ7GWOqD.mjs} +26 -26
- package/dist/argo-Bh0_cj49.mjs +14 -0
- package/dist/{artifacts-2R2sxIKO.mjs → artifacts-VZJWVq_6.mjs} +16 -16
- package/dist/{audit-logs-LoBB1OO_.mjs → audit-logs-B8cGL4B9.mjs} +1 -1
- package/dist/auth-B-h0BHg7.mjs +2 -0
- package/dist/auth-B6tswVxH.mjs +2 -0
- package/dist/{auth-D499YE2n.mjs → auth-clmqFEWU.mjs} +3 -3
- package/dist/{auth-token-BwpERbnG.mjs → auth-token-DW4dJVdj.mjs} +1 -1
- package/dist/{autoconfig-B2w-woU0.mjs → autoconfig-C0ynlGHf.mjs} +47 -47
- package/dist/{basin-catalog-AgOHGiPI.mjs → basin-catalog-TehR1sKZ.mjs} +11 -11
- package/dist/billing-B2KusU6g.mjs +22 -0
- package/dist/{blocks-C8vyXIAT.mjs → blocks-BFulF68V.mjs} +1 -1
- package/dist/body-parser-DoewLePl.mjs +2 -0
- package/dist/{body-unions-CjpNjwSW.mjs → body-unions-DNs981Ia.mjs} +1 -1
- package/dist/{bot-management-fwxKIbaB.mjs → bot-management-CXHXgrQC.mjs} +2 -2
- package/dist/{botnet-feed-DCYB5kYZ.mjs → botnet-feed-UyK7Rfp6.mjs} +1 -1
- package/dist/brand-protection-kv1ba80i.mjs +14 -0
- package/dist/browser-run-D-vRoZmf.mjs +40 -0
- package/dist/build-BzJGqb2o.mjs +2 -0
- package/dist/build-FFxzigo4.mjs +2 -0
- package/dist/{builds-CoazxuN-.mjs → builds-BbxINHRP.mjs} +15 -15
- package/dist/cache-BacNNtLu.mjs +36 -0
- package/dist/{cf-hP0SOgC6.mjs → cf-BQ_LRiut.mjs} +2 -2
- package/dist/{chunk-DSGVRFIS-DQwKND2c.mjs → chunk-DSGVRFIS-BaNZNW-M.mjs} +1 -1
- package/dist/{chunk-SOBRPAPT-BKzUiNx_.mjs → chunk-SOBRPAPT-QTjnHSNs.mjs} +1 -1
- package/dist/{cli-Nqf58-1c.mjs → cli-B7vslRfu.mjs} +1 -1
- package/dist/{client-side-security-VmZzMy-m.mjs → client-side-security-bzB9JosR.mjs} +6 -6
- package/dist/{cloud-connector-bMlFnqP0.mjs → cloud-connector-BHtf37R5.mjs} +2 -2
- package/dist/{cloudflared-Ba4KWdTO.mjs → cloudflared-QDdHMUEY.mjs} +1 -1
- package/dist/{cloudforce-one-CCaIBOAo.mjs → cloudforce-one-DWBPQDA3.mjs} +71 -71
- package/dist/{command-C4OgtX_x.mjs → command-AVwd7XjE.mjs} +1 -1
- package/dist/{command-C5Kqc5Km.mjs → command-B87T_f2f.mjs} +1 -1
- package/dist/{command-CelQVrZL.mjs → command-CEHhi3t0.mjs} +1 -1
- package/dist/{command-ByYf12-8.mjs → command-CYmQE79n.mjs} +1 -1
- package/dist/{command-pMoNdd22.mjs → command-CbxXc5IW.mjs} +1 -1
- package/dist/{command-Bih1HLr3.mjs → command-Ce8CVLth.mjs} +1 -1
- package/dist/{command-MxFFWqMg.mjs → command-CqDudQZs.mjs} +1 -1
- package/dist/{command-BASaTmJc.mjs → command-D4YcwpVp.mjs} +1 -1
- package/dist/{command-BxZBNPxG.mjs → command-D895kdlh.mjs} +1 -1
- package/dist/{command-CrAlzysj.mjs → command-D9Qyi1B0.mjs} +1 -1
- package/dist/{command-BiIVclNA.mjs → command-DeutqL1n.mjs} +1 -1
- package/dist/{command-C0qCuw03.mjs → command-Dl9ICrRK.mjs} +1 -1
- package/dist/{command-CZAR85ba.mjs → command-DtCSe8Hy.mjs} +1 -1
- package/dist/{command-C2FVMd1b.mjs → command-DwzVtmb3.mjs} +1 -1
- package/dist/{command-CFxyp8Uo.mjs → command-wtBubtZ4.mjs} +1 -1
- package/dist/{completions-DRzBiqpv.mjs → completions-BvdKtzsX.mjs} +1 -1
- package/dist/{connector-interrupts-CrTeSyaM.mjs → connector-interrupts-dUPW6Ya_.mjs} +2 -2
- package/dist/{connector-telemetry-events-BbAOUt9h.mjs → connector-telemetry-events-DWVCqnhn.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DcpBx7Qx.mjs → connector-telemetry-snapshots-CeMP3qeI.mjs} +1 -1
- package/dist/{connectors-D1WFLJoE.mjs → connectors-DZFGNw3i.mjs} +4 -4
- package/dist/containers-B06OGOEB.mjs +380 -0
- package/dist/{containers-BOBEs1Gk.mjs → containers-DCzQCo79.mjs} +8 -8
- package/dist/{content-scan-D1GfPSL0.mjs → content-scan-XhnNJqXf.mjs} +4 -4
- package/dist/{context-Dp4CXG22.mjs → context-BY1Eh_Qe.mjs} +1 -1
- package/dist/{cps-D4uhzg3k.mjs → cps-CohlxvuN.mjs} +2 -2
- package/dist/create-DmLDMvrj.mjs +2 -0
- package/dist/{csam-scanner-DOOUBeBM.mjs → csam-scanner-BV4bHq8v.mjs} +2 -2
- package/dist/{custom-csrs-DtdFo5YZ.mjs → custom-csrs-BVdMQjYq.mjs} +2 -2
- package/dist/{custom-hostnames-ccdlELaD.mjs → custom-hostnames-r-CxhSa1.mjs} +5 -5
- package/dist/{custom-nameservers-p3gDjfva.mjs → custom-nameservers-CapMDyly.mjs} +2 -2
- package/dist/{custom-pages-DAkKVzgR.mjs → custom-pages-BVIniWfq.mjs} +5 -5
- package/dist/{d1-CDIyRdh4.mjs → d1-nJCOJZb8.mjs} +20 -22
- package/dist/{delegate-B4bKqF7i.mjs → delegate-CcL6RoGw.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BaC5Ty7F.mjs → deploy-DJMnWFNk.mjs} +1 -1
- package/dist/{deploy-context-DTTgNGro.mjs → deploy-context-YCW3eqP1.mjs} +15 -15
- package/dist/{deploy-input-mAy06fAI.mjs → deploy-input-CQLBXFEB.mjs} +1 -1
- package/dist/{dev-De-HszNT.mjs → dev-GsYHvMah.mjs} +1 -1
- package/dist/{diagnostics-D1CUs2o9.mjs → diagnostics-C3nqxsAO.mjs} +4 -4
- package/dist/{dist-D5qkmHhC.mjs → dist-D-ihn_mV.mjs} +42 -33
- package/dist/{dls-DWBiYzY1.mjs → dls-N1x8sAK3.mjs} +3 -3
- package/dist/{dns-wMjf1t6-.mjs → dns-DATWP-PF.mjs} +25 -25
- package/dist/{dns-firewall-DH9xIT5H.mjs → dns-firewall-n3Y2ui6W.mjs} +4 -4
- package/dist/{docs-BA7qslb2.mjs → docs-CRc_WOXh.mjs} +1 -1
- package/dist/{dry-run-gy0Hl9xo.mjs → dry-run-kJbjn4kG.mjs} +1 -1
- package/dist/{durable-objects-DF0MYpnV.mjs → durable-objects-DHK9w-vO.mjs} +2 -2
- package/dist/{email-auth-BShMFXn4.mjs → email-auth-ptdqNSTZ.mjs} +1 -1
- package/dist/{email-domains-CDSbVclP.mjs → email-domains-uL22-zRY.mjs} +2 -2
- package/dist/{email-routing-CBCkbg_F.mjs → email-routing-CV43rMJC.mjs} +12 -12
- package/dist/{email-security-CnNa1YON.mjs → email-security-DK_SJ0yi.mjs} +38 -38
- package/dist/{email-sending-CpDSw-Eb.mjs → email-sending-CTQafGec.mjs} +11 -11
- package/dist/{error-sanitization-DG8WSzHe.mjs → error-sanitization-BkgtZ0Vx.mjs} +1 -1
- package/dist/error-sanitization-D069tpKk.mjs +2 -0
- package/dist/{errors-DatLr-iR.mjs → errors-VG1mgwJl.mjs} +1 -1
- package/dist/{field-extractors-BwGdMnTr.mjs → field-extractors-jcZ_bAGc.mjs} +2 -2
- package/dist/{firewall-CY_oem-d.mjs → firewall-CW-fAI9m.mjs} +12 -12
- package/dist/{flagship-Bat5EZCk.mjs → flagship-RiLnDwfJ.mjs} +8 -8
- package/dist/{fraud-CSUKLh8X.mjs → fraud-DvfBBTe8.mjs} +2 -2
- package/dist/get-3XNn0upb.mjs +2 -0
- package/dist/{google-tag-gateway-C2skt6t-.mjs → google-tag-gateway-C5WYsSXv.mjs} +2 -2
- package/dist/{healthchecks-uC43QKQd.mjs → healthchecks-BA1fmzTm.mjs} +5 -5
- package/dist/{hyperdrive-FcBbpew4.mjs → hyperdrive-Ch6klUp3.mjs} +4 -4
- package/dist/{iam-8T74DNhH.mjs → iam-LlGEzRCq.mjs} +14 -14
- package/dist/{images-C3JUaf6b.mjs → images-C5WqUXkK.mjs} +11 -11
- package/dist/index.mjs +1 -1
- package/dist/{init-BEVVz4_P.mjs → init-EVsjBrOz.mjs} +2 -2
- package/dist/{intel-DRy4rHrt.mjs → intel-vcWyslaX.mjs} +14 -14
- package/dist/{interactive-CKHdGvkh.mjs → interactive-BCDFSPtq.mjs} +1 -1
- package/dist/{internal-CamuESs0.mjs → internal-BhV9WjLp.mjs} +1 -1
- package/dist/{ips-DinCNnWj.mjs → ips-CqHjVsqd.mjs} +1 -1
- package/dist/k2-CZT2Pd5J.mjs +10 -0
- package/dist/kv-Ipa7dnvF.mjs +12 -0
- package/dist/{lazy-command-WB1FOuew.mjs → lazy-command-DbKVgdGT.mjs} +1 -1
- package/dist/{leaked-credential-checks-CSZd9hBQ.mjs → leaked-credential-checks-EzT4TTjO.mjs} +4 -4
- package/dist/{live-B6AsI_E5.mjs → live-C9L1bNuE.mjs} +1 -1
- package/dist/{load-balancers-gap5u4b1.mjs → load-balancers-Cb3VkSfc.mjs} +21 -21
- package/dist/local-D5Vq6ooZ.mjs +2 -0
- package/dist/{local-CgBhtmON.mjs → local-DIJ7SIKC.mjs} +1 -1
- package/dist/{local-runtime-CmlJ20uJ.mjs → local-runtime-BZjgkacr.mjs} +1 -1
- package/dist/{login-BJHaTERg.mjs → login-DG5ebyab.mjs} +1 -1
- package/dist/login-DRJugxya.mjs +2 -0
- package/dist/{logpush-qhlxsioM.mjs → logpush-C5Gw7F_9.mjs} +16 -16
- package/dist/{logs-bI54CJ0w.mjs → logs-y3REfHbb.mjs} +8 -8
- package/dist/magic-network-monitoring-BZBGZB6M.mjs +34 -0
- package/dist/{magic-transit-BwDyySHJ.mjs → magic-transit-BPV_POf5.mjs} +129 -129
- package/dist/{managed-defense-CsBBkfeQ.mjs → managed-defense-BaUBSUcz.mjs} +3 -3
- package/dist/{managed-transforms-CUC-uAbW.mjs → managed-transforms-CjkjLzMC.mjs} +2 -2
- package/dist/{mcp-CyI0sDmL.mjs → mcp-RPtrISTy.mjs} +6 -6
- package/dist/{mesh-Czr0UCP4.mjs → mesh-DZ4QHBPE.mjs} +5 -5
- package/dist/{migrate-DKDWYrz2.mjs → migrate-CRIUqGi2.mjs} +1 -1
- package/dist/{monetization-NUgfDtSy.mjs → monetization-CVZqM8Xo.mjs} +4 -4
- package/dist/{network-B42zrBic.mjs → network-DLt2JUo1.mjs} +15 -15
- package/dist/{network-interconnects-DuIBe8fK.mjs → network-interconnects-9nS5jL__.mjs} +10 -10
- package/dist/{o11y-oEUpMC3O.mjs → o11y-ySxrnP1Z.mjs} +45 -43
- package/dist/{oauth-BmSFLp_s.mjs → oauth-CFVUl-Wv.mjs} +1 -1
- package/dist/{oauth-BLQ1-y3R.mjs → oauth-Cidoyxfp.mjs} +1 -1
- package/dist/{observability-BxhJQCgZ.mjs → observability-C-KNh__y.mjs} +1 -1
- package/dist/ohttp-gateway-B5nCl4s3.mjs +8 -0
- package/dist/organizations-DbeeWUL4.mjs +71 -0
- package/dist/output-BZQEl3mK.mjs +2 -0
- package/dist/package-B7RgwuFR.mjs +2 -0
- package/dist/{page-rules-J6LhwR-s.mjs → page-rules-DRw763O1.mjs} +4 -4
- package/dist/{pages-BksdnChs.mjs → pages-DfQnxiTk.mjs} +12 -12
- package/dist/{pay-per-crawl-BLcbHRoR.mjs → pay-per-crawl-EHYtSKxX.mjs} +13 -13
- package/dist/{pay-per-use-VatiU-Nt.mjs → pay-per-use-wdEhl8k4.mjs} +11 -11
- package/dist/{pipelines-B5AoB3f3.mjs → pipelines-DbyrI6F4.mjs} +11 -11
- package/dist/{precursor-D3VH2MXT.mjs → precursor-Dx8lN4UJ.mjs} +2 -2
- package/dist/previews-DEVNSip2.mjs +6 -0
- package/dist/{progress-DLri-rA7.mjs → progress-yvPscjYg.mjs} +1 -1
- package/dist/{prompt-D0dXwuME.mjs → prompt-CEpZ-lQZ.mjs} +1 -1
- package/dist/{queues-BsAck4To.mjs → queues-DgMc7Z6A.mjs} +18 -18
- package/dist/{r2-BYjdHDEZ.mjs → r2-BpTVicIq.mjs} +21 -21
- package/dist/{radar-CvLtu-Vr.mjs → radar-DW-S1VUh.mjs} +11 -11
- package/dist/{raw-fetch-DQeDx1wT.mjs → raw-fetch-Cl5spWC3.mjs} +1 -1
- package/dist/{ready-gsGEaWLL.mjs → ready-d0li0X6r.mjs} +1 -1
- package/dist/{realtime-DiCEgFTC.mjs → realtime-DMKHLYF4.mjs} +41 -41
- package/dist/{registrar-D4wdgWpo.mjs → registrar-D23gfKBi.mjs} +5 -5
- package/dist/{registrar-sandbox-B6yopzdG.mjs → registrar-sandbox-lVLB1-mC.mjs} +4 -4
- package/dist/{reporting-BiHgnT8L.mjs → reporting-WX8P3Y0k.mjs} +2 -2
- package/dist/{request-headers-CoxHUNcB.mjs → request-headers-C0FpeBhz.mjs} +1 -1
- package/dist/{request-tracers-817HTytF.mjs → request-tracers-qd7XOAka.mjs} +2 -2
- package/dist/resource-sharing-B2ZSt_cA.mjs +36 -0
- package/dist/{rules-CRhe_ca9.mjs → rules-CB0QQTB3.mjs} +5 -5
- package/dist/{rulesets-CKyc-Xlx.mjs → rulesets-DmqwixUC.mjs} +6 -6
- package/dist/{rum-BfnWHW_d.mjs → rum-BZ_24qZU.mjs} +9 -9
- package/dist/{run-Ciw_GIrC.mjs → run-BOKI1uWa.mjs} +1 -1
- package/dist/run-DBqOjD1P.mjs +2 -0
- package/dist/{schema-DuLIZRhA.mjs → schema-Dj9STsWI.mjs} +1 -1
- package/dist/{schema-cache-BIo0Gi2H.mjs → schema-cache-5NkOj7Y3.mjs} +1 -1
- package/dist/{schema-flags-DrqvwQNw.mjs → schema-flags-CXm9iIv6.mjs} +1 -1
- package/dist/{scim-C4iRWNYB.mjs → scim-DchxaJfE.mjs} +8 -8
- package/dist/{secrets-store-DgtzZRze.mjs → secrets-store-oAft1cFE.mjs} +5 -5
- package/dist/{security-insights-SlUGW3F_.mjs → security-insights-DMm0qg_m.mjs} +15 -15
- package/dist/{security-txt-C3YS0REz.mjs → security-txt-CIt0494b.mjs} +2 -2
- package/dist/{session-D2yuwO4i.mjs → session-vzNfUhPl.mjs} +1 -1
- package/dist/{shared--uVkAAd7.mjs → shared-MK-_lkbn.mjs} +1 -1
- package/dist/{signed-url-ClLk45_J.mjs → signed-url-gNangfwc.mjs} +1 -1
- package/dist/{smart-shield-Dn95hqUH.mjs → smart-shield-Boy_qbqd.mjs} +6 -6
- package/dist/{snippets-BNUKOajz.mjs → snippets-DdoDYXW-.mjs} +3 -3
- package/dist/{spawn-DuT4snxu.mjs → spawn-B5F4OIHG.mjs} +1 -1
- package/dist/{spectrum-Cj0BMtg2.mjs → spectrum-DLYIHelC.mjs} +3 -3
- package/dist/{speed-BrVeZRyX.mjs → speed-DugG9Tm9.mjs} +2 -2
- package/dist/{sql-BX1pBqj3.mjs → sql-Bb56llsb.mjs} +2 -2
- package/dist/src-BoSDeQ9m.mjs +133 -0
- package/dist/{ssl-Bx4LCutF.mjs → ssl-Bg4X3WGk.mjs} +24 -24
- package/dist/startup-profile-DQVkZZpb.mjs +2 -0
- package/dist/{startup-profile-DqaYNT0b.mjs → startup-profile-DZL2DC44.mjs} +1 -1
- package/dist/state-DW3QZtfh.mjs +2 -0
- package/dist/{state-BmzOLELo.mjs → state-mr5ux1Nb.mjs} +1 -1
- package/dist/{stream-BRzr6yh0.mjs → stream-BuZYDbNR.mjs} +21 -21
- package/dist/{tags-xVzjZxdt.mjs → tags-SKz2odE_.mjs} +3 -3
- package/dist/{telemetry-CJ9URio3.mjs → telemetry-B4zmCpT0.mjs} +1 -1
- package/dist/telemetry-DkDUr4KK.mjs +2 -0
- package/dist/{tenant-custom-nameservers-M7Fxqh2W.mjs → tenant-custom-nameservers-BhkhBerL.mjs} +2 -2
- package/dist/tenants-DD-GMq0K.mjs +13 -0
- package/dist/{tools-C-vmgYSv.mjs → tools-KW_4hvzY.mjs} +1 -1
- package/dist/{tunnels-DQVXKUKA.mjs → tunnels-D90ztENM.mjs} +6 -6
- package/dist/{turnstile-B_Ugzgom.mjs → turnstile-DhSU_Xar.mjs} +4 -4
- package/dist/ui-xjCox-gU.mjs +2 -0
- package/dist/{update-check-DHUo4FOJ.mjs → update-check-CRttabfu.mjs} +1 -1
- package/dist/{update-check-DRr0eRhB.mjs → update-check-HltjTMDE.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-CZRQH_pJ.mjs → url-normalization-K7gkmPvG.mjs} +2 -2
- package/dist/{url-scanner-BH4PLy16.mjs → url-scanner-BRdWwka4.mjs} +3 -3
- package/dist/{user-Bn82Qw0Y.mjs → user-Cmb1_Wu5.mjs} +50 -50
- package/dist/{vectorize-DoVVz_sh.mjs → vectorize-BTBerJME.mjs} +11 -11
- package/dist/verify-B9ILCohg.mjs +2 -0
- package/dist/verify-BCuWaO-L.mjs +2 -0
- package/dist/version-6Bpy6Bgt.mjs +2 -0
- package/dist/{waiting-rooms-QUW131o3.mjs → waiting-rooms-LymmKIGr.mjs} +13 -13
- package/dist/{web-assets-CgQXsp8m.mjs → web-assets-LHPQsrnY.mjs} +21 -21
- package/dist/{web3-TY9s6Swn.mjs → web3-BsOio0Ae.mjs} +12 -12
- package/dist/workers-BnLiOjZf.mjs +39 -0
- package/dist/{workers-builds-BgGY0IGk.mjs → workers-builds-sKpITeRk.mjs} +4 -4
- package/dist/{workers-for-platforms-5RkV9MVp.mjs → workers-for-platforms-BGp6yr6P.mjs} +9 -9
- package/dist/{workers-vpc-Bt4OQbwM.mjs → workers-vpc-D8lefWDo.mjs} +3 -3
- package/dist/{workflows-6m85DdqF.mjs → workflows-B-ZIG3y7.mjs} +22 -22
- package/dist/{wrangler-migration-BbmGOu8l.mjs → wrangler-migration-6E6wT_LZ.mjs} +66 -57
- package/dist/{zaraz-8WSJ7l0L.mjs → zaraz-BBKki5WS.mjs} +11 -11
- package/dist/{zero-trust-DK0cqDZv.mjs → zero-trust-BZDXM5r6.mjs} +165 -165
- package/dist/{zones-DTAcguf6.mjs → zones-B-UV_DGE.mjs} +24 -24
- package/package.json +14 -14
- package/dist/ai-audit-BmzOgt6x.mjs +0 -6
- package/dist/analytics-engine-BHpcNSdD.mjs +0 -4
- package/dist/api-X3wKppsT.mjs +0 -3
- package/dist/argo-D1VONzu-.mjs +0 -14
- package/dist/auth-CspwoBlp.mjs +0 -2
- package/dist/auth-FK2eLQ02.mjs +0 -2
- package/dist/billing-DRNww0iC.mjs +0 -24
- package/dist/body-parser-BKcZS9iJ.mjs +0 -2
- package/dist/brand-protection-BVICLzBc.mjs +0 -26
- package/dist/browser-run-CEk-NIgP.mjs +0 -40
- package/dist/build-CRm2TQq8.mjs +0 -2
- package/dist/build-DO_GNhRl.mjs +0 -2
- package/dist/cache-jlLJLSu7.mjs +0 -36
- package/dist/containers-DINLx5_i.mjs +0 -380
- package/dist/create-BtmuVqVL.mjs +0 -2
- package/dist/error-sanitization-B025CygB.mjs +0 -2
- package/dist/get-Be821dio.mjs +0 -2
- package/dist/k2-wsanPL3y.mjs +0 -10
- package/dist/kv-BLSPcEnH.mjs +0 -12
- package/dist/local-CFsO9Tkg.mjs +0 -2
- package/dist/login-BfuOf-Yi.mjs +0 -2
- package/dist/magic-network-monitoring-CX3TaMTu.mjs +0 -34
- package/dist/organization-CEnlXwrl.mjs +0 -70
- package/dist/organizations-Dt86ToxE.mjs +0 -4
- package/dist/origin-post-quantum-encryption-lX-uaJSL.mjs +0 -6
- package/dist/output-BJEgbI0G.mjs +0 -2
- package/dist/package-CiRJBRHO.mjs +0 -2
- package/dist/previews-DzJ85fsr.mjs +0 -6
- package/dist/resource-sharing-CW9xxtq5.mjs +0 -36
- package/dist/run-DD45EQTm.mjs +0 -2
- package/dist/src-DPnUfK4c.mjs +0 -131
- package/dist/startup-profile-tZNb2HGz.mjs +0 -2
- package/dist/state-Uwfrmw5I.mjs +0 -2
- package/dist/telemetry-Pt5GpCKD.mjs +0 -2
- package/dist/ui-FYultowZ.mjs +0 -2
- package/dist/version-Zr2oF8mY.mjs +0 -2
- package/dist/workers-B3uJqJKc.mjs +0 -39
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{t as n}from"./list-ByCv9-Fl.mjs";import{n as r}from"./auth-B-h0BHg7.mjs";import{a as i,t as a}from"./context-BY1Eh_Qe.mjs";import{t as o}from"./output-BZQEl3mK.mjs";import{t as s}from"./dry-run-kJbjn4kG.mjs";import{t as c}from"./progress-yvPscjYg.mjs";import{t as l}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as u,n as d,t as f}from"./body-parser-DoewLePl.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-CEpZ-lQZ.mjs";var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/oauth_clients`,body:`json`};function v(e){return e.usage(`$0 iam oauth-clients create
|
|
3
3
|
|
|
4
|
-
Create a new OAuth client for an account.`).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).coerce(`token-endpoint-auth-method`,e=>p(e,`token-endpoint-auth-method`,`text`)).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create OAuth Client`,builder:v,handler:async e=>l({command:`iam oauth-clients create`,classification:{safeFlags:[`token-endpoint-auth-method`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({allowed_cors_origins:e[`allowed-cors-origins`],client_name:p(e[`client-name`],`client-name`,`text`),client_uri:p(e[`client-uri`],`client-uri`,`text`),grant_types:e[`grant-types`],logo_uri:p(e[`logo-uri`],`logo-uri`,`text`),optional_scopes:e[`optional-scopes`],policy_uri:p(e[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:e[`post-logout-redirect-uris`],redirect_uris:e[`redirect-uris`],response_types:e[`response-types`],scopes:e.scopes,token_endpoint_auth_method:e[`token-endpoint-auth-method`],tos_uri:p(e[`tos-uri`],`tos-uri`,`text`)}):d(e.body)});return}let n=await r(e),
|
|
4
|
+
Create a new OAuth client for an account.`).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).coerce(`token-endpoint-auth-method`,e=>p(e,`token-endpoint-auth-method`,`text`)).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create OAuth Client`,builder:v,handler:async e=>l({command:`iam oauth-clients create`,classification:{safeFlags:[`token-endpoint-auth-method`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({allowed_cors_origins:e[`allowed-cors-origins`],client_name:p(e[`client-name`],`client-name`,`text`),client_uri:p(e[`client-uri`],`client-uri`,`text`),grant_types:e[`grant-types`],logo_uri:p(e[`logo-uri`],`logo-uri`,`text`),optional_scopes:e[`optional-scopes`],policy_uri:p(e[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:e[`post-logout-redirect-uris`],redirect_uris:e[`redirect-uris`],response_types:e[`response-types`],scopes:e.scopes,token_endpoint_auth_method:e[`token-endpoint-auth-method`],tos_uri:p(e[`tos-uri`],`tos-uri`,`text`)}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let e=n,t=await c(`Creating`,async()=>l.send(_,{body:e,account_id:u}));o(t,{successLabel:`Created`});return}if(e[`client-name`]===void 0&&(e[`client-name`]=await m(`client-name`,`Human-readable name of the OAuth client.`)),e[`grant-types`]===void 0)throw Error(`--grant-types is required (or pass --body with this field set).`);if(e[`redirect-uris`]===void 0)throw Error(`--redirect-uris is required (or pass --body with this field set).`);if(e[`response-types`]===void 0)throw Error(`--response-types is required (or pass --body with this field set).`);if(e.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);e[`token-endpoint-auth-method`]===void 0&&(e[`token-endpoint-auth-method`]=await h(`token-endpoint-auth-method`,`The authentication method the client uses at the token endpoint.`,[`none`,`client_secret_basic`,`client_secret_post`]));let g=f({allowed_cors_origins:e[`allowed-cors-origins`],client_name:p(e[`client-name`],`client-name`,`text`),client_uri:p(e[`client-uri`],`client-uri`,`text`),grant_types:e[`grant-types`],logo_uri:p(e[`logo-uri`],`logo-uri`,`text`),optional_scopes:e[`optional-scopes`],policy_uri:p(e[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:e[`post-logout-redirect-uris`],redirect_uris:e[`redirect-uris`],response_types:e[`response-types`],scopes:e.scopes,token_endpoint_auth_method:e[`token-endpoint-auth-method`],tos_uri:p(e[`tos-uri`],`tos-uri`,`text`)}),v=await c(`Creating`,async()=>l.send(_,{body:g,account_id:u}));o(v,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/oauth_clients/${t.oauth_client_id}/rotate_secret`};function ee(e){return e.usage(`$0 iam oauth-clients delete-rotated-secret <oauth-client-id>
|
|
5
5
|
|
|
6
|
-
Removes the old client secret after a rotation, keeping only the new one. Use this after you have updated your client configuration to use the new secret. The \`has_rotated_secret\` field on the client indicates whether there is an old secret to delete.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const
|
|
6
|
+
Removes the old client secret after a rotation, keeping only the new one. Use this after you have updated your client configuration to use the new secret. The \`has_rotated_secret\` field on the client indicates whether there is an old secret to delete.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const te={command:`delete-rotated-secret <oauth-client-id>`,describe:`Delete Rotated OAuth Client Secret`,builder:ee,handler:async e=>l({command:`iam oauth-clients delete-rotated-secret`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients delete-rotated-secret`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients/${e[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(e[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(e[`oauth-client-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(b,{account_id:l,oauth_client_id:e[`oauth-client-id`]}));o(u,{successLabel:`Deleted`})})};var ne={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/oauth_clients/${t.oauth_client_id}`};function re(e){return e.usage(`$0 iam oauth-clients delete <oauth-client-id>
|
|
7
7
|
|
|
8
|
-
Delete an OAuth client.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const
|
|
8
|
+
Delete an OAuth client.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ie={command:`delete <oauth-client-id>`,describe:`Delete OAuth Client`,builder:re,handler:async e=>l({command:`iam oauth-clients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients/${e[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(e[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(e[`oauth-client-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(ne,{account_id:l,oauth_client_id:e[`oauth-client-id`]}));o(u,{successLabel:`Deleted`})})};var ae={method:`GET`,path:t=>e`/accounts/${t.account_id}/oauth_clients/${t.oauth_client_id}`};function oe(e){return e.usage(`$0 iam oauth-clients get <oauth-client-id>
|
|
9
9
|
|
|
10
|
-
Get details of a specific OAuth client.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <oauth-client-id>`,describe:`OAuth Client Details`,builder:
|
|
10
|
+
Get details of a specific OAuth client.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <oauth-client-id>`,describe:`OAuth Client Details`,builder:oe,handler:async e=>l({command:`iam oauth-clients get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients/${e[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(e[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(e[`oauth-client-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ae,{account_id:l,oauth_client_id:e[`oauth-client-id`]}));o(u,{successLabel:`Loaded`})})};var S={method:`GET`,path:t=>e`/accounts/${t.account_id}/oauth_clients`};function C(e){return e.usage(`$0 iam oauth-clients list
|
|
11
11
|
|
|
12
12
|
List all OAuth clients for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`List OAuth Clients`,builder:C,handler:async e=>l({command:`iam oauth-clients list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf iam oauth-clients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(S,{account_id:l}));o(u,{successLabel:`Loaded`})})};var T={method:`POST`,path:t=>e`/accounts/${t.account_id}/oauth_clients/${t.oauth_client_id}/rotate_secret`};function E(e){return e.usage("$0 iam oauth-clients rotate-secret <oauth-client-id>\n\nCreates a second client secret so you can update your client configuration before deleting the old one. The `has_rotated_secret` field on the client will be set to `true`.").positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`rotate-secret <oauth-client-id>`,describe:`Rotate OAuth Client Secret`,builder:E,handler:async e=>l({command:`iam oauth-clients rotate-secret`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients rotate-secret`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients/${e[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(e[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(e[`oauth-client-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Creating`,async()=>n.send(T,{account_id:l,oauth_client_id:e[`oauth-client-id`]}));o(u,{successLabel:`Created`})})};var O={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/oauth_clients/${t.oauth_client_id}`,body:`json`};function k(e){return e.usage(`$0 iam oauth-clients update <oauth-client-id>
|
|
13
13
|
|
|
14
|
-
Update an existing OAuth client. Only include fields you want to update.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).coerce(`token-endpoint-auth-method`,e=>p(e,`token-endpoint-auth-method`,`text`)).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`visibility`,{type:`string`,description:"Promote the OAuth client from private to public visibility. Only `public` is accepted; demotion to `private` is not supported. Promotion requires a non-empty client name, logo URI, verified client URI host, and at least one non-identity scope.",choices:[`public`]}).coerce(`visibility`,e=>p(e,`visibility`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update request for an OAuth client. Only include fields you want to update.`})}const A={command:`update <oauth-client-id>`,describe:`Update OAuth Client`,builder:k,handler:async e=>l({command:`iam oauth-clients update`,classification:{safeFlags:[`token-endpoint-auth-method`,`visibility`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients/${e[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(e[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(e[`oauth-client-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({allowed_cors_origins:e[`allowed-cors-origins`],client_name:p(e[`client-name`],`client-name`,`text`),client_uri:p(e[`client-uri`],`client-uri`,`text`),grant_types:e[`grant-types`],logo_uri:p(e[`logo-uri`],`logo-uri`,`text`),optional_scopes:e[`optional-scopes`],policy_uri:p(e[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:e[`post-logout-redirect-uris`],redirect_uris:e[`redirect-uris`],response_types:e[`response-types`],scopes:e.scopes,token_endpoint_auth_method:e[`token-endpoint-auth-method`],tos_uri:p(e[`tos-uri`],`tos-uri`,`text`),visibility:e.visibility}):d(e.body)});return}let n=await r(e),
|
|
14
|
+
Update an existing OAuth client. Only include fields you want to update.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).coerce(`token-endpoint-auth-method`,e=>p(e,`token-endpoint-auth-method`,`text`)).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`visibility`,{type:`string`,description:"Promote the OAuth client from private to public visibility. Only `public` is accepted; demotion to `private` is not supported. Promotion requires a non-empty client name, logo URI, verified client URI host, and at least one non-identity scope.",choices:[`public`]}).coerce(`visibility`,e=>p(e,`visibility`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update request for an OAuth client. Only include fields you want to update.`})}const A={command:`update <oauth-client-id>`,describe:`Update OAuth Client`,builder:k,handler:async e=>l({command:`iam oauth-clients update`,classification:{safeFlags:[`token-endpoint-auth-method`,`visibility`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/oauth_clients/${e[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(e[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(e[`oauth-client-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({allowed_cors_origins:e[`allowed-cors-origins`],client_name:p(e[`client-name`],`client-name`,`text`),client_uri:p(e[`client-uri`],`client-uri`,`text`),grant_types:e[`grant-types`],logo_uri:p(e[`logo-uri`],`logo-uri`,`text`),optional_scopes:e[`optional-scopes`],policy_uri:p(e[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:e[`post-logout-redirect-uris`],redirect_uris:e[`redirect-uris`],response_types:e[`response-types`],scopes:e.scopes,token_endpoint_auth_method:e[`token-endpoint-auth-method`],tos_uri:p(e[`tos-uri`],`tos-uri`,`text`),visibility:e.visibility}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=n,r=await c(`Updating`,async()=>l.send(O,{body:t,account_id:u,oauth_client_id:e[`oauth-client-id`]}));o(r,{successLabel:`Updated`});return}let m=f({allowed_cors_origins:e[`allowed-cors-origins`],client_name:p(e[`client-name`],`client-name`,`text`),client_uri:p(e[`client-uri`],`client-uri`,`text`),grant_types:e[`grant-types`],logo_uri:p(e[`logo-uri`],`logo-uri`,`text`),optional_scopes:e[`optional-scopes`],policy_uri:p(e[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:e[`post-logout-redirect-uris`],redirect_uris:e[`redirect-uris`],response_types:e[`response-types`],scopes:e.scopes,token_endpoint_auth_method:e[`token-endpoint-auth-method`],tos_uri:p(e[`tos-uri`],`tos-uri`,`text`),visibility:e.visibility}),h=await c(`Updating`,async()=>l.send(O,{body:m,account_id:u,oauth_client_id:e[`oauth-client-id`]}));o(h,{successLabel:`Updated`})})},j={command:`oauth-clients`,describe:`Operations for oauth-clients`,builder:e=>e.command(y).command(ie).command(te).command(x).command(w).command(D).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 iam oauth-scopes list
|
|
15
15
|
|
|
16
16
|
List all available OAuth scopes. This endpoint requires authentication but has no authorization role requirements.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List OAuth Scopes`,builder:M,handler:async e=>l({command:`iam oauth-scopes list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf iam oauth-scopes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/oauth/scopes`,pathParams:{},bodyKind:`none`});return}let t=await r(e),i=await c(`Loading`,async()=>t.send(n));o(i,{successLabel:`Loaded`})})},P={command:`oauth-scopes`,describe:`Operations for oauth-scopes`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/iam/permission_groups/${t.permission_group_id}`};function I(e){return e.usage(`$0 iam permission-groups get <permission-group-id>
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ Get information about a specific permission group in an account.`).positional(`p
|
|
|
19
19
|
|
|
20
20
|
List all the permissions groups for an account.`).option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List Account Permission Groups`,builder:z,handler:async e=>l({command:`iam permission-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={id:e.id,name:e.name,label:e.label,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();s({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/iam/permission_groups`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(R,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})},V={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`POST`,path:t=>e`/accounts/${t.account_id}/iam/resource_groups`,body:`json`};function U(e){return e.usage(`$0 iam resource-groups create
|
|
21
21
|
|
|
22
|
-
Create a new Resource Group under the specified account.`).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`scope-objects`,{type:`string`,description:`A list of scope objects for additional context. The number of Scope objects should not be zero. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`create`,describe:`Create Resource Group`,builder:U,handler:async e=>l({command:`iam resource-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),scope:{objects:u(e[`scope-objects`],`scope-objects`)}}):d(e.body)});return}let n=await r(e),
|
|
22
|
+
Create a new Resource Group under the specified account.`).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`scope-objects`,{type:`string`,description:`A list of scope objects for additional context. The number of Scope objects should not be zero. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`create`,describe:`Create Resource Group`,builder:U,handler:async e=>l({command:`iam resource-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),scope:{objects:u(e[`scope-objects`],`scope-objects`)}}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body!==void 0){let e=n,t=await c(`Creating`,async()=>l.send(H,{body:e,account_id:h}));o(t,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await m(`name`,`Name of the resource group`)),e[`scope-objects`]===void 0)throw Error(`--scope-objects is required (or pass --body with this field set).`);let g=f({name:p(e.name,`name`,`text`),scope:{objects:u(e[`scope-objects`],`scope-objects`)}}),_=await c(`Creating`,async()=>l.send(H,{body:g,account_id:h}));o(_,{successLabel:`Created`})})};var G={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/iam/resource_groups/${t.resource_group_id}`};function K(e){return e.usage(`$0 iam resource-groups delete <resource-group-id>
|
|
23
23
|
|
|
24
24
|
Remove a resource group from an account.`).positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const q={command:`delete <resource-group-id>`,describe:`Remove Resource Group`,builder:K,handler:async e=>l({command:`iam resource-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/resource_groups/${e[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(e[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(e[`resource-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(G,{account_id:l,resource_group_id:e[`resource-group-id`]}));o(u,{successLabel:`Deleted`})})};var se={method:`GET`,path:t=>e`/accounts/${t.account_id}/iam/resource_groups/${t.resource_group_id}`};function ce(e){return e.usage(`$0 iam resource-groups get <resource-group-id>
|
|
25
25
|
|
|
@@ -27,11 +27,11 @@ Get information about a specific resource group in an account.`).positional(`res
|
|
|
27
27
|
|
|
28
28
|
List all the resource groups for an account.`).option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`List Resource Groups`,builder:de,handler:async e=>l({command:`iam resource-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={id:e.id,name:e.name};if(e.dryRun){let e=await i();s({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/iam/resource_groups`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ue,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var J={method:`PUT`,path:t=>e`/accounts/${t.account_id}/iam/resource_groups/${t.resource_group_id}`,body:`json`};function pe(e){return e.usage(`$0 iam resource-groups update <resource-group-id>
|
|
29
29
|
|
|
30
|
-
Modify an existing resource group.`).positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`scope-objects`,{type:`string`,description:`A list of scope objects for additional context. The number of Scope objects should not be zero. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`update <resource-group-id>`,describe:`Update Resource Group`,builder:pe,handler:async e=>l({command:`iam resource-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/resource_groups/${e[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(e[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(e[`resource-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),scope:{objects:u(e[`scope-objects`],`scope-objects`)}}):d(e.body)});return}let n=await r(e),
|
|
30
|
+
Modify an existing resource group.`).positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`scope-objects`,{type:`string`,description:`A list of scope objects for additional context. The number of Scope objects should not be zero. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`update <resource-group-id>`,describe:`Update Resource Group`,builder:pe,handler:async e=>l({command:`iam resource-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/resource_groups/${e[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(e[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(e[`resource-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),scope:{objects:u(e[`scope-objects`],`scope-objects`)}}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),m=e.local?t:await a();if(e.accountId=m,e.body!==void 0){let t=n,r=await c(`Updating`,async()=>l.send(J,{body:t,account_id:m,resource_group_id:e[`resource-group-id`]}));o(r,{successLabel:`Updated`});return}let h=f({name:p(e.name,`name`,`text`),scope:{objects:u(e[`scope-objects`],`scope-objects`)}}),g=await c(`Updating`,async()=>l.send(J,{body:h,account_id:m,resource_group_id:e[`resource-group-id`]}));o(g,{successLabel:`Updated`})})},he={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(W).command(q).command(le).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ge={method:`POST`,path:t=>e`/accounts/${t.account_id}/sso_connectors/${t.sso_connector_id}/begin_verification`};function _e(e){return e.usage(`$0 iam sso begin-verification <sso-connector-id>
|
|
31
31
|
|
|
32
32
|
Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`).positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`begin-verification <sso-connector-id>`,describe:`Begin SSO connector verification`,builder:_e,handler:async e=>l({command:`iam sso begin-verification`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/sso_connectors/${e[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(e[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(e[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Creating`,async()=>n.send(ge,{account_id:l,sso_connector_id:e[`sso-connector-id`]}));o(u,{successLabel:`Created`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/sso_connectors`,body:`json`};function ye(e){return e.usage(`$0 iam sso create
|
|
33
33
|
|
|
34
|
-
Creates a new SSO connector for logging into Cloudflare through an identity provider.`).option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`create`,describe:`Initialize new SSO connector`,builder:ye,handler:async e=>l({command:`iam sso create`,classification:{safeFlags:[`begin-verification`,`use-fedramp-language`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({begin_verification:e[`begin-verification`],email_domain:p(e[`email-domain`],`email-domain`,`text`),use_fedramp_language:e[`use-fedramp-language`]}):d(e.body)});return}let n=await r(e),
|
|
34
|
+
Creates a new SSO connector for logging into Cloudflare through an identity provider.`).option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`create`,describe:`Initialize new SSO connector`,builder:ye,handler:async e=>l({command:`iam sso create`,classification:{safeFlags:[`begin-verification`,`use-fedramp-language`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({begin_verification:e[`begin-verification`],email_domain:p(e[`email-domain`],`email-domain`,`text`),use_fedramp_language:e[`use-fedramp-language`]}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let e=n,t=await c(`Creating`,async()=>l.send(Y,{body:e,account_id:u}));o(t,{successLabel:`Created`});return}e[`email-domain`]===void 0&&(e[`email-domain`]=await m(`email-domain`,`Email domain of the new SSO connector`));let h=f({begin_verification:e[`begin-verification`],email_domain:p(e[`email-domain`],`email-domain`,`text`),use_fedramp_language:e[`use-fedramp-language`]}),g=await c(`Creating`,async()=>l.send(Y,{body:h,account_id:u}));o(g,{successLabel:`Created`})})};var xe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/sso_connectors/${t.sso_connector_id}`};function Se(e){return e.usage(`$0 iam sso delete <sso-connector-id>
|
|
35
35
|
|
|
36
36
|
Deletes an SSO connector from the account.`).positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ce={command:`delete <sso-connector-id>`,describe:`Delete SSO connector`,builder:Se,handler:async e=>l({command:`iam sso delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/sso_connectors/${e[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(e[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(e[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(xe,{account_id:l,sso_connector_id:e[`sso-connector-id`]}));o(u,{successLabel:`Deleted`})})};var we={method:`GET`,path:t=>e`/accounts/${t.account_id}/sso_connectors/${t.sso_connector_id}`};function Te(e){return e.usage(`$0 iam sso get <sso-connector-id>
|
|
37
37
|
|
|
@@ -39,9 +39,9 @@ Retrieves details for a specific SSO connector.`).positional(`sso-connector-id`,
|
|
|
39
39
|
|
|
40
40
|
Lists all SSO connectors configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`Get all SSO connectors`,builder:Oe,handler:async e=>l({command:`iam sso list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(De,{account_id:l}));o(u,{successLabel:`Loaded`})})};var X={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/sso_connectors/${t.sso_connector_id}`,body:`json`};function Ae(e){return e.usage(`$0 iam sso update <sso-connector-id>
|
|
41
41
|
|
|
42
|
-
Updates the state or configuration of an SSO connector.`).positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const je={command:`update <sso-connector-id>`,describe:`Update SSO connector state`,builder:Ae,handler:async e=>l({command:`iam sso update`,classification:{safeFlags:[`enabled`,`use-fedramp-language`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/sso_connectors/${e[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(e[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(e[`sso-connector-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({enabled:e.enabled,use_fedramp_language:e[`use-fedramp-language`]}):d(e.body)});return}let n=await r(e),
|
|
42
|
+
Updates the state or configuration of an SSO connector.`).positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const je={command:`update <sso-connector-id>`,describe:`Update SSO connector state`,builder:Ae,handler:async e=>l({command:`iam sso update`,classification:{safeFlags:[`enabled`,`use-fedramp-language`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/sso_connectors/${e[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(e[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(e[`sso-connector-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({enabled:e.enabled,use_fedramp_language:e[`use-fedramp-language`]}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=n,r=await c(`Updating`,async()=>l.send(X,{body:t,account_id:u,sso_connector_id:e[`sso-connector-id`]}));o(r,{successLabel:`Updated`});return}let p=f({enabled:e.enabled,use_fedramp_language:e[`use-fedramp-language`]}),m=await c(`Updating`,async()=>l.send(X,{body:p,account_id:u,sso_connector_id:e[`sso-connector-id`]}));o(m,{successLabel:`Updated`})})},Me={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(ve).command(be).command(Ce).command(Ee).command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/iam/user_groups`,body:`json`};function Ne(e){return e.usage(`$0 iam user-groups create
|
|
43
43
|
|
|
44
|
-
Create a new user group under the specified account.`).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`create`,describe:`Create User Group`,builder:Ne,handler:async e=>l({command:`iam user-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),policies:u(e.policies,`policies`)}):d(e.body)});return}let n=await r(e),
|
|
44
|
+
Create a new user group under the specified account.`).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`create`,describe:`Create User Group`,builder:Ne,handler:async e=>l({command:`iam user-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),policies:u(e.policies,`policies`)}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body!==void 0){let e=n,t=await c(`Creating`,async()=>l.send(Z,{body:e,account_id:h}));o(t,{successLabel:`Created`});return}e.name===void 0&&(e.name=await m(`name`,`Name of the User group.`));let g=f({name:p(e.name,`name`,`text`),policies:u(e.policies,`policies`)}),_=await c(`Creating`,async()=>l.send(Z,{body:g,account_id:h}));o(_,{successLabel:`Created`})})};var Fe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}`};function Ie(e){return e.usage(`$0 iam user-groups delete <user-group-id>
|
|
45
45
|
|
|
46
46
|
Remove a user group from an account.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Le={command:`delete <user-group-id>`,describe:`Remove User Group`,builder:Ie,handler:async e=>l({command:`iam user-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(Fe,{account_id:l,user_group_id:e[`user-group-id`]}));o(u,{successLabel:`Deleted`})})};var Re={method:`GET`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}`};function ze(e){return e.usage(`$0 iam user-groups get <user-group-id>
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ Get information about a specific user group in an account.`).positional(`user-gr
|
|
|
49
49
|
|
|
50
50
|
List all the user groups for an account.`).option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`list`,describe:`List User Groups`,builder:He,handler:async e=>l({command:`iam user-groups list`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{let n={id:e.id,name:e.name,fuzzyName:e[`fuzzy-name`],page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/iam/user_groups`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Ve,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var We={method:`POST`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}/members`,body:`json`};function Ge(e){return e.usage(`$0 iam user-groups members create <user-group-id>
|
|
51
51
|
|
|
52
|
-
Add members to a User Group.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ke={command:`create <user-group-id>`,describe:`Add User Group Members`,builder:Ge,handler:async e=>l({command:`iam user-groups members create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let n=await r(e),
|
|
52
|
+
Add members to a User Group.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ke={command:`create <user-group-id>`,describe:`Add User Group Members`,builder:Ge,handler:async e=>l({command:`iam user-groups members create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let n=e.body===void 0?void 0:d(e.body),l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=n,r=await c(`Creating`,async()=>l.send(We,{body:t,account_id:u,user_group_id:e[`user-group-id`]}));o(r,{successLabel:`Created`})}})};var qe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}/members/${t.member_id}`};function Je(e){return e.usage(`$0 iam user-groups members delete <member-id>
|
|
53
53
|
|
|
54
54
|
Remove a member from User Group`).positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ye={command:`delete <member-id>`,describe:`Remove User Group Member`,builder:Je,handler:async e=>l({command:`iam user-groups members delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"user-group-id":String(e[`user-group-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(qe,{account_id:l,user_group_id:e[`user-group-id`],member_id:e[`member-id`]}));o(u,{successLabel:`Deleted`})})};var Q={method:`GET`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}/members/${t.member_id}`};function Xe(e){return e.usage(`$0 iam user-groups members get <member-id>
|
|
55
55
|
|
|
@@ -57,6 +57,6 @@ Get details of a specific member in a user group.`).positional(`member-id`,{type
|
|
|
57
57
|
|
|
58
58
|
List all the members attached to a user group.`).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const et={command:`list`,describe:`List User Group Members`,builder:$e,handler:async e=>l({command:`iam user-groups members list`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],fuzzyEmail:e[`fuzzy-email`],direction:e.direction};if(e.dryRun){let t=await i();s({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Qe,{account_id:u,user_group_id:e[`user-group-id`],...n}));o(d,{successLabel:`Loaded`})})};var tt={method:`PUT`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}/members`,body:`json`};function nt(e){return e.usage(`$0 iam user-groups members update <user-group-id>
|
|
59
59
|
|
|
60
|
-
Replace the set of members attached to a User Group.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Set/Replace members to a user group.`})}const rt={command:`update <user-group-id>`,describe:`Update User Group Members`,builder:nt,handler:async e=>l({command:`iam user-groups members update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let n=await r(e),
|
|
60
|
+
Replace the set of members attached to a User Group.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Set/Replace members to a user group.`})}const rt={command:`update <user-group-id>`,describe:`Update User Group Members`,builder:nt,handler:async e=>l({command:`iam user-groups members update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let n=e.body===void 0?void 0:d(e.body),l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body!==void 0){let t=n,r=await c(`Updating`,async()=>l.send(tt,{body:t,account_id:u,user_group_id:e[`user-group-id`]}));o(r,{successLabel:`Updated`})}})},it={command:`members`,describe:`Operations for user-groups.members`,builder:e=>e.command(Ke).command(Ye).command(Ze).command(et).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PUT`,path:t=>e`/accounts/${t.account_id}/iam/user_groups/${t.user_group_id}`,body:`json`};function at(e){return e.usage(`$0 iam user-groups update <user-group-id>
|
|
61
61
|
|
|
62
|
-
Modify an existing user group.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ot={command:`update <user-group-id>`,describe:`Update User Group`,builder:at,handler:async e=>l({command:`iam user-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),policies:u(e.policies,`policies`)}):d(e.body)});return}let n=await r(e),
|
|
62
|
+
Modify an existing user group.`).positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ot={command:`update <user-group-id>`,describe:`Update User Group`,builder:at,handler:async e=>l({command:`iam user-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/iam/user_groups/${e[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(e[`user-group-id`]))}`,pathParams:{"user-group-id":String(e[`user-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),policies:u(e.policies,`policies`)}):d(e.body)});return}let n=e.body===void 0?void 0:d(e.body),l=await r(e),m=e.local?t:await a();if(e.accountId=m,e.body!==void 0){let t=n,r=await c(`Updating`,async()=>l.send($,{body:t,account_id:m,user_group_id:e[`user-group-id`]}));o(r,{successLabel:`Updated`});return}let h=f({name:p(e.name,`name`,`text`),policies:u(e.policies,`policies`)}),g=await c(`Updating`,async()=>l.send($,{body:h,account_id:m,user_group_id:e[`user-group-id`]}));o(g,{successLabel:`Updated`})})},st={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(Pe).command(Le).command(Be).command(Ue).command(ot).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ct={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(j).command(P).command(V).command(he).command(Me).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ct as default};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{i as n,n as r}from"./auth-B-h0BHg7.mjs";import{a as i,i as a,t as o}from"./context-BY1Eh_Qe.mjs";import{t as s}from"./output-BZQEl3mK.mjs";import{t as c}from"./dry-run-kJbjn4kG.mjs";import{t as l}from"./progress-yvPscjYg.mjs";import{t as u}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as d,n as f,r as p,t as m}from"./body-parser-DoewLePl.mjs";import{n as h,t as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as v,n as y}from"./prompt-CEpZ-lQZ.mjs";import{n as b,t as x}from"./raw-fetch-Cl5spWC3.mjs";var S={method:`POST`,path:t=>e`/accounts/${t.account_id}/images/v1`,pathParams:[`account_id`],body:`form`};function ee(e){return e.usage(`$0 images create
|
|
3
3
|
|
|
4
|
-
Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const te={command:`create`,describe:`Upload an image`,builder:ee,handler:async e=>u({command:`images create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,creator:e.creator,id:e.id,metadata:e.metadata,"require-signed-urls":e[`require-signed-urls`],url:e.url}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file!==void 0||e.body!==void 0||e.creator!==void 0||e.id!==void 0||e.metadata!==void 0||e[`require-signed-urls`]!==void 0||e.url!==void 0){let t=new FormData;if(e.file){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.creator!==void 0&&t.append(`creator`,String(h(e.creator,`creator`,`text`)??``)),e.id!==void 0&&t.append(`id`,String(h(e.id,`id`,`text`)??``)),e.metadata!==void 0){let n=typeof e.metadata==`string`?h(e.metadata,`metadata`,`text`):e.metadata;t.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}e[`require-signed-urls`]!==void 0&&t.append(`requireSignedURLs`,String(e[`require-signed-urls`])),e.url!==void 0&&t.append(`url`,String(h(e.url,`url`,`text`)??``));let r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v1`,{body:t}));s(r,{successLabel:`Created`});return}if(e.body){let t=h(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v1`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));s(r,{successLabel:`Created`});return}let d=await l(`Creating`,async()=>a.send(S,{account_id:u}));s(d,{successLabel:`Created`})})};var ne={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/images/v1/${t.image_id}`};function re(e){return e.usage(`$0 images delete <image-id>
|
|
4
|
+
Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const te={command:`create`,describe:`Upload an image`,builder:ee,handler:async e=>u({command:`images create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,creator:e.creator,id:e.id,metadata:e.metadata,"require-signed-urls":e[`require-signed-urls`],url:e.url}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file!==void 0||e.body!==void 0||e.creator!==void 0||e.id!==void 0||e.metadata!==void 0||e[`require-signed-urls`]!==void 0||e.url!==void 0){let t=new FormData;if(e.file!==void 0){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.creator!==void 0&&t.append(`creator`,String(h(e.creator,`creator`,`text`)??``)),e.id!==void 0&&t.append(`id`,String(h(e.id,`id`,`text`)??``)),e.metadata!==void 0){let n=typeof e.metadata==`string`?h(e.metadata,`metadata`,`text`):e.metadata;t.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}e[`require-signed-urls`]!==void 0&&t.append(`requireSignedURLs`,String(e[`require-signed-urls`])),e.url!==void 0&&t.append(`url`,String(h(e.url,`url`,`text`)??``));let r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v1`,{body:t}));s(r,{successLabel:`Created`});return}if(e.body!==void 0){let t=h(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v1`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));s(r,{successLabel:`Created`});return}let d=await l(`Creating`,async()=>a.send(S,{account_id:u}));s(d,{successLabel:`Created`})})};var ne={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/images/v1/${t.image_id}`};function re(e){return e.usage(`$0 images delete <image-id>
|
|
5
5
|
|
|
6
6
|
Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.`).positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ie={command:`delete <image-id>`,describe:`Delete image`,builder:re,handler:async e=>u({command:`images delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/${e[`image-id`]==null?`<image-id>`:encodeURIComponent(String(e[`image-id`]))}`,pathParams:{"image-id":String(e[`image-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`This operation will delete this image.`}))return;let u=await l(`Deleting`,async()=>n.send(ne,{account_id:a,image_id:e[`image-id`]}));s(u,{successLabel:`Deleted`})})};var ae={method:`POST`,path:t=>e`/accounts/${t.account_id}/images/v2/direct_upload`,pathParams:[`account_id`],body:`form`};function oe(e){return e.usage(`$0 images direct-upload
|
|
7
7
|
|
|
8
|
-
Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the \`draft: true\` property is not present.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const C={command:`direct-upload`,describe:`Create authenticated direct upload URL V2`,builder:oe,handler:async e=>u({command:`images direct-upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images direct-upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,creator:e.creator,expiry:e.expiry,id:e.id,metadata:e.metadata,"require-signed-urls":e[`require-signed-urls`]}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file!==void 0||e.body!==void 0||e.creator!==void 0||e.expiry!==void 0||e.id!==void 0||e.metadata!==void 0||e[`require-signed-urls`]!==void 0){let t=new FormData;if(e.file){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.creator!==void 0&&t.append(`creator`,String(h(e.creator,`creator`,`text`)??``)),e.expiry!==void 0&&t.append(`expiry`,String(h(e.expiry,`expiry`,`text`)??``)),e.id!==void 0&&t.append(`id`,String(h(e.id,`id`,`text`)??``)),e.metadata!==void 0){let n=typeof e.metadata==`string`?h(e.metadata,`metadata`,`text`):e.metadata;t.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}e[`require-signed-urls`]!==void 0&&t.append(`requireSignedURLs`,String(e[`require-signed-urls`]));let r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:t}));s(r,{successLabel:`Created`});return}if(e.body){let t=h(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));s(r,{successLabel:`Created`});return}let d=await l(`Creating`,async()=>a.send(ae,{account_id:u}));s(d,{successLabel:`Created`})})};var w={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/images/v1/${t.image_id}`,body:`json`};function T(e){return e.usage(`$0 images edit <image-id>
|
|
8
|
+
Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the \`draft: true\` property is not present.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const C={command:`direct-upload`,describe:`Create authenticated direct upload URL V2`,builder:oe,handler:async e=>u({command:`images direct-upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images direct-upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,creator:e.creator,expiry:e.expiry,id:e.id,metadata:e.metadata,"require-signed-urls":e[`require-signed-urls`]}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file!==void 0||e.body!==void 0||e.creator!==void 0||e.expiry!==void 0||e.id!==void 0||e.metadata!==void 0||e[`require-signed-urls`]!==void 0){let t=new FormData;if(e.file!==void 0){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.creator!==void 0&&t.append(`creator`,String(h(e.creator,`creator`,`text`)??``)),e.expiry!==void 0&&t.append(`expiry`,String(h(e.expiry,`expiry`,`text`)??``)),e.id!==void 0&&t.append(`id`,String(h(e.id,`id`,`text`)??``)),e.metadata!==void 0){let n=typeof e.metadata==`string`?h(e.metadata,`metadata`,`text`):e.metadata;t.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}e[`require-signed-urls`]!==void 0&&t.append(`requireSignedURLs`,String(e[`require-signed-urls`]));let r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:t}));s(r,{successLabel:`Created`});return}if(e.body!==void 0){let t=h(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));s(r,{successLabel:`Created`});return}let d=await l(`Creating`,async()=>a.send(ae,{account_id:u}));s(d,{successLabel:`Created`})})};var w={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/images/v1/${t.image_id}`,body:`json`};function T(e){return e.usage(`$0 images edit <image-id>
|
|
9
9
|
|
|
10
|
-
Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`).positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record for managing images. No change if not specified. Provide as a JSON object or @path/to/file.json.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit <image-id>`,describe:`Update image`,builder:T,handler:async e=>u({command:`images edit`,classification:{safeFlags:[`require-signed-urls`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/${e[`image-id`]==null?`<image-id>`:encodeURIComponent(String(e[`image-id`]))}`,pathParams:{"image-id":String(e[`image-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({creator:h(e.creator,`creator`,`text`),metadata:p(e.metadata,`metadata`),requireSignedURLs:e[`require-signed-urls`]},[[`metadata`]]):f(e.body)});return}let n=await r(e),
|
|
10
|
+
Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`).positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record for managing images. No change if not specified. Provide as a JSON object or @path/to/file.json.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit <image-id>`,describe:`Update image`,builder:T,handler:async e=>u({command:`images edit`,classification:{safeFlags:[`require-signed-urls`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/${e[`image-id`]==null?`<image-id>`:encodeURIComponent(String(e[`image-id`]))}`,pathParams:{"image-id":String(e[`image-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({creator:h(e.creator,`creator`,`text`),metadata:p(e.metadata,`metadata`),requireSignedURLs:e[`require-signed-urls`]},[[`metadata`]]):f(e.body)});return}let n=e.body===void 0?void 0:f(e.body),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await l(`Updating`,async()=>a.send(w,{body:t,account_id:u,image_id:e[`image-id`]}));s(r,{successLabel:`Updated`});return}let d=m({creator:h(e.creator,`creator`,`text`),metadata:p(e.metadata,`metadata`),requireSignedURLs:e[`require-signed-urls`]},[[`metadata`]]),g=await l(`Updating`,async()=>a.send(w,{body:d,account_id:u,image_id:e[`image-id`]}));s(g,{successLabel:`Updated`})})};var D={method:`GET`,path:t=>e`/zones/${t.zone_id}/images/v1/flows`};function O(e){return e.usage(`$0 images flows get
|
|
11
11
|
|
|
12
12
|
Get the current transformation flows configuration for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`Get transformation flows`,builder:O,handler:async e=>u({command:`images flows get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf images flows get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/images/v1/flows`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n;let i=await l(`Loading`,async()=>t.send(D,{zone_id:n}));s(i,{successLabel:`Loaded`})})};var A={method:`PUT`,path:t=>e`/zones/${t.zone_id}/images/v1/flows`,body:`json`};function j(e){return e.usage(`$0 images flows update
|
|
13
13
|
|
|
14
|
-
Replace the entire transformation flows configuration for a zone.`).option(`etag`,{type:`string`,description:`The etag field`}).option(`flows`,{type:`string`,description:`The flows field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`config-version`,{type:`number`,description:`The version field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update`,describe:`Update transformation flows`,builder:j,handler:async e=>u({command:`images flows update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf images flows update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/images/v1/flows`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({etag:h(e.etag,`etag`,`text`),flows:d(e.flows,`flows`),version:e[`config-version`]}):f(e.body)});return}let t=await r(e),
|
|
14
|
+
Replace the entire transformation flows configuration for a zone.`).option(`etag`,{type:`string`,description:`The etag field`}).option(`flows`,{type:`string`,description:`The flows field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`config-version`,{type:`number`,description:`The version field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update`,describe:`Update transformation flows`,builder:j,handler:async e=>u({command:`images flows update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf images flows update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/images/v1/flows`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({etag:h(e.etag,`etag`,`text`),flows:d(e.flows,`flows`),version:e[`config-version`]}):f(e.body)});return}let t=e.body===void 0?void 0:f(e.body),n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body!==void 0){let e=t,r=await l(`Updating`,async()=>n.send(A,{body:e,zone_id:i}));s(r,{successLabel:`Updated`});return}if(e.flows===void 0)throw Error(`--flows is required (or pass --body with this field set).`);if(e[`config-version`]===void 0)throw Error(`--config-version is required (or pass --body with this field set).`);let o=m({etag:h(e.etag,`etag`,`text`),flows:d(e.flows,`flows`),version:e[`config-version`]}),u=await l(`Updating`,async()=>n.send(A,{body:o,zone_id:i}));s(u,{successLabel:`Updated`})})},N={command:`flows`,describe:`Zone-level transformation flows that control how images are resized and optimized on delivery`,builder:e=>e.command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.usage(`$0 images get-blob <image-id>
|
|
15
15
|
|
|
16
16
|
Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.`).positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const F={command:`get-blob <image-id>`,describe:`Download image`,builder:P,handler:async e=>u({command:`images get-blob`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images get-blob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/${e[`image-id`]==null?`<image-id>`:encodeURIComponent(String(e[`image-id`]))}/blob`,pathParams:{"image-id":String(e[`image-id`]??``)},bodyKind:`none`});return}await r(e);let n=e.local?t:await o();e.accountId=n;let a=await l(`Loading`,async()=>x(`/accounts/${n}/images/v1/${encodeURIComponent(String(e[`image-id`]))}/blob`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));b(e.text===!0?a.toString(`utf-8`):a)})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/images/v1/${t.image_id}`};function L(e){return e.usage(`$0 images get <image-id>
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ Fetch details for a CF Images image.`).positional(`image-id`,{type:`string`,desc
|
|
|
19
19
|
|
|
20
20
|
Abort a running CF Images import. Already imported images will remain.`).positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`abort <migration-id>`,describe:`Abort a migration`,builder:B,handler:async e=>u({command:`images import abort`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import abort`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/migrations/${e[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(e[`migration-id`]))}/lifecycle/abort`,pathParams:{"migration-id":String(e[`migration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Updating`,async()=>n.send(z,{account_id:a,migration_id:e[`migration-id`]}));s(u,{successLabel:`Updated`})})};var H={method:`POST`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/migrations`,body:`json`};function U(e){return e.usage(`$0 images import create
|
|
21
21
|
|
|
22
|
-
Create a pending CF Images import from a configured source.`).option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).coerce(`conflict-behaviour`,e=>h(e,`conflict-behaviour`,`text`)).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`create`,describe:`Create a sourcing kit migration`,builder:U,handler:async e=>u({command:`images import create`,classification:{safeFlags:[`conflict-behaviour`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({conflictBehaviour:e[`conflict-behaviour`],excludedContentTypes:e[`excluded-content-types`],pathPrefix:h(e[`path-prefix`],`path-prefix`,`text`),rootDirectory:h(e[`root-directory`],`root-directory`,`text`),sourceId:h(e[`source-id`],`source-id`,`text`)}):f(e.body)});return}let n=await r(e),
|
|
22
|
+
Create a pending CF Images import from a configured source.`).option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).coerce(`conflict-behaviour`,e=>h(e,`conflict-behaviour`,`text`)).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`create`,describe:`Create a sourcing kit migration`,builder:U,handler:async e=>u({command:`images import create`,classification:{safeFlags:[`conflict-behaviour`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({conflictBehaviour:e[`conflict-behaviour`],excludedContentTypes:e[`excluded-content-types`],pathPrefix:h(e[`path-prefix`],`path-prefix`,`text`),rootDirectory:h(e[`root-directory`],`root-directory`,`text`),sourceId:h(e[`source-id`],`source-id`,`text`)}):f(e.body)});return}let n=e.body===void 0?void 0:f(e.body),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let e=n,t=await l(`Creating`,async()=>a.send(H,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}e[`source-id`]===void 0&&(e[`source-id`]=await _(`source-id`,`The identifier of the source to migrate from.`));let d=m({conflictBehaviour:e[`conflict-behaviour`],excludedContentTypes:e[`excluded-content-types`],pathPrefix:h(e[`path-prefix`],`path-prefix`,`text`),rootDirectory:h(e[`root-directory`],`root-directory`,`text`),sourceId:h(e[`source-id`],`source-id`,`text`)}),p=await l(`Creating`,async()=>a.send(H,{body:d,account_id:u}));s(p,{successLabel:`Created`})})};var G={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/migrations/${t.migration_id}`};function K(e){return e.usage(`$0 images import delete <migration-id>
|
|
23
23
|
|
|
24
24
|
Delete a completed, failed, or aborted CF Images import.`).positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const q={command:`delete <migration-id>`,describe:`Delete a sourcing kit migration`,builder:K,handler:async e=>u({command:`images import delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/migrations/${e[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(e[`migration-id`]))}`,pathParams:{"migration-id":String(e[`migration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`This operation will delete this import migration.`}))return;let u=await l(`Deleting`,async()=>n.send(G,{account_id:a,migration_id:e[`migration-id`]}));s(u,{successLabel:`Deleted`})})};var se={method:`GET`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/migrations/${t.migration_id}`};function ce(e){return e.usage(`$0 images import get <migration-id>
|
|
25
25
|
|
|
@@ -33,7 +33,7 @@ Get progress and object counts for a CF Images import.`).positional(`migration-i
|
|
|
33
33
|
|
|
34
34
|
Check whether a source can still access its S3 bucket.`).positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`check <source-id>`,describe:`Get source connectivity status`,builder:be,handler:async e=>u({command:`images import sources check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources check`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources/${e[`source-id`]==null?`<source-id>`:encodeURIComponent(String(e[`source-id`]))}/connectivity`,pathParams:{"source-id":String(e[`source-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ye,{account_id:a,source_id:e[`source-id`]}));s(u,{successLabel:`Loaded`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/sources`,body:`json`};function Se(e){return e.usage(`$0 images import sources create
|
|
35
35
|
|
|
36
|
-
Configure an S3 source for CF Images imports.`).option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`name`,{type:`string`,description:`A human-readable name for the source.`}).option(`secret`,{type:`string`,description:`Storage credentials for accessing the bucket. Shape depends on vendor. Provide as a JSON object or @path/to/file.json.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).coerce(`vendor`,e=>h(e,`vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`create`,describe:`Create a sourcing kit source`,builder:Se,handler:async e=>u({command:`images import sources create`,classification:{safeFlags:[`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({account:h(e.account,`account`,`text`),bucket:h(e.bucket,`bucket`,`text`),name:h(e.name,`name`,`text`),secret:p(e.secret,`secret`,!0),vendor:e.vendor},[[`secret`]]):f(e.body,[{path:[`secret`],flag:`secret`}])});return}let n=await r(e),
|
|
36
|
+
Configure an S3 source for CF Images imports.`).option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`name`,{type:`string`,description:`A human-readable name for the source.`}).option(`secret`,{type:`string`,description:`Storage credentials for accessing the bucket. Shape depends on vendor. Provide as a JSON object or @path/to/file.json.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).coerce(`vendor`,e=>h(e,`vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`create`,describe:`Create a sourcing kit source`,builder:Se,handler:async e=>u({command:`images import sources create`,classification:{safeFlags:[`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({account:h(e.account,`account`,`text`),bucket:h(e.bucket,`bucket`,`text`),name:h(e.name,`name`,`text`),secret:p(e.secret,`secret`,!0),vendor:e.vendor},[[`secret`]]):f(e.body,[{path:[`secret`],flag:`secret`}])});return}let n=e.body===void 0?void 0:f(e.body,[{path:[`secret`],flag:`secret`}]),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let e=n,t=await l(`Creating`,async()=>a.send(J,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e.bucket===void 0&&(e.bucket=await _(`bucket`,`The name of the storage bucket.`)),e.name===void 0&&(e.name=await _(`name`,`A human-readable name for the source.`)),e.secret===void 0)throw Error(`--secret is required (or pass --body with this field set).`);e.vendor===void 0&&(e.vendor=await v(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let d=m({account:h(e.account,`account`,`text`),bucket:h(e.bucket,`bucket`,`text`),name:h(e.name,`name`,`text`),secret:p(e.secret,`secret`,!0),vendor:e.vendor},[[`secret`]]),g=await l(`Creating`,async()=>a.send(J,{body:d,account_id:u}));s(g,{successLabel:`Created`})})};var we={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/sources/${t.source_id}`};function Te(e){return e.usage(`$0 images import sources delete <source-id>
|
|
37
37
|
|
|
38
38
|
Delete a source configured for CF Images imports. Sources used by active imports cannot be deleted.`).positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ee={command:`delete <source-id>`,describe:`Delete a sourcing kit source`,builder:Te,handler:async e=>u({command:`images import sources delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources/${e[`source-id`]==null?`<source-id>`:encodeURIComponent(String(e[`source-id`]))}`,pathParams:{"source-id":String(e[`source-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`This operation will delete this import source.`}))return;let u=await l(`Deleting`,async()=>n.send(we,{account_id:a,source_id:e[`source-id`]}));s(u,{successLabel:`Deleted`})})};var De={method:`GET`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/sources/${t.source_id}`};function Oe(e){return e.usage(`$0 images import sources get <source-id>
|
|
39
39
|
|
|
@@ -41,9 +41,9 @@ Get details of a source configured for CF Images imports.`).positional(`source-i
|
|
|
41
41
|
|
|
42
42
|
List sources configured for CF Images imports.`).option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`name`,{type:`string`,description:`Filter sources by name (partial match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`List sourcing kit sources`,builder:je,handler:async e=>u({command:`images import sources list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={offset:e.offset,limit:e.limit,name:e.name};if(e.dryRun){let e=await i();c({command:`cf images import sources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Ae,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/sources/connectivity-precheck`,body:`json`};function Ne(e){return e.usage(`$0 images import sources pre-check
|
|
43
43
|
|
|
44
|
-
Check S3 credentials without saving a source.`).option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`region`,{type:`string`,description:`The region hint for the bucket (S3 only).`}).option(`secret`,{type:`string`,description:`Storage credentials for accessing the bucket. Provide as a JSON object or @path/to/file.json.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).coerce(`vendor`,e=>h(e,`vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`pre-check`,describe:`Precheck source connectivity`,builder:Ne,handler:async e=>u({command:`images import sources pre-check`,classification:{safeFlags:[`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources pre-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({account:h(e.account,`account`,`text`),bucket:h(e.bucket,`bucket`,`text`),region:h(e.region,`region`,`text`),secret:p(e.secret,`secret`,!0),vendor:e.vendor},[[`secret`]]):f(e.body,[{path:[`secret`],flag:`secret`}])});return}let n=await r(e),
|
|
44
|
+
Check S3 credentials without saving a source.`).option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`region`,{type:`string`,description:`The region hint for the bucket (S3 only).`}).option(`secret`,{type:`string`,description:`Storage credentials for accessing the bucket. Provide as a JSON object or @path/to/file.json.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).coerce(`vendor`,e=>h(e,`vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`pre-check`,describe:`Precheck source connectivity`,builder:Ne,handler:async e=>u({command:`images import sources pre-check`,classification:{safeFlags:[`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources pre-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({account:h(e.account,`account`,`text`),bucket:h(e.bucket,`bucket`,`text`),region:h(e.region,`region`,`text`),secret:p(e.secret,`secret`,!0),vendor:e.vendor},[[`secret`]]):f(e.body,[{path:[`secret`],flag:`secret`}])});return}let n=e.body===void 0?void 0:f(e.body,[{path:[`secret`],flag:`secret`}]),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let e=n,t=await l(`Creating`,async()=>a.send(Y,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e.bucket===void 0&&(e.bucket=await _(`bucket`,`The name of the storage bucket.`)),e.secret===void 0)throw Error(`--secret is required (or pass --body with this field set).`);e.vendor===void 0&&(e.vendor=await v(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let d=m({account:h(e.account,`account`,`text`),bucket:h(e.bucket,`bucket`,`text`),region:h(e.region,`region`,`text`),secret:p(e.secret,`secret`,!0),vendor:e.vendor},[[`secret`]]),g=await l(`Creating`,async()=>a.send(Y,{body:d,account_id:u}));s(g,{successLabel:`Created`})})};var X={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/sources/${t.source_id}`,body:`json`};function Fe(e){return e.usage(`$0 images import sources update <source-id>
|
|
45
45
|
|
|
46
|
-
Rename a source configured for CF Images imports.`).positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`Updated name for the source.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ie={command:`update <source-id>`,describe:`Update a sourcing kit source`,builder:Fe,handler:async e=>u({command:`images import sources update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources/${e[`source-id`]==null?`<source-id>`:encodeURIComponent(String(e[`source-id`]))}`,pathParams:{"source-id":String(e[`source-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),
|
|
46
|
+
Rename a source configured for CF Images imports.`).positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`Updated name for the source.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ie={command:`update <source-id>`,describe:`Update a sourcing kit source`,builder:Fe,handler:async e=>u({command:`images import sources update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import sources update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/sources/${e[`source-id`]==null?`<source-id>`:encodeURIComponent(String(e[`source-id`]))}`,pathParams:{"source-id":String(e[`source-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=e.body===void 0?void 0:f(e.body),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await l(`Updating`,async()=>a.send(X,{body:t,account_id:u,source_id:e[`source-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`Updated name for the source.`));let d=m({name:h(e.name,`name`,`text`)}),p=await l(`Updating`,async()=>a.send(X,{body:d,account_id:u,source_id:e[`source-id`]}));s(p,{successLabel:`Updated`})})},Le={command:`sources`,describe:`Operations for import.sources`,builder:e=>e.command(xe).command(Ce).command(Ee).command(ke).command(Me).command(Pe).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Re={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/images/v2/sourcingkit/migrations/${t.migration_id}/lifecycle/start`};function ze(e){return e.usage(`$0 images import start <migration-id>
|
|
47
47
|
|
|
48
48
|
Start a pending CF Images import.`).positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`start <migration-id>`,describe:`Start a migration`,builder:ze,handler:async e=>u({command:`images import start`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images import start`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v2/sourcingkit/migrations/${e[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(e[`migration-id`]))}/lifecycle/start`,pathParams:{"migration-id":String(e[`migration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Updating`,async()=>n.send(Re,{account_id:a,migration_id:e[`migration-id`]}));s(u,{successLabel:`Updated`})})},Ve={command:`import`,describe:`Import images from S3`,builder:e=>e.command(V).command(W).command(q).command(le).command(fe).command(he).command(ve).command(Be).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var He={method:`PUT`,path:t=>e`/accounts/${t.account_id}/images/v1/keys/${t.signing_key_name}`};function Ue(e){return e.usage(`$0 images keys create <signing-key-name>
|
|
49
49
|
|
|
@@ -55,11 +55,11 @@ List your CF Images signing keys.`).option(`dry-run`,{type:`boolean`,description
|
|
|
55
55
|
|
|
56
56
|
Fetch image statistics details for Cloudflare Images. The returned statistics detail storage usage, including the current image count vs this account's allowance.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`stats`,describe:`Images usage statistics`,builder:nt,handler:async e=>u({command:`images stats`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf images stats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/images/v1/stats`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(tt,{account_id:a}));s(u,{successLabel:`Loaded`})})};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/images/v1/variants`,body:`json`};function it(e){return e.usage(`$0 images variants create
|
|
57
57
|
|
|
58
|
-
Create a CF Images variant that allows you to resize images for different use cases.`).option(`id`,{type:`string`,description:`The id field`}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`,default:!1}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).coerce(`options-fit`,e=>h(e,`options-fit`,`text`)).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).coerce(`options-metadata`,e=>h(e,`options-metadata`,`text`)).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const at={command:`create`,describe:`Create a variant`,builder:it,handler:async e=>u({command:`images variants create`,classification:{safeFlags:[`never-require-signed-urls`,`options-fit`,`options-metadata`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images variants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({id:h(e.id,`id`,`text`),neverRequireSignedURLs:e[`never-require-signed-urls`],options:{fit:e[`options-fit`],height:e[`options-height`],metadata:e[`options-metadata`],width:e[`options-width`]}}):f(e.body)});return}let n=await r(e),
|
|
58
|
+
Create a CF Images variant that allows you to resize images for different use cases.`).option(`id`,{type:`string`,description:`The id field`}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`,default:!1}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).coerce(`options-fit`,e=>h(e,`options-fit`,`text`)).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).coerce(`options-metadata`,e=>h(e,`options-metadata`,`text`)).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const at={command:`create`,describe:`Create a variant`,builder:it,handler:async e=>u({command:`images variants create`,classification:{safeFlags:[`never-require-signed-urls`,`options-fit`,`options-metadata`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images variants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({id:h(e.id,`id`,`text`),neverRequireSignedURLs:e[`never-require-signed-urls`],options:{fit:e[`options-fit`],height:e[`options-height`],metadata:e[`options-metadata`],width:e[`options-width`]}}):f(e.body)});return}let n=e.body===void 0?void 0:f(e.body),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let e=n,t=await l(`Creating`,async()=>a.send(Z,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e.id===void 0&&(e.id=await _(`id`,`The id field`)),e[`options-fit`]===void 0&&(e[`options-fit`]=await v(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),e[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(e[`options-metadata`]===void 0&&(e[`options-metadata`]=await v(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),e[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let d=m({id:h(e.id,`id`,`text`),neverRequireSignedURLs:e[`never-require-signed-urls`],options:{fit:e[`options-fit`],height:e[`options-height`],metadata:e[`options-metadata`],width:e[`options-width`]}}),p=await l(`Creating`,async()=>a.send(Z,{body:d,account_id:u}));s(p,{successLabel:`Created`})})};var Q={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/images/v1/variants/${t.variant_id}`};function ot(e){return e.usage(`$0 images variants delete <variant-id>
|
|
59
59
|
|
|
60
60
|
Delete a CF Images variant. This will purge the cache for all images associated with the variant.`).positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const st={command:`delete <variant-id>`,describe:`Delete a variant`,builder:ot,handler:async e=>u({command:`images variants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/variants/${e[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(e[`variant-id`]))}`,pathParams:{"variant-id":String(e[`variant-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`This operation will delete this variant.`}))return;let u=await l(`Deleting`,async()=>n.send(Q,{account_id:a,variant_id:e[`variant-id`]}));s(u,{successLabel:`Deleted`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/images/v1/variants/${t.variant_id}`,body:`json`};function ct(e){return e.usage(`$0 images variants edit <variant-id>
|
|
61
61
|
|
|
62
|
-
Update a CF Images variant. This will purge the cache for all images associated with the variant.`).positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).coerce(`options-fit`,e=>h(e,`options-fit`,`text`)).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).coerce(`options-metadata`,e=>h(e,`options-metadata`,`text`)).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const lt={command:`edit <variant-id>`,describe:`Update a variant`,builder:ct,handler:async e=>u({command:`images variants edit`,classification:{safeFlags:[`never-require-signed-urls`,`options-fit`,`options-metadata`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/variants/${e[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(e[`variant-id`]))}`,pathParams:{"variant-id":String(e[`variant-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({neverRequireSignedURLs:e[`never-require-signed-urls`],options:{fit:e[`options-fit`],height:e[`options-height`],metadata:e[`options-metadata`],width:e[`options-width`]}}):f(e.body)});return}let n=await r(e),
|
|
62
|
+
Update a CF Images variant. This will purge the cache for all images associated with the variant.`).positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).coerce(`options-fit`,e=>h(e,`options-fit`,`text`)).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).coerce(`options-metadata`,e=>h(e,`options-metadata`,`text`)).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const lt={command:`edit <variant-id>`,describe:`Update a variant`,builder:ct,handler:async e=>u({command:`images variants edit`,classification:{safeFlags:[`never-require-signed-urls`,`options-fit`,`options-metadata`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/variants/${e[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(e[`variant-id`]))}`,pathParams:{"variant-id":String(e[`variant-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({neverRequireSignedURLs:e[`never-require-signed-urls`],options:{fit:e[`options-fit`],height:e[`options-height`],metadata:e[`options-metadata`],width:e[`options-width`]}}):f(e.body)});return}let n=e.body===void 0?void 0:f(e.body),a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await l(`Updating`,async()=>a.send($,{body:t,account_id:u,variant_id:e[`variant-id`]}));s(r,{successLabel:`Updated`});return}if(e[`options-fit`]===void 0&&(e[`options-fit`]=await v(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),e[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(e[`options-metadata`]===void 0&&(e[`options-metadata`]=await v(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),e[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let d=m({neverRequireSignedURLs:e[`never-require-signed-urls`],options:{fit:e[`options-fit`],height:e[`options-height`],metadata:e[`options-metadata`],width:e[`options-width`]}}),p=await l(`Updating`,async()=>a.send($,{body:d,account_id:u,variant_id:e[`variant-id`]}));s(p,{successLabel:`Updated`})})};var ut={method:`GET`,path:t=>e`/accounts/${t.account_id}/images/v1/variants/${t.variant_id}`};function dt(e){return e.usage(`$0 images variants get <variant-id>
|
|
63
63
|
|
|
64
64
|
Fetch details for a CF Images variant.`).positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`get <variant-id>`,describe:`Variant details`,builder:dt,handler:async e=>u({command:`images variants get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf images variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/images/v1/variants/${e[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(e[`variant-id`]))}`,pathParams:{"variant-id":String(e[`variant-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ut,{account_id:a,variant_id:e[`variant-id`]}));s(u,{successLabel:`Loaded`})})};var pt={method:`GET`,path:t=>e`/accounts/${t.account_id}/images/v1/variants`};function mt(e){return e.usage(`$0 images variants list
|
|
65
65
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,r as t,t as n}from"./src-
|
|
2
|
+
import{n as e,r as t,t as n}from"./src-BoSDeQ9m.mjs";import{t as r}from"./cli-exit-CstFZ1eJ.mjs";export{r as CliExit,n as buildCli,e as main,t as runMain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./src-
|
|
2
|
+
import"./src-BoSDeQ9m.mjs";import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{i as n,n as r,t as i}from"./autoconfig-C0ynlGHf.mjs";import{R as a,n as o}from"./dist-D-ihn_mV.mjs";import{n as s}from"./version-6Bpy6Bgt.mjs";import{i as c}from"./delegate-CcL6RoGw.mjs";import{t as l}from"./project-settings-nBMEx1f-.mjs";import"./ui-xjCox-gU.mjs";import{t as u}from"./log-BWdaOGOW.mjs";import{n as d,r as f}from"./dialog-D5lus4M4.mjs";import{t as p}from"./progress-yvPscjYg.mjs";import{n as m}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{basename as h,dirname as g,isAbsolute as _,join as v,relative as y,resolve as b}from"node:path";import{mkdir as x,readdir as S,stat as C,writeFile as w}from"node:fs/promises";const T={"@cloudflare/vite-plugin":`beta`,typescript:`^7.0.2`,vite:`^8.3.0`};function ee(e){return{".gitignore":M(),"cloudflare.config.ts":D(e),"package.json":A(e),...e.packageManager===`pnpm`?{"pnpm-workspace.yaml":te()}:{},"src/index.ts":k(),"tsconfig.json":j(),"vite.config.ts":O()}}function te(){return`# Approve build scripts needed by the generated Worker's dependencies.
|
|
3
3
|
allowBuilds:
|
|
4
4
|
esbuild: true
|
|
5
5
|
workerd: true
|
|
@@ -39,5 +39,5 @@ dist/
|
|
|
39
39
|
!.env.example
|
|
40
40
|
*.log
|
|
41
41
|
.DS_Store
|
|
42
|
-
`}const N=[`npm`,`pnpm`,`yarn`,`bun`],P=[`install`,`package-manager`],F=/* @__PURE__ */ new Set([`.git`]);function I(e){return e.positional(`directory`,{type:`string`,describe:`Directory to initialize; created when missing (prompts when omitted; use . for the current directory)`}).option(`install`,{type:`boolean`,default:!0,describe:`Install dependencies after creating a new project (use --no-install to skip)`}).option(`package-manager`,{type:`string`,choices:N,describe:`Package manager for a new project (prompts when interactive)`})}async function L(e){let t=b(e.directory??await R());await H(t)===`not-empty`?await K(t,e):await U(t,e)}async function R(){return(await d(`Which directory do you want to initialize?`,{defaultValue:`.`,placeholder:`. (the current directory)`,fallbackError:`Pass the directory to initialize, for example ${e.code(`cf init my-worker`)}, or ${e.code(`cf init .`)} for the current directory.`})).trim()||`.`}function z(e){return{directory:e.directory,install:e.install??!0,packageManager:V(e.packageManager),mode:e.mode}}function B(e=process.env.npm_config_user_agent){return V(e?.split(`/`,1)[0])}function V(e){return N.find(t=>t===e)}async function H(e){let t;try{t=(await C(e)).isDirectory()}catch(e){if(ne(e)&&e.code===`ENOENT`)return`missing`;throw e}if(!t)throw Error(`Cannot initialize ${Z(e)} because it is not a directory.`);return(await S(e)).every(e=>F.has(e))?`empty`:`not-empty`}async function U(
|
|
42
|
+
`}const N=[`npm`,`pnpm`,`yarn`,`bun`],P=[`install`,`package-manager`],F=/* @__PURE__ */ new Set([`.git`]);function I(e){return e.positional(`directory`,{type:`string`,describe:`Directory to initialize; created when missing (prompts when omitted; use . for the current directory)`}).option(`install`,{type:`boolean`,default:!0,describe:`Install dependencies after creating a new project (use --no-install to skip)`}).option(`package-manager`,{type:`string`,choices:N,describe:`Package manager for a new project (prompts when interactive)`})}async function L(e){let t=b(e.directory??await R());await H(t)===`not-empty`?await K(t,e):await U(t,e)}async function R(){return(await d(`Which directory do you want to initialize?`,{defaultValue:`.`,placeholder:`. (the current directory)`,fallbackError:`Pass the directory to initialize, for example ${e.code(`cf init my-worker`)}, or ${e.code(`cf init .`)} for the current directory.`})).trim()||`.`}function z(e){return{directory:e.directory,install:e.install??!0,packageManager:V(e.packageManager),mode:e.mode}}function B(e=process.env.npm_config_user_agent){return V(e?.split(`/`,1)[0])}function V(e){return N.find(t=>t===e)}async function H(e){let t;try{t=(await C(e)).isDirectory()}catch(e){if(ne(e)&&e.code===`ENOENT`)return`missing`;throw e}if(!t)throw Error(`Cannot initialize ${Z(e)} because it is not a directory.`);return(await S(e)).every(e=>F.has(e))?`empty`:`not-empty`}async function U(r,i){u.info(`Creating a new Worker in ${e.bold(r)}`);let c=await G(i),l=a(h(r).toLowerCase().replace(/\s+/g,`-`)).replace(/-+$/,``),d=ee({name:l,compatibilityDate:o,cfVersion:s,packageManager:c});for(let[e,t]of Object.entries(d)){let n=v(r,e);await x(g(n),{recursive:!0}),await w(n,t,{flag:`wx`})}if(u.success(`Created the ${e.bold(l)} Worker in ${Z(r)}`),i.install){let a=`${c} install`,o=await n(a,r);if(o.exitCode!==0||o.signal)throw u.error(`Dependency installation failed. Run ${e.code(a)} in ${Z(r)} to try again.`),new t(o.exitCode,{signal:o.signal});await W(r,i.mode)}Y(r,[...i.install?[]:[{command:`${c} install`,description:`Install dependencies`}],...J()])}async function W(t,n){try{let{generateWorkerTypes:e}=await import(`./generate-D6V4Q58z.mjs`),r=await p(`Generating types`,()=>e({configPath:v(t,l),mode:n,includeRuntime:!0}));u.success(`Generated types in ${Z(r)}`)}catch(n){let r=n instanceof Error?n.message:String(n);u.warn(`Could not generate types: ${r}\nRun ${e.code(`${q()} workers types`)} in ${Z(t)} to try again.`)}}async function G(e){if(e.packageManager)return e.packageManager;let t=B()??`npm`;return e.install?f(`Which package manager do you want to use?`,{choices:N.map(e=>({title:e,value:e})),defaultOption:N.indexOf(t)}):t}async function K(t,n){let a=Z(t);u.info(`Setting up the existing project in ${e.bold(t)}`),(!n.install||n.packageManager)&&u.warn(`${e.code(`--no-install`)} and ${e.code(`--package-manager`)} only apply when creating a new project. Setting up an existing project uses its own package manager.`);let o=process.cwd();process.chdir(t);let s=!1;try{let n=await i(t);if(!n)throw Error(`cf could not detect a project to set up in ${a}, and the directory is not empty.\nRun ${e.code(`cf init`)} in an empty directory, or pass a new directory name (for example, ${e.code(`cf init my-worker`)}).`);s=n.configured,s||await r(n)}finally{process.chdir(o)}s?u.info(`Found an existing Cloudflare configuration in ${a}.`):u.success(`Set up ${a} for Cloudflare.`),Y(t,J())}function q(){return c()?`npx cf`:`cf`}function J(){let e=q();return[{command:`${e} dev`,description:`Start a local development server`},{command:`${e} deploy`,description:`Deploy to Cloudflare`}]}function Y(t,n){let r=[...X(t).map(e=>({command:e})),...n],i=Math.max(...r.filter(e=>e.description).map(e=>e.command.length)),a=` `.repeat(3),o=r.map(({command:t,description:n})=>n?`${a}${e.code(t)}${` `.repeat(i-t.length+2)}${e.muted(n)}`:`${a}${e.code(t)}`);u.end(e.bold(`Next steps`)),process.stderr.write(`${o.join(`
|
|
43
43
|
`)}\n\n`)}function X(e){let t=y(process.cwd(),e);if(t===``)return[];let n=Q(t)?e:t;return[`cd ${/\s/.test(n)?JSON.stringify(n):n}`]}function Z(e){let t=y(process.cwd(),e);return t===``?`the current directory`:Q(t)?e:t}function Q(e){return e.startsWith(`..`)||_(e)}function ne(e){return e instanceof Error&&`code`in e}const $={command:`workers [directory]`,describe:`Create a new Workers project or set up an existing one`,builder:I,handler:async e=>{await L(z(e))}},re={command:`init [directory]`,describe:`Create a new Cloudflare project or set up an existing one`,builder:e=>I(e).command(m({...$,describe:`${$.describe} [default]`},{command:`init workers`,classification:{safeFlags:P}})).epilogue(`Running cf init without a subcommand runs cf init workers. An empty directory, or one containing only .git, receives a new hello-world Worker. A directory with other files is set up with autoconfig instead. When no directory is given, cf asks for one; non-interactive runs must pass it. Use ./workers to initialize a directory named workers.`),handler:async e=>{await L(z(e))}};export{re as default};
|