cf 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +3 -3
- package/dist/_meta/commands.json +149 -5
- package/dist/_meta/hand-written-commands.json +181 -5
- package/dist/{abuse-reports-sDBTV0qZ.mjs → abuse-reports-D40QFl-y.mjs} +1 -1
- package/dist/{access-DcNzuCue.mjs → access-Dl2IU1ID.mjs} +1 -1
- package/dist/{account-BX90zXn5.mjs → account-CPbieCZ4.mjs} +1 -1
- package/dist/{account-tags-Bz3JG5hI.mjs → account-tags-skfP7H8k.mjs} +1 -1
- package/dist/{accounts-DCuW3xyZ.mjs → accounts-CSgR6909.mjs} +1 -1
- package/dist/{acm-zjfShZLS.mjs → acm-CVvCTaNk.mjs} +1 -1
- package/dist/{addressing-DORQ64Ux.mjs → addressing-Uq5hEDDP.mjs} +1 -1
- package/dist/{agent-context-BgPR_aQr.mjs → agent-context-BvuDdaJb.mjs} +1 -1
- package/dist/{agent-memory-C0hAUMeC.mjs → agent-memory-BrHMIU0E.mjs} +1 -1
- package/dist/{ai-audit-DnU3vn3E.mjs → ai-audit-BoZuL84i.mjs} +1 -1
- package/dist/{ai-gateway-COOrr_Yw.mjs → ai-gateway-DE50Jem1.mjs} +1 -1
- package/dist/{ai-search-DKbN9Tyd.mjs → ai-search-Fx7NHCHB.mjs} +1 -1
- package/dist/{ai-security-C_I5lo58.mjs → ai-security-DyLbY9kv.mjs} +1 -1
- package/dist/{ai-BpEBGMT2.mjs → ai-v2fP1r0s.mjs} +1 -1
- package/dist/{alerting-4T8gmZs-.mjs → alerting-5mFZjTcD.mjs} +1 -1
- package/dist/{analytics-Bxh4TCP7.mjs → analytics-BygTfozw.mjs} +1 -1
- package/dist/{analytics_engine-fV56bjVN.mjs → analytics_engine-4L-q362P.mjs} +1 -1
- package/dist/{api-security-COk_i184.mjs → api-security-DjFsRYWx.mjs} +1 -1
- package/dist/{argo-DIRfvxvv.mjs → argo-TzXPN7tz.mjs} +1 -1
- package/dist/args-CDgWUP4J.mjs +2 -0
- package/dist/{artifacts-BBfXNfUg.mjs → artifacts-dEw2UUBV.mjs} +1 -1
- package/dist/{audit-logs-BlOrlAWe.mjs → audit-logs-CqY7zzwv.mjs} +1 -1
- package/dist/{auth-DPhNN3Ly.mjs → auth-CPLdkOC7.mjs} +1 -1
- package/dist/{auth-D3X9HYhD.mjs → auth-DY_Y2bXC.mjs} +2 -2
- package/dist/{billing-B9e4PnvN.mjs → billing-DHQuRT8S.mjs} +1 -1
- package/dist/{bot-management-D2JVeS-V.mjs → bot-management-CfqG79hF.mjs} +1 -1
- package/dist/{botnet-feed-BTzTYs5d.mjs → botnet-feed-BOeNnDoH.mjs} +1 -1
- package/dist/{brand-protection-C5Q6Gpw9.mjs → brand-protection-DYttrKIM.mjs} +1 -1
- package/dist/{browser-extension-u5uA0Lwk.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
- package/dist/{browser-run-CHGOCTdG.mjs → browser-run-373D4e1i.mjs} +1 -1
- package/dist/build-D0ir_S70.mjs +2 -0
- package/dist/{cache-C6V7PbQM.mjs → cache-DJXBmc3w.mjs} +1 -1
- package/dist/{calls-Bye8Tyy-.mjs → calls-COO0Eoz1.mjs} +1 -1
- package/dist/{certificate-authorities-B-U_e6JJ.mjs → certificate-authorities-DbHLmKbd.mjs} +1 -1
- package/dist/{cf-Ds4JFovl.mjs → cf-yPz_IqW6.mjs} +11 -11
- package/dist/{chunk-LQW53VED-22IYZovK.mjs → chunk-LQW53VED-9MACsvSG.mjs} +25 -25
- package/dist/{chunk-QBZBEHZB-CKzQKcIp.mjs → chunk-QBZBEHZB-yeyhVUeD.mjs} +1 -1
- package/dist/{client-certificates-3RrC-6LG.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
- package/dist/{client-side-security-DIdKvRMT.mjs → client-side-security-HOmA37et.mjs} +1 -1
- package/dist/{cloud-connector-CL1jPQud.mjs → cloud-connector-C7hw1c1f.mjs} +1 -1
- package/dist/{cloudforce-one-DULeqLkR.mjs → cloudforce-one-DLOj76q4.mjs} +1 -1
- package/dist/command-BV87D4tR.mjs +2 -0
- package/dist/{completions-CqgGKRAC.mjs → completions-BnD46cXe.mjs} +1 -1
- package/dist/config.d.mts +305 -332
- package/dist/config.mjs +1 -1
- package/dist/{connector-interrupts-CXlLObDv.mjs → connector-interrupts-DY-z_LrH.mjs} +1 -1
- package/dist/{connector-telemetry-events-BrYX4ig4.mjs → connector-telemetry-events-DCXmcAc9.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-BdeBQYcM.mjs → connector-telemetry-snapshots-D8GNuzx3.mjs} +1 -1
- package/dist/{connectors-BQwyBJ4_.mjs → connectors-fEOn-J_i.mjs} +1 -1
- package/dist/containers-BDBsEs7-.mjs +58 -0
- package/dist/{content-scan-DNzhXYkY.mjs → content-scan-Cmj9--XY.mjs} +1 -1
- package/dist/{csamScanner-CFq5s1Q3.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
- package/dist/{ct-alerting-CH6UmsGQ.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
- package/dist/{custom-certificates-DnG73Wg2.mjs → custom-certificates-C5qrlyhb.mjs} +1 -1
- package/dist/{custom-csrs-bhClr2SU.mjs → custom-csrs-BgOnTbBW.mjs} +1 -1
- package/dist/{custom-hostnames-C0eiGvG9.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
- package/dist/{custom-nameservers-CVMhhLm6.mjs → custom-nameservers-2ZajBkRC.mjs} +1 -1
- package/dist/{custom-pages-DTINMR30.mjs → custom-pages-Buki_Cb8.mjs} +1 -1
- package/dist/{d1-sKdExJYF.mjs → d1-n2in0cSF.mjs} +1 -1
- package/dist/{data-security-mV3a6UfW.mjs → data-security-DzOQMkv3.mjs} +1 -1
- package/dist/{dcv-delegation-dBu3jdRw.mjs → dcv-delegation-BTP9LCOm.mjs} +1 -1
- package/dist/deploy-BUSz35vq.mjs +2 -0
- package/dist/deploy-input-BvD9aRP1.mjs +2 -0
- package/dist/dev-DY_DquQx.mjs +4 -0
- package/dist/{diagnostics-CJV6qWUA.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
- package/dist/{directory-B5zCMusW.mjs → directory-BeiSyg8A.mjs} +1 -1
- package/dist/{dispatch-namespaces-Dg5lu5xX.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
- package/dist/dist-BBx1io2f.mjs +2 -0
- package/dist/dist-Cb9TJ2VV.mjs +9 -0
- package/dist/dist-DV7LR38l.mjs +387 -0
- package/dist/dist-DvizctjW.mjs +48 -0
- package/dist/{dls-t0hnIe_P.mjs → dls-BwoU29mS.mjs} +1 -1
- package/dist/{dns-C8FC2hbh.mjs → dns-DISAfuzj.mjs} +1 -1
- package/dist/{dns-firewall-CuhhUm55.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
- package/dist/dry-run-ILZRVpnp.mjs +2 -0
- package/dist/{durable-objects-BLrgM3Cw.mjs → durable-objects-DhDL3San.mjs} +1 -1
- package/dist/{email-auth-BmYrl0pO.mjs → email-auth-BROqK6-C.mjs} +1 -1
- package/dist/{email-routing-CF3_Z957.mjs → email-routing-BZXHDAOO.mjs} +1 -1
- package/dist/{email-security-F7OYcMkZ.mjs → email-security-DVumybrk.mjs} +1 -1
- package/dist/{email-sending-EyU3WvGQ.mjs → email-sending-CDQ3_wyz.mjs} +1 -1
- package/dist/{fieldExtractors-Cno37T2m.mjs → fieldExtractors-Cy1rxHEF.mjs} +1 -1
- package/dist/{firewall-8YWWy4iB.mjs → firewall-C0g5X7Zd.mjs} +1 -1
- package/dist/{flagship-C4x0l-8J.mjs → flagship-fFBiZUz-.mjs} +1 -1
- package/dist/{fraud-HR_SdUx3.mjs → fraud-CjIETOaM.mjs} +1 -1
- package/dist/{google-tag-gateway-BdcS0WnX.mjs → google-tag-gateway-hPa5IHUx.mjs} +1 -1
- package/dist/{healthchecks-4qOvjrTN.mjs → healthchecks-CoycpTf9.mjs} +1 -1
- package/dist/{hostnames-DehdYOMz.mjs → hostnames-x_Yezxpr.mjs} +1 -1
- package/dist/{hyperdrive-3gD3hn70.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
- package/dist/{iam-DR72hmii.mjs → iam-Bk7K_PPO.mjs} +1 -1
- package/dist/{images-CeKc5JPh.mjs → images-BAEFb9q1.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DtFix9WL.mjs → intel-DDkyJVaP.mjs} +1 -1
- package/dist/interactive-CRnq-B5I.mjs +11 -0
- package/dist/{interactive-C7M55Wxx.mjs → interactive-cytQzL94.mjs} +1 -1
- package/dist/{ips-CtWCjXAN.mjs → ips-DU0ti0i0.mjs} +1 -1
- package/dist/{keyless-certificates-Dk24yQFz.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
- package/dist/{keys-BmhG6Kn1.mjs → keys-DqldTZqH.mjs} +1 -1
- package/dist/{kv-BuVPAuZP.mjs → kv-CcfCfnwq.mjs} +1 -1
- package/dist/{leaked-credential-checks-XcZmt1I-.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
- package/dist/{load-balancers-CylN-l7n.mjs → load-balancers-Dg4pDad1.mjs} +1 -1
- package/dist/{local-Be3lg_9E.mjs → local-DGiIS1uM.mjs} +1 -1
- package/dist/local-runtime--IQr44qq.mjs +2 -0
- package/dist/{logexplorer-CvRPoKbj.mjs → logexplorer-Bu2mG5rh.mjs} +1 -1
- package/dist/{logo-matches-Heuft3yF.mjs → logo-matches-CWUzxY7G.mjs} +1 -1
- package/dist/{logos-DRYjGBDq.mjs → logos-BTfdkDPi.mjs} +1 -1
- package/dist/{logpush-Dve9jOMp.mjs → logpush-BZyay3h2.mjs} +1 -1
- package/dist/{logs-SC86FE89.mjs → logs-BqF7jjQO.mjs} +1 -1
- package/dist/{magic-cloud-networking-DXzeqwX-.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +1 -1
- package/dist/{magic-network-monitoring-DW0Jl74i.mjs → magic-network-monitoring-D0FnkjuN.mjs} +1 -1
- package/dist/{magic-transit-BK_3asH2.mjs → magic-transit-B5skt0G7.mjs} +1 -1
- package/dist/{managed-transforms-B6TV4qoE.mjs → managed-transforms-B6X_crcJ.mjs} +1 -1
- package/dist/{matches-Iss9Fo4R.mjs → matches-DeYaB4I0.mjs} +1 -1
- package/dist/{mcp-8wxXT6JU.mjs → mcp-ChjBiMx2.mjs} +1 -1
- package/dist/{mesh-Bf9UAS4J.mjs → mesh-DRVAFLBX.mjs} +1 -1
- package/dist/{moq-ZKMFOeVz.mjs → moq-DE7VDEFS.mjs} +1 -1
- package/dist/{mtls-certificates-DoWm6GiE.mjs → mtls-certificates-Cbc3uAkN.mjs} +1 -1
- package/dist/{network-B1lBARU9.mjs → network-CDPZNFbn.mjs} +1 -1
- package/dist/{network-interconnects-CLYIFHfU.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
- package/dist/{oauth-DuEONNgC.mjs → oauth-DAa7SwkM.mjs} +4 -4
- package/dist/{oauth-clients-DgiTzLzu.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
- package/dist/{oauth-scopes-BOBRMxjm.mjs → oauth-scopes-BE6xF4_h.mjs} +1 -1
- package/dist/{observability-Jya7-zkl.mjs → observability-DnyI8rPJ.mjs} +1 -1
- package/dist/{organization-CYxYV4e0.mjs → organization-yh0mSUdI.mjs} +1 -1
- package/dist/{organizations-SacGUW44.mjs → organizations-B3aU-RCG.mjs} +1 -1
- package/dist/{origin-ca-certificates-Ph1bJGQ1.mjs → origin-ca-certificates-BaNWfVqf.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-BBLiGAGB.mjs → origin-post-quantum-encryption-CIUtQgyv.mjs} +1 -1
- package/dist/{origin-tls-client-auth-DSDgTN2X.mjs → origin-tls-client-auth-CvEpbX2Q.mjs} +1 -1
- package/dist/{page-rules-BqEyFR2c.mjs → page-rules-CzbyXbt6.mjs} +1 -1
- package/dist/{pages-CQ7ZVWk1.mjs → pages-CX8yefTI.mjs} +1 -1
- package/dist/{pay-per-crawl-BMe_3_Qj.mjs → pay-per-crawl-v4vBOMWD.mjs} +1 -1
- package/dist/{pipelines-6De2Pe2C.mjs → pipelines-BZ1KGupx.mjs} +1 -1
- package/dist/{precursor-iwK-1P_d.mjs → precursor-D42A9ay5.mjs} +1 -1
- package/dist/{progress-BqQcF5QH.mjs → progress-jYW64HY7.mjs} +1 -1
- package/dist/{project-settings-C_1-JI6Y.mjs → project-settings-BN7tL0c7.mjs} +2 -2
- package/dist/{prompt-B0sWIs9c.mjs → prompt-CyATfGUu.mjs} +1 -1
- package/dist/{public-BYCVISMH-DnMJ5Jct.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
- package/dist/{queries-c7zvnfEQ.mjs → queries-xvETUjUE.mjs} +1 -1
- package/dist/{queues-BU6y16qS.mjs → queues-CpqHDtxF.mjs} +1 -1
- package/dist/{r2-data-catalog-B-tw-JdG.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
- package/dist/{r2-Jo3QMahK.mjs → r2-jhmLvD1z.mjs} +1 -1
- package/dist/{radar-DIYAMEof.mjs → radar-C2J16wpX.mjs} +1 -1
- package/dist/{rate-limits-DewOcznT.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
- package/dist/{raw-fetch-Cc-MjHeL.mjs → raw-fetch-CNKIypJ7.mjs} +1 -1
- package/dist/{realtimekit-cnZEVNDn.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
- package/dist/{registrar-BsWr_aPM.mjs → registrar-BI5ewTAk.mjs} +1 -1
- package/dist/{registrar-sandbox-BlcpUyIH.mjs → registrar-sandbox-al1znWMc.mjs} +1 -1
- package/dist/{registry-jifR3_Y6.mjs → registry-5-I2XLwF.mjs} +1 -1
- package/dist/{reporting--1AyTV7k.mjs → reporting-CxsdHAH3.mjs} +1 -1
- package/dist/{request-tracers-C_VX7X6-.mjs → request-tracers-DJJCncft.mjs} +1 -1
- package/dist/{resource-sharing-Br5dqr3o.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
- package/dist/{resource-tagging-C33U6T74.mjs → resource-tagging-aTtpX5e5.mjs} +1 -1
- package/dist/{rules-BfjzALMi.mjs → rules-PpsDU89Q.mjs} +1 -1
- package/dist/{rulesets-3i_1Vwt-.mjs → rulesets-DP12Aqik.mjs} +1 -1
- package/dist/{rum-CjmIckiR.mjs → rum-DxvpzJYc.mjs} +1 -1
- package/dist/{schema-1mwmslUV.mjs → schema-DlLbiOJj.mjs} +1 -1
- package/dist/{schema-flags-llLJuFFw.mjs → schema-flags-CTfQVGCs.mjs} +1 -1
- package/dist/schemas-BFCBlp_W.mjs +65 -0
- package/dist/{scim-pApmzA5B.mjs → scim-DJ4AVU20.mjs} +1 -1
- package/dist/{secrets-store-DBC9WJau.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
- package/dist/{security-center-Djm06dq-.mjs → security-center-008FMs_z.mjs} +1 -1
- package/dist/{security-txt-Ci7bP4zH.mjs → security-txt-CqcfrhlN.mjs} +1 -1
- package/dist/{share-Dj-MNXrw.mjs → share-D5fzsVAJ.mjs} +1 -1
- package/dist/{shared-BJvq4DkR.mjs → shared-DlKGNPiT.mjs} +92 -142
- package/dist/{smart-shield--8EpJjrF.mjs → smart-shield-DpFscIk8.mjs} +1 -1
- package/dist/{snippets-Dyz0PH60.mjs → snippets-CCKgI2ZX.mjs} +1 -1
- package/dist/spawn-C3_tJ3RB.mjs +526 -0
- package/dist/{spectrum-rAHWz8rH.mjs → spectrum-LmdqY3ki.mjs} +1 -1
- package/dist/{speed-BKepWBXj.mjs → speed-CEK36h3A.mjs} +1 -1
- package/dist/src-CEb2fgtT.mjs +108 -0
- package/dist/{ssl-KdFiY3ev.mjs → ssl-ChHUyaQm.mjs} +1 -1
- package/dist/{startup-profile-GLNPHQ9U.mjs → startup-profile-Dpxg-MjV.mjs} +3 -3
- package/dist/{state-Cu3cItUg.mjs → state-DeX23Kmg.mjs} +1 -1
- package/dist/{stream-CKJ6Tb0M.mjs → stream-DfUSELMX.mjs} +1 -1
- package/dist/{submit-BxbKKhBn.mjs → submit-DF2G5CIz.mjs} +1 -1
- package/dist/{tags-DA8dq9fx.mjs → tags-nFJJHlLJ.mjs} +1 -1
- package/dist/{tenant-DLXw48hS.mjs → tenant-CRLw1oRU.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-9G93XuvU.mjs → tenant-custom-nameservers-BvBQRDcs.mjs} +1 -1
- package/dist/{tools-x8bj9E6b.mjs → tools-j8UGEtP1.mjs} +1 -1
- package/dist/{tunnel-CNQA5Flp.mjs → tunnel-CMQeBgmb.mjs} +1 -1
- package/dist/{tunnels-CC10EOsU.mjs → tunnels-iVA3MrdS.mjs} +1 -1
- package/dist/{turnstile-CH58hnf4.mjs → turnstile-DQHP6-_b.mjs} +1 -1
- package/dist/{ui-CmnnBm_O.mjs → ui-DJFcf61J.mjs} +1 -1
- package/dist/{url-info-BpCgdUtL.mjs → url-info-BVgdb_pf.mjs} +1 -1
- package/dist/{url-normalization-BzuynEy1.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
- package/dist/{url-scanner-APIZbhB7.mjs → url-scanner-DwuDZLPk.mjs} +1 -1
- package/dist/{user-2-NGebfI.mjs → user-I_MbB_KX.mjs} +1 -1
- package/dist/{values-S_bNv819.mjs → values-S-Q7-5o8.mjs} +1 -1
- package/dist/{vectorize-Bv7feLBC.mjs → vectorize-CNZdF_0A.mjs} +1 -1
- package/dist/{waiting-rooms-Dk4LIpvm.mjs → waiting-rooms-Bo-OSsxu.mjs} +1 -1
- package/dist/{web-assets-C1UmOyzD.mjs → web-assets-tlFzKdNL.mjs} +1 -1
- package/dist/{web3-GnUocVYH.mjs → web3-CdbfoZ2x.mjs} +1 -1
- package/dist/{workers-J1-PLwdl.mjs → workers-DQ9Q7czn.mjs} +2 -2
- package/dist/{workers-builds-DCHmWOMS.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
- package/dist/{workflows-CArfEI2c.mjs → workflows-BhEy-crm.mjs} +1 -1
- package/dist/{zaraz-mg2YlR3_.mjs → zaraz-DbKvA_8C.mjs} +1 -1
- package/dist/{zero-trust-DVdUPtj1.mjs → zero-trust-DrHCPVOc.mjs} +1 -1
- package/dist/{zone-DMAfrDJX.mjs → zone-D2zrbJI2.mjs} +1 -1
- package/dist/{zones-CNwxUi7I.mjs → zones-DrpxQ_-A.mjs} +1 -1
- package/package.json +9 -8
- package/dist/args-DlUhyGU0.mjs +0 -2
- package/dist/build-D0FhOj40.mjs +0 -8
- package/dist/command-C9VP3xaA.mjs +0 -2
- package/dist/containers-BrQtGiNp.mjs +0 -58
- package/dist/deploy-BL59O1O1.mjs +0 -2
- package/dist/deploy-input-Dz6q-__n.mjs +0 -2
- package/dist/dev-BDaavgH1.mjs +0 -4
- package/dist/dist-BHi7UhXO.mjs +0 -72
- package/dist/dist-BWpErtDM.mjs +0 -384
- package/dist/dry-run-DL2V6yFm.mjs +0 -2
- package/dist/local-runtime-Ce7k598H.mjs +0 -2
- package/dist/spawn-C5Z7oWdp.mjs +0 -519
- package/dist/src-gJma71Ec.mjs +0 -108
- /package/dist/{alerts-15-IW4jE.mjs → alerts-9PR5sQ_z.mjs} +0 -0
- /package/dist/{autorag-CFwRkEKw.mjs → autorag-Bevo1kIH.mjs} +0 -0
- /package/dist/{body-parser-BshbixEq.mjs → body-parser-BGVbwPeM.mjs} +0 -0
- /package/dist/{brands-BgT1vu9B.mjs → brands-C4M04Man.mjs} +0 -0
- /package/dist/{clear-BlCK85Me.mjs → clear-DS0eRXOc.mjs} +0 -0
- /package/dist/{cli-types-DAYeL_Mj.mjs → cli-types-C3nVfpSG.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BbpcII3_.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-DuCiimXl.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
- /package/dist/{domain-info-C7LBxPBt.mjs → domain-info-BUiaGCEq.mjs} +0 -0
- /package/dist/{health-DZFfafkX.mjs → health-vX6Ml2Na.mjs} +0 -0
- /package/dist/{input-validation-QDIYu7Vb.mjs → input-validation-1esLElok.mjs} +0 -0
- /package/dist/{internal-BKHC2D1Y.mjs → internal-ROz7anul.mjs} +0 -0
- /package/dist/{live-DwCvDmaH.mjs → live-CSxvigCS.mjs} +0 -0
- /package/dist/{metadata-B5yfL0ln.mjs → metadata-DEqBUaSv.mjs} +0 -0
- /package/dist/{open-PBXRGS4R-CX8K4WYl.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +0 -0
- /package/dist/{output-Ccqw2WOb.mjs → output-BqDR9h74.mjs} +0 -0
- /package/dist/{rate-limit-analytics-B8Vuu1sU.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
- /package/dist/{ready-D9H2zHHI.mjs → ready-6G9zVGPJ.mjs} +0 -0
- /package/dist/{recent-submissions-BPo0J80d.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
- /package/dist/{refute-2W8NLCN4.mjs → refute-DjkmLSNe.mjs} +0 -0
- /package/dist/{resolve-B8CyM1mi.mjs → resolve-DEvdeprv.mjs} +0 -0
- /package/dist/{scan-logo-D5x6F1Y0.mjs → scan-logo-545qLcGs.mjs} +0 -0
- /package/dist/{scan-page-CWhta3x7.mjs → scan-page-DRQiVufl.mjs} +0 -0
- /package/dist/{search-DZmBQJL9.mjs → search-CXbqFoqe.mjs} +0 -0
- /package/dist/{signed-url-CQrmWgz5.mjs → signed-url-rU_nvgFA.mjs} +0 -0
- /package/dist/{submission-info-C98A0bqq.mjs → submission-info-D6PgXNQP.mjs} +0 -0
- /package/dist/{total-queries-BZoaFoDE.mjs → total-queries-XkFyu8H5.mjs} +0 -0
- /package/dist/{tracked-domains-CNHogPHx.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
- /package/dist/{verify-4e4L9IRk.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f}from"./input-validation-1esLElok.mjs";import{a as p,i as m,n as h}from"./prompt-CyATfGUu.mjs";import{t as g}from"./cli-types-C3nVfpSG.mjs";function ee(e){return e.option(`kind`,{type:`string`,description:`The kind of the schema`,choices:[`openapi_v3`]}).option(`name`,{type:`string`,description:`A human-readable name for the schema`}).option(`source`,{type:`string`,description:`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`}).option(`validation-enabled`,{type:`boolean`,description:`An indicator if this schema is enabled`}).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 te={command:`create`,describe:`Uploads an OpenAPI schema that defines expected request formats for API operations.`,builder:ee,handler:async e=>{if(e.dryRun){s({command:`cf api-security schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({kind:f(e.kind,`kind`,`text`),name:f(e.name,`name`,`text`),source:f(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.apiSecurity.schemaValidation.schemas.create({...r,zone_id:n})),{successLabel:`Created`});return}if(e.kind===void 0&&(e.kind=await m(`kind`,`The kind of the schema`,[`openapi_v3`])),e.name===void 0&&(e.name=await p(`name`,`A human-readable name for the schema`)),e.source===void 0&&(e.source=await p(`source`,`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`)),e[`validation-enabled`]===void 0)throw Error(`--validation-enabled is required (or pass --body with this field set).`);let i=d({kind:f(e.kind,`kind`,`text`),name:f(e.name,`name`,`text`),source:f(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]});o(await c(`Creating`,async()=>t.apiSecurity.schemaValidation.schemas.create({...i,zone_id:n})),{successLabel:`Created`})}};function _(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,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 v={command:`delete <schema-id>`,describe:`Permanently removes an uploaded OpenAPI schema from API Security. Operations using this schema will lose their validation rules.`,builder:_,handler:async e=>{if(e.dryRun){s({command:`cf api-security schema-validation schemas delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force,message:`This operation permanently deletes the uploaded schema and removes its validation coverage.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}o(await c(`Deleting`,async()=>t.apiSecurity.schemaValidation.schemas.delete({zone_id:n,schema_id:e[`schema-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <schema-id>`,describe:`Gets the contents and metadata of a specific OpenAPI schema uploaded to API Security.`,builder:y,handler:async e=>{let t={omit_source:e[`omit-source`]};if(e.dryRun){s({command:`cf api-security schema-validation schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.apiSecurity.schemaValidation.schemas.get({zone_id:i,schema_id:e[`schema-id`],...t})),{successLabel:`Loaded`})}};function x(e){return e.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 S={command:`list`,describe:`Lists all unique hosts found in uploaded OpenAPI schemas for the zone.`,builder:x,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){s({command:`cf api-security schema-validation schemas hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/hosts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.apiSecurity.schemaValidation.schemas.hosts.list({zone_id:i,...t})),{successLabel:`Loaded`})}},C={command:`hosts`,describe:`Operations for schema-validation.schemas.hosts`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`}).option(`validation-enabled`,{type:`boolean`,description:`Filter for enabled schemas`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Lists all OpenAPI schemas uploaded to API Security.`,builder:w,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],omit_source:e[`omit-source`],validation_enabled:e[`validation-enabled`]};if(e.dryRun){s({command:`cf api-security schema-validation schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.apiSecurity.schemaValidation.schemas.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function E(e){return e.option(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`host`,{type:`string`,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`operation-status`,{type:`string`,description:"Filter results by whether operations exist in Web Asset Management or not. `new` will just return operations from the schema that do not exist otherwise. `existing` will just return operations from the schema that already exist.",choices:[`new`,`existing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.`,builder:g(E),handler:async e=>{let t={feature:e.feature,host:e.host,method:e.method,endpoint:e.endpoint,page:e.page,per_page:e[`per-page`],operation_status:e[`operation-status`]};if(e.dryRun){s({command:`cf api-security schema-validation schemas operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.apiSecurity.schemaValidation.schemas.operations.list({zone_id:i,schema_id:e[`schema-id`],...t})),{successLabel:`Loaded`})}},O={command:`operations`,describe:`Operations for schema-validation.schemas.operations`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`validation-enabled`,{type:`boolean`,description:`Flag whether schema is enabled for validation.`}).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 A={command:`set-validation <schema-id>`,describe:`Enables or disables validation for an uploaded OpenAPI schema without changing the schema document.`,builder:k,handler:async e=>{if(e.dryRun){s({command:`cf api-security schema-validation schemas set-validation`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({validation_enabled:e[`validation-enabled`]}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.apiSecurity.schemaValidation.schemas.setValidation({...r,zone_id:n,schema_id:e[`schema-id`]})),{successLabel:`Updated`});return}let i=d({validation_enabled:e[`validation-enabled`]});o(await c(`Updating`,async()=>t.apiSecurity.schemaValidation.schemas.setValidation({...i,zone_id:n,schema_id:e[`schema-id`]})),{successLabel:`Updated`})}},j={command:`schemas`,describe:`Operations for schema-validation.schemas`,builder:e=>e.command(te).command(v).command(b).command(T).command(A).command(C).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`validation-default-mitigation-action`,{type:`string`,description:`The default mitigation action used
|
|
4
4
|
Mitigation actions are as follows:
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";import{n as s}from"./input-validation-1esLElok.mjs";import{i as c}from"./prompt-CyATfGUu.mjs";function l(e){return e.option(`value`,{type:`string`,description:`Specifies the enablement value of Argo Smart Routing.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configures the enablement of Argo Smart Routing.`})}const u={command:`edit`,describe:`Configures the value of the Argo Smart Routing enablement setting.`,builder:l,handler:async l=>{if(l.dryRun){r({command:`cf argo smart-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.argo.smartRouting.edit({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Specifies the enablement value of Argo Smart Routing.`,[`on`,`off`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.argo.smartRouting.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Retrieves the value of Argo Smart Routing enablement setting.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf argo smart-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.argo.smartRouting.get({zone_id:s})),{successLabel:`Loaded`})}},p={command:`smart-routing`,describe:`Route traffic through the fastest network paths to your origin using real-time latency data`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`value`,{type:`string`,description:`Enables Tiered Caching.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Tiered Caching.`})}const h={command:`edit`,describe:`Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`,builder:m,handler:async l=>{if(l.dryRun){r({command:`cf argo tiered-caching edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.argo.tieredCaching.edit({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Enables Tiered Caching.`,[`on`,`off`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.argo.tieredCaching.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf argo tiered-caching get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.argo.tieredCaching.get({zone_id:s})),{successLabel:`Loaded`})}},v={command:`tiered-caching`,describe:`Operations for tiered-caching`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`argo`,describe:`Network optimization features that speed up and improve reliability of traffic to your origins`,builder:e=>e.command(p).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
function e(e=process.argv.slice(2)){let t=!1;for(let[n,r]of e.entries()){if(r===`--`)break;if(r===`--quiet=false`||r===`-q=false`||r===`--no-quiet`){t=!1;continue}if(r===`--quiet=true`||r===`-q=true`){t=!0;continue}(r===`--quiet`||r===`-q`)&&(t=e[n+1]!==`false`)}return t}export{e as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,n as d}from"./prompt-CyATfGUu.mjs";import{t as f}from"./cli-types-C3nVfpSG.mjs";import{n as p,t as m}from"./raw-fetch-CNKIypJ7.mjs";function h(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`artifactsNamespacesList`,describe:`Lists Artifacts namespaces for an account.`,builder:h,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf artifacts namespaces artifactsNamespacesList`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.artifacts.namespaces.artifactsNamespacesList({account_id:u,...c})),{successLabel:`Loaded`})}};function _(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <namespace>`,describe:`Returns an Artifacts namespace summary.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf artifacts namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}`,pathParams:{namespace:String(s.namespace??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.artifacts.namespaces.get({account_id:l,namespace:s.namespace})),{successLabel:`Loaded`})}};function y(e){return e.positional(`hash`,{type:`string`,description:`40-character lowercase hexadecimal Git object hash.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,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 b={command:`get <hash>`,describe:`Returns raw bytes for an immutable Git blob object. Blob responses are cacheable forever by hash.`,builder:y,handler:async i=>{if(i.dryRun){a({command:`cf artifacts namespaces repos blobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${i.namespace==null?`<namespace>`:encodeURIComponent(String(i.namespace))}/repos/${i.name==null?`<name>`:encodeURIComponent(String(i.name))}/blob/${i.hash==null?`<hash>`:encodeURIComponent(String(i.hash))}`,pathParams:{namespace:String(i.namespace??``),name:String(i.name??``),hash:String(i.hash??``)},bodyKind:`none`});return}await r(i);let s=i.local?e:await t();i.accountId=s;let c=await o(`Loading`,async()=>m(`/accounts/${s}/artifacts/namespaces/${encodeURIComponent(String(i.namespace))}/repos/${encodeURIComponent(String(i.name))}/blob/${encodeURIComponent(String(i.hash))}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}));p(i.text===!0?c.toString(`utf-8`):c)}},x={command:`blobs`,describe:`Operations for namespaces.repos.blobs`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`hash`,{type:`string`,description:`40-character lowercase hexadecimal Git object hash.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <hash>`,describe:`Returns decoded metadata for an immutable Git commit object. Commit responses are cacheable forever by hash.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf artifacts namespaces repos commits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/commit/${s.hash==null?`<hash>`:encodeURIComponent(String(s.hash))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``),hash:String(s.hash??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.artifacts.namespaces.repos.commits.get({account_id:l,namespace:s.namespace,name:s.name,hash:s.hash})),{successLabel:`Loaded`})}},w={command:`commits`,describe:`Operations for namespaces.repos.commits`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`default-branch`,{type:`string`,description:`Git branch name. Must match /^[a-zA-Z0-9][a-zA-Z0-9._/-]*$/, must not contain '..', and must not end with '/' or '.'.`}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`read-only`,{type:`boolean`,description:`The read_only 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 E={command:`create <namespace>`,describe:`Creates a Git-compatible Artifacts repository in a namespace.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf artifacts namespaces repos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${d.namespace==null?`<namespace>`:encodeURIComponent(String(d.namespace))}/repos`,pathParams:{namespace:String(d.namespace??``)},bodyKind:`json`,body:d.body===void 0?c({default_branch:l(d[`default-branch`],`default-branch`,`text`),description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`),read_only:d[`read-only`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.artifacts.namespaces.repos.create({...e,account_id:p,namespace:d.namespace})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`The name field`));let m=c({default_branch:l(d[`default-branch`],`default-branch`,`text`),description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`),read_only:d[`read-only`]});i(await o(`Creating`,async()=>f.artifacts.namespaces.repos.create({...m,account_id:p,namespace:d.namespace})),{successLabel:`Created`})}};function D(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,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 O={command:`delete <name>`,describe:`Deletes a repository and schedules cleanup of its backing data.`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf artifacts namespaces repos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.artifacts.namespaces.repos.delete({account_id:l,namespace:s.namespace,name:s.name})),{successLabel:`Deleted`})}};function k(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`ref`,{type:`string`,description:`Git ref, branch, tag, or commit hash.`,demandOption:!0}).option(`path`,{type:`string`,description:`File path.`,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 A={command:`get <name>`,describe:`Returns raw bytes for a file resolved by ref and path.`,builder:k,handler:async i=>{let s={ref:i.ref,path:i.path};if(i.dryRun){a({command:`cf artifacts namespaces repos files get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${i.namespace==null?`<namespace>`:encodeURIComponent(String(i.namespace))}/repos/${i.name==null?`<name>`:encodeURIComponent(String(i.name))}/file`,pathParams:{namespace:String(i.namespace??``),name:String(i.name??``)},query:s,bodyKind:`none`});return}await r(i);let c=i.local?e:await t();i.accountId=c;let l=new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await o(`Loading`,async()=>m(`/accounts/${c}/artifacts/namespaces/${encodeURIComponent(String(i.namespace))}/repos/${encodeURIComponent(String(i.name))}/file${l?`?`+l:``}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}));p(i.text===!0?u.toString(`utf-8`):u)}},j={command:`files`,describe:`Operations for namespaces.repos.files`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`default-branch-only`,{type:`boolean`,description:`The default_branch_only field`}).option(`description`,{type:`string`,description:`The description field`}).option(`read-only`,{type:`boolean`,description:`The read_only 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 N={command:`fork <name>`,describe:`Forks a source repository into a new repository.`,builder:M,handler:async u=>{if(u.dryRun){a({command:`cf artifacts namespaces repos fork`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${u.namespace==null?`<namespace>`:encodeURIComponent(String(u.namespace))}/repos/${u.name==null?`<name>`:encodeURIComponent(String(u.name))}/fork`,pathParams:{namespace:String(u.namespace??``),name:String(u.name??``)},bodyKind:`json`,body:u.body===void 0?c({default_branch_only:u[`default-branch-only`],description:l(u.description,`description`,`text`),read_only:u[`read-only`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.artifacts.namespaces.repos.fork({...e,account_id:f,namespace:u.namespace,name:u.name})),{successLabel:`Created`});return}let p=c({default_branch_only:u[`default-branch-only`],description:l(u.description,`description`,`text`),read_only:u[`read-only`]});i(await o(`Creating`,async()=>d.artifacts.namespaces.repos.fork({...p,account_id:f,namespace:u.namespace,name:u.name})),{successLabel:`Created`})}};function P(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <name>`,describe:`Returns repository metadata.`,builder:P,handler:async s=>{if(s.dryRun){a({command:`cf artifacts namespaces repos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.artifacts.namespaces.repos.get({account_id:l,namespace:s.namespace,name:s.name})),{successLabel:`Loaded`})}};function ee(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`branch`,{type:`string`,description:`Git branch name. Must match /^[a-zA-Z0-9][a-zA-Z0-9._/-]*$/, must not contain '..', and must not end with '/' or '.'.`}).option(`depth`,{type:`number`,description:`The depth field`}).option(`read-only`,{type:`boolean`,description:`The read_only field`}).option(`url`,{type:`string`,description:`The url 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 I={command:`import <name>`,describe:`Imports an HTTPS Git repository into an Artifacts repository.`,builder:ee,handler:async d=>{if(d.dryRun){a({command:`cf artifacts namespaces repos import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${d.namespace==null?`<namespace>`:encodeURIComponent(String(d.namespace))}/repos/${d.name==null?`<name>`:encodeURIComponent(String(d.name))}/import`,pathParams:{namespace:String(d.namespace??``),name:String(d.name??``)},bodyKind:`json`,body:d.body===void 0?c({branch:l(d.branch,`branch`,`text`),depth:d.depth,read_only:d[`read-only`],url:l(d.url,`url`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.artifacts.namespaces.repos.import({...e,account_id:p,namespace:d.namespace,name:d.name})),{successLabel:`Created`});return}d.url===void 0&&(d.url=await u(`url`,`The url field`));let m=c({branch:l(d.branch,`branch`,`text`),depth:d.depth,read_only:d[`read-only`],url:l(d.url,`url`,`text`)});i(await o(`Creating`,async()=>f.artifacts.namespaces.repos.import({...m,account_id:p,namespace:d.namespace,name:d.name})),{successLabel:`Created`})}};function L(e){return e.option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`search`,{type:`string`,description:`Search`}).option(`sort`,{type:`string`,description:`Sort`,choices:[`created_at`,`updated_at`,`last_push_at`,`name`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Lists repositories in a namespace.`,builder:f(L),handler:async s=>{let c={limit:s.limit,cursor:s.cursor,search:s.search,sort:s.sort,direction:s.direction};if(s.dryRun){a({command:`cf artifacts namespaces repos list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos`,pathParams:{namespace:String(s.namespace??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.artifacts.namespaces.repos.list({account_id:u,namespace:s.namespace,...c})),{successLabel:`Loaded`})}};function z(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`ref`,{type:`string`,description:`Git ref, branch, tag, or commit hash. Defaults to HEAD.`}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <name>`,describe:`Returns commit metadata walking backwards from a ref, branch, tag, or HEAD.`,builder:z,handler:async s=>{let c={ref:s.ref,limit:s.limit,offset:s.offset};if(s.dryRun){a({command:`cf artifacts namespaces repos logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/log`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.artifacts.namespaces.repos.logs.get({account_id:u,namespace:s.namespace,name:s.name,...c})),{successLabel:`Loaded`})}},V={command:`logs`,describe:`Operations for namespaces.repos.logs`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.positional(`path`,{type:`string`,description:`File path. May contain slashes.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`ref`,{type:`string`,description:`Git ref, branch, tag, or 40-character commit hash.`,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 U={command:`get <path>`,describe:`Returns file bytes resolved by ref and path, with a sniffed content type and browser-safe response headers.`,builder:H,handler:async i=>{if(i.dryRun){a({command:`cf artifacts namespaces repos raw get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${i.namespace==null?`<namespace>`:encodeURIComponent(String(i.namespace))}/repos/${i.name==null?`<name>`:encodeURIComponent(String(i.name))}/raw/${i.ref==null?`<ref>`:encodeURIComponent(String(i.ref))}/${i.path==null?`<path>`:encodeURIComponent(String(i.path))}`,pathParams:{namespace:String(i.namespace??``),name:String(i.name??``),ref:String(i.ref??``),path:String(i.path??``)},bodyKind:`none`});return}await r(i);let s=i.local?e:await t();i.accountId=s;let c=await o(`Loading`,async()=>m(`/accounts/${s}/artifacts/namespaces/${encodeURIComponent(String(i.namespace))}/repos/${encodeURIComponent(String(i.name))}/raw/${encodeURIComponent(String(i.ref))}/${encodeURIComponent(String(i.path))}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}));p(i.text===!0?c.toString(`utf-8`):c)}},W={command:`raw`,describe:`Operations for namespaces.repos.raw`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`hash`,{type:`string`,description:`40-character lowercase hexadecimal Git object hash.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <hash>`,describe:`Returns decoded entries for an immutable Git tree object. Tree responses are cacheable forever by hash.`,builder:G,handler:async s=>{if(s.dryRun){a({command:`cf artifacts namespaces repos trees get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/tree/${s.hash==null?`<hash>`:encodeURIComponent(String(s.hash))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``),hash:String(s.hash??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.artifacts.namespaces.repos.trees.get({account_id:l,namespace:s.namespace,name:s.name,hash:s.hash})),{successLabel:`Loaded`})}},q={command:`trees`,describe:`Operations for namespaces.repos.trees`,builder:e=>e.command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`repos`,describe:`Operations for namespaces.repos`,builder:e=>e.command(E).command(O).command(N).command(F).command(I).command(R).command(x).command(w).command(j).command(V).command(W).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`repo`,{type:`string`,description:`The repo field`}).option(`scope`,{type:`string`,description:`The scope field`,choices:[`read`,`write`]}).option(`ttl`,{type:`number`,description:`The ttl 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 X={command:`create <namespace>`,describe:`Creates a scoped Git token for a repository.`,builder:Y,handler:async d=>{if(d.dryRun){a({command:`cf artifacts namespaces tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${d.namespace==null?`<namespace>`:encodeURIComponent(String(d.namespace))}/tokens`,pathParams:{namespace:String(d.namespace??``)},bodyKind:`json`,body:d.body===void 0?c({repo:l(d.repo,`repo`,`text`),scope:l(d.scope,`scope`,`text`),ttl:d.ttl}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.artifacts.namespaces.tokens.create({...e,account_id:p,namespace:d.namespace})),{successLabel:`Created`});return}d.repo===void 0&&(d.repo=await u(`repo`,`The repo field`));let m=c({repo:l(d.repo,`repo`,`text`),scope:l(d.scope,`scope`,`text`),ttl:d.ttl});i(await o(`Creating`,async()=>f.artifacts.namespaces.tokens.create({...m,account_id:p,namespace:d.namespace})),{successLabel:`Created`})}};function Z(e){return e.option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`state`,{type:`string`,description:`State`,choices:[`active`,`expired`,`revoked`,`all`]}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Lists tokens for a repository.`,builder:f(Z),handler:async s=>{let c={state:s.state,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf artifacts namespaces tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/tokens`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.artifacts.namespaces.tokens.list({account_id:u,namespace:s.namespace,name:s.name,...c})),{successLabel:`Loaded`})}};function $(e){return e.positional(`id`,{type:`string`,description:`Token ID. Must match /^[0-9a-z]{16}$/.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,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:`revoke <id>`,describe:`Revokes an Artifacts repository token.`,builder:$,handler:async s=>{if(s.dryRun){a({command:`cf artifacts namespaces tokens revoke`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/tokens/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{namespace:String(s.namespace??``),id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.artifacts.namespaces.tokens.revoke({account_id:l,namespace:s.namespace,id:s.id})),{successLabel:`Deleted`})}},ne={command:`tokens`,describe:`Operations for namespaces.tokens`,builder:e=>e.command(X).command(Q).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},re={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(g).command(v).command(J).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`artifacts`,describe:`artifacts`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ie as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{t as s}from"./cli-types-C3nVfpSG.mjs";function c(e){return e.option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`export`,{type:`boolean`,description:`Indicates that this request is an export of logs in CSV format.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-ip`,{type:`string`,description:`Filters by the IP address of the request that made the change by specific IP address or valid CIDR Range.`}).option(`actor-email`,{type:`string`,description:`Filters by the email address of the actor that made the change.`}).option(`since`,{type:`string`,description:"Limits the returned results to logs newer than the specified date. A `full-date` that conforms to RFC3339."}).option(`before`,{type:`string`,description:"Limits the returned results to logs older than the specified date. A `full-date` that conforms to RFC3339."}).option(`zone-name`,{type:`string`,description:`Filters by the name of the zone associated to the change.`}).option(`direction`,{type:`string`,description:`Changes the direction of the chronological sorting.`,choices:[`desc`,`asc`]}).option(`per-page`,{type:`number`,description:`Sets the number of results to return per page.`}).option(`page`,{type:`number`,description:`Defines which page of results to return.`}).option(`hide-user-logs`,{type:`boolean`,description:`Indicates whether or not to hide user level audit logs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`list`,describe:`Gets a list of audit logs for an account. Can be filtered by who made the change, on which zone, and the timeframe of the change.`,builder:s(c),handler:async s=>{let c={id:s.id,export:s.export,"action.type":s[`action-type`],"actor.ip":s[`actor-ip`],"actor.email":s[`actor-email`],since:s.since,before:s.before,"zone.name":s[`zone-name`],direction:s.direction,per_page:s[`per-page`],page:s.page,hide_user_logs:s[`hide-user-logs`]};if(s.dryRun){a({command:`cf audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/audit_logs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.auditLogs.list({account_id:u,...c})),{successLabel:`Loaded`})}},u={command:`audit-logs`,describe:`audit-logs`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{u as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{m as e,o as t}from"./chunk-LQW53VED-
|
|
2
|
+
import{m as e,o as t}from"./chunk-LQW53VED-9MACsvSG.mjs";import{a as n}from"./theme-CrIBazAF.mjs";import{n as r,r as i,t as a}from"./ui-DJFcf61J.mjs";import{a as o,c as s,d as c,i as l,n as u,o as d,r as f,s as p,t as m,u as h}from"./oauth-DAa7SwkM.mjs";import{i as g,n as _}from"./auth-DY_Y2bXC.mjs";import{t as v}from"./output-BqDR9h74.mjs";import y from"node:path";function b(e,t,n){if(!e.profile)return;let r=n?` ${n}`:``;throw Error(`The --profile flag cannot be used with \`cf auth ${t}\`.${r}`)}function x(){if(t({allowGlobalAuthKey:!1})!==void 0)throw Error(`Cannot manage auth profiles while CLOUDFLARE_API_TOKEN is set. Unset CLOUDFLARE_API_TOKEN and try again.`)}const S={command:`create <name>`,describe:`Create or re-authenticate a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name for the auth profile`,demandOption:!0}).option(`browser`,{type:`boolean`,description:`Open the authorization link in a browser (use --no-browser to print it instead)`,default:!0}).option(`device`,{type:`boolean`,description:`Use OAuth device authorization (use --no-device for the localhost callback flow)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async t=>{b(t,`create`,"Pass the profile name as the command argument: `cf auth create <name>`."),x(),e(t.name);let i=l().configs.exists(t.name);await p({browser:t.browser,device:t.device,scopes:t.scopes,profile:t.name}),console.log(r(i?`Profile "${t.name}" re-authenticated.`:`Profile "${t.name}" created.`)),console.log(a(`Run ${n.code(`cf auth activate ${t.name}`)} to use this profile in a directory.`))}},C={command:`delete <name>`,describe:`Delete a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to delete`,demandOption:!0}),handler:async t=>{b(t,`delete`),x(),e(t.name);let i=l();if(!i.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist.`);let o=i.bindings.removeAllBindingsForProfile(t.name);if(o.length>0){console.log(r(`Removed directory bindings:`));for(let e of o)console.log(` ${e}`)}await s(t.name),i.configs.delete(t.name),console.log(r(`Profile "${t.name}" deleted.`));let c=i.bindings.getProfileForDirectory(process.cwd());c?console.log(r(`Active profile for this directory: ${c}.`)):i.configs.exists(`default`)?console.log(r(`This directory now uses the default profile.`)):console.log(a(`No active profile for this directory. Run ${n.code(`cf auth login`)} to set up the default profile, or ${n.code(`cf auth create <name>`)} to create a named profile.`))}},w={command:`activate <name> [dir]`,describe:`Bind a named auth profile to a directory`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to activate`,demandOption:!0}).positional(`dir`,{type:`string`,description:`Directory to bind the profile to (defaults to current directory)`}),handler:t=>{b(t,`activate`,"Pass the profile name as the command argument: `cf auth activate <name>`."),x(),e(t.name);let n=l();if(!n.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist. Run \`cf auth create ${t.name}\` first.`);let i=t.dir??process.cwd();n.bindings.activate(t.name,i),console.log(r(`Profile "${t.name}" activated for "${y.resolve(i)}".`))}},T={command:`deactivate [dir]`,describe:`Remove the auth profile binding from a directory`,builder:e=>e.positional(`dir`,{type:`string`,description:`Directory to unbind (defaults to current directory). Must be the exact directory the profile was bound to.`}),handler:e=>{b(e,`deactivate`),x();let t=l(),i=e.dir??process.cwd(),{removedProfile:o,newResolution:s}=t.bindings.deactivate(i);console.log(r(`Profile "${o}" deactivated from "${y.resolve(i)}".`)),s.profile===void 0?console.log(a(`Run ${n.code(`cf auth login`)} to set up the default profile, or ${n.code(`cf auth create <name>`)} to create a named profile.`)):s.profile===`default`?console.log(r(`This directory now uses the default profile.`)):console.log(r(`Now using: ${s.profile} (${s.source}).`))}},E={command:`list`,describe:`List all auth profiles`,handler:e=>{b(e,`list`);let t=l(),n=t.bindings.read(),r={};for(let[e,t]of Object.entries(n))(r[t]??=[]).push(e);v(t.configs.list().map(e=>({name:e,boundDirectories:r[e]??[]})))}},D={command:`login`,describe:`Authenticate with Cloudflare`,builder:e=>e.option(`force`,{type:`boolean`,alias:`f`,description:`Force re-authentication even if already logged in`,default:!1}).option(`browser`,{type:`boolean`,description:`Open the authorization link in a browser (use --no-browser to print it instead)`,default:!0}).option(`device`,{type:`boolean`,description:`Use OAuth device authorization (use --no-device for the localhost callback flow)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async e=>{b(e,`login`,"Run `cf auth create <name>` to authenticate a named profile.");let t=u();if(t!==`default`&&console.log(i(`This directory has profile "${t}" active. \`cf auth login\` updates the default profile, not "${t}".\nTo re-authenticate "${t}", run \`cf auth create ${t}\`.`)),c(`default`),!e.force&&d()){if(await o()){let e=h();console.log(r(`You are already logged in.`)),console.log(`${n.info(`Config file:`)} ${n.muted(f())}`),e?.expiration_time&&console.log(`${n.info(`Token expires:`)} ${new Date(e.expiration_time).toLocaleString()}`),console.log(a(`Run ${n.code(`cf auth login --force`)} to re-authenticate, or ${n.code(`cf auth logout`)} to log out.`));return}console.log(i(`Existing tokens are invalid or expired. Starting fresh login...
|
|
3
3
|
`))}else e.force&&d()&&console.log(r(`Re-authenticating...
|
|
4
4
|
`));if(console.log(r(`Starting OAuth login flow...
|
|
5
5
|
`)),!await p({browser:e.browser,device:e.device,scopes:e.scopes,profile:`default`})){console.log(i(`CLOUDFLARE_API_TOKEN is set and takes precedence. Unset it to log in via OAuth.`));return}let s=h();console.log(`${n.info(`Config file:`)} ${n.muted(f())}`),s?.scopes&&console.log(`${n.info(`Scopes:`)} ${s.scopes.join(`, `)}`),s?.expiration_time&&console.log(`${n.info(`Token expires:`)} ${new Date(s.expiration_time).toLocaleString()}`)}},O={command:`logout`,describe:`Log out and remove stored credentials`,handler:async e=>{b(e,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let t=u();t!==`default`&&console.log(i(`This directory has profile "${t}" active. \`cf auth logout\` removes the default profile's token, not "${t}".\nTo delete "${t}", run \`cf auth delete ${t}\`.`)),c(`default`);let o=d(),l=!!process.env.CLOUDFLARE_API_TOKEN;if(!o){l?(console.log(r(`No cf OAuth credentials found, but CLOUDFLARE_API_TOKEN environment variable is set.`)),console.log(r(`Unset it with: unset CLOUDFLARE_API_TOKEN`))):(console.log(r(`You are not currently logged in.`)),console.log(a(`Run ${n.code(`cf auth login`)} to authenticate.`)));return}console.log(r(`Logging out...`)),await s(`default`),console.log(`${n.info(`Removed:`)} OAuth tokens from ${n.muted(f())}`),l&&(console.log(``),console.log(i(`CLOUDFLARE_API_TOKEN environment variable is still set.`)),console.log(r(`You will remain authenticated via the env var. Unset it with: unset CLOUDFLARE_API_TOKEN`)))}},k={command:`whoami`,describe:`Show current user and authentication status`,builder:e=>e,handler:async e=>{let t=process.env.CLOUDFLARE_API_TOKEN,n=h(),r;r=t?`CLOUDFLARE_API_TOKEN environment variable`:n?.oauth_token?`OAuth token from ${f()}`:`none`;let i;try{i=await g()}catch{v({authenticated:!1,error:`Not logged in`});return}let a=_({apiToken:i}),o,s=[],[c,l]=await Promise.allSettled([a.user.get(),m()]);if(c.status===`fulfilled`){let e=c.value;e&&`email`in e&&typeof e.email==`string`&&(o=e.email)}else process.env.DEBUG&&console.error(`User lookup error:`,c.reason);l.status===`fulfilled`?s=l.value:process.env.DEBUG&&console.error(`Account lookup error:`,l.reason);let u=c.status===`fulfilled`||l.status===`fulfilled`,d={authenticated:!0,authSource:r,tokenValid:u,...o&&{email:o},accounts:s};n?.oauth_token&&(d.scopes=n.scopes,d.expiresAt=n.expiration_time),v(d)}},A={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(D).command(O).command(k).command(S).command(C).command(w).command(T).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{s as e}from"./project-settings-
|
|
2
|
+
import{s as e}from"./project-settings-BN7tL0c7.mjs";import{n as t,r as n,t as r}from"./sdk-ZctLa5jW.mjs";import{H as i}from"./dist-DV7LR38l.mjs";import{o as a}from"./chunk-LQW53VED-9MACsvSG.mjs";import{a as o,g as s,p as c}from"./oauth-DAa7SwkM.mjs";import{r as l,t as u}from"./interactive-cytQzL94.mjs";import{execSync as d}from"child_process";import f from"os";function p(e){try{let t=d(`ps -p ${e} -o pid=,ppid=,command=`,{encoding:`utf8`,timeout:5e3}).trim();if(!t)return null;let[n,r,...i]=t.split(/\s+/),a=n?parseInt(n,10):NaN,o=r?parseInt(r,10):NaN;return isNaN(a)||isNaN(o)?null:{pid:a,ppid:o,command:i.join(` `)||void 0}}catch(t){return t instanceof Error&&t.message.includes(`timeout`)&&console.warn(`Process lookup timed out for PID ${e}`),null}}function m(e){let t=[],n=new Set,r=e,i=1e3;for(;r&&i>0;){if(n.has(r)){console.warn(`Detected cycle in process tree at PID ${r}`);break}n.add(r);let e=p(r);if(!e||e.ppid===0||e.ppid===1)break;t.push(e),r=e.ppid,i--}return i===0&&console.warn(`Reached maximum depth limit while traversing process tree from PID ${e}`),t}function h(e){try{let t=d(`wmic process where (ProcessId=${e}) get ProcessId,ParentProcessId,CommandLine /format:csv`,{encoding:`utf8`,timeout:1e4});if(!t)return null;let n=t.split(`
|
|
3
3
|
`).filter(e=>e.trim()&&!e.startsWith(`Node`)).pop()?.split(`,`);if(!n||n.length<4)return null;let[r,i,a,o]=n,s=o?parseInt(o.trim(),10):NaN,c=a?parseInt(a.trim(),10):NaN;return isNaN(s)||isNaN(c)?null:{pid:s,ppid:c,command:i?.trim()||void 0}}catch(t){return t instanceof Error&&t.message.includes(`timeout`)&&console.warn(`Process lookup timed out for PID ${e}`),null}}function g(e){let t=[],n=new Set,r=e,i=1e3;for(;r&&i>0;){if(n.has(r)){console.warn(`Detected cycle in process tree at PID ${r}`);break}n.add(r);let e=h(r);if(!e||e.ppid===0||e.ppid===4)break;t.push(e),r=e.ppid,i--}return i===0&&console.warn(`Reached maximum depth limit while traversing process tree from PID ${e}`),t}function _(e=process.pid){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw Error(`PID must be a positive integer`);return f.platform()===`win32`?g(e):m(e)}const v=[{id:`opencode`,name:`OpenCode`,type:`agent`,envVars:[{any:[`OPENCODE`,`OPENCODE_BIN_PATH`,`OPENCODE_SERVER`,`OPENCODE_APP_INFO`,`OPENCODE_MODES`]}]},{id:`jules`,name:`Jules`,type:`agent`,envVars:[{all:[[`HOME`,`/home/jules`],[`USER`,`swebot`]]}]},{id:`claude-code`,name:`Claude Code`,type:`agent`,envVars:[`CLAUDECODE`]},{id:`cursor-agent`,name:`Cursor Agent`,type:`agent`,envVars:[{all:[`CURSOR_TRACE_ID`,[`PAGER`,`head -n 10000 | cat`]]}]},{id:`cursor`,name:`Cursor`,type:`interactive`,envVars:[`CURSOR_TRACE_ID`]},{id:`gemini-agent`,name:`Gemini Agent`,type:`agent`,processChecks:[`gemini`]},{id:`codex`,name:`OpenAI Codex`,type:`agent`,processChecks:[`codex`]},{id:`replit`,name:`Replit`,type:`agent`,envVars:[`REPL_ID`]},{id:`aider`,name:`Aider`,type:`agent`,envVars:[`AIDER_API_KEY`],processChecks:[`aider`]},{id:`bolt-agent`,name:`Bolt.new Agent`,type:`agent`,envVars:[{all:[[`SHELL`,`/bin/jsh`],`npm_config_yes`]}]},{id:`bolt`,name:`Bolt.new`,type:`interactive`,envVars:[{all:[[`SHELL`,`/bin/jsh`]],none:[`npm_config_yes`]}]},{id:`zed-agent`,name:`Zed Agent`,type:`agent`,envVars:[{all:[[`TERM_PROGRAM`,`zed`],[`PAGER`,`cat`]]}]},{id:`zed`,name:`Zed`,type:`interactive`,envVars:[{all:[[`TERM_PROGRAM`,`zed`]],none:[[`PAGER`,`cat`]]}]},{id:`replit-assistant`,name:`Replit Assistant`,type:`agent`,envVars:[{all:[`REPL_ID`,[`REPLIT_MODE`,`assistant`]]}]},{id:`replit`,name:`Replit`,type:`interactive`,envVars:[{all:[`REPL_ID`],none:[[`REPLIT_MODE`,`assistant`]]}]},{id:`windsurf`,name:`Windsurf`,type:`agent`,envVars:[`CODEIUM_EDITOR_APP_ROOT`]},{id:`crush`,name:`Crush`,type:`agent`,processChecks:[`crush`]},{id:`vscode-copilot-agent`,name:`GitHub Copilot in VS Code`,type:`agent`,envVars:[{all:[[`TERM_PROGRAM`,`vscode`],[`GIT_PAGER`,`cat`]]}]},{id:`warp`,name:`Warp Terminal`,type:`hybrid`,envVars:[{all:[[`TERM_PROGRAM`,`WarpTerminal`]]}]},{id:`octofriend`,name:`Octofriend`,type:`agent`,processChecks:[`octofriend`]}];function y(e,t=process.env){let[n,r]=typeof e==`string`?[e,void 0]:e,i=t[n];return!!(i&&(!r||i===r))}function b(e,t){try{let n=t??_();for(let t of n)if(t.command?.includes(e))return!0}catch{}return!1}function x(e,t=process.env){if(typeof e==`string`||Array.isArray(e))return y(e,t);let{any:n,all:r,none:i}=e,a=!n?.length||n.some(e=>y(e,t)),o=!r?.length||r.every(e=>y(e,t)),s=!i?.length||!i.some(e=>y(e,t));return a&&o&&s}function S(e){return e.customDetectors?.some(e=>{try{return e()}catch{return!1}})??!1}function C(e){return{isAgentic:!0,id:e.id,name:e.name,type:e.type}}function w(e=process.env,t){for(let t of v)if(t.envVars?.some(t=>x(t,e)))return C(t);let n=t,r=()=>{if(n===void 0)try{n=_()}catch{n=[]}return n};for(let e of v)if(e.processChecks?.some(e=>b(e,r())))return C(e);for(let e of v)if(S(e))return C(e);return{isAgentic:!1,id:null,name:null,type:null}}function T(){return u?`ci`:l()?`interactive`:`non-interactive`}function E(){let t=w(),n=t.isAgentic&&t.id!==null?{"X-CF-CLI-Agent":t.id}:{};return{"User-Agent":e,"X-CF-CLI-Mode":T(),...n}}const D=3e4,O=t.Default;function k(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream||e instanceof URLSearchParams}function A(e){return Object.keys(e).some(e=>e.toLowerCase()===`content-type`)}async function j(e){let t=e.headers.get(`content-type`)??``;try{return t.includes(`application/json`)?await e.json():await e.text()}catch{return null}}function M(e,t,n){if(!(n==null||n===``)){if(Array.isArray(n)){for(let r of n)M(e,t,r);return}e.append(t,String(n))}}function N(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))M(t,n,r);return t.toString()}function P(e,t,n){let r=new URL(t.endsWith(`/`)?t:`${t}/`),i=new URL(e.startsWith(`/`)?e.slice(1):e,r);if(i.origin!==r.origin)throw Error(`Refusing to send an authenticated request to ${i.origin} (expected ${r.origin})`);let a=N(n??{});return a&&(i.search=a),i.toString()}const F=new WeakMap;async function I(e,t,r,i={}){let a=P(r,F.get(e)??O,i.query),o={...i.headers},s;i.body!==void 0&&(k(i.body)||typeof i.body==`string`&&A(o)?s=i.body:(o[`Content-Type`]??=`application/json`,s=JSON.stringify(i.body)));let c;try{c=await e.fetch(a,{method:t,headers:o,body:s,signal:i.signal},{timeoutInSeconds:i.timeout?i.timeout/1e3:void 0,abortSignal:i.signal})}catch(e){throw i.signal?.aborted?Error(`Request aborted`):e instanceof Error&&e.name===`AbortError`?Error(`Request timed out after ${i.timeout??3e4}ms`):e instanceof Error?Error(`Request failed: ${e.message}`):e}if(!c.ok)throw new n({statusCode:c.status,body:await j(c),rawResponse:{status:c.status,statusText:c.statusText,url:c.url||a,headers:c.headers,redirected:c.redirected,type:c.type}});if(c.status===204)return null;let l=c.headers.get(`content-type`)??``;if(!l.includes(`application/json`)&&i.preserveNonJsonBytes)return Buffer.from(await c.arrayBuffer());let u=await c.text();if(u===``)return null;if(!l.includes(`application/json`))return u;let d=JSON.parse(u);if(d.success===!1)throw new n({message:`API error: ${d.errors?.map(e=>e.message).filter(Boolean).join(`, `)||`unknown error`}`,statusCode:c.status,body:d});return`result`in d?d.result:d}function L(e){let t=e.baseURL??O,n=new r({baseUrl:t,auth:async()=>({headers:{Authorization:`Bearer ${e.apiToken}`}}),headers:e.defaultHeaders,timeoutInSeconds:(e.timeout??3e4)/1e3,maxRetries:0,fetch:e.fetch??globalThis.fetch});return F.set(n,t),n}async function R(){let e=a({allowGlobalAuthKey:!1});if(e&&`apiToken`in e)return e.apiToken;let t=await o();if(t)return t;throw Error(`No authentication token found.
|
|
4
4
|
|
|
5
5
|
Please set one of the following:
|
|
6
6
|
1. Set the CLOUDFLARE_API_TOKEN environment variable
|
|
7
7
|
2. Run 'cf auth login' to authenticate via OAuth
|
|
8
8
|
|
|
9
|
-
For API tokens, visit: https://dash.cloudflare.com/profile/api-tokens`)}async function z(e){let t=await s();if(t)return t;try{let t=await R(),n=i({compliance_region:await c()}),r=e-Date.now();if(r<=0)return;let a=L({apiToken:t,baseURL:n,defaultHeaders:E()}),o={timeoutInSeconds:r/1e3,maxRetries:0},[s,l]=await Promise.allSettled([a.accounts.list({per_page:50},o),a.user.memberships.list({per_page:50},o)]);if(s.status===`rejected`)return;let u=s.value;if((u.result_info?.total_count??u.result.length)>u.result.length)return;let d=u.result;if(l.status===`fulfilled`){let e=l.value.result??[];if((l.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));d=d.filter(e=>t.has(e.id))}return d.length===1?d[0]?.id:void 0}catch{return}}async function B(e){let t=i({compliance_region:await c()});if(e.local){let{createLocalFetch:n}=await import(`./local-
|
|
9
|
+
For API tokens, visit: https://dash.cloudflare.com/profile/api-tokens`)}async function z(e){let t=await s();if(t)return t;try{let t=await R(),n=i({compliance_region:await c()}),r=e-Date.now();if(r<=0)return;let a=L({apiToken:t,baseURL:n,defaultHeaders:E()}),o={timeoutInSeconds:r/1e3,maxRetries:0},[s,l]=await Promise.allSettled([a.accounts.list({per_page:50},o),a.user.memberships.list({per_page:50},o)]);if(s.status===`rejected`)return;let u=s.value;if((u.result_info?.total_count??u.result.length)>u.result.length)return;let d=u.result;if(l.status===`fulfilled`){let e=l.value.result??[];if((l.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));d=d.filter(e=>t.has(e.id))}return d.length===1?d[0]?.id:void 0}catch{return}}async function B(e){let t=i({compliance_region:await c()});if(e.local){let{createLocalFetch:n}=await import(`./local-DGiIS1uM.mjs`).then(e=>e.a);return L({apiToken:`cf-local-mode-no-auth`,baseURL:t,defaultHeaders:E(),fetch:n({persistTo:e.persistTo,apiBaseUrl:t})})}return L({apiToken:await R(),baseURL:t,defaultHeaders:E()})}export{I as a,R as i,L as n,z as o,B as r,E as s,D as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,r as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{n as d}from"./prompt-CyATfGUu.mjs";function f(e){return e.option(`address`,{type:`string`,description:`Address line 1.`}).option(`address2`,{type:`string`,description:`Address line 2.`}).option(`city`,{type:`string`,description:`City.`}).option(`country`,{type:`string`,description:`Country code.`}).option(`state`,{type:`string`,description:`State or province.`}).option(`zipcode`,{type:`string`,description:`Postal or zip code.`}).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 p={command:`validate`,describe:`Validates a billing address and returns validated address suggestions. Authentication is not enforced to support pre-signup address validation flows, so credentials are accepted but not required.`,builder:f,handler:async e=>{if(e.dryRun){a({command:`cf billing addresses validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/billing/address-validation`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({address:u(e.address,`address`,`text`),address2:u(e.address2,`address2`,`text`),city:u(e.city,`city`,`text`),country:u(e.country,`country`,`text`),state:u(e.state,`state`,`text`),zipcode:u(e.zipcode,`zipcode`,`text`)}):s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Creating`,async()=>t.billing.addresses.validate({...n})),{successLabel:`Created`});return}let n=l({address:u(e.address,`address`,`text`),address2:u(e.address2,`address2`,`text`),city:u(e.city,`city`,`text`),country:u(e.country,`country`,`text`),state:u(e.state,`state`,`text`),zipcode:u(e.zipcode,`zipcode`,`text`)});i(await o(`Creating`,async()=>t.billing.addresses.validate({...n})),{successLabel:`Created`})}},m={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`address`,{type:`string`,description:`Street address line 1.`}).option(`address2`,{type:`string`,description:`Street address line 2 (apt, suite, etc.).`}).option(`billing-email`,{type:`string`,description:`Primary billing email address.`}).option(`buying-rate-plan`,{type:`string`,description:`Rate plan being purchased right after profile setup.`}).option(`captcha-challenge-jwt`,{type:`string`,description:`Captcha challenge JWT issued during onboarding.`}).option(`cf-turnstile-response`,{type:`string`,description:`Cloudflare Turnstile response.`}).option(`city`,{type:`string`,description:`City on the billing profile.`}).option(`company`,{type:`string`,description:`Company name on the billing profile.`}).option(`country`,{type:`string`,description:`ISO 3166-1 alpha-2 country code.`}).option(`first-name`,{type:`string`,description:`First name on the billing profile.`}).option(`h-captcha-response`,{type:`string`,description:`hCaptcha response.`}).option(`last-name`,{type:`string`,description:`Last name on the billing profile.`}).option(`preferred-locale`,{type:`string`,description:`Preferred locale for invoice rendering (BCP 47).`}).option(`secondary-billing-email`,{type:`string`,description:`Secondary billing email address for CC on invoices.`}).option(`state`,{type:`string`,description:`State or region on the billing profile.`}).option(`tax-id-type`,{type:`string`,description:`Type of tax ID provided.`}).option(`telephone`,{type:`string`,description:`Contact phone number.`}).option(`vat`,{type:`string`,description:`VAT identifier.`}).option(`zipcode`,{type:`string`,description:`ZIP or postal code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a billing profile.`})}const g={command:`create`,describe:`Creates a billing profile for an account.`,builder:h,handler:async c=>{if(c.dryRun){a({command:`cf billing profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({address:u(c.address,`address`,`text`),address2:u(c.address2,`address2`,`text`),billing_email:u(c[`billing-email`],`billing-email`,`text`),buying_rate_plan:u(c[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:u(c[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:u(c[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:u(c.city,`city`,`text`),company:u(c.company,`company`,`text`),country:u(c.country,`country`,`text`),first_name:u(c[`first-name`],`first-name`,`text`),h_captcha_response:u(c[`h-captcha-response`],`h-captcha-response`,`text`),last_name:u(c[`last-name`],`last-name`,`text`),preferred_locale:u(c[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:u(c[`secondary-billing-email`],`secondary-billing-email`,`text`),state:u(c.state,`state`,`text`),tax_id_type:u(c[`tax-id-type`],`tax-id-type`,`text`),telephone:u(c.telephone,`telephone`,`text`),vat:u(c.vat,`vat`,`text`),zipcode:u(c.zipcode,`zipcode`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Creating`,async()=>d.billing.profiles.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=l({address:u(c.address,`address`,`text`),address2:u(c.address2,`address2`,`text`),billing_email:u(c[`billing-email`],`billing-email`,`text`),buying_rate_plan:u(c[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:u(c[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:u(c[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:u(c.city,`city`,`text`),company:u(c.company,`company`,`text`),country:u(c.country,`country`,`text`),first_name:u(c[`first-name`],`first-name`,`text`),h_captcha_response:u(c[`h-captcha-response`],`h-captcha-response`,`text`),last_name:u(c[`last-name`],`last-name`,`text`),preferred_locale:u(c[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:u(c[`secondary-billing-email`],`secondary-billing-email`,`text`),state:u(c.state,`state`,`text`),tax_id_type:u(c[`tax-id-type`],`tax-id-type`,`text`),telephone:u(c.telephone,`telephone`,`text`),vat:u(c.vat,`vat`,`text`),zipcode:u(c.zipcode,`zipcode`,`text`)});i(await o(`Creating`,async()=>d.billing.profiles.create({body:p,account_id:f})),{successLabel:`Created`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`createPaymentIntent`,describe:`Creates a Stripe payment intent for adding or updating a payment method on the account's billing profile. Returns a client secret for frontend payment method collection.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf billing profiles createPaymentIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/profile/payment-method`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.billing.profiles.createPaymentIntent({account_id:l})),{successLabel:`Created`})}};function y(e){return e.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 b={command:`delete`,describe:`Deletes the billing profile for an account.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf billing profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.billing.profiles.delete({account_id:l})),{successLabel:`Deleted`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Gets the current billing profile for the account.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf billing profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.billing.profiles.get({account_id:l})),{successLabel:`Loaded`})}};function C(e){return e.option(`address`,{type:`string`,description:`Street address line 1.`}).option(`address2`,{type:`string`,description:`Street address line 2 (apt, suite, etc.).`}).option(`billing-email`,{type:`string`,description:`Primary billing email address.`}).option(`buying-rate-plan`,{type:`string`,description:`Rate plan being purchased right after profile setup.`}).option(`captcha-challenge-jwt`,{type:`string`,description:`Captcha challenge JWT issued during onboarding.`}).option(`cf-turnstile-response`,{type:`string`,description:`Cloudflare Turnstile response.`}).option(`city`,{type:`string`,description:`City on the billing profile.`}).option(`company`,{type:`string`,description:`Company name on the billing profile.`}).option(`country`,{type:`string`,description:`ISO 3166-1 alpha-2 country code.`}).option(`first-name`,{type:`string`,description:`First name on the billing profile.`}).option(`h-captcha-response`,{type:`string`,description:`hCaptcha response.`}).option(`last-name`,{type:`string`,description:`Last name on the billing profile.`}).option(`preferred-locale`,{type:`string`,description:`Preferred locale for invoice rendering (BCP 47).`}).option(`secondary-billing-email`,{type:`string`,description:`Secondary billing email address for CC on invoices.`}).option(`state`,{type:`string`,description:`State or region on the billing profile.`}).option(`tax-id-type`,{type:`string`,description:`Type of tax ID provided.`}).option(`telephone`,{type:`string`,description:`Contact phone number.`}).option(`vat`,{type:`string`,description:`VAT identifier.`}).option(`zipcode`,{type:`string`,description:`ZIP or postal code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a billing profile.`})}const w={command:`update`,describe:`Updates the billing profile for an account.`,builder:C,handler:async c=>{if(c.dryRun){a({command:`cf billing profiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({address:u(c.address,`address`,`text`),address2:u(c.address2,`address2`,`text`),billing_email:u(c[`billing-email`],`billing-email`,`text`),buying_rate_plan:u(c[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:u(c[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:u(c[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:u(c.city,`city`,`text`),company:u(c.company,`company`,`text`),country:u(c.country,`country`,`text`),first_name:u(c[`first-name`],`first-name`,`text`),h_captcha_response:u(c[`h-captcha-response`],`h-captcha-response`,`text`),last_name:u(c[`last-name`],`last-name`,`text`),preferred_locale:u(c[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:u(c[`secondary-billing-email`],`secondary-billing-email`,`text`),state:u(c.state,`state`,`text`),tax_id_type:u(c[`tax-id-type`],`tax-id-type`,`text`),telephone:u(c.telephone,`telephone`,`text`),vat:u(c.vat,`vat`,`text`),zipcode:u(c.zipcode,`zipcode`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.billing.profiles.update({body:e,account_id:f})),{successLabel:`Updated`});return}let p=l({address:u(c.address,`address`,`text`),address2:u(c.address2,`address2`,`text`),billing_email:u(c[`billing-email`],`billing-email`,`text`),buying_rate_plan:u(c[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:u(c[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:u(c[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:u(c.city,`city`,`text`),company:u(c.company,`company`,`text`),country:u(c.country,`country`,`text`),first_name:u(c[`first-name`],`first-name`,`text`),h_captcha_response:u(c[`h-captcha-response`],`h-captcha-response`,`text`),last_name:u(c[`last-name`],`last-name`,`text`),preferred_locale:u(c[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:u(c[`secondary-billing-email`],`secondary-billing-email`,`text`),state:u(c.state,`state`,`text`),tax_id_type:u(c[`tax-id-type`],`tax-id-type`,`text`),telephone:u(c.telephone,`telephone`,`text`),vat:u(c.vat,`vat`,`text`),zipcode:u(c.zipcode,`zipcode`,`text`)});i(await o(`Updating`,async()=>d.billing.profiles.update({body:p,account_id:f})),{successLabel:`Updated`})}};function T(e){return e.option(`billing-email`,{type:`string`,description:`The billing_email field`}).option(`preferred-locale`,{type:`string`,description:`The preferred_locale field`}).option(`secondary-billing-email`,{type:`string`,description:`The secondary_billing_email 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 E={command:`updateEmail`,describe:`Updates the billing email addresses and preferred locale for an account.`,builder:T,handler:async c=>{if(c.dryRun){a({command:`cf billing profiles updateEmail`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({billing_email:u(c[`billing-email`],`billing-email`,`text`),preferred_locale:u(c[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:u(c[`secondary-billing-email`],`secondary-billing-email`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.billing.profiles.updateEmail({...e,account_id:f})),{successLabel:`Updated`});return}let p=l({billing_email:u(c[`billing-email`],`billing-email`,`text`),preferred_locale:u(c[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:u(c[`secondary-billing-email`],`secondary-billing-email`,`text`)});i(await o(`Updating`,async()=>d.billing.profiles.updateEmail({...p,account_id:f})),{successLabel:`Updated`})}},D={command:`profiles`,describe:`Billing profile with payment method, address, and invoice preferences`,builder:e=>e.command(g).command(v).command(b).command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`public-key`,{type:`string`,description:`The public key identifier for the rate plan.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <public-key>`,describe:`Gets a rate plan's details by its public key (e.g., 'teams_free', 'cf_pro_20_20'). This is a public catalog endpoint, so authentication is not enforced and credentials are accepted but not required.`,builder:O,handler:async e=>{if(e.dryRun){a({command:`cf billing rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/billing/rate_plans/${e[`public-key`]==null?`<public-key>`:encodeURIComponent(String(e[`public-key`]))}`,pathParams:{"public-key":String(e[`public-key`]??``)},bodyKind:`none`});return}let t=await r(e);i(await o(`Loading`,async()=>t.billing.ratePlans.get({public_key:e[`public-key`]})),{successLabel:`Loaded`})}},A={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get-account-usage-v2`,describe:"Returns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.",builder:j,handler:async s=>{let c={from:s.from,to:s.to};if(s.dryRun){a({command:`cf billing usage get-account-usage-v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billable/usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.billing.usage.getAccountUsageV2({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get-info-v1`,describe:`Returns high-level usage information for the account, including coverage, and subscription metadata.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf billing usage get-info-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billable-usage/info`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.billing.usage.getInfoV1({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.option(`from`,{type:`string`,description:`Start date for the usage query (ISO 8601). The provided time range must include the subscription billing cycle anchor day, otherwise no usage data is returned. Use the info endpoint to retrieve the subscription anchor day.`}).option(`to`,{type:`string`,description:`End date for the usage query (ISO 8601).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get-v1`,describe:`Returns billable usage data for the account. When no query parameters are provided, returns usage for the current billing period.`,builder:F,handler:async s=>{let c={from:s.from,to:s.to};if(s.dryRun){a({command:`cf billing usage get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billable-usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.billing.usage.getV1({account_id:u,...c})),{successLabel:`Loaded`})}};function L(e){return e.option(`filter-by-metric-ids`,{type:`string`,array:!0,description:"Restrict results to rows whose `x_BillableMetricId` matches one of these billable metric ids (e.g. `workers_standard_requests`). Values must be unique."}).option(`filter-by-product-family-ids`,{type:`string`,array:!0,description:`Restrict results to billable metrics belonging to these product families. Values must be unique UUIDs.`}).option(`group-by`,{type:`string`,description:`Customer resource tags used to split result rows. At most two unique tag keys may be supplied. Provide as a JSON array of objects or @path/to/file.json.`}).option(`time-period-from`,{type:`string`,description:"Start of the range (ISO 8601). Required if `To` is set."}).option(`time-period-to`,{type:`string`,description:"End of the range (ISO 8601). Required if `From` is set. Must be after `From` and no more than 31 days after it."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter criteria for a usage query. Every field is optional; an empty object is equivalent to omitting the body entirely. Unknown fields are rejected.`})}const R={command:`query`,describe:"Returns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. This is the filterable counterpart to `GET` on the same path. It is a read-only operation and requires only the `#billing:read` permission; `POST` is used so that filter criteria can be supplied in a request body rather than in the query string. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. The request body is optional. When it is omitted, or when `TimePeriod` is omitted, the range defaults to the start of the current month through today. The maximum date range is 31 days. Filters of different kinds are combined with AND. Values within one tag filter are combined with OR. Filter values that do not match usage produce an empty result set. Results can be grouped by up to two customer resource-tag keys. Grouped values are returned in the `Tags` field. Usage without a requested tag remains in an untagged group, with that key omitted from `Tags`. Requests using tag filtering or grouping return HTTP 400 when tag-aware usage data is unavailable.",builder:L,handler:async d=>{if(d.dryRun){a({command:`cf billing usage query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billable/usage`,pathParams:{},bodyKind:`json`,body:d.body===void 0?l({FilterBy:{MetricIds:d[`filter-by-metric-ids`],ProductFamilyIds:d[`filter-by-product-family-ids`]},GroupBy:c(d[`group-by`],`group-by`),TimePeriod:{From:u(d[`time-period-from`],`time-period-from`,`text`),To:u(d[`time-period-to`],`time-period-to`,`text`)}}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Loading`,async()=>f.billing.usage.query({...e,account_id:p})),{successLabel:`Loaded`});return}let m=l({FilterBy:{MetricIds:d[`filter-by-metric-ids`],ProductFamilyIds:d[`filter-by-product-family-ids`]},GroupBy:c(d[`group-by`],`group-by`),TimePeriod:{From:u(d[`time-period-from`],`time-period-from`,`text`),To:u(d[`time-period-to`],`time-period-to`,`text`)}});i(await o(`Loading`,async()=>f.billing.usage.query({...m,account_id:p})),{successLabel:`Loaded`})}},z={command:`usage`,describe:`Metered usage data for billed services — requests, bandwidth, and feature consumption`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`billing`,describe:`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,builder:e=>e.command(m).command(D).command(A).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{B as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";import{n as s}from"./input-validation-1esLElok.mjs";import{a as c,i as l}from"./prompt-CyATfGUu.mjs";function u(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`Wirefilter expression describing the traffic being reported.`}).option(`first-request-seen-at`,{type:`string`,description:`The first_request_seen_at field`}).option(`last-request-seen-at`,{type:`string`,description:`The last_request_seen_at field`}).option(`requests`,{type:`number`,description:`The requests field`}).option(`subtype`,{type:`string`,description:`The subtype field`}).option(`type`,{type:`string`,description:`Type of feedback report.`,choices:[`false_positive`,`false_negative`]}).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 d={command:`create`,describe:"Submit a feedback report for the specified zone. Use `type` to indicate whether the report is a false positive (good traffic flagged as bot) or a false negative (bot traffic missed). Furthermore, you can also use `expression` as a wirefilter to identify the affected traffic sample. See more accepted API fields and expression types at https://developers.cloudflare.com/bots/concepts/feedback-loop/#api-fields and https://developers.cloudflare.com/bots/concepts/feedback-loop/#expression-fields, respectively.",builder:u,handler:async u=>{if(u.dryRun){r({command:`cf bot-management feedback create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?o({description:s(u.description,`description`,`text`),expression:s(u.expression,`expression`,`text`),first_request_seen_at:s(u[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(u[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:u.requests,subtype:s(u.subtype,`subtype`,`text`),type:s(u.type,`type`,`text`)}):a(u.body)});return}let d=await t(u),f=await e({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=a(u.body);n(await i(`Creating`,async()=>d.botManagement.feedback.create({body:e,zone_id:f})),{successLabel:`Created`});return}if(u.description===void 0&&(u.description=await c(`description`,`The description field`)),u.expression===void 0&&(u.expression=await c(`expression`,`Wirefilter expression describing the traffic being reported.`)),u[`first-request-seen-at`]===void 0&&(u[`first-request-seen-at`]=await c(`first-request-seen-at`,`The first_request_seen_at field`)),u[`last-request-seen-at`]===void 0&&(u[`last-request-seen-at`]=await c(`last-request-seen-at`,`The last_request_seen_at field`)),u.requests===void 0)throw Error(`--requests is required (or pass --body with this field set).`);u.type===void 0&&(u.type=await l(`type`,`Type of feedback report.`,[`false_positive`,`false_negative`]));let p=o({description:s(u.description,`description`,`text`),expression:s(u.expression,`expression`,`text`),first_request_seen_at:s(u[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(u[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:u.requests,subtype:s(u.subtype,`subtype`,`text`),type:s(u.type,`type`,`text`)});n(await i(`Creating`,async()=>d.botManagement.feedback.create({body:p,zone_id:f})),{successLabel:`Created`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`Returns all feedback reports previously submitted for the specified zone. Feedback reports help improve detection by sharing samples of traffic that were misclassified as bots or humans.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf bot-management feedback list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.botManagement.feedback.list({zone_id:s})),{successLabel:`Loaded`})}},m={command:`feedback`,describe:`Operations for feedback`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve a zone's Bot Management Config`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf bot-management get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/bot_management`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.botManagement.get({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.option(`ai-bots-protection`,{type:`string`,description:`Enable rule to block AI Scrapers and Crawlers.`,choices:[`block`,`disabled`,`only_on_ad_pages`]}).option(`bot-preference-sync-enabled`,{type:`boolean`,description:`Enable Bot Preference Sync for this zone. When enabled, Cloudflare can serve robots.txt content derived from the zone's AI Search, AI User, and AI Training preferences.`}).option(`cf-robots-variant`,{type:`string`,description:`Specifies the Robots Access Control License variant to use.`,choices:[`off`,`policy_only`]}).option(`content-bots-protection`,{type:`string`,description:`Enable rule to block content bots. When enabled, blocks automated traffic with low bot scores, excluding safe verified bot categories. Exceptions should be managed via skip rules.`,choices:[`block`,`disabled`]}).option(`crawler-protection`,{type:`string`,description:`Enable rule to punish AI Scrapers and Crawlers via a link maze.`,choices:[`enabled`,`disabled`]}).option(`enable-js`,{type:`boolean`,description:`Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).`}).option(`is-robots-txt-managed`,{type:`boolean`,description:`Enable cloudflare managed robots.txt. If an existing robots.txt is detected, then managed robots.txt will be prepended to the existing robots.txt.`}).option(`fight-mode`,{type:`boolean`,description:`Whether to enable Bot Fight Mode.`}).option(`stale-zone-configuration-optimize-wordpress`,{type:`boolean`,description:`Indicates that the zone's wordpress optimization for SBFM is turned on.`}).option(`stale-zone-configuration-sbfm-definitely-automated`,{type:`string`,description:`Indicates that the zone's definitely automated requests are being blocked or challenged.`}).option(`stale-zone-configuration-sbfm-likely-automated`,{type:`string`,description:`Indicates that the zone's likely automated requests are being blocked or challenged.`}).option(`stale-zone-configuration-sbfm-static-resource-protection`,{type:`string`,description:`Indicates that the zone's static resource protection is turned on.`}).option(`stale-zone-configuration-sbfm-verified-bots`,{type:`string`,description:`Indicates that the zone's verified bot requests are being blocked.`}).option(`stale-zone-configuration-suppress-session-score`,{type:`boolean`,description:`Indicates that the zone's session score tracking is disabled.`}).option(`stale-zone-configuration-fight-mode`,{type:`boolean`,description:`Indicates that the zone's Bot Fight Mode is turned on.`}).option(`optimize-wordpress`,{type:`boolean`,description:`Whether to optimize Super Bot Fight Mode protections for Wordpress.`}).option(`sbfm-definitely-automated`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on definitely automated requests.`,choices:[`allow`,`block`,`managed_challenge`]}).option(`sbfm-static-resource-protection`,{type:`boolean`,description:`Super Bot Fight Mode (SBFM) to enable static resource protection.
|
|
3
3
|
Enable if static resources on your application need bot protection.
|
|
4
4
|
Note: Static resource protection can also result in legitimate traffic being blocked.
|
|
5
5
|
`}).option(`sbfm-verified-bots`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on verified bots requests.`,choices:[`allow`,`block`]}).option(`sbfm-likely-automated`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on likely automated requests.`,choices:[`allow`,`block`,`managed_challenge`]}).option(`auto-update-model`,{type:`boolean`,description:`Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)`}).option(`bm-cookie-enabled`,{type:`boolean`,description:`Indicates that the bot management cookie can be placed on end user devices accessing the site. Defaults to true`}).option(`suppress-session-score`,{type:`boolean`,description:`Whether to disable tracking the highest bot score for a session in the Bot Management cookie.`}).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 v={command:`update`,describe:'Updates the Bot Management configuration for a zone. This API is used to update: - **Bot Fight Mode** - **Super Bot Fight Mode** - **Bot Management for Enterprise** See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more information on the different plans \\ If you recently upgraded or downgraded your plan, refer to the following examples to clean up old configurations. Copy and paste the example body to remove old zone configurations based on your current plan. #### Clean up configuration for Bot Fight Mode plan ```json { "sbfm_likely_automated": "allow", "sbfm_definitely_automated": "allow", "sbfm_verified_bots": "allow", "sbfm_static_resource_protection": false, "optimize_wordpress": false, "suppress_session_score": false } ``` #### Clean up configuration for SBFM Pro plan ```json { "sbfm_likely_automated": "allow", "fight_mode": false } ``` #### Clean up configuration for SBFM Biz plan ```json { "fight_mode": false } ``` #### Clean up configuration for BM Enterprise Subscription plan It is strongly recommended that you ensure you have [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to protect your zone before disabling the SBFM rules. Without these protections, your zone is vulnerable to attacks. ```json { "sbfm_likely_automated": "allow", "sbfm_definitely_automated": "allow", "sbfm_verified_bots": "allow", "sbfm_static_resource_protection": false, "optimize_wordpress": false, "fight_mode": false } ```',builder:_,handler:async c=>{if(c.dryRun){r({command:`cf bot-management update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/bot_management`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({ai_bots_protection:s(c[`ai-bots-protection`],`ai-bots-protection`,`text`),bot_preference_sync_enabled:c[`bot-preference-sync-enabled`],cf_robots_variant:s(c[`cf-robots-variant`],`cf-robots-variant`,`text`),content_bots_protection:s(c[`content-bots-protection`],`content-bots-protection`,`text`),crawler_protection:s(c[`crawler-protection`],`crawler-protection`,`text`),enable_js:c[`enable-js`],is_robots_txt_managed:c[`is-robots-txt-managed`],fight_mode:c[`fight-mode`],stale_zone_configuration:{optimize_wordpress:c[`stale-zone-configuration-optimize-wordpress`],sbfm_definitely_automated:s(c[`stale-zone-configuration-sbfm-definitely-automated`],`stale-zone-configuration-sbfm-definitely-automated`,`text`),sbfm_likely_automated:s(c[`stale-zone-configuration-sbfm-likely-automated`],`stale-zone-configuration-sbfm-likely-automated`,`text`),sbfm_static_resource_protection:s(c[`stale-zone-configuration-sbfm-static-resource-protection`],`stale-zone-configuration-sbfm-static-resource-protection`,`text`),sbfm_verified_bots:s(c[`stale-zone-configuration-sbfm-verified-bots`],`stale-zone-configuration-sbfm-verified-bots`,`text`),suppress_session_score:c[`stale-zone-configuration-suppress-session-score`],fight_mode:c[`stale-zone-configuration-fight-mode`]},optimize_wordpress:c[`optimize-wordpress`],sbfm_definitely_automated:s(c[`sbfm-definitely-automated`],`sbfm-definitely-automated`,`text`),sbfm_static_resource_protection:c[`sbfm-static-resource-protection`],sbfm_verified_bots:s(c[`sbfm-verified-bots`],`sbfm-verified-bots`,`text`),sbfm_likely_automated:s(c[`sbfm-likely-automated`],`sbfm-likely-automated`,`text`),auto_update_model:c[`auto-update-model`],bm_cookie_enabled:c[`bm-cookie-enabled`],suppress_session_score:c[`suppress-session-score`]}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.botManagement.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=o({ai_bots_protection:s(c[`ai-bots-protection`],`ai-bots-protection`,`text`),bot_preference_sync_enabled:c[`bot-preference-sync-enabled`],cf_robots_variant:s(c[`cf-robots-variant`],`cf-robots-variant`,`text`),content_bots_protection:s(c[`content-bots-protection`],`content-bots-protection`,`text`),crawler_protection:s(c[`crawler-protection`],`crawler-protection`,`text`),enable_js:c[`enable-js`],is_robots_txt_managed:c[`is-robots-txt-managed`],fight_mode:c[`fight-mode`],stale_zone_configuration:{optimize_wordpress:c[`stale-zone-configuration-optimize-wordpress`],sbfm_definitely_automated:s(c[`stale-zone-configuration-sbfm-definitely-automated`],`stale-zone-configuration-sbfm-definitely-automated`,`text`),sbfm_likely_automated:s(c[`stale-zone-configuration-sbfm-likely-automated`],`stale-zone-configuration-sbfm-likely-automated`,`text`),sbfm_static_resource_protection:s(c[`stale-zone-configuration-sbfm-static-resource-protection`],`stale-zone-configuration-sbfm-static-resource-protection`,`text`),sbfm_verified_bots:s(c[`stale-zone-configuration-sbfm-verified-bots`],`stale-zone-configuration-sbfm-verified-bots`,`text`),suppress_session_score:c[`stale-zone-configuration-suppress-session-score`],fight_mode:c[`stale-zone-configuration-fight-mode`]},optimize_wordpress:c[`optimize-wordpress`],sbfm_definitely_automated:s(c[`sbfm-definitely-automated`],`sbfm-definitely-automated`,`text`),sbfm_static_resource_protection:c[`sbfm-static-resource-protection`],sbfm_verified_bots:s(c[`sbfm-verified-bots`],`sbfm-verified-bots`,`text`),sbfm_likely_automated:s(c[`sbfm-likely-automated`],`sbfm-likely-automated`,`text`),auto_update_model:c[`auto-update-model`],bm_cookie_enabled:c[`bm-cookie-enabled`],suppress_session_score:c[`suppress-session-score`]});n(await i(`Updating`,async()=>l.botManagement.update({body:d,zone_id:u})),{successLabel:`Updated`})}},y={command:`bot-management`,describe:`bot-management`,builder:e=>e.command(g).command(v).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s}from"./prompt-CyATfGUu.mjs";function c(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`date`,{type:`string`,description:`Date`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`day-report <asn-id>`,describe:`Gets all the data the botnet tracking database has for a given ASN registered to user account for given date. If no date is given, it will return results for the previous day.`,builder:c,handler:async s=>{let c={date:s.date};if(s.dryRun){a({command:`cf botnet-feed asn day-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/botnet_feed/asn/${s[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(s[`asn-id`]))}/day_report`,pathParams:{"asn-id":String(s[`asn-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.botnetFeed.asn.dayReport({account_id:u,asn_id:s[`asn-id`],...c})),{successLabel:`Loaded`})}};function u(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`full-report <asn-id>`,describe:`Gets all the data the botnet threat feed tracking database has for a given ASN registered to user account.`,builder:u,handler:async s=>{if(s.dryRun){a({command:`cf botnet-feed asn full-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/botnet_feed/asn/${s[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(s[`asn-id`]))}/full_report`,pathParams:{"asn-id":String(s[`asn-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.botnetFeed.asn.fullReport({account_id:l,asn_id:s[`asn-id`]})),{successLabel:`Loaded`})}},f={command:`asn`,describe:`Operations for asn`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.positional(`asn-id`,{type:`string`,description:`Asn 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 m={command:`delete <asn-id>`,describe:`Delete an ASN from botnet threat feed for a given user.`,builder:p,handler:async c=>{if(c.dryRun){a({command:`cf botnet-feed configs asn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/botnet_feed/configs/asn/${c[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(c[`asn-id`]))}`,pathParams:{"asn-id":String(c[`asn-id`]??``)},bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,!await s({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>l.botnetFeed.configs.asn.delete({account_id:u,asn_id:c[`asn-id`]})),{successLabel:`Deleted`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf botnet-feed configs asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/botnet_feed/configs/asn`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.botnetFeed.configs.asn.get({account_id:l})),{successLabel:`Loaded`})}},_={command:`asn`,describe:`Operations for configs.asn`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`configs`,describe:`Operations for configs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`botnet-feed`,describe:`botnet-feed`,builder:e=>e.command(f).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,n as d}from"./prompt-CyATfGUu.mjs";import{t as f}from"./cli-types-C3nVfpSG.mjs";function p(e){return e.option(`show-historic`,{type:`string`,description:`Include scanned images without domain metadata (historic data). Default: false (only show images with domain)`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score threshold for matches (0-1, default: 0)`,default:0}).option(`top-k`,{type:`number`,description:`Number of closest matches to return (1-100, default: 10)`,default:10}).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:`submit`,describe:`Submit an image and find the n closest matches from the scanned images index without creating any match records. Returns similarity scores and metadata for each match.`,builder:p,handler:async d=>{let f={showHistoric:d[`show-historic`],download:d.download};if(d.dryRun){a({command:`cf brand-protection submit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/search`,pathParams:{},query:f,bodyKind:`json`,body:d.body===void 0?c({image_data:l(d[`image-data`],`image-data`,`text`),score_threshold:d[`score-threshold`],top_k:d[`top-k`]}):s(d.body)});return}let p=await r(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=s(d.body);new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>p.brandProtection.submit({...e,account_id:m,...f})),{successLabel:`Created`});return}d[`image-data`]===void 0&&(d[`image-data`]=await u(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`));let h=c({image_data:l(d[`image-data`],`image-data`,`text`),score_threshold:d[`score-threshold`],top_k:d[`top-k`]});new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>p.brandProtection.submit({...h,account_id:m,...f})),{successLabel:`Created`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`url-info`,describe:`Get the total number of saved brand protection queries (domain + logo) for an account`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf brand-protection url-info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/total-queries`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.brandProtection.urlInfo({account_id:l})),{successLabel:`Loaded`})}};function _(e){return e.option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`query-id`,{type:`string`,description:`Query ID`,demandOption:!0}).option(`download`,{type:`string`,description:`Download`}).option(`order-by`,{type:`string`,description:`Column to sort by. Options: 'matchedAt', 'domain', 'similarityScore', or 'registrar'`,choices:[`matchedAt`,`domain`,`similarityScore`,`registrar`]}).option(`order`,{type:`string`,description:`Sort order. Options: 'asc' (ascending) or 'desc' (descending)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Get paginated list of logo matches for a specific brand protection logo query`,builder:f(_),handler:async s=>{let c={offset:s.offset,limit:s.limit,query_id:s[`query-id`],download:s.download,orderBy:s[`order-by`],order:s.order};if(s.dryRun){a({command:`cf brand-protection v2 logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.brandProtection.v2.logoMatches.get({account_id:u,...c})),{successLabel:`Loaded`})}},y={command:`logo-matches`,describe:`Operations for v2.logo-matches`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`search-lookback`,{type:`boolean`,description:`If true, search historic scanned images for matches above the similarity threshold`,default:!0}).option(`similarity-threshold`,{type:`number`,description:`Minimum similarity score (0-1) required for visual matches`}).option(`tag`,{type:`string`,description:`Unique identifier for the logo query`}).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 x={command:`create`,describe:`Create a new saved brand protection logo query for visual similarity matching`,builder:b,handler:async d=>{if(d.dryRun){a({command:`cf brand-protection v2 logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({image_data:l(d[`image-data`],`image-data`,`text`),search_lookback:d[`search-lookback`],similarity_threshold:d[`similarity-threshold`],tag:l(d.tag,`tag`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.brandProtection.v2.logos.create({...e,account_id:p})),{successLabel:`Created`});return}if(d[`image-data`]===void 0&&(d[`image-data`]=await u(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`)),d[`similarity-threshold`]===void 0)throw Error(`--similarity-threshold is required (or pass --body with this field set).`);d.tag===void 0&&(d.tag=await u(`tag`,`Unique identifier for the logo query`));let m=c({image_data:l(d[`image-data`],`image-data`,`text`),search_lookback:d[`search-lookback`],similarity_threshold:d[`similarity-threshold`],tag:l(d.tag,`tag`,`text`)});i(await o(`Creating`,async()=>f.brandProtection.v2.logos.create({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.positional(`query-id`,{type:`string`,description:`Query 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 C={command:`delete <query-id>`,describe:`Delete a saved brand protection logo query. Returns 404 if the query ID doesn't exist.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf brand-protection v2 logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${s[`query-id`]==null?`<query-id>`:encodeURIComponent(String(s[`query-id`]))}`,pathParams:{"query-id":String(s[`query-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.brandProtection.v2.logos.delete({account_id:l,query_id:s[`query-id`]})),{successLabel:`Deleted`})}};function w(e){return e.option(`id`,{type:`string`,description:`Optional query ID to retrieve a specific logo query`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Get all saved brand protection logo queries for an account. Optionally specify id to get a single query. Set download=true to include base64-encoded image data.`,builder:w,handler:async s=>{let c={id:s.id,download:s.download};if(s.dryRun){a({command:`cf brand-protection v2 logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.brandProtection.v2.logos.get({account_id:u,...c})),{successLabel:`Loaded`})}},E={command:`logos`,describe:`Operations for v2.logos`,builder:e=>e.command(x).command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`query-id`,{type:`string`,description:`Query ID or comma-separated list of Query IDs. When multiple IDs are provided, matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and dismissed state.`,demandOption:!0}).option(`include-domain-id`,{type:`string`,description:`Include domain ID`}).option(`include-dismissed`,{type:`string`,description:`Include dismissed`}).option(`domain-search`,{type:`string`,description:`Filter matches by domain name (substring match)`}).option(`order-by`,{type:`string`,description:`Column to sort by. Options: 'domain', 'first_seen', or 'registrar'`,choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:`Sort order. Options: 'asc' (ascending) or 'desc' (descending)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Get paginated list of domain matches for one or more brand protection queries. When multiple query_ids are provided (comma-separated), matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and individual dismissed state.`,builder:f(D),handler:async s=>{let c={offset:s.offset,limit:s.limit,query_id:s[`query-id`],include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`],domain_search:s[`domain-search`],orderBy:s[`order-by`],order:s.order};if(s.dryRun){a({command:`cf brand-protection v2 matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.brandProtection.v2.matches.get({account_id:u,...c})),{successLabel:`Loaded`})}},k={command:`matches`,describe:`Operations for v2.matches`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`page`,{type:`number`,description:`Optional page number for paginated list requests. Defaults to 1 when only per_page is supplied. Omit page and per_page to preserve the legacy full-list response.`}).option(`per-page`,{type:`number`,description:`Optional number of queries per page for paginated list requests. Defaults to 100 when only page is supplied. Maximum 100. Omit page and per_page to preserve the legacy full-list response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get`,describe:`Get all saved brand protection queries for an account`,builder:A,handler:async s=>{let c={id:s.id,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf brand-protection v2 queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.brandProtection.v2.queries.get({account_id:u,...c})),{successLabel:`Loaded`})}},M={command:`queries`,describe:`Operations for v2.queries`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`v2`,describe:`Operations for v2`,builder:e=>e.command(y).command(E).command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`brand-protection`,describe:`brand-protection`,builder:e=>e.command(m).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,n as d}from"./prompt-CyATfGUu.mjs";function f(e){return e.option(`config-min-extension-version`,{type:`string`,description:`Minimum required browser extension version.`}).option(`config-mode`,{type:`string`,description:`The config.mode field`,choices:[`proxy`],default:`proxy`}).option(`config-proxy-url`,{type:`string`,description:`PAC script URL for proxy configuration.`}).option(`config-team-domain`,{type:`string`,description:`Team domain for the browser extension.`}).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 p={command:`create`,describe:`Creates the browser extension configuration for an account.`,builder:f,handler:async d=>{if(d.dryRun){a({command:`cf browser-extension config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/browser-extension/config`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({config:{min_extension_version:l(d[`config-min-extension-version`],`config-min-extension-version`,`text`),mode:l(d[`config-mode`],`config-mode`,`text`),proxy_url:l(d[`config-proxy-url`],`config-proxy-url`,`text`),team_domain:l(d[`config-team-domain`],`config-team-domain`,`text`)}}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.browserExtension.config.create({...e,account_id:p})),{successLabel:`Created`});return}d[`config-proxy-url`]===void 0&&(d[`config-proxy-url`]=await u(`config-proxy-url`,`PAC script URL for proxy configuration.`)),d[`config-team-domain`]===void 0&&(d[`config-team-domain`]=await u(`config-team-domain`,`Team domain for the browser extension.`));let m=c({config:{min_extension_version:l(d[`config-min-extension-version`],`config-min-extension-version`,`text`),mode:l(d[`config-mode`],`config-mode`,`text`),proxy_url:l(d[`config-proxy-url`],`config-proxy-url`,`text`),team_domain:l(d[`config-team-domain`],`config-team-domain`,`text`)}});i(await o(`Creating`,async()=>f.browserExtension.config.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.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 h={command:`delete`,describe:`Deletes the browser extension configuration for an account. The shard mapping is preserved and not deleted.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf browser-extension config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/browser-extension/config`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.browserExtension.config.delete({account_id:l})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Returns the browser extension configuration for an account.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf browser-extension config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/browser-extension/config`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.browserExtension.config.get({account_id:l})),{successLabel:`Loaded`})}};function v(e){return e.option(`config-min-extension-version`,{type:`string`,description:`Minimum required browser extension version.`}).option(`config-mode`,{type:`string`,description:`The config.mode field`,choices:[`proxy`]}).option(`config-proxy-url`,{type:`string`,description:`PAC script URL for proxy configuration.`}).option(`config-team-domain`,{type:`string`,description:`Team domain for the browser extension.`}).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:`update`,describe:`Replaces the browser extension configuration for an account. The configuration must already exist. The shard mapping is immutable.`,builder:v,handler:async d=>{if(d.dryRun){a({command:`cf browser-extension config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/browser-extension/config`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({config:{min_extension_version:l(d[`config-min-extension-version`],`config-min-extension-version`,`text`),mode:l(d[`config-mode`],`config-mode`,`text`),proxy_url:l(d[`config-proxy-url`],`config-proxy-url`,`text`),team_domain:l(d[`config-team-domain`],`config-team-domain`,`text`)}}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.browserExtension.config.update({...e,account_id:p})),{successLabel:`Updated`});return}d[`config-proxy-url`]===void 0&&(d[`config-proxy-url`]=await u(`config-proxy-url`,`PAC script URL for proxy configuration.`)),d[`config-team-domain`]===void 0&&(d[`config-team-domain`]=await u(`config-team-domain`,`Team domain for the browser extension.`));let m=c({config:{min_extension_version:l(d[`config-min-extension-version`],`config-min-extension-version`,`text`),mode:l(d[`config-mode`],`config-mode`,`text`),proxy_url:l(d[`config-proxy-url`],`config-proxy-url`,`text`),team_domain:l(d[`config-team-domain`],`config-team-domain`,`text`)}});i(await o(`Updating`,async()=>f.browserExtension.config.update({...m,account_id:p})),{successLabel:`Updated`})}},b={command:`config`,describe:`Operations for config`,builder:e=>e.command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`browser-extension`,describe:`browser-extension`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{x as default};
|