cf 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CzDAjFpo.mjs} +1 -1
- package/dist/{access-RbqBFrSC.mjs → access-CxyW_sIW.mjs} +1 -1
- package/dist/{account-D7xvYqDx.mjs → account-Dd4-tDYJ.mjs} +1 -1
- package/dist/{account-tags-CKRh1jra.mjs → account-tags-65fAlHrf.mjs} +1 -1
- package/dist/{accounts-2pGhN4s8.mjs → accounts-Bp5KGc6r.mjs} +1 -1
- package/dist/{acm-Szq4CoQN.mjs → acm-CHacxa3s.mjs} +1 -1
- package/dist/{addressing-CgTTbuCF.mjs → addressing-BnqNmmYN.mjs} +1 -1
- package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-D--BQS0W.mjs} +1 -1
- package/dist/{ai-Cn0BniR4.mjs → ai-BnVlQDiI.mjs} +1 -1
- package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-CfpDKXkD.mjs} +1 -1
- package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-oG4j_oYN.mjs} +1 -1
- package/dist/{ai-search-2xP8FP_W.mjs → ai-search-B2l3B_jn.mjs} +1 -1
- package/dist/{ai-security-AUfzagSE.mjs → ai-security-byjIIrfl.mjs} +1 -1
- package/dist/{alerting-DbXVpGv3.mjs → alerting-qa8SkXlD.mjs} +1 -1
- package/dist/{analytics-UQrIx99t.mjs → analytics-DeIKjC9n.mjs} +1 -1
- package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-BnECMIWJ.mjs} +1 -1
- package/dist/{api-security-pSJdgmtK.mjs → api-security-MfHbfZyf.mjs} +1 -1
- package/dist/{argo-Br60zF3y.mjs → argo-DFerMyXF.mjs} +1 -1
- package/dist/{artifacts-D8HMRQmb.mjs → artifacts-CtyEYYDa.mjs} +1 -1
- package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-retFtvow.mjs} +1 -1
- package/dist/{auth-C6MhC9EZ.mjs → auth-DuLchM18.mjs} +2 -2
- package/dist/{auth-MeSu8lFz.mjs → auth-aazs91XL.mjs} +1 -1
- package/dist/{billing-0RNCYBJM.mjs → billing-CxQVqpGZ.mjs} +1 -1
- package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Rli7v7tg.mjs} +1 -1
- package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-Cw6XSEf8.mjs} +1 -1
- package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CTvnHGfV.mjs} +1 -1
- package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-q79xHrVW.mjs} +1 -1
- package/dist/{browser-run-C5pYOwtf.mjs → browser-run-FwtwnBzA.mjs} +1 -1
- package/dist/{build-Nivzj54_.mjs → build-Dji9BYmV.mjs} +1 -1
- package/dist/{cache-BgRIDcFJ.mjs → cache-Cl7vKJwH.mjs} +1 -1
- package/dist/{calls-JrRne0U0.mjs → calls-DtK_ANxq.mjs} +1 -1
- package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-DZP1RzAs.mjs} +1 -1
- package/dist/{cf-BUKsENG5.mjs → cf-oSz9pud_.mjs} +1 -1
- package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-BtPU9GsQ.mjs} +1 -1
- package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-DAn-3jwp.mjs} +1 -1
- package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-BpVcvhjZ.mjs} +1 -1
- package/dist/{cloudforce-one-Cp4bQmrG.mjs → cloudforce-one-2PecncfX.mjs} +1 -1
- package/dist/{connector-interrupts-BR47snkh.mjs → connector-interrupts-ollUcksZ.mjs} +1 -1
- package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-D5_3X7XW.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CJ9gLRFR.mjs} +1 -1
- package/dist/{connectors-BRCQSsos.mjs → connectors-Bo6ZT8PT.mjs} +1 -1
- package/dist/{containers-CfKOM_f5.mjs → containers-Bog7j0Hw.mjs} +1 -1
- package/dist/{content-scan-CB4xHGv1.mjs → content-scan-D03UfK2X.mjs} +1 -1
- package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DgS-7ADh.mjs} +1 -1
- package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-8AKtNnUg.mjs} +1 -1
- package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-4y35UC1X.mjs} +1 -1
- package/dist/{custom-csrs-D0zBkQT5.mjs → custom-csrs-DwBrLh-H.mjs} +1 -1
- package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-CDIAnsRa.mjs} +1 -1
- package/dist/{custom-nameservers-G2MWpRwY.mjs → custom-nameservers-stk7ymnP.mjs} +1 -1
- package/dist/{custom-pages-BINNZTds.mjs → custom-pages-vfDxrXbt.mjs} +1 -1
- package/dist/{d1-FmAh7T7l.mjs → d1-Cllm-iTT.mjs} +1 -1
- package/dist/{data-security-2fmzF_Me.mjs → data-security-rnoSCEdL.mjs} +1 -1
- package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-DCRCOL6l.mjs} +1 -1
- package/dist/{deploy-BzFbjH6a.mjs → deploy-DGlmjPTS.mjs} +1 -1
- package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-DhCo1I0I.mjs} +1 -1
- package/dist/{dev-CWaf-qW4.mjs → dev-BbLV0Ti-.mjs} +1 -1
- package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-D5Yo2xqx.mjs} +1 -1
- package/dist/{directory-CGNWfVQc.mjs → directory-CCndFkbQ.mjs} +1 -1
- package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-C48JQ9EA.mjs} +1 -1
- package/dist/{dls-CobKlH4N.mjs → dls-BBq99pjI.mjs} +1 -1
- package/dist/{dns-OfJXNYkK.mjs → dns-DdQYtenF.mjs} +1 -1
- package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-DdwVtm12.mjs} +1 -1
- package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-BvxXBht_.mjs} +1 -1
- package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DFvXKSkg.mjs} +1 -1
- package/dist/{email-routing-CRvIUSFm.mjs → email-routing-QBRPBlyl.mjs} +1 -1
- package/dist/{email-security-D-P8ln2L.mjs → email-security-BFagcRPP.mjs} +1 -1
- package/dist/{email-sending-BwRN8PMW.mjs → email-sending-Ddhe7xjN.mjs} +1 -1
- package/dist/{filters-DczM8qpH.mjs → filters-CGisPGD1.mjs} +1 -1
- package/dist/{firewall-BMiETRmM.mjs → firewall-DD8U-Brd.mjs} +1 -1
- package/dist/{flagship-CPkQMist.mjs → flagship-FJHc4mFi.mjs} +1 -1
- package/dist/{fraud-BhX0QNUl.mjs → fraud-AH47n-wL.mjs} +1 -1
- package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-149kbuG_.mjs} +1 -1
- package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-DfEUG007.mjs} +1 -1
- package/dist/{hostnames-CGAFkYT1.mjs → hostnames-DQUiD3Vr.mjs} +1 -1
- package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-RyQboMWI.mjs} +1 -1
- package/dist/{iam-Su_hpatD.mjs → iam-BhHYhMXO.mjs} +1 -1
- package/dist/{images-D2ZflvBi.mjs → images-CDViyKtZ.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DPGzVovJ.mjs → intel-YHZbPlS3.mjs} +1 -1
- package/dist/{interactive-CM2G03lr.mjs → interactive-mV8PABm6.mjs} +1 -1
- package/dist/{ips-C5-NH1b0.mjs → ips-BpCdldFx.mjs} +1 -1
- package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-oNu5jWKF.mjs} +1 -1
- package/dist/{keys-B0FBtlOD.mjs → keys-yYtv7Ztr.mjs} +1 -1
- package/dist/{kv-BbZ9st5o.mjs → kv-Bi9B4E0A.mjs} +1 -1
- package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DKRjBLcr.mjs} +1 -1
- package/dist/{load-balancers-Ct5cyyF9.mjs → load-balancers-jRCN75mX.mjs} +1 -1
- package/dist/{local-eEF0NF51.mjs → local-DTyuGwTw.mjs} +1 -1
- package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-IAXhEugU.mjs} +1 -1
- package/dist/{logexplorer-BhsAWxCr.mjs → logexplorer-kO8CULiK.mjs} +1 -1
- package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-LyDAYPbI.mjs} +1 -1
- package/dist/{logos-DS0krPAz.mjs → logos-O9f5bGSB.mjs} +1 -1
- package/dist/{logpush-CFQBi88z.mjs → logpush-dtXLu3Ck.mjs} +1 -1
- package/dist/{logs-C07M9zn-.mjs → logs-DmWWL5f9.mjs} +1 -1
- package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-XbTa6P52.mjs} +1 -1
- package/dist/{magic-network-monitoring-CY3CHSpX.mjs → magic-network-monitoring-CpfkgZMp.mjs} +1 -1
- package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-DwgZeIj-.mjs} +1 -1
- package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-DCmogkxv.mjs} +1 -1
- package/dist/{matches-CIaCrdrs.mjs → matches-BAeN8VM1.mjs} +1 -1
- package/dist/{mcp-D2afM8MD.mjs → mcp-DKZ2D050.mjs} +1 -1
- package/dist/{mesh-DLNLi3UT.mjs → mesh-CzIPtuaM.mjs} +1 -1
- package/dist/{moq-BBQVNGo1.mjs → moq-CJpE-eNj.mjs} +1 -1
- package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-Bbm_1lQI.mjs} +1 -1
- package/dist/{network-CmuJqtFJ.mjs → network-D2WRXCDe.mjs} +1 -1
- package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-Clq4X1U8.mjs} +1 -1
- package/dist/{oauth-BjHjJtnn.mjs → oauth-BPizUUqP.mjs} +1 -1
- package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-hilWfAlm.mjs} +1 -1
- package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-CmbgsPYd.mjs} +1 -1
- package/dist/{observability-B5p3iwrq.mjs → observability-DXYgDdU5.mjs} +1 -1
- package/dist/{organization-DQIfNVCT.mjs → organization-D41rIvJa.mjs} +1 -1
- package/dist/{organizations-L_ycAy6r.mjs → organizations-eNzfOwlP.mjs} +1 -1
- package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-DaiAmw45.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-7YztBged.mjs} +1 -1
- package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DRwURM8s.mjs} +1 -1
- package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-B2Csdc4h.mjs} +1 -1
- package/dist/{pages-CskAn5mR.mjs → pages-BAL6Q7OY.mjs} +1 -1
- package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-C-1-ZAtn.mjs} +1 -1
- package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-cyQOuFLb.mjs} +1 -1
- package/dist/{precursor-DgRWBN9_.mjs → precursor-BrweY39h.mjs} +1 -1
- package/dist/{progress-C-oFUtvC.mjs → progress-B84wYh91.mjs} +1 -1
- package/dist/{prompt-DM4z101s.mjs → prompt-CDtLWxNv.mjs} +1 -1
- package/dist/{queries-DrqcK0ZX.mjs → queries-oM8uGZy5.mjs} +1 -1
- package/dist/{queues-CutvMZcc.mjs → queues-CTx04ZNw.mjs} +1 -1
- package/dist/{r2-sFI62vhq.mjs → r2-CnlIUn7R.mjs} +1 -1
- package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-DLtf9d6o.mjs} +1 -1
- package/dist/{radar-Cu9rsTw_.mjs → radar-CGNgGh8v.mjs} +1 -1
- package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-B1YjnGue.mjs} +1 -1
- package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-Dz-QBoP_.mjs} +1 -1
- package/dist/{realtimekit-msnGHBbf.mjs → realtimekit-BPwzhNS9.mjs} +1 -1
- package/dist/{registrar-C0EsXf83.mjs → registrar-BEcb90RX.mjs} +1 -1
- package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-0i1T3zne.mjs} +1 -1
- package/dist/{registry-CJvn75Bq.mjs → registry-DDcSvd8H.mjs} +1 -1
- package/dist/{reporting-BB6sqe6r.mjs → reporting-CLbjHlnw.mjs} +1 -1
- package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-BcKpofP1.mjs} +1 -1
- package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-Ctdi9D-j.mjs} +1 -1
- package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-DGEyVTDN.mjs} +1 -1
- package/dist/{rules-C2BxykEe.mjs → rules-CmuB5rIN.mjs} +1 -1
- package/dist/{rulesets-BHvhAeG_.mjs → rulesets-CGaMq8vG.mjs} +1 -1
- package/dist/{rum-Dyno5zj3.mjs → rum-QT6EP4JK.mjs} +1 -1
- package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-DHryz6SF.mjs} +1 -1
- package/dist/{scim-Bb2xHpIz.mjs → scim-BgGsmHrL.mjs} +1 -1
- package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-BCpFhYFv.mjs} +1 -1
- package/dist/{security-center-DRC4Mf3R.mjs → security-center-BNm4uPVB.mjs} +1 -1
- package/dist/{security-txt-Bh_2gymk.mjs → security-txt-Be2Bif0z.mjs} +1 -1
- package/dist/{session-Br-q_UIW.mjs → session-Ckt20hHa.mjs} +1 -1
- package/dist/{share-DfTpOxhk.mjs → share-Bz2tFTUP.mjs} +1 -1
- package/dist/{shared-BNjZc02w.mjs → shared-BzPQog8H.mjs} +1 -1
- package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-SODkOUyO.mjs} +1 -1
- package/dist/{snippets-nSLwH8uJ.mjs → snippets-B5jY8v_7.mjs} +1 -1
- package/dist/{spawn-Bj8QRFJ5.mjs → spawn-CHkoow5W.mjs} +1 -1
- package/dist/{spectrum-DuhSUTZI.mjs → spectrum-BA0a42eM.mjs} +1 -1
- package/dist/{speed-Dgby_e1J.mjs → speed-mmOjxOzo.mjs} +1 -1
- package/dist/{src-CgAVPA4I.mjs → src-CHW7s5IS.mjs} +4 -4
- package/dist/{ssl-BsxTHasY.mjs → ssl-Yr6kELqg.mjs} +1 -1
- package/dist/{state-C1m9nwUm.mjs → state-DZC531l2.mjs} +1 -1
- package/dist/{stream-CkEOX5Ko.mjs → stream-Cu0kYWbc.mjs} +1 -1
- package/dist/{submit-BjdywxTq.mjs → submit-Dl_27e0n.mjs} +1 -1
- package/dist/{tags-CFAw_Sce.mjs → tags-Cdo_Pwtr.mjs} +1 -1
- package/dist/{tenant-C66iOy5O.mjs → tenant-EX-ANl6X.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-BPHUeckw.mjs} +1 -1
- package/dist/{triggers-Dv22ZXM4.mjs → triggers-Bf9hbP3h.mjs} +1 -1
- package/dist/{tunnel-BatkLdds.mjs → tunnel-CDYkWjnt.mjs} +1 -1
- package/dist/{tunnels-CstoXOoq.mjs → tunnels-CgyX8R2J.mjs} +1 -1
- package/dist/{turnstile-IoRtama4.mjs → turnstile-BUtzlW-0.mjs} +1 -1
- package/dist/{ui-DjQ4AQww.mjs → ui-DIpjthrV.mjs} +1 -1
- package/dist/{url-info-Hjhwr2la.mjs → url-info-CJsa1Oc9.mjs} +1 -1
- package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-BeKkOZz7.mjs} +1 -1
- package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-Cz-yl0_3.mjs} +1 -1
- package/dist/{user-CVHm-cnB.mjs → user-BxHjEqpd.mjs} +1 -1
- package/dist/{values-Cmlw5wGZ.mjs → values-C43NurfT.mjs} +1 -1
- package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CjXfiFH4.mjs} +1 -1
- package/dist/{versions-CU6Av1vh.mjs → versions-BFbc90Wu.mjs} +1 -1
- package/dist/{waiting-rooms-ku9UsAr9.mjs → waiting-rooms-C5jSQv_r.mjs} +1 -1
- package/dist/{web-assets-DmSKaxzf.mjs → web-assets-BzM5vVzy.mjs} +1 -1
- package/dist/{web3-DVv4jNul.mjs → web3-Ctv9HGiR.mjs} +1 -1
- package/dist/{workers-D8czeT64.mjs → workers-D-YbIedB.mjs} +1 -1
- package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B44wc67O.mjs} +1 -1
- package/dist/{workflows-BOi5MTEN.mjs → workflows-rFuQWClt.mjs} +1 -1
- package/dist/{zaraz-CGSSFJng.mjs → zaraz-BA6kY-b6.mjs} +1 -1
- package/dist/{zero-trust-BmA0VkgF.mjs → zero-trust-DOFLlUz1.mjs} +1 -1
- package/dist/{zone-Bx5ElO9U.mjs → zone-B_rgejLV.mjs} +1 -1
- package/dist/{zone-tags-izd3WWmy.mjs → zone-tags-BWdza4rH.mjs} +1 -1
- package/dist/{zones-_SnlZMiM.mjs → zones-DTWO7Vvn.mjs} +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-CDtLWxNv.mjs";import{t as f}from"./cli-types-BWdZbsFE.mjs";function p(e){return e.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups/${s[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(s[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(s[`permission-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.permissionGroups.get({account_id:l,permission_group_id:s[`permission-group-id`]})),{successLabel:`Loaded`})}};function ee(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List all the permissions groups for an account.`,builder:ee,handler:async s=>{let c={id:s.id,name:s.name,label:s.label,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups`,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.iam.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},g={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:_,handler:async d=>{if(d.dryRun){a({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`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.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the resource group`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function y(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.iam.resourceGroups.delete({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.resourceGroups.get({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Loaded`})}};function C(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`List all the resource groups for an account.`,builder:C,handler:async s=>{let c={id:s.id,name:s.name};if(s.dryRun){a({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,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.iam.resourceGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function T(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:T,handler:async u=>{if(u.dryRun){a({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${u[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(u[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(u[`resource-group-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`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(`Updating`,async()=>d.iam.resourceGroups.update({...e,account_id:f,resource_group_id:u[`resource-group-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`)});i(await o(`Updating`,async()=>d.iam.resourceGroups.update({...p,account_id:f,resource_group_id:u[`resource-group-id`]})),{successLabel:`Updated`})}},D={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:O,handler:async s=>{if(s.dryRun){a({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.iam.sso.beginVerification({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Created`})}};function A(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:A,handler:async d=>{if(d.dryRun){a({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({begin_verification:d[`begin-verification`],email_domain:l(d[`email-domain`],`email-domain`,`text`),use_fedramp_language:d[`use-fedramp-language`]}):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.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}d[`email-domain`]===void 0&&(d[`email-domain`]=await u(`email-domain`,`Email domain of the new SSO connector`));let m=c({begin_verification:d[`begin-verification`],email_domain:l(d[`email-domain`],`email-domain`,`text`),use_fedramp_language:d[`use-fedramp-language`]});i(await o(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function M(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:M,handler:async s=>{if(s.dryRun){a({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.iam.sso.delete({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Deleted`})}};function P(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:P,handler:async s=>{if(s.dryRun){a({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.sso.get({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:I,handler:async s=>{if(s.dryRun){a({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.sso.list({account_id:l})),{successLabel:`Loaded`})}};function R(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:R,handler:async l=>{if(l.dryRun){a({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${l[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(l[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(l[`sso-connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]}):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(`Updating`,async()=>u.iam.sso.update({...e,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=c({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]});i(await o(`Updating`,async()=>u.iam.sso.update({...f,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`})}},z={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`create`,describe:`Create a new user group under the specified account.`,builder:B,handler:async d=>{if(d.dryRun){a({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`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.iam.userGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the User group.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.iam.userGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const U={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:H,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>c.iam.userGroups.delete({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Deleted`})}};function W(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:W,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.userGroups.get({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List all the user groups for an account.`,builder:f(K),handler:async s=>{let c={id:s.id,name:s.name,fuzzyName:s[`fuzzy-name`],page:s.page,per_page:s[`per-page`],direction:s.direction};if(s.dryRun){a({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,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.iam.userGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:J,handler:async c=>{if(c.dryRun){a({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},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(`Creating`,async()=>l.iam.userGroups.members.create({body:e,account_id:u,user_group_id:c[`user-group-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function X(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Z={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:X,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members/${s[`member-id`]==null?`<member-id>`:encodeURIComponent(String(s[`member-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``),"member-id":String(s[`member-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{a as i,r as a}from"./auth-DuLchM18.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-B84wYh91.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,i as m,n as h}from"./prompt-CDtLWxNv.mjs";import{t as g}from"./cli-types-BWdZbsFE.mjs";import{n as _,t as v}from"./raw-fetch-Dz-QBoP_.mjs";function ee(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const te={command:`cloudflareImagesBaseImage <image-id>`,describe:`Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.`,builder:ee,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesBaseImage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}/blob`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>v(`/accounts/${i}/images/v1/${encodeURIComponent(String(r[`image-id`]))}/blob`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?o.toString(`utf-8`):o)}};function y(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const b={command:`cloudflareImagesCreateAuthenticatedDirectUploadUrlV2`,describe:"Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present.",builder:y,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesCreateAuthenticatedDirectUploadUrlV2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,expiry:r.expiry,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.expiry!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(d(r.creator,`creator`,`text`)??``)),r.expiry!==void 0&&e.append(`expiry`,String(d(r.expiry,`expiry`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.cloudflareImagesCreateAuthenticatedDirectUploadUrlV2({account_id:u})),{successLabel:`Created`})}};function x(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`cloudflareImagesDeleteImage <image-id>`,describe:`Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.`,builder:x,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesDeleteImage`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation will delete this image.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}o(await c(`Deleting`,async()=>i.images.cloudflareImagesDeleteImage({account_id:l,image_id:r[`image-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`cloudflareImagesImageDetails <image-id>`,describe:`Fetch details for a CF Images image.`,builder:C,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesImageDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.cloudflareImagesImageDetails({account_id:l,image_id:r[`image-id`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`continuation-token`,{type:`string`,description:`Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint.`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`cloudflareImagesListImagesV2`,describe:"List up to 10000 images from CF Images, with up to 1000 results per page. Use the optional parameters below to get a specific range of images. Pagination is supported via continuation_token. **Metadata Filtering (Optional):** You can optionally filter images by custom metadata fields using the `meta.<field>[<operator>]=<value>` syntax. **Supported Operators:** - `eq` / `eq:string` / `eq:number` / `eq:boolean` - Exact match - `gt` / `gt:number` - Greater than (number only) - `gte` / `gte:number` - Greater than or equal (number only) - `lt` / `lt:number` - Less than (number only) - `lte` / `lte:number` - Less than or equal (number only) - `in` / `in:string` / `in:number` - Match any value in list (pipe-separated) **Metadata Filter Constraints:** - Maximum 5 metadata filters per request - Maximum 5 levels of nesting (e.g., `meta.first.second.third.fourth.fifth`) - Maximum 10 elements for list operators (`in`) - Supports string, number, and boolean value types - Range operators (`gt`, `gte`, `lt`, `lte`) only accept numeric values **Filter Consistency:** Filters are combined with AND logic. The system does not validate whether filter combinations are logically consistent. For example, `meta.priority[eq:number]=5&meta.priority[lte:number]=3` will return zero results because no value can satisfy both conditions simultaneously. It is the caller's responsibility to ensure filter combinations make sense. **Examples:** ``` # List all images /images/v2 # Filter by metadata [eq] /images/v2?meta.status[eq:string]=active # Filter by metadata [in] /images/v2?meta.status[in]=pending|deleted|flagged # Filter by metadata [in:number] /images/v2?meta.ratings[in:number]=4|5 # Filter by metadata range [gte:number] /images/v2?meta.priority[gte:number]=1 # Filter by bounded range /images/v2?meta.priority[gte:number]=1&meta.priority[lte:number]=5 # Filter by nested metadata /images/v2?meta.region.name[eq]=eu-west # Combine metadata filters with creator /images/v2?meta.status[eq]=active&creator=user123 # Multiple metadata filters (AND logic) /images/v2?meta.status[eq]=active&meta.priority[eq:number]=5 ```",builder:g(T),handler:async r=>{let i={continuation_token:r[`continuation-token`],per_page:r[`per-page`],sort_order:r[`sort-order`],creator:r.creator};if(r.dryRun){s({command:`cf images cloudflareImagesListImagesV2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2`,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.images.cloudflareImagesListImagesV2({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`cloudflareImagesUpdateImage <image-id>`,describe:`Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesUpdateImage`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]}):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.images.cloudflareImagesUpdateImage({...e,account_id:f,image_id:r[`image-id`]})),{successLabel:`Updated`});return}let p=u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]});o(await c(`Updating`,async()=>i.images.cloudflareImagesUpdateImage({...p,account_id:f,image_id:r[`image-id`]})),{successLabel:`Updated`})}};function k(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const A={command:`cloudflareImagesUploadAnImageViaUrl`,describe:`Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`,builder:k,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesUploadAnImageViaUrl`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`],url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(d(r.creator,`creator`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),r.url!==void 0&&e.append(`url`,String(d(r.url,`url`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v1`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.cloudflareImagesUploadAnImageViaUrl({account_id:u})),{successLabel:`Created`})}};function j(e){return e.positional(`image-id`,{type:`string`,description:`Image 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 M={command:`deleteImageDelete <imageId>`,describe:`Delete an image.`,builder:j,handler:async r=>{if(r.dryRun){s({command:`cf images deleteImageDelete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}o(await c(`Deleting`,async()=>i.images.deleteImageDelete({accountId:l,imageId:r[`image-id`]})),{successLabel:`Deleted`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Get the current transformation flows configuration for a zone.`,builder:N,handler:async i=>{if(i.dryRun){s({command:`cf images flows get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zones/${i.zone??i.zoneId??`<zone>`}/v1/images/flows`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});i.zoneId=d,o(await c(`Loading`,async()=>l.images.flows.get({accountId:u,zoneId:d})),{successLabel:`Loaded`})}};function F(e){return e.option(`etag`,{type:`string`,description:`The etag field`}).option(`version`,{type:`number`,description:`The version field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update`,describe:`Replace the entire transformation flows configuration for a zone.`,builder:F,handler:async i=>{if(i.dryRun){s({command:`cf images flows update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zones/${i.zone??i.zoneId??`<zone>`}/v1/images/flows`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`json`,body:i.body===void 0?u({etag:d(i.etag,`etag`,`text`),version:i.version}):l(i.body)});return}let f=await a(i),p=i.local?e:await t();i.accountId=p;let m=await r({zone:i.zone},f,{quiet:i.quiet});if(i.zoneId=m,i.body){let e=l(i.body);o(await c(`Updating`,async()=>f.images.flows.update({...e,accountId:p,zoneId:m})),{successLabel:`Updated`});return}if(i.version===void 0)throw Error(`--version is required (or pass --body with this field set).`);let h=u({etag:d(i.etag,`etag`,`text`),version:i.version});o(await c(`Updating`,async()=>f.images.flows.update({...h,accountId:p,zoneId:m})),{successLabel:`Updated`})}},L={command:`flows`,describe:`Zone-level transformation flows that control how images are resized and optimized on delivery`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`continuation-token`,{type:`string`,description:`Continuation token for a next page. List images V2 returns continuation_token`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string will return images where creator field is not set`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`getAccountsAccountIdV2Images`,describe:`List images for an account.`,builder:g(R),handler:async r=>{let i={per_page:r[`per-page`],continuation_token:r[`continuation-token`],creator:r.creator,sort_order:r[`sort-order`]};if(r.dryRun){s({command:`cf images getAccountsAccountIdV2Images`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v2/images`,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.images.getAccountsAccountIdV2Images({accountId:u,...i})),{successLabel:`Loaded`})}};function B(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`getImageGet <imageId>`,describe:`Get image metadata.`,builder:B,handler:async r=>{if(r.dryRun){s({command:`cf images getImageGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.getImageGet({accountId:l,imageId:r[`image-id`]})),{successLabel:`Loaded`})}};function H(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const U={command:`getImageGetBlob <imageId>`,describe:`Get image as a blob.`,builder:H,handler:async r=>{if(r.dryRun){s({command:`cf images getImageGetBlob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}/blob`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>v(`/accounts/${i}/v1/images/${encodeURIComponent(String(r[`image-id`]))}/blob`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?o.toString(`utf-8`):o)}};function W(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`create <signing-key-name>`,describe:`Create a new CF Images signing key with specified name. Returns all keys available.`,builder:W,handler:async r=>{if(r.dryRun){s({command:`cf images keys create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys/${r[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(r[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(r[`signing-key-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.keys.create({account_id:l,signing_key_name:r[`signing-key-name`]})),{successLabel:`Updated`})}};function K(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const q={command:`delete <signing-key-name>`,describe:`Delete a CF Images signing key with specified name. Returns all keys available. When the last key is removed, a new default signing key will be generated.`,builder:K,handler:async r=>{if(r.dryRun){s({command:`cf images keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys/${r[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(r[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(r[`signing-key-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation will delete this signing key. This will invalidate any URLs that are signed with this key.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}o(await c(`Deleting`,async()=>i.images.keys.delete({account_id:l,signing_key_name:r[`signing-key-name`]})),{successLabel:`Deleted`})}};function J(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List your CF Images signing keys.`,builder:J,handler:async r=>{if(r.dryRun){s({command:`cf images keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.keys.list({account_id:l})),{successLabel:`Loaded`})}},X={command:`keys`,describe:`Manage signing keys for generating private image URLs`,builder:e=>e.command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Image creator`}).option(`require-signed-urls`,{type:`boolean`,description:`Required signed url`}).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 Q={command:`patchImageEdit <imageId>`,describe:`Update an image's metadata.`,builder:Z,handler:async r=>{if(r.dryRun){s({command:`cf images patchImageEdit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]}):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.images.patchImageEdit({...e,accountId:f,imageId:r[`image-id`]})),{successLabel:`Updated`});return}let p=u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]});o(await c(`Updating`,async()=>i.images.patchImageEdit({...p,accountId:f,imageId:r[`image-id`]})),{successLabel:`Updated`})}};function ne(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`})}const re={command:`postDirectUploadLink`,describe:`Create an authenticated direct upload URL for an image.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf images postDirectUploadLink`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v2/images/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,expiry:r.expiry,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.expiry!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.expiry!==void 0&&e.append(`expiry`,String(d(r.expiry,`expiry`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v2/images/direct_upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v2/images/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.postDirectUploadLink({accountId:u})),{successLabel:`Created`})}};function ie(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const ae={command:`postImageUpload`,describe:`Upload a new image.`,builder:ie,handler:async r=>{if(r.dryRun){s({command:`cf images postImageUpload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`],url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(d(r.creator,`creator`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),r.url!==void 0&&e.append(`url`,String(d(r.url,`url`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v1/images`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v1/images`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.postImageUpload({accountId:u})),{successLabel:`Created`})}};function oe(e){return e.option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`create`,describe:`Create a new migration from an existing source. The migration will import objects from the source bucket into Cloudflare Images.`,builder:oe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({conflictBehaviour:d(r[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:r[`excluded-content-types`],pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),rootDirectory:d(r[`root-directory`],`root-directory`,`text`),sourceId:d(r[`source-id`],`source-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.images.sourcingKit.migrations.create({...e,account_id:f})),{successLabel:`Created`});return}r[`source-id`]===void 0&&(r[`source-id`]=await p(`source-id`,`The identifier of the source to migrate from.`));let m=u({conflictBehaviour:d(r[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:r[`excluded-content-types`],pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),rootDirectory:d(r[`root-directory`],`root-directory`,`text`),sourceId:d(r[`source-id`],`source-id`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.migrations.create({...m,account_id:f})),{successLabel:`Created`})}};function ce(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const le={command:`delete <migration-id>`,describe:`Delete an existing migration. Only completed, errored, or aborted migrations can be deleted.`,builder:ce,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t,r as n,t as r}from"./src-
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./src-CHW7s5IS.mjs";export{r as CliExit,t as buildCli,n as main,e as runMain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{a as i,r as a}from"./auth-C6MhC9EZ.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-C-oFUtvC.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,n as m}from"./prompt-DM4z101s.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import{n as ee,t as te}from"./raw-fetch-25gXED6c.mjs";function g(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:g,handler:async r=>{if(r.dryRun){s({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}};function v(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:v,handler:async r=>{if(r.dryRun){s({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}/subnets`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.subnets.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}},b={command:`subnets`,describe:`Operations for asn.subnets`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(_).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.attackSurfaceReport.issueTypes.get({account_id:l})),{successLabel:`Loaded`})}},w={command:`issue-types`,describe:`Operations for attack-surface-report.issue-types`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:h(T),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/class`,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.intel.attackSurfaceReport.issues.class({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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 O={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/${r[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(r[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(r[`issue-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({dismiss:r.dismiss}):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.intel.attackSurfaceReport.issues.dismiss({...e,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`});return}let f=u({dismiss:r.dismiss});o(await c(`Updating`,async()=>i.intel.attackSurfaceReport.issues.dismiss({...f,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`})}};function k(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:h(k),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues`,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.intel.attackSurfaceReport.issues.list({account_id:u,...i})),{successLabel:`Loaded`})}};function j(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:h(j),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/severity`,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.intel.attackSurfaceReport.issues.severity({account_id:u,...i})),{successLabel:`Loaded`})}};function N(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:h(N),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/type`,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.intel.attackSurfaceReport.issues.type({account_id:u,...i})),{successLabel:`Loaded`})}},F={command:`issues`,describe:`Operations for attack-surface-report.issues`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`attack-surface-report`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(w).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:h(L),handler:async r=>{let i={start_end_params:r[`start-end-params`],ipv4:r.ipv4,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/dns`,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.intel.dns.list({account_id:u,...i})),{successLabel:`Loaded`})}},z={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:B,handler:async r=>{let i={domain:r.domain};if(r.dryRun){s({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain-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.intel.domainHistory.get({account_id:u,...i})),{successLabel:`Loaded`})}},H={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:U,handler:async r=>{let i={domain:r.domain,include_ranking:r[`include-ranking`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain/bulk`,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.intel.domains.bulks.get({account_id:u,...i})),{successLabel:`Loaded`})}},G={command:`bulks`,describe:`Operations for domains.bulks`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:K,handler:async r=>{let i={domain:r.domain,skip_dns:r[`skip-dns`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain`,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.intel.domains.get({account_id:u,...i})),{successLabel:`Loaded`})}},J={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(q).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`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.intel.indicatorFeeds.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.intel.indicatorFeeds.create({...p,account_id:f})),{successLabel:`Created`})}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:Z,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/data`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i,ee((await c(`Loading`,async()=>te(`/accounts/${i}/intel/indicator-feeds/${encodeURIComponent(String(r[`feed-id`]))}/data`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}};function ne(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/download`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.downloads.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}},ie={command:`downloads`,describe:`Operations for indicator-feeds.downloads`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:ae,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}};function se(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.list({account_id:l})),{successLabel:`Loaded`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).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 ue={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:le,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):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.intel.indicatorFeeds.permissions.create({body:e,account_id:f})),{successLabel:`Updated`});return}let p=u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});o(await c(`Updating`,async()=>i.intel.indicatorFeeds.permissions.create({body:p,account_id:f})),{successLabel:`Updated`})}};function de(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).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:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:de,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,!await m({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{a as i,r as a}from"./auth-DuLchM18.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-B84wYh91.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,n as m}from"./prompt-CDtLWxNv.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import{n as ee,t as te}from"./raw-fetch-Dz-QBoP_.mjs";function g(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:g,handler:async r=>{if(r.dryRun){s({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}};function v(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:v,handler:async r=>{if(r.dryRun){s({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}/subnets`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.subnets.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}},b={command:`subnets`,describe:`Operations for asn.subnets`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(_).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.attackSurfaceReport.issueTypes.get({account_id:l})),{successLabel:`Loaded`})}},w={command:`issue-types`,describe:`Operations for attack-surface-report.issue-types`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:h(T),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/class`,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.intel.attackSurfaceReport.issues.class({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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 O={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/${r[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(r[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(r[`issue-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({dismiss:r.dismiss}):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.intel.attackSurfaceReport.issues.dismiss({...e,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`});return}let f=u({dismiss:r.dismiss});o(await c(`Updating`,async()=>i.intel.attackSurfaceReport.issues.dismiss({...f,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`})}};function k(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:h(k),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues`,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.intel.attackSurfaceReport.issues.list({account_id:u,...i})),{successLabel:`Loaded`})}};function j(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:h(j),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/severity`,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.intel.attackSurfaceReport.issues.severity({account_id:u,...i})),{successLabel:`Loaded`})}};function N(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:h(N),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/type`,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.intel.attackSurfaceReport.issues.type({account_id:u,...i})),{successLabel:`Loaded`})}},F={command:`issues`,describe:`Operations for attack-surface-report.issues`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`attack-surface-report`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(w).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:h(L),handler:async r=>{let i={start_end_params:r[`start-end-params`],ipv4:r.ipv4,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/dns`,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.intel.dns.list({account_id:u,...i})),{successLabel:`Loaded`})}},z={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:B,handler:async r=>{let i={domain:r.domain};if(r.dryRun){s({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain-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.intel.domainHistory.get({account_id:u,...i})),{successLabel:`Loaded`})}},H={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:U,handler:async r=>{let i={domain:r.domain,include_ranking:r[`include-ranking`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain/bulk`,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.intel.domains.bulks.get({account_id:u,...i})),{successLabel:`Loaded`})}},G={command:`bulks`,describe:`Operations for domains.bulks`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:K,handler:async r=>{let i={domain:r.domain,skip_dns:r[`skip-dns`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain`,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.intel.domains.get({account_id:u,...i})),{successLabel:`Loaded`})}},J={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(q).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`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.intel.indicatorFeeds.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.intel.indicatorFeeds.create({...p,account_id:f})),{successLabel:`Created`})}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:Z,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/data`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i,ee((await c(`Loading`,async()=>te(`/accounts/${i}/intel/indicator-feeds/${encodeURIComponent(String(r[`feed-id`]))}/data`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}};function ne(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/download`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.downloads.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}},ie={command:`downloads`,describe:`Operations for indicator-feeds.downloads`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:ae,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}};function se(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.list({account_id:l})),{successLabel:`Loaded`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).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 ue={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:le,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):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.intel.indicatorFeeds.permissions.create({body:e,account_id:f})),{successLabel:`Updated`});return}let p=u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});o(await c(`Updating`,async()=>i.intel.indicatorFeeds.permissions.create({body:p,account_id:f})),{successLabel:`Updated`})}};function de(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).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:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:de,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,!await m({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}if(r.body){let e=l(r.body);o(await c(`Deleting`,async()=>i.intel.indicatorFeeds.permissions.delete({body:e,account_id:f})),{successLabel:`Deleted`});return}let p=u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});o(await c(`Deleting`,async()=>i.intel.indicatorFeeds.permissions.delete({body:p,account_id:f})),{successLabel:`Deleted`})}};function pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Lists current access permissions for custom threat indicator feeds.`,builder:pe,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/view`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.permissions.list({account_id:l})),{successLabel:`Loaded`})}},he={command:`permissions`,describe:`Operations for indicator-feeds.permissions`,builder:e=>e.command(ue).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`account-id-path`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`account-id`,{type:`number`,description:`The numeric account ID to create the provider for. Distinct from the
|
|
4
4
|
path \`account_id\` parameter, which carries the account identifier
|
|
5
5
|
string used for routing.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t,t as n}from"./chunk-vbHwaUoU.mjs";import{o as r,s as i}from"./session-
|
|
2
|
+
import{i as e,r as t,t as n}from"./chunk-vbHwaUoU.mjs";import{o as r,s as i}from"./session-Ckt20hHa.mjs";import{X as a}from"./chunk-LQW53VED-Xakf_rUn.mjs";import"node:fs";import{styleText as o}from"node:util";import"node:path";import"node:os";import s,{stdin as c,stdout as l}from"node:process";import{ReadStream as u}from"node:tty";import*as d from"node:readline";import f from"node:readline";const p=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,m=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,h=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,g=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,_=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,v=/\t{1,1000}/y,y=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,b=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,x=/\p{M}+/gu,S={limit:1/0,ellipsis:``},ee=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?ee(i,S,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,te=n.wideWidth??2,C=0,w=0,T=e.length,E=0,D=!1,O=T,k=Math.max(0,r-a),A=0,j=0,M=0,N=0;outer:for(;;){if(j>A||w>=T&&w>C){let t=e.slice(A,j)||e.slice(C,w);E=0;for(let e of t.replaceAll(x,``)){let t=e.codePointAt(0)||0;if(N=m(t)?d:h(t)?te:l!==f&&p(t)?l:f,M+N>k&&(O=Math.min(O,Math.max(A,C)+E)),M+N>r){D=!0;break outer}E+=e.length,M+=N}A=j=0}if(w>=T)break;if(b.lastIndex=w,b.test(e)){if(E=b.lastIndex-w,N=E*f,M+N>k&&(O=Math.min(O,w+Math.floor((k-M)/f))),M+N>r){D=!0;break}M+=N,A=C,j=w,w=C=b.lastIndex;continue}if(g.lastIndex=w,g.test(e)){if(M+o>k&&(O=Math.min(O,w)),M+o>r){D=!0;break}M+=o,A=C,j=w,w=C=g.lastIndex;continue}if(_.lastIndex=w,_.test(e)){if(E=_.lastIndex-w,N=E*s,M+N>k&&(O=Math.min(O,w+Math.floor((k-M)/s))),M+N>r){D=!0;break}M+=N,A=C,j=w,w=C=_.lastIndex;continue}if(v.lastIndex=w,v.test(e)){if(E=v.lastIndex-w,N=E*c,M+N>k&&(O=Math.min(O,w+Math.floor((k-M)/c))),M+N>r){D=!0;break}M+=N,A=C,j=w,w=C=v.lastIndex;continue}if(y.lastIndex=w,y.test(e)){if(M+u>k&&(O=Math.min(O,w)),M+u>r){D=!0;break}M+=u,A=C,j=w,w=C=y.lastIndex;continue}w+=1}return{width:D?k:M,index:D?O:T,truncated:D,ellipsed:D&&r>=a}},te={limit:1/0,ellipsis:``,ellipsisWidth:0},C=(e,t={})=>ee(e,te,t).width,w=`]8;;`,T=RegExp(`(?:\\[(?<code>\\d+)m|\\${w}(?<uri>.*))`,`y`),E=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},D=e=>`[${e}m`,O=e=>`${w}${e}`,k=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:C(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=C(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(w,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},A=e=>{let t=e.split(` `),n=t.length;for(;n&&!C(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},j=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=C(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=C(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),k(s,r,t),c=C(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){k(s,r,t),c=C(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){k(s,r,t),c=C(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>A(e)));let l=s.join(`
|
|
3
3
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,!u)u=t>=`\ud800`&&t<=`\udbff`;else continue;if(t===`\x1B`||t===``){T.lastIndex=e+1;let t=T.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
4
4
|
`){a&&(r+=O(``));let e=i?E(i):void 0;i&&e&&(r+=D(e))}else t===`
|
|
5
5
|
`&&(i&&E(i)&&(r+=D(i)),a&&(r+=O(a)))}return r},M=/\r?\n/;function N(e,t,n){return String(e).normalize().split(M).map(e=>j(e,t,n)).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";function i(e){return e.option(`networks`,{type:`string`,description:"Specified as `jdcloud` to list IPs used by JD Cloud data centers."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`Get IPs used on the Cloudflare/JD Cloud network, see https://www.cloudflare.com/ips for Cloudflare IPs or https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD Cloud IPs.`,builder:i,handler:async i=>{let a={networks:i.networks};if(i.dryRun){n({command:`cf ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/ips`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.ips.list(a)),{successLabel:`Loaded`})}},o={command:`ips`,describe:`ips`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{a as c,n as l}from"./prompt-CDtLWxNv.mjs";function u(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or SSL certificate and intermediate(s).`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`,default:24008}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network 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)`}).check(e=>{if([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].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 --tunnel-* flag is set`)}return!0})}const d={command:`create`,describe:`Creates a Keyless SSL configuration that allows SSL/TLS termination without exposing private keys to Cloudflare. Keys remain on your infrastructure.`,builder:u,handler:async l=>{if(l.dryRun){r({command:`cf keyless-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.keylessCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.certificate===void 0&&(l.certificate=await c(`certificate`,`The zone's SSL certificate or SSL certificate and intermediate(s).`)),l.host===void 0&&(l.host=await c(`host`,`The keyless SSL name.`)),l.port===void 0)throw Error(`--port is required (or pass --body with this field set).`);let f=o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`Creating`,async()=>u.keylessCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`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 p={command:`delete <keyless-certificate-id>`,describe:`Removes a Keyless SSL configuration. SSL connections will no longer use the keyless server for cryptographic operations.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf keyless-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.keylessCertificates.delete({zone_id:s,keyless_certificate_id:a[`keyless-certificate-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether or not the Keyless SSL is on or off.`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network 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)`}).check(e=>{if([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].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 --tunnel-* flag is set`)}return!0})}const h={command:`edit <keyless-certificate-id>`,describe:`This will update attributes of a Keyless SSL. Consists of one or more of the following: host,name,port.`,builder:m,handler:async c=>{if(c.dryRun){r({command:`cf keyless-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/keyless_certificates/${c[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(c[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(c[`keyless-certificate-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({enabled:c.enabled,host:s(c.host,`host`,`text`),name:s(c.name,`name`,`text`),port:c.port,tunnel:{private_ip:s(c[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(c[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.keylessCertificates.edit({...e,zone_id:u,keyless_certificate_id:c[`keyless-certificate-id`]})),{successLabel:`Updated`});return}let d=o({enabled:c.enabled,host:s(c.host,`host`,`text`),name:s(c.name,`name`,`text`),port:c.port,tunnel:{private_ip:s(c[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(c[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`Updating`,async()=>l.keylessCertificates.edit({...d,zone_id:u,keyless_certificate_id:c[`keyless-certificate-id`]})),{successLabel:`Updated`})}};function g(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <keyless-certificate-id>`,describe:`Get details for one Keyless SSL configuration.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf keyless-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.keylessCertificates.get({zone_id:s,keyless_certificate_id:a[`keyless-certificate-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List all Keyless SSL configurations for a given zone.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf keyless-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.keylessCertificates.list({zone_id:s})),{successLabel:`Loaded`})}},b={command:`keyless-certificates`,describe:`keyless-certificates`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";function s(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Lists all distinct tag keys used across resources in an account.`,builder:s,handler:async s=>{let c={cursor:s.cursor};if(s.dryRun){a({command:`cf keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/keys`,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.keys.list({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`keys`,describe:`keys`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l 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-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{a as r,r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u,t as d}from"./input-validation-BBKJRoRB.mjs";import{a as f,n as p}from"./prompt-CDtLWxNv.mjs";import{t as m}from"./cli-types-BWdZbsFE.mjs";import{n as h,t as g}from"./raw-fetch-Dz-QBoP_.mjs";function _(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete <namespace-id>`,describe:`Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.`,builder:_,handler:async l=>{if(l.dryRun){o({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the specified keys from the namespace.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}if(l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>1e4){let t=Math.ceil(e.length/1e4),n=null;for(let i=0;i<e.length;i+=1e4){let a=e.slice(i,i+1e4);n=await s(`Deleting: batch ${Math.floor(i/1e4)+1}/${t}`,async()=>r(u,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,{body:a}))}a(n,{successLabel:`Deleted`});return}a(await s(`Deleting`,async()=>r(u,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,{body:e})),{successLabel:`Deleted`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function y(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`keys`,{type:`string`,array:!0,description:`Array of keys to retrieve (maximum of 100).`}).option(`type`,{type:`string`,description:`Whether to parse JSON values in the response.`,choices:[`text`,`json`],default:`text`}).option(`with-metadata`,{type:`boolean`,description:`Whether to include metadata in the response.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`get <namespace-id>`,describe:"Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based values. JSON values can optionally be parsed instead of being returned as a string value. Metadata can be included if `withMetadata` is true.",builder:y,handler:async r=>{if(r.dryRun){o({command:`cf kv bulk get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/bulk/get`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({keys:r.keys,type:u(r.type,`type`,`text`),withMetadata:r[`with-metadata`]}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.kv.bulk.get({...e,account_id:f,namespace_id:r[`namespace-id`]})),{successLabel:`Created`});return}if(r.keys===void 0)throw Error(`--keys is required (or pass --body with this field set).`);let p=l({keys:r.keys,type:u(r.type,`type`,`text`),withMetadata:r[`with-metadata`]});a(await s(`Creating`,async()=>d.kv.bulk.get({...p,account_id:f,namespace_id:r[`namespace-id`]})),{successLabel:`Created`})}};function x(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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 S={command:`update <namespace-id>`,describe:"Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. The entire request size must be 100 megabytes or less.",builder:x,handler:async l=>{if(l.dryRun){o({command:`cf kv bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>1e4){let t=Math.ceil(e.length/1e4),n=null;for(let i=0;i<e.length;i+=1e4){let a=e.slice(i,i+1e4);n=await s(`Updating: batch ${Math.floor(i/1e4)+1}/${t}`,async()=>r(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk`,{body:a}))}a(n,{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk`,{body:e})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},C={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace 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 T={command:`delete <key-name>`,describe:"Remove a KV pair from the namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:w,handler:async r=>{if(r.dryRun){o({command:`cf kv keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/values/${r[`key-name`]==null?`<key-name>`:encodeURIComponent(String(r[`key-name`]))}`,pathParams:{"key-name":String(r[`key-name`]??``),"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>c.kv.keys.delete({account_id:l,namespace_id:r[`namespace-id`],key_name:r[`key-name`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const D={command:`get <key-name>`,describe:"Returns the value associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. If the KV-pair is set to expire at some point, the expiration time as measured in seconds since the UNIX epoch will be returned in the `expiration` response header.",builder:E,handler:async r=>{if(r.dryRun){o({command:`cf kv keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/values/${r[`key-name`]==null?`<key-name>`:encodeURIComponent(String(r[`key-name`]))}`,pathParams:{"key-name":String(r[`key-name`]??``),"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a;let c=await s(`Loading`,async()=>g(`/accounts/${a}/storage/kv/namespaces/${encodeURIComponent(String(r[`namespace-id`]))}/values/${encodeURIComponent(String(r[`key-name`]))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));h(r.text===!0?c.toString(`utf-8`):c)}};function O(e){return e.option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit.`}).option(`prefix`,{type:`string`,description:`Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned.`}).option(`cursor`,{type:`string`,description:"Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists a namespace's keys.`,builder:O,handler:async r=>{let c={limit:r.limit,prefix:r.prefix,cursor:r.cursor};if(r.dryRun){o({command:`cf kv keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/keys`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.kv.keys.list({account_id:u,namespace_id:r[`namespace-id`],...c})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`expiration`,{type:`number`,description:`Expires the key at a certain time, measured in number of seconds since the UNIX epoch.`}).option(`expiration-ttl`,{type:`number`,description:`Expires the key after a number of seconds. Must be at least 60.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A byte sequence to be stored, up to 25 MiB in length.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`The metadata`})}const j={command:`update <key-name>`,describe:"Write a value identified by a key. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. Body should be the value to be stored. If JSON metadata to be associated with the key/value pair is needed, use `multipart/form-data` content type for your PUT request (see dropdown below in `REQUEST BODY SCHEMA`). Existing values, expirations, and metadata will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.",builder:A,handler:async c=>{let l={expiration:c.expiration,expiration_ttl:c[`expiration-ttl`]};if(c.dryRun){o({command:`cf kv keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${c[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(c[`namespace-id`]))}/values/${c[`key-name`]==null?`<key-name>`:encodeURIComponent(String(c[`key-name`]))}`,pathParams:{"key-name":String(c[`key-name`]??``),"namespace-id":String(c[`namespace-id`]??``)},query:l,bodyKind:c.metadata===void 0?`octet-stream`:`multipart`,body:c.metadata===void 0?c.body:{body:c.body,file:c.file,metadata:c.metadata}});return}let f=await i(c),p=c.local?e:await t();if(c.accountId=p,c.metadata!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`value`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`value`,c.body);c.metadata!==void 0&&e.append(`metadata`,String(u(c.metadata,`metadata`,`text`)??``)),a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}`,{body:e})),{successLabel:`Updated`});return}if(c.file){let e=d(c.file);a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(c.body){let e=u(c.body,`body`,`binary`),t=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{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.`)}},M={command:`keys`,describe:`Operations for keys`,builder:e=>e.command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <key-name>`,describe:"Returns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:N,handler:async r=>{if(r.dryRun){o({command:`cf kv metadata get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/metadata/${r[`key-name`]==null?`<key-name>`:encodeURIComponent(String(r[`key-name`]))}`,pathParams:{"key-name":String(r[`key-name`]??``),"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.kv.metadata.get({account_id:l,namespace_id:r[`namespace-id`],key_name:r[`key-name`]})),{successLabel:`Loaded`})}},F={command:`metadata`,describe:`Operations for metadata`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`jurisdiction`,{type:`string`,description:`Specify the jurisdiction to restrict the KV namespace to durably store data within. Can only be set at namespace creation time.`,choices:[`eu`,`fedramp`,`us`]}).option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).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 L={command:`create`,describe:"Creates a namespace under the given title. A `400` is returned if the account already owns a namespace with this title. A namespace must be explicitly deleted to be replaced.",builder:I,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({jurisdiction:u(r.jurisdiction,`jurisdiction`,`text`),title:u(r.title,`title`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.kv.namespaces.create({...e,account_id:p})),{successLabel:`Created`});return}r.title===void 0&&(r.title=await f(`title`,`A human-readable string name for a Namespace.`));let m=l({jurisdiction:u(r.jurisdiction,`jurisdiction`,`text`),title:u(r.title,`title`,`text`)});a(await s(`Creating`,async()=>d.kv.namespaces.create({...m,account_id:p})),{successLabel:`Created`})}};function R(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace 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 z={command:`delete <namespace-id>`,describe:`Deletes the namespace corresponding to the given ID.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}a(await s(`Deleting`,async()=>c.kv.namespaces.delete({account_id:l,namespace_id:r[`namespace-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <namespace-id>`,describe:`Get the namespace corresponding to the given ID.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.kv.namespaces.get({account_id:l,namespace_id:r[`namespace-id`]})),{successLabel:`Loaded`})}};function H(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(`order`,{type:`string`,description:`Field to order results by.`,choices:[`id`,`title`]}).option(`direction`,{type:`string`,description:`Direction to order namespaces.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Returns the namespaces owned by an account.`,builder:m(H),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf kv namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.kv.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function W(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).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 <namespace-id>`,describe:`Modifies a namespace's title.`,builder:W,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({title:u(r.title,`title`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.kv.namespaces.update({...e,account_id:p,namespace_id:r[`namespace-id`]})),{successLabel:`Updated`});return}r.title===void 0&&(r.title=await f(`title`,`A human-readable string name for a Namespace.`));let m=l({title:u(r.title,`title`,`text`)});a(await s(`Updating`,async()=>d.kv.namespaces.update({...m,account_id:p,namespace_id:r[`namespace-id`]})),{successLabel:`Updated`})}},K={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`kv`,describe:`kv`,builder:e=>e.command(C).command(M).command(F).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
|
package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DKRjBLcr.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{n as c}from"./prompt-CDtLWxNv.mjs";function l(e){return e.option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const u={command:`create`,describe:'Create a detection location for credentials that the default scan locations do not cover, using Rules language expressions such as `lookup_json_string(http.request.body.raw, "user")`. Only the username expression is required, and Leaked Credential Checks must be enabled on the zone.',builder:l,handler:async c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:d,zone_id:u})),{successLabel:`Created`})}};function d(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,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 f={command:`delete <detection-id>`,describe:`Delete a user-defined detection location, identified by its detection ID. Incoming requests are then scanned using only the default scan locations and the detection locations that remain.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force,message:`This operation deletes a Leaked Credential Checks custom detection location.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.leakedCredentialChecks.detections.delete({zone_id:s,detection_id:a[`detection-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <detection-id>`,describe:`Get the username and password expressions of a single user-defined detection location, identified by its detection ID.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.detections.get({zone_id:s,detection_id:a[`detection-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List the user-defined detection locations configured for Leaked Credential Checks, each with its own identifier. A custom detection location tells the WAF where to find the username and password in requests to your application.`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.detections.list({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const v={command:`update <detection-id>`,describe:`Update the username and password expressions of an existing detection location, identified by its detection ID. Both expressions are overwritten, so omitting the password expression clears it.`,builder:_,handler:async c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections/${c[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(c[`detection-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"detection-id":String(c[`detection-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:e,zone_id:u,detection_id:c[`detection-id`]})),{successLabel:`Updated`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:d,zone_id:u,detection_id:c[`detection-id`]})),{successLabel:`Updated`})}},y={command:`detections`,describe:`Custom detection locations that tell the WAF where to find usernames and passwords in requests`,builder:e=>e.command(u).command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Get the current Leaked Credential Checks status for the zone. While enabled, Cloudflare scans incoming requests for usernames and passwords that were exposed in known data breaches.`,builder:b,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.get({zone_id:s})),{successLabel:`Loaded`})}};function S(e){return e.option(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).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:`Defines the overall status for Leaked Credential Checks.`})}const C={command:`update`,describe:"Update the Leaked Credential Checks status for the zone, enabling or disabling the detection. While enabled, the detection populates the `cf.waf.credential_check.*` fields, which you can reference in custom rules and rate limiting rules to challenge or block requests carrying compromised credentials.",builder:S,handler:async s=>{if(s.dryRun){r({command:`cf leaked-credential-checks update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled}):a(s.body)});return}let l=await t(s),u=await e({zone:s.zone},l,{quiet:s.quiet});if(s.zoneId=u,!await c({force:!!s.force,message:`This operation toggles Leaked Credential Checks for a zone.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}if(s.body){let e=a(s.body);n(await i(`Deleting`,async()=>l.leakedCredentialChecks.update({body:e,zone_id:u})),{successLabel:`Deleted`});return}let d=o({enabled:s.enabled});n(await i(`Deleting`,async()=>l.leakedCredentialChecks.update({body:d,zone_id:u})),{successLabel:`Deleted`})}},w={command:`leaked-credential-checks`,describe:`Detect compromised credentials in login requests by checking against known breach databases`,builder:e=>e.command(x).command(C).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|