cf 0.9.1 → 0.10.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/README.md +5 -0
- package/dist/_meta/agent-context.json +34 -35
- package/dist/_meta/commands.json +6834 -10044
- package/dist/_meta/schemas.json +11228 -12752
- package/dist/{abuse-reports-CzDAjFpo.mjs → abuse-reports-CGF4zcKf.mjs} +2 -2
- package/dist/{access-CxyW_sIW.mjs → access-lhLJo1v2.mjs} +1 -1
- package/dist/{account-Dd4-tDYJ.mjs → account-CYRm3yoN.mjs} +1 -1
- package/dist/account-tags-B88TotoH.mjs +9 -0
- package/dist/accounts-BSIAT_iP.mjs +28 -0
- package/dist/{acm-CHacxa3s.mjs → acm-VULm1djv.mjs} +1 -1
- package/dist/{addressing-BnqNmmYN.mjs → addressing-BHPBIkRY.mjs} +1 -1
- package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-KBy48G1b.mjs} +1 -1
- package/dist/{agent-memory-D--BQS0W.mjs → agent-memory-DDv_Gxr7.mjs} +2 -2
- package/dist/{ai-audit-CfpDKXkD.mjs → ai-audit-BWZGvbca.mjs} +1 -1
- package/dist/{ai-gateway-oG4j_oYN.mjs → ai-gateway-jeB-sAgP.mjs} +1 -1
- package/dist/ai-search-BmdskMjR.mjs +7 -0
- package/dist/{ai-security-byjIIrfl.mjs → ai-security-CsmfcaUx.mjs} +1 -1
- package/dist/{ai-BnVlQDiI.mjs → ai-viHB1tgI.mjs} +1 -1
- package/dist/{alerting-qa8SkXlD.mjs → alerting-Bl8OqViR.mjs} +4 -4
- package/dist/analytics-vOxw8Hy0.mjs +3 -0
- package/dist/{analytics_engine-BnECMIWJ.mjs → analytics_engine-DO4-C0wD.mjs} +1 -1
- package/dist/{api-security-MfHbfZyf.mjs → api-security-4FVrD4n8.mjs} +1 -1
- package/dist/argo-CQfCgazW.mjs +2 -0
- package/dist/args-DlUhyGU0.mjs +2 -0
- package/dist/artifacts-CVDGnr2V.mjs +4 -0
- package/dist/{audit-logs-retFtvow.mjs → audit-logs-CzpwvQ6A.mjs} +1 -1
- package/dist/{auth-aazs91XL.mjs → auth-D0xZxAEa.mjs} +1 -1
- package/dist/{auth-DuLchM18.mjs → auth-MQEamPN9.mjs} +2 -2
- package/dist/{billing-CxQVqpGZ.mjs → billing-aJgapeRm.mjs} +2 -2
- package/dist/{bot-management-Rli7v7tg.mjs → bot-management-Y2q5d-pi.mjs} +1 -1
- package/dist/{botnet-feed-Cw6XSEf8.mjs → botnet-feed-DANJqfmE.mjs} +1 -1
- package/dist/{brand-protection-CTvnHGfV.mjs → brand-protection-CjpZWBjp.mjs} +1 -1
- package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-BtpCbh-2.mjs} +1 -1
- package/dist/browser-run-BFn9h2Tz.mjs +4 -0
- package/dist/{build-Dji9BYmV.mjs → build-DcflwvqN.mjs} +1 -1
- package/dist/{cache-Cl7vKJwH.mjs → cache-VyWK1SjY.mjs} +1 -1
- package/dist/{calls-DtK_ANxq.mjs → calls-BxoRYxs4.mjs} +1 -1
- package/dist/{certificate-authorities-DZP1RzAs.mjs → certificate-authorities-D7OAFxF_.mjs} +1 -1
- package/dist/{cf-oSz9pud_.mjs → cf-C7DU4819.mjs} +1 -1
- package/dist/{chunk-LQW53VED-Xakf_rUn.mjs → chunk-LQW53VED-DLrXV-hE.mjs} +2 -2
- package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-DDUv8K0a.mjs} +1 -1
- package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-D4ysjwWT.mjs} +1 -1
- package/dist/{cloud-connector-BpVcvhjZ.mjs → cloud-connector-Bhec6z2P.mjs} +1 -1
- package/dist/cloudforce-one-J_hn9ss9.mjs +36 -0
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-Dycx8zFx.mjs +2 -0
- package/dist/{connector-telemetry-events-D5_3X7XW.mjs → connector-telemetry-events-BmxOSNtN.mjs} +1 -1
- package/dist/connector-telemetry-events-latest-BY2556uL.mjs +2 -0
- package/dist/{connector-telemetry-snapshots-CJ9gLRFR.mjs → connector-telemetry-snapshots-CdcqfKnH.mjs} +1 -1
- package/dist/connector-telemetry-snapshots-latest-BHYdxUEF.mjs +2 -0
- package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BqxYMMtQ.mjs} +1 -1
- package/dist/{containers-Bog7j0Hw.mjs → containers-CKW081JA.mjs} +8 -8
- package/dist/{content-scan-D03UfK2X.mjs → content-scan-Dgd7A8KF.mjs} +1 -1
- package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-DYL37wLc.mjs} +1 -1
- package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CkhSbfAs.mjs} +1 -1
- package/dist/{custom-certificates-4y35UC1X.mjs → custom-certificates-BzAOnEoT.mjs} +1 -1
- package/dist/custom-csrs-CgzG3pd3.mjs +3 -0
- package/dist/{custom-hostnames-CDIAnsRa.mjs → custom-hostnames-q_nsnlye.mjs} +4 -4
- package/dist/custom-nameservers-BUBmfhUe.mjs +3 -0
- package/dist/custom-pages-M7jA2Hit.mjs +3 -0
- package/dist/{d1-Cllm-iTT.mjs → d1-BFvMd6-S.mjs} +1 -1
- package/dist/{data-security-rnoSCEdL.mjs → data-security-Bji4Or_j.mjs} +2 -2
- package/dist/{dcv-delegation-DCRCOL6l.mjs → dcv-delegation-BuoRQ1Yh.mjs} +1 -1
- package/dist/{deploy-DGlmjPTS.mjs → deploy-CZ7bgNDu.mjs} +1 -1
- package/dist/{deploy-input-DhCo1I0I.mjs → deploy-input-CrvuoDGJ.mjs} +1 -1
- package/dist/{dev-BbLV0Ti-.mjs → dev-V10MG-Bg.mjs} +1 -1
- package/dist/{diagnostics-D5Yo2xqx.mjs → diagnostics-BTH-8nJH.mjs} +2 -2
- package/dist/{directory-CCndFkbQ.mjs → directory-BlH6N6Qy.mjs} +1 -1
- package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-BCjH1JzB.mjs} +1 -1
- package/dist/{dist-COfwjT96.mjs → dist-CgrMkXFx.mjs} +1 -1
- package/dist/{dls-BBq99pjI.mjs → dls-BF5iN78p.mjs} +1 -1
- package/dist/{dns-DdQYtenF.mjs → dns-CeCTNqRk.mjs} +11 -11
- package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-B54MaLGm.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
- package/dist/{durable-objects-BvxXBht_.mjs → durable-objects-D8FQORrL.mjs} +1 -1
- package/dist/{email-auth-DFvXKSkg.mjs → email-auth-DJK0Eb30.mjs} +1 -1
- package/dist/email-routing-NpmiKIrl.mjs +6 -0
- package/dist/{email-security-BFagcRPP.mjs → email-security-BLZ7WZ9Z.mjs} +2 -2
- package/dist/email-sending-dn-353Nx.mjs +7 -0
- package/dist/fieldExtractors-ahysj57J.mjs +3 -0
- package/dist/firewall-CBPGJ43p.mjs +11 -0
- package/dist/{flagship-FJHc4mFi.mjs → flagship-BusjRNIb.mjs} +3 -3
- package/dist/{fraud-AH47n-wL.mjs → fraud-BIhS8pLf.mjs} +1 -1
- package/dist/{google-tag-gateway-149kbuG_.mjs → google-tag-gateway-TZZ3F1tV.mjs} +1 -1
- package/dist/{healthchecks-DfEUG007.mjs → healthchecks-FiXIk-KP.mjs} +2 -2
- package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-Bx0mykMR.mjs} +1 -1
- package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-C8qCabBF.mjs} +1 -1
- package/dist/{iam-BhHYhMXO.mjs → iam-Cj63Kjc6.mjs} +1 -1
- package/dist/{images-CDViyKtZ.mjs → images-CBWXCDhy.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-YHZbPlS3.mjs → intel-B-9Z_sJs.mjs} +2 -2
- package/dist/{interactive-mV8PABm6.mjs → interactive-DtsCYfrK.mjs} +1 -1
- package/dist/{ips-BpCdldFx.mjs → ips-qs9eGJnI.mjs} +1 -1
- package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-THHvoXX3.mjs} +1 -1
- package/dist/{keys-yYtv7Ztr.mjs → keys-D7N0j4-x.mjs} +1 -1
- package/dist/{kv-Bi9B4E0A.mjs → kv-BFDUCnft.mjs} +1 -1
- package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-DUlUCOoJ.mjs} +1 -1
- package/dist/load-balancers-D2zbQ8fT.mjs +6 -0
- package/dist/{local-DTyuGwTw.mjs → local-D-aVNu6A.mjs} +1 -1
- package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Dh3keC5v.mjs} +1 -1
- package/dist/logexplorer-CUsfZ_bS.mjs +13 -0
- package/dist/{logo-matches-LyDAYPbI.mjs → logo-matches-CJcthPHf.mjs} +1 -1
- package/dist/{logos-O9f5bGSB.mjs → logos-BS65zN8q.mjs} +1 -1
- package/dist/logpush-BK34mMQs.mjs +4 -0
- package/dist/{logs-DmWWL5f9.mjs → logs-CLAqX9h2.mjs} +1 -1
- package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-h_ozrC5S.mjs} +1 -1
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +4 -0
- package/dist/{magic-transit-DwgZeIj-.mjs → magic-transit-BtsFePMx.mjs} +5 -5
- package/dist/{managed-transforms-DCmogkxv.mjs → managed-transforms-Cm_KVCMB.mjs} +1 -1
- package/dist/{matches-BAeN8VM1.mjs → matches-InA1hwII.mjs} +1 -1
- package/dist/{mcp-DKZ2D050.mjs → mcp-mJ7bekNJ.mjs} +1 -1
- package/dist/mesh-BK4S1Ezy.mjs +4 -0
- package/dist/{moq-CJpE-eNj.mjs → moq-qmuVPAO0.mjs} +1 -1
- package/dist/{mtls-certificates-Bbm_1lQI.mjs → mtls-certificates-CU4OAAXY.mjs} +1 -1
- package/dist/{network-D2WRXCDe.mjs → network-D74cSy3t.mjs} +1 -1
- package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-BJ0Nc48J.mjs} +1 -1
- package/dist/{oauth-BPizUUqP.mjs → oauth-B0ETkNcX.mjs} +2 -2
- package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-Br-smLxQ.mjs} +1 -1
- package/dist/{oauth-scopes-CmbgsPYd.mjs → oauth-scopes-D5bF11ju.mjs} +1 -1
- package/dist/observability-BWE0Gg3V.mjs +4 -0
- package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-R-qesf18.mjs} +1 -1
- package/dist/{organization-D41rIvJa.mjs → organization-NX7yCZrq.mjs} +1 -1
- package/dist/{organizations-eNzfOwlP.mjs → organizations-DLhiRt8g.mjs} +1 -1
- package/dist/{origin-ca-certificates-DaiAmw45.mjs → origin-ca-certificates-Ff4McZRQ.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-7YztBged.mjs → origin-post-quantum-encryption-UuTr4_SW.mjs} +1 -1
- package/dist/{origin-tls-client-auth-DRwURM8s.mjs → origin-tls-client-auth-DOJ1zlH3.mjs} +1 -1
- package/dist/{output-DgW1hQGX.mjs → output-DrpYYfnB.mjs} +1 -1
- package/dist/{page-rules-B2Csdc4h.mjs → page-rules-BSz1gO-_.mjs} +1 -1
- package/dist/{pages-BAL6Q7OY.mjs → pages-DVDogxPs.mjs} +4 -4
- package/dist/{pay-per-crawl-C-1-ZAtn.mjs → pay-per-crawl-BrLXK7gT.mjs} +1 -1
- package/dist/{pipelines-cyQOuFLb.mjs → pipelines-BszRk4sM.mjs} +2 -2
- package/dist/{precursor-BrweY39h.mjs → precursor-BPNjQr76.mjs} +1 -1
- package/dist/progress-CsHIt3Tp.mjs +2 -0
- package/dist/{prompt-CDtLWxNv.mjs → prompt-DdegNPpg.mjs} +1 -1
- package/dist/{queries-oM8uGZy5.mjs → queries-JL1H1Biz.mjs} +1 -1
- package/dist/{queues-CTx04ZNw.mjs → queues-DpkYdRUE.mjs} +1 -1
- package/dist/{r2-CnlIUn7R.mjs → r2-CKozthw_.mjs} +4 -4
- package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-Du7hN9jA.mjs} +1 -1
- package/dist/radar-C-92vggG.mjs +2 -0
- package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-yBF3qoYD.mjs} +1 -1
- package/dist/{raw-fetch-Dz-QBoP_.mjs → raw-fetch-CteyTOM2.mjs} +1 -1
- package/dist/realtimekit-CIP7lP-a.mjs +7 -0
- package/dist/{registrar-BEcb90RX.mjs → registrar-DKKN0M29.mjs} +3 -3
- package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-DiXg8p_1.mjs} +3 -3
- package/dist/{registry-DDcSvd8H.mjs → registry-Bck_zFkz.mjs} +1 -1
- package/dist/{reporting-CLbjHlnw.mjs → reporting-fg_GKXe1.mjs} +1 -1
- package/dist/{request-tracers-BcKpofP1.mjs → request-tracers-CkMya96z.mjs} +1 -1
- package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-D1pSDvtf.mjs} +1 -1
- package/dist/{resource-tagging-DGEyVTDN.mjs → resource-tagging-z48JGHCq.mjs} +1 -1
- package/dist/{rules-CmuB5rIN.mjs → rules-BTmNjDN-.mjs} +1 -1
- package/dist/rulesets-CsoSM-17.mjs +5 -0
- package/dist/{rum-QT6EP4JK.mjs → rum-DB4iO2q5.mjs} +1 -1
- package/dist/{schema-BeXPWeK9.mjs → schema-B34Q9tLF.mjs} +1 -1
- package/dist/{schema-flags-DHryz6SF.mjs → schema-flags-iGoOriJt.mjs} +1 -1
- package/dist/{scim-BgGsmHrL.mjs → scim-CcSyfKCH.mjs} +1 -1
- package/dist/sdk-ZctLa5jW.mjs +3 -0
- package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DFmvtphu.mjs} +1 -1
- package/dist/security-center-DFKeHq5c.mjs +2 -0
- package/dist/{security-txt-Be2Bif0z.mjs → security-txt-DqnFpjMI.mjs} +1 -1
- package/dist/{session-Ckt20hHa.mjs → session-D6KHthHf.mjs} +1 -1
- package/dist/{share-Bz2tFTUP.mjs → share-BuwYUzOL.mjs} +1 -1
- package/dist/{shared-BzPQog8H.mjs → shared-VppSAQf4.mjs} +1 -1
- package/dist/{smart-shield-SODkOUyO.mjs → smart-shield-D6X8L7p8.mjs} +2 -2
- package/dist/{snippets-B5jY8v_7.mjs → snippets-DIpc9pb_.mjs} +1 -1
- package/dist/{spawn-CHkoow5W.mjs → spawn-O1RS01vr.mjs} +2 -2
- package/dist/{spectrum-BA0a42eM.mjs → spectrum-b7N1ZRAm.mjs} +1 -1
- package/dist/{speed-mmOjxOzo.mjs → speed-cw31yFva.mjs} +1 -1
- package/dist/src-D_HETJNy.mjs +108 -0
- package/dist/{ssl-Yr6kELqg.mjs → ssl-CsEhRVTO.mjs} +1 -1
- package/dist/{state-DZC531l2.mjs → state-Bb5Cbc_L.mjs} +1 -1
- package/dist/{stream-Cu0kYWbc.mjs → stream-DFOao6Gu.mjs} +3 -3
- package/dist/{submit-Dl_27e0n.mjs → submit--xTzyNPy.mjs} +1 -1
- package/dist/{tags-Cdo_Pwtr.mjs → tags-efICDkah.mjs} +1 -1
- package/dist/{tenant-EX-ANl6X.mjs → tenant-CerHuToJ.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-BPHUeckw.mjs → tenant-custom-nameservers-C4otMBm2.mjs} +1 -1
- package/dist/{tools-D2Xxfkrc.mjs → tools-BHfBOZOU.mjs} +1 -1
- package/dist/{triggers-Bf9hbP3h.mjs → triggers-BEsiiKAf.mjs} +1 -1
- package/dist/{tunnel-CDYkWjnt.mjs → tunnel-DkMiNtVY.mjs} +1 -1
- package/dist/{tunnels-CgyX8R2J.mjs → tunnels-D0J8lJoI.mjs} +1 -1
- package/dist/{turnstile-BUtzlW-0.mjs → turnstile-CFmtY5bn.mjs} +2 -2
- package/dist/{ui-DIpjthrV.mjs → ui-DE8CNn6c.mjs} +1 -1
- package/dist/{url-info-CJsa1Oc9.mjs → url-info-DBCeRWwb.mjs} +1 -1
- package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-ClfFiruK.mjs} +1 -1
- package/dist/{url-scanner-Cz-yl0_3.mjs → url-scanner-CNyvg65L.mjs} +1 -1
- package/dist/{user-BxHjEqpd.mjs → user-bifVEQq5.mjs} +2 -2
- package/dist/{values-C43NurfT.mjs → values-OxkdP1tV.mjs} +1 -1
- package/dist/{vectorize-CjXfiFH4.mjs → vectorize-CVKu7lEt.mjs} +1 -1
- package/dist/{versions-BFbc90Wu.mjs → versions-BVL-Ludh.mjs} +1 -1
- package/dist/waiting-rooms-CmRAl51T.mjs +11 -0
- package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C2s9kzWf.mjs} +1 -1
- package/dist/{web3-Ctv9HGiR.mjs → web3-y_cY91V_.mjs} +1 -1
- package/dist/{workers-builds-B44wc67O.mjs → workers-builds-B55-oXOa.mjs} +4 -4
- package/dist/{workers-D-YbIedB.mjs → workers-jDcq14GH.mjs} +6 -6
- package/dist/{workflows-rFuQWClt.mjs → workflows-B-kGHxFu.mjs} +2 -2
- package/dist/{zaraz-BA6kY-b6.mjs → zaraz-27zwjLvv.mjs} +1 -1
- package/dist/zero-trust-DV3sIOvu.mjs +92 -0
- package/dist/{zone-B_rgejLV.mjs → zone-BJix2KQ9.mjs} +1 -1
- package/dist/{zones-DTWO7Vvn.mjs → zones-Bkj5i92c.mjs} +1 -1
- package/package.json +1 -1
- package/dist/account-tags-65fAlHrf.mjs +0 -9
- package/dist/accounts-Bp5KGc6r.mjs +0 -28
- package/dist/ai-search-B2l3B_jn.mjs +0 -7
- package/dist/analytics-DeIKjC9n.mjs +0 -3
- package/dist/argo-DFerMyXF.mjs +0 -2
- package/dist/artifacts-CtyEYYDa.mjs +0 -4
- package/dist/browser-run-FwtwnBzA.mjs +0 -4
- package/dist/cloudforce-one-2PecncfX.mjs +0 -30
- package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
- package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
- package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
- package/dist/custom-pages-vfDxrXbt.mjs +0 -4
- package/dist/email-CGOC_evd.mjs +0 -2
- package/dist/email-routing-QBRPBlyl.mjs +0 -6
- package/dist/email-sending-Ddhe7xjN.mjs +0 -7
- package/dist/filters-CGisPGD1.mjs +0 -4
- package/dist/firewall-DD8U-Brd.mjs +0 -11
- package/dist/load-balancers-jRCN75mX.mjs +0 -7
- package/dist/logexplorer-kO8CULiK.mjs +0 -24
- package/dist/logpush-dtXLu3Ck.mjs +0 -5
- package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
- package/dist/media-CnxgOViL.mjs +0 -2
- package/dist/mesh-CzIPtuaM.mjs +0 -4
- package/dist/observability-DXYgDdU5.mjs +0 -4
- package/dist/progress-B84wYh91.mjs +0 -2
- package/dist/radar-CGNgGh8v.mjs +0 -2
- package/dist/realtimekit-BPwzhNS9.mjs +0 -7
- package/dist/rulesets-CGaMq8vG.mjs +0 -8
- package/dist/sdk-m4xeaua4.mjs +0 -3
- package/dist/security-center-BNm4uPVB.mjs +0 -2
- package/dist/src-CHW7s5IS.mjs +0 -108
- package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
- package/dist/zero-trust-DOFLlUz1.mjs +0 -102
- package/dist/zone-tags-BWdza4rH.mjs +0 -9
- /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
- /package/dist/{alerts-B85uj2Vx.mjs → alerts-CRmjqOZi.mjs} +0 -0
- /package/dist/{autorag-Do9l_LyY.mjs → autorag-BD7cu5NU.mjs} +0 -0
- /package/dist/{body-parser-CYD7PKFC.mjs → body-parser-C-c9gfH1.mjs} +0 -0
- /package/dist/{brands-DateHCdd.mjs → brands-BhALBkX2.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
- /package/dist/{clear-CB2kgcEB.mjs → clear-BgF8No7D.mjs} +0 -0
- /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-BsTty22w.mjs} +0 -0
- /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C50W5GhA.mjs} +0 -0
- /package/dist/{health-buY5f5pp.mjs → health-BFNZqiAm.mjs} +0 -0
- /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-Bav2M9F-.mjs} +0 -0
- /package/dist/{internal-CwyoJUHh.mjs → internal-BTeSewwB.mjs} +0 -0
- /package/dist/{live-wEpA5V_n.mjs → live-Dkiyu30_.mjs} +0 -0
- /package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BwQqexwo-CNW_dPly.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-Dz-Wv1T0.mjs} +0 -0
- /package/dist/{ready-CBSCPiHE.mjs → ready-TKOkKeRg.mjs} +0 -0
- /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-3Asm6eIi.mjs} +0 -0
- /package/dist/{refute-u7ZPQJZy.mjs → refute-BVz9nMyd.mjs} +0 -0
- /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-CeBbH6Pq.mjs} +0 -0
- /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-ZteA-PUV.mjs} +0 -0
- /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-DWDSyzQ7.mjs} +0 -0
- /package/dist/{search-D9WDwnV4.mjs → search-DGNc37HK.mjs} +0 -0
- /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-B5Qpn2mn.mjs} +0 -0
- /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-FjUolE6A.mjs} +0 -0
- /package/dist/{theme-BePJemMn.mjs → theme-CeVf-5qG.mjs} +0 -0
- /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-NHJj1HGq.mjs} +0 -0
- /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CniKVHIp.mjs} +0 -0
- /package/dist/{verify-2yi0H93r.mjs → verify-DS1PWAJe.mjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,i as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`eligibility <report-id>`,describe:`Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(s[`report-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.abuseReports.appeals.eligibility({account_id:l,report_id:s[`report-id`]})),{successLabel:`Loaded`})}},h={command:`appeals`,describe:`Operations for appeals`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`act`,{type:`string`,description:`The act field`,choices:[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`]}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
3
3
|
`}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
4
4
|
`,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
5
5
|
`}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
6
6
|
`,choices:[`send`,`send-anon`,`none`]}).option(`signature`,{type:`string`,description:`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`}).option(`state`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`justification`,{type:`string`,description:`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters.
|
|
7
7
|
`}).option(`trademark-number`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-office`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-symbol`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`destination-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ports-protocols`,{type:`string`,description:`A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual port/protocol should not exceed 100 characters. The list should not have more than 30 unique ports and protocols.`}).option(`source-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ncmec-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
8
|
-
`,choices:[`send`,`send-anon`]}).option(`reg-who-request-reg-who-authorization-statement`,{type:`string`,description:`Optional authorization statement or power of attorney per RDP 10.2.1.3.`}).option(`reg-who-request-reg-who-good-faith-affirmation`,{type:`boolean`,description:`Affirmation that the request is made in good faith per RDP 10.2.4. Must be true.`}).option(`reg-who-request-reg-who-lawful-processing-agreement`,{type:`boolean`,description:`Agreement to process data lawfully per RDP 10.2.5. Must be true.`}).option(`reg-who-request-reg-who-legal-basis`,{type:`string`,description:`Legal rights and rationale for the request per RDP 10.2.3. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-request-type`,{type:`string`,description:`The type of WHOIS data request per RDP procedure.`,choices:[`disclosure`,`invalid_whois`]}).option(`reg-who-request-reg-who-requested-data-elements`,{type:`string`,array:!0,description:`The specific WHOIS data elements being requested per RDP 10.2.2. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-requestor-type`,{type:`string`,description:`The nature of the requestor per RDP 10.2.1.2.`,choices:[`government`,`corporation`,`individual`]}).option(`ncsei-subject-representation`,{type:`boolean`,description:`If the submitter is the target of NCSEI in the URLs of the abuse report.`}).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)`}).conflicts(`address1`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`address1`,[`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agent-name`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agent-name`,[`address1`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agree`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agree`,[`address1`,`agent-name`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`city`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`city`,[`address1`,`agent-name`,`agree`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`country`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`original-work`]).implies(`country`,[`address1`,`agent-name`,`agree`,`city`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`host-notification`,[`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).conflicts(`original-work`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`country`]).implies(`original-work`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`signature`,`state`]).conflicts(`signature`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`signature`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`state`]).conflicts(`state`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`state`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`]).conflicts(`justification`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`trademark-number`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-number`,[`host-notification`,`justification`,`trademark-office`,`trademark-symbol`]).conflicts(`trademark-office`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-office`,[`host-notification`,`justification`,`trademark-number`,`trademark-symbol`]).conflicts(`trademark-symbol`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-symbol`,[`host-notification`,`justification`,`trademark-number`,`trademark-office`]).conflicts(`destination-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ports-protocols`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`source-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ncmec-notification`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`ncmec-notification`,[`host-notification`,`justification`]).conflicts(`reg-who-request-reg-who-authorization-statement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-good-faith-affirmation`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-lawful-processing-agreement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-legal-basis`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-request-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requested-data-elements`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requestor-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`ncsei-subject-representation`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).implies(`ncsei-subject-representation`,[`host-notification`]).check(e=>{if([`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`].some(t=>e[t]!==void 0)){let t={"reg-who-request-reg-who-good-faith-affirmation":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-lawful-processing-agreement":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-legal-basis":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-request-type":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-requested-data-elements":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]},n=[`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0})}const _={command:`create <report-param>`,describe:"Submit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Account > Abuse Reports > Edit` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below).",builder:g,handler:async f=>{if(f.dryRun){a({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${f[`report-param`]==null?`<report-param>`:encodeURIComponent(String(f[`report-param`]))}`,pathParams:{"report-param":String(f[`report-param`]??``)},bodyKind:`json`,body:f.body===void 0?c({act:l(f.act,`act`,`text`),comments:l(f.comments,`comments`,`text`),company:l(f.company,`company`,`text`),email:l(f.email,`email`,`text`),email2:l(f.email2,`email2`,`text`),name:l(f.name,`name`,`text`),reported_country:l(f[`reported-country`],`reported-country`,`text`),reported_user_agent:l(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:l(f.tele,`tele`,`text`),title:l(f.title,`title`,`text`),urls:l(f.urls,`urls`,`text`),address1:l(f.address1,`address1`,`text`),agent_name:l(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:l(f.city,`city`,`text`),country:l(f.country,`country`,`text`),host_notification:l(f[`host-notification`],`host-notification`,`text`),original_work:l(f[`original-work`],`original-work`,`text`),owner_notification:l(f[`owner-notification`],`owner-notification`,`text`),signature:l(f.signature,`signature`,`text`),state:l(f.state,`state`,`text`),justification:l(f.justification,`justification`,`text`),trademark_number:l(f[`trademark-number`],`trademark-number`,`text`),trademark_office:l(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:l(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:l(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:l(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:l(f[`source-ips`],`source-ips`,`text`),ncmec_notification:l(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:l(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:l(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:l(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:l(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.abuseReports.create({body:e,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`});return}if(f.act===void 0&&(f.act=await d(`act`,`The act field`,[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`])),f.email===void 0&&(f.email=await u(`email`,`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.email2===void 0&&(f.email2=await u(`email2`,"Should match the value provided in `email`")),f.name===void 0&&(f.name=await u(`name`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.urls===void 0&&(f.urls=await u(`urls`,`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f[`owner-notification`]===void 0&&(f[`owner-notification`]=await d(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`])),f.act===`abuse_dmca`&&f.address1===void 0&&(f.address1=await u(`address1`,`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --address1`})),f.act===`abuse_dmca`&&f[`agent-name`]===void 0&&(f[`agent-name`]=await u(`agent-name`,`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --agent-name`})),f.act===`abuse_dmca`&&f.agree===void 0)throw Error(`--agree is required (or pass --body with this field set).`);if(f.act===`abuse_dmca`&&f.city===void 0&&(f.city=await u(`city`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --city`})),f.act===`abuse_dmca`&&f.country===void 0&&(f.country=await u(`country`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --country`})),f.act===`abuse_dmca`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_dmca`&&f[`original-work`]===void 0&&(f[`original-work`]=await u(`original-work`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --original-work`})),f.act===`abuse_dmca`&&f.signature===void 0&&(f.signature=await u(`signature`,`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`,{question:`Enter value for --signature`})),f.act===`abuse_dmca`&&f.state===void 0&&(f.state=await u(`state`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --state`})),f.act===`abuse_trademark`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_trademark`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_trademark`&&f[`trademark-number`]===void 0&&(f[`trademark-number`]=await u(`trademark-number`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-number`})),f.act===`abuse_trademark`&&f[`trademark-office`]===void 0&&(f[`trademark-office`]=await u(`trademark-office`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-office`})),f.act===`abuse_trademark`&&f[`trademark-symbol`]===void 0&&(f[`trademark-symbol`]=await u(`trademark-symbol`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-symbol`})),f.act===`abuse_general`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_general`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_phishing`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_phishing`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_children`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_children`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_children`&&f[`ncmec-notification`]===void 0&&(f[`ncmec-notification`]=await u(`ncmec-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --ncmec-notification`})),f.act===`abuse_threat`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_threat`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_ncsei`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_ncsei`&&f[`ncsei-subject-representation`]===void 0)throw Error(`--ncsei-subject-representation is required (or pass --body with this field set).`);let h=c({act:l(f.act,`act`,`text`),comments:l(f.comments,`comments`,`text`),company:l(f.company,`company`,`text`),email:l(f.email,`email`,`text`),email2:l(f.email2,`email2`,`text`),name:l(f.name,`name`,`text`),reported_country:l(f[`reported-country`],`reported-country`,`text`),reported_user_agent:l(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:l(f.tele,`tele`,`text`),title:l(f.title,`title`,`text`),urls:l(f.urls,`urls`,`text`),address1:l(f.address1,`address1`,`text`),agent_name:l(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:l(f.city,`city`,`text`),country:l(f.country,`country`,`text`),host_notification:l(f[`host-notification`],`host-notification`,`text`),original_work:l(f[`original-work`],`original-work`,`text`),owner_notification:l(f[`owner-notification`],`owner-notification`,`text`),signature:l(f.signature,`signature`,`text`),state:l(f.state,`state`,`text`),justification:l(f.justification,`justification`,`text`),trademark_number:l(f[`trademark-number`],`trademark-number`,`text`),trademark_office:l(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:l(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:l(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:l(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:l(f[`source-ips`],`source-ips`,`text`),ncmec_notification:l(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:l(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:l(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:l(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:l(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]});i(await o(`Creating`,async()=>p.abuseReports.create({body:h,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`})}};function v(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1)`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent to hosts or submitters.`,builder:v,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/emails`,pathParams:{"report-id":String(s[`report-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.abuseReports.emails.list({account_id:u,report_id:s[`report-id`],...c})),{successLabel:`Loaded`})}},b={command:`emails`,describe:`Emails operations`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`report-param`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <report-param>`,describe:`Retrieve the details of an abuse report.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-param`]==null?`<report-param>`:encodeURIComponent(String(s[`report-param`]))}`,pathParams:{"report-param":String(s[`report-param`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.abuseReports.get({account_id:l,report_param:s[`report-param`]})),{successLabel:`Loaded`})}};function C(e){return e.option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order (id, cdate, domain, type, status)`}).option(`domain`,{type:`string`,description:`Filter by domain name related to the abuse report`}).option(`created-before`,{type:`string`,description:`Returns reports created before the specified date`}).option(`created-after`,{type:`string`,description:`Returns reports created after the specified date`}).option(`status`,{type:`string`,description:`Filter by the status of the report.`,choices:[`accepted`,`in_review`]}).option(`type`,{type:`string`,description:`Filter by the type of the report.`,choices:[`PHISH`,`GEN`,`THREAT`,`DMCA`,`EMER`,`TM`,`REG_WHO`,`NCSEI`,`NETWORK`]}).option(`mitigation-status`,{type:`string`,description:`Filter reports that have any mitigations in the given status.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`List the abuse reports for a given account`,builder:f(C),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],sort:s.sort,domain:s.domain,created_before:s[`created-before`],created_after:s[`created-after`],status:s.status,type:s.type,mitigation_status:s[`mitigation-status`]};if(s.dryRun){a({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports`,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.abuseReports.list({account_id:u,...c})),{successLabel:`Loaded`})}};function T(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set.`}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`,`custom_expression`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:f(T),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],sort:s.sort,type:s.type,effective_before:s[`effective-before`],effective_after:s[`effective-after`],status:s.status,entity_type:s[`entity-type`]};if(s.dryRun){a({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/mitigations`,pathParams:{"report-id":String(s[`report-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.abuseReports.mitigations.list({account_id:u,report_id:s[`report-id`],...c})),{successLabel:`Loaded`})}};function D(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`data-city`,{type:`string`,description:`The data.city field`}).option(`data-company`,{type:`string`,description:`The data.company field`}).option(`data-counter-notice-response`,{type:`string`,description:`The data.counter_notice_response field`}).option(`data-country`,{type:`string`,description:`The data.country field`}).option(`data-email`,{type:`string`,description:`The data.email field`}).option(`data-full-name`,{type:`string`,description:`The data.full_name field`}).option(`data-jurisdiction-consent`,{type:`boolean`,description:`The data.jurisdiction_consent field`}).option(`data-perjury-attestation`,{type:`boolean`,description:`The data.perjury_attestation field`}).option(`data-phone-number`,{type:`string`,description:`The data.phone_number field`}).option(`data-signature`,{type:`string`,description:`The data.signature field`}).option(`data-state`,{type:`string`,description:`The data.state field`}).option(`data-street-address`,{type:`string`,description:`The data.street_address field`}).option(`data-urls`,{type:`string`,array:!0,description:`The data.urls field`}).option(`data-zip-code`,{type:`string`,description:`The data.zip_code field`}).option(`type`,{type:`string`,description:`The type of appeal being submitted.`,choices:[`counter_notice`,`content_removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Submit an appeal for a report. Provide either a list of mitigations to appeal, or an appeal type with its supporting details, but not both. When type is "counter_notice", the counter-notice details are required.`}).check(e=>{if([`data-city`,`data-company`,`data-counter-notice-response`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].some(t=>e[t]!==void 0)){let t=[`data-city`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --data-* flag is set`)}return!0})}const O={command:`review <report-id>`,describe:`Request a review for mitigations on an account.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${u[`report-id`]==null?`<report-id>`:encodeURIComponent(String(u[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(u[`report-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({data:{city:l(u[`data-city`],`data-city`,`text`),company:l(u[`data-company`],`data-company`,`text`),counter_notice_response:l(u[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:l(u[`data-country`],`data-country`,`text`),email:l(u[`data-email`],`data-email`,`text`),full_name:l(u[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:u[`data-jurisdiction-consent`],perjury_attestation:u[`data-perjury-attestation`],phone_number:l(u[`data-phone-number`],`data-phone-number`,`text`),signature:l(u[`data-signature`],`data-signature`,`text`),state:l(u[`data-state`],`data-state`,`text`),street_address:l(u[`data-street-address`],`data-street-address`,`text`),urls:u[`data-urls`],zip_code:l(u[`data-zip-code`],`data-zip-code`,`text`)},type:l(u.type,`type`,`text`)}):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.abuseReports.mitigations.review({body:e,account_id:f,report_id:u[`report-id`]})),{successLabel:`Created`});return}let p=c({data:{city:l(u[`data-city`],`data-city`,`text`),company:l(u[`data-company`],`data-company`,`text`),counter_notice_response:l(u[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:l(u[`data-country`],`data-country`,`text`),email:l(u[`data-email`],`data-email`,`text`),full_name:l(u[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:u[`data-jurisdiction-consent`],perjury_attestation:u[`data-perjury-attestation`],phone_number:l(u[`data-phone-number`],`data-phone-number`,`text`),signature:l(u[`data-signature`],`data-signature`,`text`),state:l(u[`data-state`],`data-state`,`text`),street_address:l(u[`data-street-address`],`data-street-address`,`text`),urls:u[`data-urls`],zip_code:l(u[`data-zip-code`],`data-zip-code`,`text`)},type:l(u.type,`type`,`text`)});i(await o(`Creating`,async()=>d.abuseReports.mitigations.review({body:p,account_id:f,report_id:u[`report-id`]})),{successLabel:`Created`})}},k={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(_).command(S).command(w).command(h).command(b).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
|
8
|
+
`,choices:[`send`,`send-anon`]}).option(`reg-who-request-reg-who-authorization-statement`,{type:`string`,description:`Optional authorization statement or power of attorney per RDP 10.2.1.3.`}).option(`reg-who-request-reg-who-good-faith-affirmation`,{type:`boolean`,description:`Affirmation that the request is made in good faith per RDP 10.2.4. Must be true.`}).option(`reg-who-request-reg-who-lawful-processing-agreement`,{type:`boolean`,description:`Agreement to process data lawfully per RDP 10.2.5. Must be true.`}).option(`reg-who-request-reg-who-legal-basis`,{type:`string`,description:`Legal rights and rationale for the request per RDP 10.2.3. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-request-type`,{type:`string`,description:`The type of WHOIS data request per RDP procedure.`,choices:[`disclosure`,`invalid_whois`]}).option(`reg-who-request-reg-who-requested-data-elements`,{type:`string`,array:!0,description:`The specific WHOIS data elements being requested per RDP 10.2.2. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-requestor-type`,{type:`string`,description:`The nature of the requestor per RDP 10.2.1.2.`,choices:[`government`,`corporation`,`individual`]}).option(`ncsei-subject-representation`,{type:`boolean`,description:`If the submitter is the target of NCSEI in the URLs of the abuse report.`}).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)`}).conflicts(`address1`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`address1`,[`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agent-name`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agent-name`,[`address1`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agree`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agree`,[`address1`,`agent-name`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`city`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`city`,[`address1`,`agent-name`,`agree`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`country`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`original-work`]).implies(`country`,[`address1`,`agent-name`,`agree`,`city`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`host-notification`,[`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).conflicts(`original-work`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`country`]).implies(`original-work`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`signature`,`state`]).conflicts(`signature`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`signature`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`state`]).conflicts(`state`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`state`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`]).conflicts(`justification`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`trademark-number`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-number`,[`host-notification`,`justification`,`trademark-office`,`trademark-symbol`]).conflicts(`trademark-office`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-office`,[`host-notification`,`justification`,`trademark-number`,`trademark-symbol`]).conflicts(`trademark-symbol`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-symbol`,[`host-notification`,`justification`,`trademark-number`,`trademark-office`]).conflicts(`destination-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ports-protocols`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`source-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ncmec-notification`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`ncmec-notification`,[`host-notification`,`justification`]).conflicts(`reg-who-request-reg-who-authorization-statement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-good-faith-affirmation`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-lawful-processing-agreement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-legal-basis`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-request-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requested-data-elements`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requestor-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`ncsei-subject-representation`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).implies(`ncsei-subject-representation`,[`host-notification`]).check(e=>{if([`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`].some(t=>e[t]!==void 0)){let t={"reg-who-request-reg-who-good-faith-affirmation":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-lawful-processing-agreement":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-legal-basis":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-request-type":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-requested-data-elements":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]},n=[`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0})}const _={command:`create <report-param>`,describe:"Submit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Account > Abuse Reports > Edit` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below).",builder:g,handler:async f=>{if(f.dryRun){a({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${f[`report-param`]==null?`<report-param>`:encodeURIComponent(String(f[`report-param`]))}`,pathParams:{"report-param":String(f[`report-param`]??``)},bodyKind:`json`,body:f.body===void 0?c({act:l(f.act,`act`,`text`),comments:l(f.comments,`comments`,`text`),company:l(f.company,`company`,`text`),email:l(f.email,`email`,`text`),email2:l(f.email2,`email2`,`text`),name:l(f.name,`name`,`text`),reported_country:l(f[`reported-country`],`reported-country`,`text`),reported_user_agent:l(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:l(f.tele,`tele`,`text`),title:l(f.title,`title`,`text`),urls:l(f.urls,`urls`,`text`),address1:l(f.address1,`address1`,`text`),agent_name:l(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:l(f.city,`city`,`text`),country:l(f.country,`country`,`text`),host_notification:l(f[`host-notification`],`host-notification`,`text`),original_work:l(f[`original-work`],`original-work`,`text`),owner_notification:l(f[`owner-notification`],`owner-notification`,`text`),signature:l(f.signature,`signature`,`text`),state:l(f.state,`state`,`text`),justification:l(f.justification,`justification`,`text`),trademark_number:l(f[`trademark-number`],`trademark-number`,`text`),trademark_office:l(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:l(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:l(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:l(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:l(f[`source-ips`],`source-ips`,`text`),ncmec_notification:l(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:l(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:l(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:l(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:l(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.abuseReports.create({body:e,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`});return}if(f.act===void 0&&(f.act=await d(`act`,`The act field`,[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`])),f.email===void 0&&(f.email=await u(`email`,`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.email2===void 0&&(f.email2=await u(`email2`,"Should match the value provided in `email`")),f.name===void 0&&(f.name=await u(`name`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.urls===void 0&&(f.urls=await u(`urls`,`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f[`owner-notification`]===void 0&&(f[`owner-notification`]=await d(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`])),f.act===`abuse_dmca`&&f.address1===void 0&&(f.address1=await u(`address1`,`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --address1`})),f.act===`abuse_dmca`&&f[`agent-name`]===void 0&&(f[`agent-name`]=await u(`agent-name`,`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --agent-name`})),f.act===`abuse_dmca`&&f.agree===void 0)throw Error(`--agree is required (or pass --body with this field set).`);if(f.act===`abuse_dmca`&&f.city===void 0&&(f.city=await u(`city`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --city`})),f.act===`abuse_dmca`&&f.country===void 0&&(f.country=await u(`country`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --country`})),f.act===`abuse_dmca`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_dmca`&&f[`original-work`]===void 0&&(f[`original-work`]=await u(`original-work`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --original-work`})),f.act===`abuse_dmca`&&f.signature===void 0&&(f.signature=await u(`signature`,`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`,{question:`Enter value for --signature`})),f.act===`abuse_dmca`&&f.state===void 0&&(f.state=await u(`state`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --state`})),f.act===`abuse_trademark`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_trademark`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_trademark`&&f[`trademark-number`]===void 0&&(f[`trademark-number`]=await u(`trademark-number`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-number`})),f.act===`abuse_trademark`&&f[`trademark-office`]===void 0&&(f[`trademark-office`]=await u(`trademark-office`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-office`})),f.act===`abuse_trademark`&&f[`trademark-symbol`]===void 0&&(f[`trademark-symbol`]=await u(`trademark-symbol`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-symbol`})),f.act===`abuse_general`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_general`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_phishing`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_phishing`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_children`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_children`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_children`&&f[`ncmec-notification`]===void 0&&(f[`ncmec-notification`]=await u(`ncmec-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --ncmec-notification`})),f.act===`abuse_threat`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_threat`&&f.justification===void 0&&(f.justification=await u(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),f.act===`abuse_ncsei`&&f[`host-notification`]===void 0&&(f[`host-notification`]=await u(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),f.act===`abuse_ncsei`&&f[`ncsei-subject-representation`]===void 0)throw Error(`--ncsei-subject-representation is required (or pass --body with this field set).`);let h=c({act:l(f.act,`act`,`text`),comments:l(f.comments,`comments`,`text`),company:l(f.company,`company`,`text`),email:l(f.email,`email`,`text`),email2:l(f.email2,`email2`,`text`),name:l(f.name,`name`,`text`),reported_country:l(f[`reported-country`],`reported-country`,`text`),reported_user_agent:l(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:l(f.tele,`tele`,`text`),title:l(f.title,`title`,`text`),urls:l(f.urls,`urls`,`text`),address1:l(f.address1,`address1`,`text`),agent_name:l(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:l(f.city,`city`,`text`),country:l(f.country,`country`,`text`),host_notification:l(f[`host-notification`],`host-notification`,`text`),original_work:l(f[`original-work`],`original-work`,`text`),owner_notification:l(f[`owner-notification`],`owner-notification`,`text`),signature:l(f.signature,`signature`,`text`),state:l(f.state,`state`,`text`),justification:l(f.justification,`justification`,`text`),trademark_number:l(f[`trademark-number`],`trademark-number`,`text`),trademark_office:l(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:l(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:l(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:l(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:l(f[`source-ips`],`source-ips`,`text`),ncmec_notification:l(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:l(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:l(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:l(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:l(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]});i(await o(`Creating`,async()=>p.abuseReports.create({body:h,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`})}};function v(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1)`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent to hosts or submitters.`,builder:v,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/emails`,pathParams:{"report-id":String(s[`report-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.abuseReports.emails.list({account_id:u,report_id:s[`report-id`],...c})),{successLabel:`Loaded`})}};function b(e){return e.positional(`report-id`,{type:`string`,description:`Public report code.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1).`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`listSubmitted <report-id>`,describe:`List successful emails sent to the submitter of a report submitted by the account. Does not include emails sent to customers or hosts.`,builder:b,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf abuse-reports emails listSubmitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/submitted/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/emails`,pathParams:{"report-id":String(s[`report-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.abuseReports.emails.listSubmitted({account_id:u,report_id:s[`report-id`],...c})),{successLabel:`Loaded`})}},S={command:`emails`,describe:`Emails operations`,builder:e=>e.command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.positional(`report-param`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <report-param>`,describe:`Retrieve the details of an abuse report.`,builder:C,handler:async s=>{if(s.dryRun){a({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-param`]==null?`<report-param>`:encodeURIComponent(String(s[`report-param`]))}`,pathParams:{"report-param":String(s[`report-param`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.abuseReports.get({account_id:l,report_param:s[`report-param`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`report-id`,{type:`string`,description:`Public report code.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`getSubmitted <report-id>`,describe:`Retrieve a report submitted by the account.`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf abuse-reports getSubmitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/submitted/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}`,pathParams:{"report-id":String(s[`report-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.abuseReports.getSubmitted({account_id:l,report_id:s[`report-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order (id, cdate, domain, type, status)`}).option(`domain`,{type:`string`,description:`Filter by domain name related to the abuse report`}).option(`created-before`,{type:`string`,description:`Returns reports created before the specified date`}).option(`created-after`,{type:`string`,description:`Returns reports created after the specified date`}).option(`status`,{type:`string`,description:`Filter by the status of the report.`,choices:[`accepted`,`in_review`]}).option(`type`,{type:`string`,description:`Filter by the type of the report.`,choices:[`PHISH`,`GEN`,`THREAT`,`DMCA`,`EMER`,`TM`,`REG_WHO`,`NCSEI`,`NETWORK`]}).option(`mitigation-status`,{type:`string`,description:`Filter reports that have any mitigations in the given status.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List the abuse reports for a given account`,builder:f(D),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],sort:s.sort,domain:s.domain,created_before:s[`created-before`],created_after:s[`created-after`],status:s.status,type:s.type,mitigation_status:s[`mitigation-status`]};if(s.dryRun){a({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports`,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.abuseReports.list({account_id:u,...c})),{successLabel:`Loaded`})}};function k(e){return e.option(`page`,{type:`number`,description:`Page of submitted reports to return.`}).option(`per-page`,{type:`number`,description:`Number of submitted reports per page.`}).option(`sort`,{type:`string`,description:`A property and direction to sort by (id, cdate, domain, type, status).`}).option(`id`,{type:`string`,description:`Filter by report code.`}).option(`domain`,{type:`string`,description:`Filter by reported domain. This parameter can be specified multiple times.`}).option(`created-before`,{type:`string`,description:`Return reports submitted before this time.`}).option(`created-after`,{type:`string`,description:`Return reports submitted after this time.`}).option(`status`,{type:`string`,description:`Filter by submitter-facing status. This parameter can be specified multiple times.`}).option(`type`,{type:`string`,description:`Filter by report type. This parameter can be specified multiple times.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`listSubmitted`,describe:`List abuse reports submitted by the account.`,builder:f(k),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],sort:s.sort,id:s.id,domain:s.domain,created_before:s[`created-before`],created_after:s[`created-after`],status:s.status,type:s.type};if(s.dryRun){a({command:`cf abuse-reports listSubmitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/submitted`,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.abuseReports.listSubmitted({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set.`}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`,`custom_expression`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:f(j),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],sort:s.sort,type:s.type,effective_before:s[`effective-before`],effective_after:s[`effective-after`],status:s.status,entity_type:s[`entity-type`]};if(s.dryRun){a({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/mitigations`,pathParams:{"report-id":String(s[`report-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.abuseReports.mitigations.list({account_id:u,report_id:s[`report-id`],...c})),{successLabel:`Loaded`})}};function N(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`data-city`,{type:`string`,description:`The data.city field`}).option(`data-company`,{type:`string`,description:`The data.company field`}).option(`data-counter-notice-response`,{type:`string`,description:`The data.counter_notice_response field`}).option(`data-country`,{type:`string`,description:`The data.country field`}).option(`data-email`,{type:`string`,description:`The data.email field`}).option(`data-full-name`,{type:`string`,description:`The data.full_name field`}).option(`data-jurisdiction-consent`,{type:`boolean`,description:`The data.jurisdiction_consent field`}).option(`data-perjury-attestation`,{type:`boolean`,description:`The data.perjury_attestation field`}).option(`data-phone-number`,{type:`string`,description:`The data.phone_number field`}).option(`data-signature`,{type:`string`,description:`The data.signature field`}).option(`data-state`,{type:`string`,description:`The data.state field`}).option(`data-street-address`,{type:`string`,description:`The data.street_address field`}).option(`data-urls`,{type:`string`,array:!0,description:`The data.urls field`}).option(`data-zip-code`,{type:`string`,description:`The data.zip_code field`}).option(`type`,{type:`string`,description:`The type of appeal being submitted.`,choices:[`counter_notice`,`content_removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Submit an appeal for a report. Provide either a list of mitigations to appeal, or an appeal type with its supporting details, but not both. When type is "counter_notice", the counter-notice details are required.`}).check(e=>{if([`data-city`,`data-company`,`data-counter-notice-response`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].some(t=>e[t]!==void 0)){let t=[`data-city`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --data-* flag is set`)}return!0})}const P={command:`review <report-id>`,describe:`Request a review for mitigations on an account.`,builder:N,handler:async u=>{if(u.dryRun){a({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${u[`report-id`]==null?`<report-id>`:encodeURIComponent(String(u[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(u[`report-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({data:{city:l(u[`data-city`],`data-city`,`text`),company:l(u[`data-company`],`data-company`,`text`),counter_notice_response:l(u[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:l(u[`data-country`],`data-country`,`text`),email:l(u[`data-email`],`data-email`,`text`),full_name:l(u[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:u[`data-jurisdiction-consent`],perjury_attestation:u[`data-perjury-attestation`],phone_number:l(u[`data-phone-number`],`data-phone-number`,`text`),signature:l(u[`data-signature`],`data-signature`,`text`),state:l(u[`data-state`],`data-state`,`text`),street_address:l(u[`data-street-address`],`data-street-address`,`text`),urls:u[`data-urls`],zip_code:l(u[`data-zip-code`],`data-zip-code`,`text`)},type:l(u.type,`type`,`text`)}):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.abuseReports.mitigations.review({body:e,account_id:f,report_id:u[`report-id`]})),{successLabel:`Created`});return}let p=c({data:{city:l(u[`data-city`],`data-city`,`text`),company:l(u[`data-company`],`data-company`,`text`),counter_notice_response:l(u[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:l(u[`data-country`],`data-country`,`text`),email:l(u[`data-email`],`data-email`,`text`),full_name:l(u[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:u[`data-jurisdiction-consent`],perjury_attestation:u[`data-perjury-attestation`],phone_number:l(u[`data-phone-number`],`data-phone-number`,`text`),signature:l(u[`data-signature`],`data-signature`,`text`),state:l(u[`data-state`],`data-state`,`text`),street_address:l(u[`data-street-address`],`data-street-address`,`text`),urls:u[`data-urls`],zip_code:l(u[`data-zip-code`],`data-zip-code`,`text`)},type:l(u.type,`type`,`text`)});i(await o(`Creating`,async()=>d.abuseReports.mitigations.review({body:p,account_id:f,report_id:u[`report-id`]})),{successLabel:`Created`})}},F={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(_).command(w).command(E).command(O).command(A).command(h).command(S).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.option(`target-ids`,{type:`string`,array:!0,description:`List of target IDs to bulk delete`}).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:`delete`,describe:`Removes one or more targets.`,builder:p,handler:async l=>{if(l.dryRun){a({command:`cf access targets bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_delete`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({target_ids:l[`target-ids`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.access.targets.bulk.delete({...e,account_id:d})),{successLabel:`Created`});return}if(l[`target-ids`]===void 0)throw Error(`--target-ids is required (or pass --body with this field set).`);let f=c({target_ids:l[`target-ids`]});i(await o(`Creating`,async()=>u.access.targets.bulk.delete({...f,account_id:d})),{successLabel:`Created`})}};function h(e){return e.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 g={command:`update`,describe:`Adds one or more targets.`,builder:h,handler:async c=>{if(c.dryRun){a({command:`cf access targets bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Updating`,async()=>l.access.targets.bulk.update({body:e,account_id:u})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},_={command:`bulk`,describe:`Operations for targets.bulk`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
|
|
3
3
|
length of 255 characters, supports the use of special characters dash
|
|
4
4
|
and period, does not support spaces, and must start and end with an
|
|
5
5
|
alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Creates a new infrastructure access target in the account.`,builder:v,handler:async d=>{if(d.dryRun){a({command:`cf access targets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({hostname:l(d.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:l(d[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:l(d[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:l(d[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:l(d[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`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.access.targets.create({...e,account_id:p})),{successLabel:`Created`});return}d.hostname===void 0&&(d.hostname=await u(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let m=c({hostname:l(d.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:l(d[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:l(d[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:l(d[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:l(d[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}});i(await o(`Creating`,async()=>f.access.targets.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <target-id>`,describe:`Removes a single infrastructure access target by its ID.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf access targets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/${s[`target-id`]==null?`<target-id>`:encodeURIComponent(String(s[`target-id`]))}`,pathParams:{"target-id":String(s[`target-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.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u}from"./prompt-DdegNPpg.mjs";function d(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).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 f={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:d,handler:async e=>{if(e.dryRun){a({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)}):s(e.body)});return}let t=await r(e);if(e.body){let n=s(e.body);i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await u(`destination-organization-id`,`Move accounts to this organization ID.`));let n=c({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`})}},p={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const h={command:`move`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:m,handler:async d=>{if(d.dryRun){a({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({destination_organization_id:l(d[`destination-organization-id`],`destination-organization-id`,`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.account.move({...e,account_id:p})),{successLabel:`Created`});return}d[`destination-organization-id`]===void 0&&(d[`destination-organization-id`]=await u(`destination-organization-id`,`The destination_organization_id field`));let m=c({destination_organization_id:l(d[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>f.account.move({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.account.organization.list({account_id:l})),{successLabel:`Loaded`})}},v={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/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.account.profile.get({account_id:l})),{successLabel:`Loaded`})}};function x(e){return e.option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 S={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:x,handler:async d=>{if(d.dryRun){a({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({business_address:l(d[`business-address`],`business-address`,`text`),business_email:l(d[`business-email`],`business-email`,`text`),business_name:l(d[`business-name`],`business-name`,`text`),business_phone:l(d[`business-phone`],`business-phone`,`text`),external_metadata:l(d[`external-metadata`],`external-metadata`,`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.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}d[`business-address`]===void 0&&(d[`business-address`]=await u(`business-address`,`The business_address field`)),d[`business-email`]===void 0&&(d[`business-email`]=await u(`business-email`,`The business_email field`)),d[`business-name`]===void 0&&(d[`business-name`]=await u(`business-name`,`The business_name field`)),d[`business-phone`]===void 0&&(d[`business-phone`]=await u(`business-phone`,`The business_phone field`)),d[`external-metadata`]===void 0&&(d[`external-metadata`]=await u(`external-metadata`,`The external_metadata field`));let m=c({business_address:l(d[`business-address`],`business-address`,`text`),business_email:l(d[`business-email`],`business-email`,`text`),business_name:l(d[`business-name`],`business-name`,`text`),business_phone:l(d[`business-phone`],`business-phone`,`text`),external_metadata:l(d[`external-metadata`],`external-metadata`,`text`)});i(await o(`Updating`,async()=>f.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})}},C={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`account`,describe:`account`,builder:e=>e.command(h).command(p).command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,r as u,t as d}from"./body-parser-C-c9gfH1.mjs";import{n as f}from"./input-validation-Bav2M9F-.mjs";import{a as p,i as m,n as h}from"./prompt-DdegNPpg.mjs";import{t as g}from"./cli-types-BsTty22w.mjs";function _(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
|
|
3
|
+
verify the current resource ETag matches before applying the write. Returns
|
|
4
|
+
412 Precondition Failed if the resource has been modified since the ETag was
|
|
5
|
+
obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`)}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).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}).option(`body`,{type:`string`,description:`Request body schema for deleting tags from account-level resources. Use /zones/{zone_id}/tags for zone-level resources.`})}const v={command:`delete`,describe:`Removes all tags from a specific account or zone-level resource.`,builder:_,handler:async g=>{let _={};if(g[`if-match`]!==void 0&&(_[`If-Match`]=String(g[`if-match`])),g.dryRun){let e=g.zone===void 0?await n():void 0,t=g.zone===void 0?`accounts`:`zones`,r=g.zone??e??`<account-id>`;s({command:`cf account-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:g.body===void 0?d({resource_id:f(g[`resource-id`],`resource-id`,`text`),resource_type:f(g[`resource-type`],`resource-type`,`text`),worker_id:f(g[`worker-id`],`worker-id`,`text`)}):l(g.body)});return}let v=await a(g),y=g.zone===void 0?`accounts`:`zones`,b=y===`zones`?await r({zone:g.zone},v,{quiet:g.quiet}):g.local?e:await t();if(y===`zones`?g.zoneId=b:g.accountId=b,!await h({force:!!g.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}if(g.body){let e=l(g.body);o(await c(`Deleting`,async()=>i(v,`DELETE`,`/${y}/${b}/tags`,{body:e,headers:Object.keys(_).length>0?_:void 0})),{successLabel:`Deleted`});return}g[`resource-id`]===void 0&&(g[`resource-id`]=await p(`resource-id`,`Identifies the unique resource.`)),g[`resource-type`]===void 0&&(g[`resource-type`]=await m(`resource-type`,`Enum for worker_version resource type.`,`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`))),g[`resource-type`]===`worker_version`&&g[`worker-id`]===void 0&&(g[`worker-id`]=await p(`worker-id`,`Worker ID is required only for worker_version resources`,{question:`Enter value for --worker-id`}));let x={};g[`resource-id`]!==void 0&&u(x,[`resource_id`],f(g[`resource-id`],`resource-id`,`text`)),g[`resource-type`]!==void 0&&u(x,[`resource_type`],f(g[`resource-type`],`resource-type`,`text`)),g[`worker-id`]!==void 0&&u(x,[`worker_id`],f(g[`worker-id`],`worker-id`,`text`)),o(await c(`Deleting`,async()=>i(v,`DELETE`,`/${y}/${b}/tags`,{body:Object.keys(x).length>0?x:void 0,headers:Object.keys(_).length>0?_:void 0})),{successLabel:`Deleted`})}};function y(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:`access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker.worker_version`.split(`.`),demandOption:!0}).option(`worker-id`,{type:`string`,description:`Worker identifier. Required for worker_version resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves tags for a specific account or zone-level resource.`,builder:g(y),handler:async i=>{let l={resource_id:i[`resource-id`],resource_type:i[`resource-type`],worker_id:i[`worker-id`]};if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf account-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.accountTags.get({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}};function x(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
|
|
7
|
+
verify the current resource ETag matches before applying the write. Returns
|
|
8
|
+
412 Precondition Failed if the resource has been modified since the ETag was
|
|
9
|
+
obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`)}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on account-level resources.`})}const S={command:`update`,describe:`Creates or updates tags for a specific account or zone-level resource.`,builder:x,handler:async h=>{let g={};if(h[`if-match`]!==void 0&&(g[`If-Match`]=String(h[`if-match`])),h.dryRun){let e=h.zone===void 0?await n():void 0,t=h.zone===void 0?`accounts`:`zones`,r=h.zone??e??`<account-id>`;s({command:`cf account-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:h.body===void 0?d({resource_id:f(h[`resource-id`],`resource-id`,`text`),resource_type:f(h[`resource-type`],`resource-type`,`text`),worker_id:f(h[`worker-id`],`worker-id`,`text`)}):l(h.body)});return}let _=await a(h),v=h.zone===void 0?`accounts`:`zones`,y=v===`zones`?await r({zone:h.zone},_,{quiet:h.quiet}):h.local?e:await t();if(v===`zones`?h.zoneId=y:h.accountId=y,h.body){let e=l(h.body);o(await c(`Updating`,async()=>i(_,`PUT`,`/${v}/${y}/tags`,{body:e,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`});return}h[`resource-id`]===void 0&&(h[`resource-id`]=await p(`resource-id`,`Identifies the unique resource.`)),h[`resource-type`]===void 0&&(h[`resource-type`]=await m(`resource-type`,`Enum for worker_version resource type.`,`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`))),h[`resource-type`]===`worker_version`&&h[`worker-id`]===void 0&&(h[`worker-id`]=await p(`worker-id`,`Worker ID is required only for worker_version resources`,{question:`Enter value for --worker-id`}));let b={};h[`resource-id`]!==void 0&&u(b,[`resource_id`],f(h[`resource-id`],`resource-id`,`text`)),h[`resource-type`]!==void 0&&u(b,[`resource_type`],f(h[`resource-type`],`resource-type`,`text`)),h[`worker-id`]!==void 0&&u(b,[`worker_id`],f(h[`worker-id`],`worker-id`,`text`)),o(await c(`Updating`,async()=>i(_,`PUT`,`/${v}/${y}/tags`,{body:Object.keys(b).length>0?b:void 0,headers:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`})}},C={command:`account-tags`,describe:`account-tags`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{C as default};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d}from"./input-validation-Bav2M9F-.mjs";import{a as f,n as p}from"./prompt-DdegNPpg.mjs";import{t as m}from"./cli-types-BsTty22w.mjs";import{n as h,t as ee}from"./raw-fetch-CteyTOM2.mjs";function te(e){return e.option(`category-id`,{type:`number`,description:`Returns the category ID.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Returns the human readable ID.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`name`,{type:`string`,description:`Returns the application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).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 g={command:`create`,describe:`Create a custom application for an account.`,builder:te,handler:async r=>{if(r.dryRun){s({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({category_id:r[`category-id`],hostnames:r.hostnames,human_id:d(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:d(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.applications.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);r[`human-id`]===void 0&&(r[`human-id`]=await f(`human-id`,`Returns the human readable ID.`)),r.name===void 0&&(r.name=await f(`name`,`Returns the application name.`));let m=u({category_id:r[`category-id`],hostnames:r.hostnames,human_id:d(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:d(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Creating`,async()=>i.accounts.applications.create({...m,account_id:p})),{successLabel:`Created`})}};function _(e){return e.positional(`id`,{type:`string`,description:`Application 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 v={command:`delete <id>`,describe:`Delete a custom application and all of its versions. Deletion is rejected when other resources reference the application.`,builder:_,handler:async r=>{if(r.dryRun){s({command:`cf accounts applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.applications.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})}};function y(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
|
|
4
|
+
- name: Filter by application name (e.g., name:HR)
|
|
5
|
+
- id: Filter by application ID (e.g., id:498)
|
|
6
|
+
- human_id: Filter by human-readable ID (e.g., human_id:HR)
|
|
7
|
+
- hostname: Filter by hostname or support domain (e.g., hostname:portal.example.com)
|
|
8
|
+
- source: Filter by application source name (e.g., source:cloudflare)
|
|
9
|
+
- ip_subnet: Filter by IP subnet using CIDR containment — returns applications where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32 matches apps with 10.0.0.0/16)
|
|
10
|
+
- category_id: Filter by category ID (e.g., category_id:12).
|
|
11
|
+
- category_name: Filter by category name (e.g., category_name:HR).
|
|
12
|
+
- supported: Filter by supported Cloudflare product (e.g., supported:ACCESS). Values: GATEWAY, ACCESS, CASB.
|
|
13
|
+
- review_status: Filter by the account's Gateway review status. Values: approved, unapproved, in_review, unreviewed.
|
|
14
|
+
.`}).option(`limit`,{type:`number`,description:`Limit of number of results to return (max 250).`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`order-by`,{type:`string`,description:`Order results using field:direction format. Supported fields are name, id, human_id,
|
|
15
|
+
category_id, application_type, application_confidence_score, and gen_ai_score.
|
|
16
|
+
Supported directions are asc and desc. Ignored when search is provided; results are
|
|
17
|
+
ranked by relevance instead.`}).option(`search`,{type:`string`,description:`Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters.`}).option(`fields`,{type:`string`,description:"Return only the listed properties on each application, as a comma-separated list.\nUse this to keep responses small when you only need part of each application — for\nexample populating a picker with `fields=id,name` instead of downloading every\nhostname and IP subnet.\n\nOmit this parameter to receive the full application object.\n\n`id` is always returned.\n\nSelectable properties: `id`, `name`, `human_id`, `version`, `hostnames`,\n`support_domains`, `ip_subnets`, `port_protocols`, `supported`, `gen_ai_score`,\n`application_confidence_score`, `created_at`, `updated_at`, `review_status`.\n\nUnknown or empty property names return `400`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`applications`,describe:"List the applications available to an account, both the applications Cloudflare curates and the custom applications the account has defined. Results are paginated. Use `filter` and `search` to narrow the list, `order_by` to sort it, and `fields` to reduce each result to only the properties you need. The authenticated principal must have access to the account identified by `account_id`.",builder:y,handler:async r=>{let i={filter:r.filter,limit:r.limit,offset:r.offset,order_by:r[`order-by`],search:r.search,fields:r.fields};if(r.dryRun){s({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.applications.get.applications({account_id:u,...i})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`id <id>`,describe:`Get application by ID.`,builder:x,handler:async r=>{if(r.dryRun){s({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.applications.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},C={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates the network matchers for the application. Omitted matcher lists are left unchanged; send an empty array to clear a list.`})}const E={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:T,handler:async r=>{if(r.dryRun){s({command:`cf accounts applications update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.applications.update({...e,account_id:d,id:r.id})),{successLabel:`Updated`});return}let f=u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Updating`,async()=>i.accounts.applications.update({...f,account_id:d,id:r.id})),{successLabel:`Updated`})}},D={command:`applications`,describe:`Applications operations`,builder:e=>e.command(g).command(v).command(E).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`createSetupIntent`,describe:`Creates a Stripe setup intent for adding a payment method to an account. Returns a client secret for frontend payment method collection.`,builder:O,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing createSetupIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/client-secret`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.createSetupIntent({account_id:l})),{successLabel:`Created`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:A,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing getBadDebt`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/bad-debt`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getBadDebt({account_id:l})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:M,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing getCredits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/credits`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getCredits({account_id:l})),{successLabel:`Loaded`})}};function P(e){return e.positional(`receipt-id`,{type:`string`,description:`Receipt identifier.`,demandOption:!0}).option(`doctype`,{type:`string`,description:`The document type to generate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const F={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:P,handler:async r=>{let i={doctype:r.doctype};if(r.dryRun){s({command:`cf accounts billing getReceiptPdf`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/receipts/${r[`receipt-id`]==null?`<receipt-id>`:encodeURIComponent(String(r[`receipt-id`]))}/pdf`,pathParams:{"receipt-id":String(r[`receipt-id`]??``)},query:i,bodyKind:`none`});return}await a(r);let o=r.local?e:await t();r.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await c(`Loading`,async()=>ee(`/accounts/${o}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));h(r.text===!0?u.toString(`utf-8`):u)}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:I,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing getUnpaidInvoices`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/unpaid-invoice`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getUnpaidInvoices({account_id:l})),{successLabel:`Loaded`})}};function R(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`status`,{type:`string`,description:`Filter billing history by status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Gets the billing history for an account.`,builder:R,handler:async r=>{let i={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){s({command:`cf accounts billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/history`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.history.list({account_id:u,...i})),{successLabel:`Loaded`})}},B={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).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 H={command:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:V,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payBadDebt`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-bad-debt`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...e,account_id:f})),{successLabel:`Created`});return}let p=u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...p,account_id:f})),{successLabel:`Created`})}};function U(e){return e.option(`invoice-id`,{type:`string`,description:`The identifier of the invoice to pay.`}).option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`validate-payment-method`,{type:`boolean`,description:`Whether to validate the payment method before processing.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`payInvoice`,describe:`Pays an outstanding invoice for an account. Returns a Stripe client secret when Strong Customer Authentication (SCA) is required to complete the payment.`,builder:U,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payInvoice`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-invoice`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...e,account_id:f})),{successLabel:`Created`});return}let p=u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...p,account_id:f})),{successLabel:`Created`})}};function G(e){return e.option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing 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 K={command:`create`,describe:`Creates a new payment method for an account.`,builder:G,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:p,account_id:f})),{successLabel:`Created`})}};function q(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:q,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
18
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.billing.paymentMethods.delete({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Deleted`})}};function Y(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <payment-method-id>`,describe:`Gets a specific payment method for an account.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.paymentMethods.get({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Lists all payment methods for an account.`,builder:Z,handler:async r=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf accounts billing payment-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.paymentMethods.list({account_id:u,...i})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`setDefault <payment-method-id>`,describe:`Sets a payment method as the default for an account.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods setDefault`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}/set-as-default`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.setDefault({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Created`})}};function ie(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing 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 ae={command:`update <payment-method-id>`,describe:`Updates a payment method for an account.`,builder:ie,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:e,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:p,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`})}},oe={command:`payment-methods`,describe:`Operations for billing.payment-methods`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`toggle`,{type:`boolean`,description:`Whether to enable or disable PDF invoice generation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`togglePdfInvoices`,describe:`Toggles PDF invoice generation for an account.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing togglePdfInvoices`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/invoices`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({toggle:r.toggle}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...e,account_id:d})),{successLabel:`Updated`});return}let f=u({toggle:r.toggle});o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...f,account_id:d})),{successLabel:`Updated`})}},le={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(H).command(W).command(ce).command(B).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`id <id>`,describe:`Get application category by ID.`,builder:ue,handler:async r=>{if(r.dryRun){s({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.categories.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},fe={command:`by`,describe:`Operations for categories.get.by`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`categories`,describe:`List application categories.`,builder:pe,handler:async r=>{let i={limit:r.limit,offset:r.offset};if(r.dryRun){s({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.categories.get.categories({account_id:u,...i})),{successLabel:`Loaded`})}},he={command:`get`,describe:`Operations for categories.get`,builder:e=>e.command(me).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`categories`,describe:`Categories operations`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`name`,{type:`string`,description:`Account name`}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const ve={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:_e,handler:async e=>{if(e.dryRun){s({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}}):l(e.body)});return}let t=await a(e);if(e.body){let n=l(e.body);o(await c(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,`Account name`));let n=u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}});o(await c(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`})}};function ye(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 be={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:ye,handler:async r=>{if(r.dryRun){s({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
19
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.delete({account_id:l})),{successLabel:`Deleted`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:xe,handler:async r=>{if(r.dryRun){s({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.get({account_id:l})),{successLabel:`Loaded`})}};function Ce(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:m(Ce),handler:async e=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){s({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function Te(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.",builder:m(Te),handler:async r=>{let i={action_time:r[`action-time`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){s({command:`cf accounts logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/history`,pathParams:{id:String(r.id??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.logs.audit.history({account_id:u,id:r.id,...i})),{successLabel:`Loaded`})}};function De(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:"Filters by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`product-category`,{type:`string`,description:`Filters audit logs by one or more predefined product categories. Each product category expands into a curated set of resource_product values and is unioned with any explicit resource_product filter. Matched case-insensitively; unknown product categories return 400. Repeatable. Use the audit log product categories endpoint to discover the available values.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:"Filters out audit logs by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:m(De),handler:async r=>{let i={account_name:r[`account-name`],action_result:r[`action-result`],action_type:r[`action-type`],actor_context:r[`actor-context`],actor_email:r[`actor-email`],actor_id:r[`actor-id`],actor_ip_address:r[`actor-ip-address`],actor_token_id:r[`actor-token-id`],actor_token_name:r[`actor-token-name`],actor_type:r[`actor-type`],audit_log_id:r[`audit-log-id`],id:r.id,raw_cf_ray_id:r[`raw-cf-ray-id`],raw_method:r[`raw-method`],raw_status_code:r[`raw-status-code`],raw_uri:r[`raw-uri`],resource_id:r[`resource-id`],resource_product:r[`resource-product`],resource_type:r[`resource-type`],resource_scope:r[`resource-scope`],product_category:r[`product-category`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],"account_name.not":r[`account-name-not`],"action_result.not":r[`action-result-not`],"action_type.not":r[`action-type-not`],"actor_context.not":r[`actor-context-not`],"actor_email.not":r[`actor-email-not`],"actor_id.not":r[`actor-id-not`],"actor_ip_address.not":r[`actor-ip-address-not`],"actor_token_id.not":r[`actor-token-id-not`],"actor_token_name.not":r[`actor-token-name-not`],"actor_type.not":r[`actor-type-not`],"audit_log_id.not":r[`audit-log-id-not`],"id.not":r[`id-not`],"raw_cf_ray_id.not":r[`raw-cf-ray-id-not`],"raw_method.not":r[`raw-method-not`],"raw_status_code.not":r[`raw-status-code-not`],"raw_uri.not":r[`raw-uri-not`],"resource_id.not":r[`resource-id-not`],"resource_product.not":r[`resource-product-not`],"resource_type.not":r[`resource-type-not`],"resource_scope.not":r[`resource-scope-not`],"zone_id.not":r[`zone-id-not`],"zone_name.not":r[`zone-name-not`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){s({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.logs.audit.list({account_id:u,...i})),{successLabel:`Loaded`})}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`product-categories`,describe:`Lists the available audit log product categories and the resource products each one expands to. Use these values with the product_category filter on the account audit logs endpoint.`,builder:ke,handler:async r=>{if(r.dryRun){s({command:`cf accounts logs audit product-categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/product_categories`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.logs.audit.productCategories({account_id:l})),{successLabel:`Loaded`})}},je={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(Ee).command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Me={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
|
|
20
|
+
Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
|
|
21
|
+
`,choices:[`accepted`,`pending`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`create`,describe:`Add a user to the list of members for this account.`,builder:Ne,handler:async r=>{if(r.dryRun){s({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({email:d(r.email,`email`,`text`),roles:r.roles,status:d(r.status,`status`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.members.create({body:e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await f(`email`,`The contact email address of the user.`));let m=u({email:d(r.email,`email`,`text`),roles:r.roles,status:d(r.status,`status`,`text`)});o(await c(`Creating`,async()=>i.accounts.members.create({body:m,account_id:p})),{successLabel:`Created`})}};function Fe(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ie={command:`delete <member-id>`,describe:`Remove a member from an account.`,builder:Fe,handler:async r=>{if(r.dryRun){s({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure you want to remove this user from the account?`})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.members.delete({account_id:l,member_id:r[`member-id`]})),{successLabel:`Deleted`})}};function Le(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:Le,handler:async r=>{if(r.dryRun){s({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.members.get({account_id:l,member_id:r[`member-id`]})),{successLabel:`Loaded`})}};function ze(e){return e.option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`user.first_name`,`user.last_name`,`user.email`,`status`]}).option(`status`,{type:`string`,description:`A member's status in the account.`,choices:[`accepted`,`pending`,`rejected`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`list`,describe:`List all members of an account.`,builder:m(ze),handler:async r=>{let i={order:r.order,status:r.status,page:r.page,per_page:r[`per-page`],direction:r.direction};if(r.dryRun){s({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.members.list({account_id:u,...i})),{successLabel:`Loaded`})}};function Ve(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const He={command:`update <member-id>`,describe:`Modify an account member.`,builder:Ve,handler:async r=>{if(r.dryRun){s({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:l(r.body)});return}let u=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>u.accounts.members.update({body:e,account_id:d,member_id:r[`member-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i(u,`PUT`,`/accounts/${d}/members/${encodeURIComponent(String(r[`member-id`]))}`)),{successLabel:`Updated`})}},Ue={command:`members`,describe:`Operations for members`,builder:e=>e.command(Pe).command(Ie).command(Re).command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.option(`subscription-ids`,{type:`string`,array:!0,description:`List of subscription identifiers to cancel downgrades for.`}).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 Ge={command:`cancelDelayedDowngrade`,describe:`Cancels pending delayed downgrades for the specified subscriptions.`,builder:We,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions cancelDelayedDowngrade`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/cancel-downgrade`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({subscription_ids:r[`subscription-ids`]}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.subscriptions.cancelDelayedDowngrade({...e,account_id:d})),{successLabel:`Created`});return}let f=u({subscription_ids:r[`subscription-ids`]});o(await c(`Creating`,async()=>i.accounts.subscriptions.cancelDelayedDowngrade({...f,account_id:d})),{successLabel:`Created`})}};function Ke(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 qe={command:`create`,describe:`Creates an account or zone subscription.`,builder:Ke,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?u({app:{install_id:d(i[`app-install-id`],`app-install-id`,`text`)},frequency:d(i.frequency,`frequency`,`text`),rate_plan:{currency:d(i[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:i[`rate-plan-externally-managed`],id:d(i[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:i[`rate-plan-is-contract`],public_name:d(i[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(i[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:i[`rate-plan-sets`]}}):l(i.body)});return}let f=await a(i),p=i.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:i.zone},f,{quiet:i.quiet}):i.local?e:await t();if(p===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=l(i.body);o(await c(`Creating`,async()=>f.accounts.subscriptions.create({body:e,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`});return}let h=u({app:{install_id:d(i[`app-install-id`],`app-install-id`,`text`)},frequency:d(i.frequency,`frequency`,`text`),rate_plan:{currency:d(i[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:i[`rate-plan-externally-managed`],id:d(i[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:i[`rate-plan-is-contract`],public_name:d(i[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(i[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:i[`rate-plan-sets`]}});o(await c(`Creating`,async()=>f.accounts.subscriptions.create({body:h,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`})}};function Je(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`other`,{type:`string`,description:`Additional cancellation details.`}).option(`reason-code`,{type:`string`,array:!0,description:`The cancellation reason codes.`}).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 Ye={command:`createCancelReason <subscription-identifier>`,describe:`Records a cancellation reason for an account subscription.`,builder:Je,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions createCancelReason`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.subscriptions.createCancelReason({...e,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`});return}let p=u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]});o(await c(`Creating`,async()=>i.accounts.subscriptions.createCancelReason({...p,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`})}};function Xe(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ze={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:Xe,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
23
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.subscriptions.delete({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Deleted`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`get`,describe:`Lists all of an account or zone's subscriptions.`,builder:Qe,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.accounts.subscriptions.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function et(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`getByIdentifier <subscription-identifier>`,describe:`Gets an account subscription by identifier.`,builder:et,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions getByIdentifier`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.subscriptions.getByIdentifier({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function nt(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`getCancelReason <subscription-identifier>`,describe:`Gets the cancellation reason for an account subscription.`,builder:nt,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions getCancelReason`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.subscriptions.getCancelReason({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function it(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const at={command:`update <subscription-identifier>`,describe:`Updates an account subscription.`,builder:it,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.subscriptions.update({body:e,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`});return}let p=u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}});o(await c(`Updating`,async()=>i.accounts.subscriptions.update({body:p,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`})}},ot={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(Ge).command(qe).command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).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 ct={command:`create`,describe:`Create a new Account Owned API token.`,builder:st,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.tokens.create({body:e,account_id:p})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await f(`name`,`Token name.`));let m=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`)});o(await c(`Creating`,async()=>i.accounts.tokens.create({body:m,account_id:p})),{successLabel:`Created`})}};function lt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ut={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:lt,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.tokens.delete({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})}};function dt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`get <token-id>`,describe:`Get information about a specific Account Owned API token.`,builder:dt,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.tokens.get({account_id:l,token_id:r[`token-id`]})),{successLabel:`Loaded`})}};function $(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(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`include-expired`,{type:`boolean`,description:`When true, includes recently-expired tokens in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pt={command:`list`,describe:`List all Account Owned API tokens created for this account. Results include active, disabled, and recently-expired tokens when include_expired is set to true.`,builder:m($),handler:async r=>{let i={page:r.page,per_page:r[`per-page`],direction:r.direction,include_expired:r[`include-expired`]};if(r.dryRun){s({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.tokens.list({account_id:u,...i})),{successLabel:`Loaded`})}};function mt(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
|
|
25
|
+
The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
|
|
26
|
+
The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:mt,handler:async r=>{let i={name:r.name,scope:r.scope};if(r.dryRun){s({command:`cf accounts tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.tokens.permissionGroups.list({account_id:u,...i})),{successLabel:`Loaded`})}},gt={command:`permission-groups`,describe:`Operations for tokens.permission-groups`,builder:e=>e.command(ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _t(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vt={command:`roll <token-id>`,describe:`Roll the Account Owned API token secret.`,builder:_t,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens roll`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}/value`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Rolling this token will invalidate the current secret and generate a new one. Any integrations using the current secret will stop working.`})){process.stderr.write(`Aborted.
|
|
27
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.tokens.roll({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})}};function yt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`status`,{type:`string`,description:`Status of the token.`,choices:[`active`,`disabled`,`expired`]}).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 bt={command:`update <token-id>`,describe:`Update an existing token.`,builder:yt,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),status:d(r.status,`status`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.tokens.update({body:e,account_id:p,token_id:r[`token-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await f(`name`,`Token name.`));let m=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),status:d(r.status,`status`,`text`)});o(await c(`Updating`,async()=>i.accounts.tokens.update({body:m,account_id:p,token_id:r[`token-id`]})),{successLabel:`Updated`})}};function xt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`verify`,describe:`Test whether a token works.`,builder:xt,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/verify`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.tokens.verify({account_id:l})),{successLabel:`Loaded`})}},Ct={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ct).command(ut).command(ft).command(pt).command(vt).command(bt).command(St).command(gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wt(e){return e.option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
|
|
28
|
+
Two-Factor Authentication 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 Tt={command:`update`,describe:`Update an existing account.`,builder:wt,handler:async r=>{if(r.dryRun){s({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({id:d(r.id,`id`,`text`),name:d(r.name,`name`,`text`),settings:{abuse_contact_email:d(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.update({body:e,account_id:p})),{successLabel:`Updated`});return}r.id===void 0&&(r.id=await f(`id`,`Identifier`)),r.name===void 0&&(r.name=await f(`name`,`Account name`));let m=u({id:d(r.id,`id`,`text`),name:d(r.name,`name`,`text`),settings:{abuse_contact_email:d(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}});o(await c(`Updating`,async()=>i.accounts.update({body:m,account_id:p})),{successLabel:`Updated`})}},Et={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(ve).command(be).command(Se).command(we).command(Tt).command(D).command(le).command(ge).command(Me).command(Ue).command(ot).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Et as default};
|