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-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{a as r,r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,r 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-DM4z101s.mjs";import{t as g}from"./cli-types-BWdZbsFE.mjs";import{n as _,t as v}from"./raw-fetch-25gXED6c.mjs";function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Binary file to be uploaded to the database.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const te={command:`create`,describe:`Uploads a binary file to Cloudforce One's binary database for malware analysis and threat intelligence correlation.`,builder:ee,handler:async c=>{if(c.dryRun){o({command:`cf cloudforce-one binary-storage create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/binary`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await i(c),u=c.local?e:await t();if(c.accountId=u,c.file!==void 0||c.body!==void 0){let e=new FormData;if(c.file){let t=f(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${u}/cloudforce-one/binary`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=d(c.body,`body`,`binary`);a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${u}/cloudforce-one/binary`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{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 y(e){return e.positional(`hash`,{type:`string`,description:`hash of the binary`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <hash>`,describe:`Retrieves a binary file from the Cloudforce One binary storage for analysis.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one binary-storage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/binary/${r.hash==null?`<hash>`:encodeURIComponent(String(r.hash))}`,pathParams:{hash:String(r.hash??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.binaryStorage.get({account_id:l,hash:r.hash})),{successLabel:`Loaded`})}},x={command:`binary-storage`,describe:`Upload and retrieve malware samples and suspicious binaries for analysis`,builder:e=>e.command(te).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`aggregate-by`,{type:`string`,description:`Column(s) to aggregate by - single column or comma-separated list (e.g., 'attacker', 'targetIndustry', 'attacker,targetIndustry')`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID(s) to filter by. Can be a single dataset ID, comma-separated list, or array. If not provided, uses default dataset`}).option(`start-date`,{type:`string`,description:`Start date for filtering (ISO 8601 format, e.g., '2024-01-01')`}).option(`end-date`,{type:`string`,description:`End date for filtering (ISO 8601 format, e.g., '2024-12-31')`}).option(`group-by-date`,{type:`boolean`,description:`Whether to group results by date (daily aggregation)`}).option(`limit`,{type:`number`,description:`Maximum number of results to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Aggregate threat events by one or more columns (e.g., attacker, targetIndustry) with optional date filtering and daily grouping. Supports multi-dimensional aggregation for cross-analysis.`,builder:S,handler:async r=>{let c={aggregateBy:r[`aggregate-by`],datasetId:r[`dataset-id`],startDate:r[`start-date`],endDate:r[`end-date`],groupByDate:r[`group-by-date`],limit:r.limit};if(r.dryRun){o({command:`cf cloudforce-one events aggregate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/aggregate`,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.cloudforceOne.events.aggregate.get({account_id:u,...c})),{successLabel:`Loaded`})}},w={command:`aggregate`,describe:`Operations for events.aggregate`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Lists categories`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events categories catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/categories/catalog`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.events.categories.catalog.get({account_id:l})),{successLabel:`Loaded`})}},D={command:`catalog`,describe:`Operations for events.categories.catalog`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`category-id`,{type:`string`,description:`Category UUID.`,demandOption:!0}).option(`kill-chain`,{type:`number`,description:`The killChain field`}).option(`mitre-attack`,{type:`string`,array:!0,description:`The mitreAttack field`}).option(`mitre-capec`,{type:`string`,array:!0,description:`The mitreCapec field`}).option(`name`,{type:`string`,description:`The name field`}).option(`shortname`,{type:`string`,description:`The shortname 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 k={command:`create <category-id>`,describe:`Updates a category`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:d(r.name,`name`,`text`),shortname:d(r.shortname,`shortname`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.categories.create({...e,account_id:f,category_id:r[`category-id`]})),{successLabel:`Created`});return}let p=u({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:d(r.name,`name`,`text`),shortname:d(r.shortname,`shortname`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.categories.create({...p,account_id:f,category_id:r[`category-id`]})),{successLabel:`Created`})}},A={command:`categories`,describe:`Operations for events.categories`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`attacker`,{type:`string`,description:`The attacker field`}).option(`attacker-country`,{type:`string`,description:`The attackerCountry field`}).option(`category`,{type:`string`,description:`The category field`}).option(`created-at`,{type:`string`,description:`The createdAt field`}).option(`dataset-id`,{type:`string`,description:`Dataset ID containing the event to update.`}).option(`date`,{type:`string`,description:`The date field`}).option(`event`,{type:`string`,description:`The event field`}).option(`indicator`,{type:`string`,description:`The indicator field`}).option(`indicator-type`,{type:`string`,description:`The indicatorType field`}).option(`insight`,{type:`string`,description:`The insight field`}).option(`raw-source`,{type:`string`,description:`The raw.source field`}).option(`raw-tlp`,{type:`string`,description:`The raw.tlp field`}).option(`target-country`,{type:`string`,description:`The targetCountry field`}).option(`target-industry`,{type:`string`,description:`The targetIndustry field`}).option(`tlp`,{type:`string`,description:`The tlp field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create <event-id>`,describe:`Updates an event`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/${r[`event-id`]==null?`<event-id>`:encodeURIComponent(String(r[`event-id`]))}`,pathParams:{"event-id":String(r[`event-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({attacker:d(r.attacker,`attacker`,`text`),attackerCountry:d(r[`attacker-country`],`attacker-country`,`text`),category:d(r.category,`category`,`text`),createdAt:d(r[`created-at`],`created-at`,`text`),datasetId:d(r[`dataset-id`],`dataset-id`,`text`),date:d(r.date,`date`,`text`),event:d(r.event,`event`,`text`),indicator:d(r.indicator,`indicator`,`text`),indicatorType:d(r[`indicator-type`],`indicator-type`,`text`),insight:d(r.insight,`insight`,`text`),raw:{source:d(r[`raw-source`],`raw-source`,`text`),tlp:d(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:d(r[`target-country`],`target-country`,`text`),targetIndustry:d(r[`target-industry`],`target-industry`,`text`),tlp:d(r.tlp,`tlp`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.create({...e,account_id:f,event_id:r[`event-id`]})),{successLabel:`Created`});return}r[`dataset-id`]===void 0&&(r[`dataset-id`]=await p(`dataset-id`,`Dataset ID containing the event to update.`));let m=u({attacker:d(r.attacker,`attacker`,`text`),attackerCountry:d(r[`attacker-country`],`attacker-country`,`text`),category:d(r.category,`category`,`text`),createdAt:d(r[`created-at`],`created-at`,`text`),datasetId:d(r[`dataset-id`],`dataset-id`,`text`),date:d(r.date,`date`,`text`),event:d(r.event,`event`,`text`),indicator:d(r.indicator,`indicator`,`text`),indicatorType:d(r[`indicator-type`],`indicator-type`,`text`),insight:d(r.insight,`insight`,`text`),raw:{source:d(r[`raw-source`],`raw-source`,`text`),tlp:d(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:d(r[`target-country`],`target-country`,`text`),targetIndustry:d(r[`target-industry`],`target-industry`,`text`),tlp:d(r.tlp,`tlp`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.create({...m,account_id:f,event_id:r[`event-id`]})),{successLabel:`Created`})}};function N(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`keep-raw-data`,{type:`boolean`,description:`If true, copies raw data to the destination dataset. Default is false (raw data is stripped/not copied).`}).option(`dest-dataset-id`,{type:`string`,description:`The destDatasetId field`}).option(`event-ids`,{type:`string`,array:!0,description:`The eventIds 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 P={command:`create <dataset-id>`,describe:`Copies specified events from one dataset to another dataset`,builder:N,handler:async r=>{let l={keepRawData:r[`keep-raw-data`]};if(r.dryRun){o({command:`cf cloudforce-one events dataset copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/copy`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},query:l,bodyKind:`json`,body:r.body===void 0?u({destDatasetId:d(r[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:r[`event-ids`]}):c(r.body)});return}let f=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...e,account_id:m,dataset_id:r[`dataset-id`],...l})),{successLabel:`Created`});return}if(r[`dest-dataset-id`]===void 0&&(r[`dest-dataset-id`]=await p(`dest-dataset-id`,`The destDatasetId field`)),r[`event-ids`]===void 0)throw Error(`--event-ids is required (or pass --body with this field set).`);let h=u({destDatasetId:d(r[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:r[`event-ids`]});new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...h,account_id:m,dataset_id:r[`dataset-id`],...l})),{successLabel:`Created`})}},F={command:`copy`,describe:`Operations for events.dataset.copy`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`is-public`,{type:`boolean`,description:`If true, then anyone can search the dataset. If false, then its limited to the account.`}).option(`name`,{type:`string`,description:`Used to describe the dataset within the account context.`}).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 <dataset-id>`,describe:`Updates an existing dataset`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({isPublic:r[`is-public`],name:d(r.name,`name`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.dataset.create({...e,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`});return}if(r[`is-public`]===void 0)throw Error(`--is-public is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`Used to describe the dataset within the account context.`));let m=u({isPublic:r[`is-public`],name:d(r.name,`name`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.create({...m,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})}};function R(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID to delete`,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 <dataset-id>`,describe:`Soft-deletes a dataset given a datasetId.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
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,r 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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Binary file to be uploaded to the database.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const te={command:`create`,describe:`Uploads a binary file to Cloudforce One's binary database for malware analysis and threat intelligence correlation.`,builder:ee,handler:async c=>{if(c.dryRun){o({command:`cf cloudforce-one binary-storage create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/binary`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await i(c),u=c.local?e:await t();if(c.accountId=u,c.file!==void 0||c.body!==void 0){let e=new FormData;if(c.file){let t=f(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${u}/cloudforce-one/binary`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=d(c.body,`body`,`binary`);a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${u}/cloudforce-one/binary`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{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 y(e){return e.positional(`hash`,{type:`string`,description:`hash of the binary`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <hash>`,describe:`Retrieves a binary file from the Cloudforce One binary storage for analysis.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one binary-storage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/binary/${r.hash==null?`<hash>`:encodeURIComponent(String(r.hash))}`,pathParams:{hash:String(r.hash??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.binaryStorage.get({account_id:l,hash:r.hash})),{successLabel:`Loaded`})}},x={command:`binary-storage`,describe:`Upload and retrieve malware samples and suspicious binaries for analysis`,builder:e=>e.command(te).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`aggregate-by`,{type:`string`,description:`Column(s) to aggregate by - single column or comma-separated list (e.g., 'attacker', 'targetIndustry', 'attacker,targetIndustry')`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID(s) to filter by. Can be a single dataset ID, comma-separated list, or array. If not provided, uses default dataset`}).option(`start-date`,{type:`string`,description:`Start date for filtering (ISO 8601 format, e.g., '2024-01-01')`}).option(`end-date`,{type:`string`,description:`End date for filtering (ISO 8601 format, e.g., '2024-12-31')`}).option(`group-by-date`,{type:`boolean`,description:`Whether to group results by date (daily aggregation)`}).option(`limit`,{type:`number`,description:`Maximum number of results to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Aggregate threat events by one or more columns (e.g., attacker, targetIndustry) with optional date filtering and daily grouping. Supports multi-dimensional aggregation for cross-analysis.`,builder:S,handler:async r=>{let c={aggregateBy:r[`aggregate-by`],datasetId:r[`dataset-id`],startDate:r[`start-date`],endDate:r[`end-date`],groupByDate:r[`group-by-date`],limit:r.limit};if(r.dryRun){o({command:`cf cloudforce-one events aggregate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/aggregate`,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.cloudforceOne.events.aggregate.get({account_id:u,...c})),{successLabel:`Loaded`})}},w={command:`aggregate`,describe:`Operations for events.aggregate`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Lists categories`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events categories catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/categories/catalog`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.events.categories.catalog.get({account_id:l})),{successLabel:`Loaded`})}},D={command:`catalog`,describe:`Operations for events.categories.catalog`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`category-id`,{type:`string`,description:`Category UUID.`,demandOption:!0}).option(`kill-chain`,{type:`number`,description:`The killChain field`}).option(`mitre-attack`,{type:`string`,array:!0,description:`The mitreAttack field`}).option(`mitre-capec`,{type:`string`,array:!0,description:`The mitreCapec field`}).option(`name`,{type:`string`,description:`The name field`}).option(`shortname`,{type:`string`,description:`The shortname 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 k={command:`create <category-id>`,describe:`Updates a category`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:d(r.name,`name`,`text`),shortname:d(r.shortname,`shortname`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.categories.create({...e,account_id:f,category_id:r[`category-id`]})),{successLabel:`Created`});return}let p=u({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:d(r.name,`name`,`text`),shortname:d(r.shortname,`shortname`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.categories.create({...p,account_id:f,category_id:r[`category-id`]})),{successLabel:`Created`})}},A={command:`categories`,describe:`Operations for events.categories`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`attacker`,{type:`string`,description:`The attacker field`}).option(`attacker-country`,{type:`string`,description:`The attackerCountry field`}).option(`category`,{type:`string`,description:`The category field`}).option(`created-at`,{type:`string`,description:`The createdAt field`}).option(`dataset-id`,{type:`string`,description:`Dataset ID containing the event to update.`}).option(`date`,{type:`string`,description:`The date field`}).option(`event`,{type:`string`,description:`The event field`}).option(`indicator`,{type:`string`,description:`The indicator field`}).option(`indicator-type`,{type:`string`,description:`The indicatorType field`}).option(`insight`,{type:`string`,description:`The insight field`}).option(`raw-source`,{type:`string`,description:`The raw.source field`}).option(`raw-tlp`,{type:`string`,description:`The raw.tlp field`}).option(`target-country`,{type:`string`,description:`The targetCountry field`}).option(`target-industry`,{type:`string`,description:`The targetIndustry field`}).option(`tlp`,{type:`string`,description:`The tlp field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create <event-id>`,describe:`Updates an event`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/${r[`event-id`]==null?`<event-id>`:encodeURIComponent(String(r[`event-id`]))}`,pathParams:{"event-id":String(r[`event-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({attacker:d(r.attacker,`attacker`,`text`),attackerCountry:d(r[`attacker-country`],`attacker-country`,`text`),category:d(r.category,`category`,`text`),createdAt:d(r[`created-at`],`created-at`,`text`),datasetId:d(r[`dataset-id`],`dataset-id`,`text`),date:d(r.date,`date`,`text`),event:d(r.event,`event`,`text`),indicator:d(r.indicator,`indicator`,`text`),indicatorType:d(r[`indicator-type`],`indicator-type`,`text`),insight:d(r.insight,`insight`,`text`),raw:{source:d(r[`raw-source`],`raw-source`,`text`),tlp:d(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:d(r[`target-country`],`target-country`,`text`),targetIndustry:d(r[`target-industry`],`target-industry`,`text`),tlp:d(r.tlp,`tlp`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.create({...e,account_id:f,event_id:r[`event-id`]})),{successLabel:`Created`});return}r[`dataset-id`]===void 0&&(r[`dataset-id`]=await p(`dataset-id`,`Dataset ID containing the event to update.`));let m=u({attacker:d(r.attacker,`attacker`,`text`),attackerCountry:d(r[`attacker-country`],`attacker-country`,`text`),category:d(r.category,`category`,`text`),createdAt:d(r[`created-at`],`created-at`,`text`),datasetId:d(r[`dataset-id`],`dataset-id`,`text`),date:d(r.date,`date`,`text`),event:d(r.event,`event`,`text`),indicator:d(r.indicator,`indicator`,`text`),indicatorType:d(r[`indicator-type`],`indicator-type`,`text`),insight:d(r.insight,`insight`,`text`),raw:{source:d(r[`raw-source`],`raw-source`,`text`),tlp:d(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:d(r[`target-country`],`target-country`,`text`),targetIndustry:d(r[`target-industry`],`target-industry`,`text`),tlp:d(r.tlp,`tlp`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.create({...m,account_id:f,event_id:r[`event-id`]})),{successLabel:`Created`})}};function N(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`keep-raw-data`,{type:`boolean`,description:`If true, copies raw data to the destination dataset. Default is false (raw data is stripped/not copied).`}).option(`dest-dataset-id`,{type:`string`,description:`The destDatasetId field`}).option(`event-ids`,{type:`string`,array:!0,description:`The eventIds 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 P={command:`create <dataset-id>`,describe:`Copies specified events from one dataset to another dataset`,builder:N,handler:async r=>{let l={keepRawData:r[`keep-raw-data`]};if(r.dryRun){o({command:`cf cloudforce-one events dataset copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/copy`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},query:l,bodyKind:`json`,body:r.body===void 0?u({destDatasetId:d(r[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:r[`event-ids`]}):c(r.body)});return}let f=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...e,account_id:m,dataset_id:r[`dataset-id`],...l})),{successLabel:`Created`});return}if(r[`dest-dataset-id`]===void 0&&(r[`dest-dataset-id`]=await p(`dest-dataset-id`,`The destDatasetId field`)),r[`event-ids`]===void 0)throw Error(`--event-ids is required (or pass --body with this field set).`);let h=u({destDatasetId:d(r[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:r[`event-ids`]});new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>f.cloudforceOne.events.dataset.copy.create({...h,account_id:m,dataset_id:r[`dataset-id`],...l})),{successLabel:`Created`})}},F={command:`copy`,describe:`Operations for events.dataset.copy`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`is-public`,{type:`boolean`,description:`If true, then anyone can search the dataset. If false, then its limited to the account.`}).option(`name`,{type:`string`,description:`Used to describe the dataset within the account context.`}).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 <dataset-id>`,describe:`Updates an existing dataset`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({isPublic:r[`is-public`],name:d(r.name,`name`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.dataset.create({...e,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`});return}if(r[`is-public`]===void 0)throw Error(`--is-public is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`Used to describe the dataset within the account context.`));let m=u({isPublic:r[`is-public`],name:d(r.name,`name`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.create({...m,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})}};function R(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID to delete`,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 <dataset-id>`,describe:`Soft-deletes a dataset given a datasetId.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.events.dataset.delete({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <event-id>`,describe:`Retrieves a specific event by its UUID.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/events/${r[`event-id`]==null?`<event-id>`:encodeURIComponent(String(r[`event-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``),"event-id":String(r[`event-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.events.dataset.events.get({account_id:l,dataset_id:r[`dataset-id`],event_id:r[`event-id`]})),{successLabel:`Loaded`})}},H={command:`events`,describe:`Operations for events.dataset.events`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name 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 W={command:`create`,describe:`Create a group`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.dataset.groups.create({...e,account_id:f})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await p(`description`,`The description field`)),r.name===void 0&&(r.name=await p(`name`,`The name field`));let m=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.groups.create({...m,account_id:f})),{successLabel:`Created`})}};function G(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const K={command:`delete <group-id>`,describe:`Delete a group for an account`,builder:G,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.events.dataset.groups.delete({account_id:l,group_id:r[`group-id`]})),{successLabel:`Deleted`})}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`group`,describe:`List groups for an account`,builder:q,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups get group`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.events.dataset.groups.get.group({account_id:l})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`v2 <group-id>`,describe:`Read a group for an account`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.events.dataset.groups.get.v2({account_id:l,group_id:r[`group-id`]})),{successLabel:`Loaded`})}},Z={command:`get`,describe:`Operations for events.dataset.groups.get`,builder:e=>e.command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`The accountTag 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 ne={command:`create <group-id>`,describe:`Create a group member`,builder:Q,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}/members`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({accountTag:d(r[`account-tag`],`account-tag`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.dataset.groups.members.create({...e,account_id:f,group_id:r[`group-id`]})),{successLabel:`Created`});return}let p=u({accountTag:d(r[`account-tag`],`account-tag`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.groups.members.create({...p,account_id:f,group_id:r[`group-id`]})),{successLabel:`Created`})}};function re(e){return e.positional(`member-id`,{type:`string`,description:`Member ID`,demandOption:!0}).option(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ie={command:`delete <member-id>`,describe:`Delete a group member`,builder:re,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``),"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.events.dataset.groups.members.delete({account_id:l,group_id:r[`group-id`],member_id:r[`member-id`]})),{successLabel:`Deleted`})}};function ae(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <group-id>`,describe:`List group members`,builder:ae,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}/members`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.events.dataset.groups.members.get({account_id:l,group_id:r[`group-id`]})),{successLabel:`Loaded`})}},se={command:`members`,describe:`Operations for events.dataset.groups.members`,builder:e=>e.command(ne).command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name 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 le={command:`update <group-id>`,describe:`Update a group`,builder:ce,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/-/groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.cloudforceOne.events.dataset.groups.update({...e,account_id:f,group_id:r[`group-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await p(`description`,`The description field`)),r.name===void 0&&(r.name=await p(`name`,`The name field`));let m=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});a(await s(`Updating`,async()=>l.cloudforceOne.events.dataset.groups.update({...m,account_id:f,group_id:r[`group-id`]})),{successLabel:`Updated`})}},ue={command:`groups`,describe:`Operations for events.dataset.groups`,builder:e=>e.command(W).command(K).command(le).command(Z).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description for the indicator type`}).option(`indicator-type`,{type:`string`,description:`The indicator type to create (e.g., 'DOMAIN', 'IP', 'URL', 'HASH', 'EMAIL')`}).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 fe={command:`create <dataset-id>`,describe:`Creates a new indicator type and initializes its dedicated Durable Object`,builder:de,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset indicator types create create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/indicatorTypes/create`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),indicatorType:d(r[`indicator-type`],`indicator-type`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.dataset.indicator.types.create.create({...e,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`});return}r[`indicator-type`]===void 0&&(r[`indicator-type`]=await p(`indicator-type`,`The indicator type to create (e.g., 'DOMAIN', 'IP', 'URL', 'HASH', 'EMAIL')`));let m=u({description:d(r.description,`description`,`text`),indicatorType:d(r[`indicator-type`],`indicator-type`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.indicator.types.create.create({...m,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})}},pe={command:`create`,describe:`Operations for events.dataset.indicator.types.create`,builder:e=>e.command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},me={command:`types`,describe:`Operations for events.dataset.indicator.types`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`indicator`,describe:`Operations for events.dataset.indicator`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`auto-create-type`,{type:`boolean`,description:`Global flag to automatically create indicator types if they don't exist. Individual indicators can override this with their own autoCreateType flag.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`create <dataset-id>`,describe:`Creates multiple indicators at once with their respective types and related datasets.`,builder:ge,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset indicators bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/indicators/bulk`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({autoCreateType:r[`auto-create-type`]}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.indicators.bulk.create({...e,account_id:d,dataset_id:r[`dataset-id`]})),{successLabel:`Created`});return}let f=u({autoCreateType:r[`auto-create-type`]});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.indicators.bulk.create({...f,account_id:d,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})}},ve={command:`bulk`,describe:`Operations for events.dataset.indicators.bulk`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.positional(`dataset-id`,{type:`string`,description:`Dataset UUID.`,demandOption:!0}).option(`auto-create-type`,{type:`boolean`,description:`If true, automatically create the indicator type if it doesn't exist. If false (default), throw an error when the indicator type doesn't exist.`}).option(`indicator-type`,{type:`string`,description:`The indicatorType field`}).option(`value`,{type:`string`,description:`The value 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 be={command:`create <dataset-id>`,describe:`Creates a new indicator with the specified type and related datasets.`,builder:ye,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset indicators create create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/indicators/create`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({autoCreateType:r[`auto-create-type`],indicatorType:d(r[`indicator-type`],`indicator-type`,`text`),value:d(r.value,`value`,`text`)}):c(r.body)});return}let l=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()=>l.cloudforceOne.events.dataset.indicators.create.create({...e,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`});return}r[`indicator-type`]===void 0&&(r[`indicator-type`]=await p(`indicator-type`,`The indicatorType field`)),r.value===void 0&&(r.value=await p(`value`,`The value field`));let m=u({autoCreateType:r[`auto-create-type`],indicatorType:d(r[`indicator-type`],`indicator-type`,`text`),value:d(r.value,`value`,`text`)});a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.indicators.create.create({...m,account_id:f,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})}},xe={command:`create`,describe:`Operations for events.dataset.indicators.create`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.positional(`indicator-id`,{type:`string`,description:`Indicator UUID.`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ce={command:`delete <indicator-id>`,describe:`Deletes a specific indicator by its UUID.`,builder:Se,handler:async r=>{if(r.dryRun){o({command:`cf cloudforce-one events dataset indicators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/indicators/${r[`indicator-id`]==null?`<indicator-id>`:encodeURIComponent(String(r[`indicator-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``),"indicator-id":String(r[`indicator-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-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";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){a({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});i(await o(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){a({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(s[`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.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-D5_3X7XW.mjs}
RENAMED
|
@@ -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.positional(`event-n`,{type:`string`,description:`Event n`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`event-t`,{type:`string`,description:`Event t`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get <event-n>`,describe:`Gets Magic WAN Connector Telemetry Event`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf connector-telemetry-events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events/${s[`event-t`]==null?`<event-t>`:encodeURIComponent(String(s[`event-t`]))}.${s[`event-n`]==null?`<event-n>`:encodeURIComponent(String(s[`event-n`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"event-t":String(s[`event-t`]??``),"event-n":String(s[`event-n`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorTelemetryEvents.get({account_id:l,connector_id:s[`connector-id`],event_t:s[`event-t`],event_n:s[`event-n`]})),{successLabel:`Loaded`})}};function l(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`k`,{type:`string`,description:`Filter by event kind`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Lists Magic WAN Connector Telemetry Events`,builder:l,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor,k:s.k};if(s.dryRun){a({command:`cf connector-telemetry-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.connectorTelemetryEvents.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},d={command:`connector-telemetry-events`,describe:`connector-telemetry-events`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d 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.positional(`snapshot-t`,{type:`string`,description:`Snapshot t`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get <snapshot-t>`,describe:`Gets Magic WAN Connector Telemetry Snapshot`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf connector-telemetry-snapshots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots/${s[`snapshot-t`]==null?`<snapshot-t>`:encodeURIComponent(String(s[`snapshot-t`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"snapshot-t":String(s[`snapshot-t`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorTelemetrySnapshots.get({account_id:l,connector_id:s[`connector-id`],snapshot_t:s[`snapshot-t`]})),{successLabel:`Loaded`})}};function l(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Lists Magic WAN Connector Telemetry Snapshots`,builder:l,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf connector-telemetry-snapshots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.connectorTelemetrySnapshots.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},d={command:`connector-telemetry-snapshots`,describe:`connector-telemetry-snapshots`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-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{n as u}from"./prompt-CDtLWxNv.mjs";import{t as d}from"./cli-types-BWdZbsFE.mjs";function f(e){return e.option(`device-id`,{type:`string`,description:`The device.id field`}).option(`device-provision-license`,{type:`boolean`,description:`When true, create and provision a new licence key for the connector.`}).option(`device-serial-number`,{type:`string`,description:`The device.serial_number field`}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`,default:!0}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone 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 p={command:`create`,describe:`Creates a Magic WAN Connector.`,builder:f,handler:async u=>{if(u.dryRun){a({command:`cf connectors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)});i(await o(`Creating`,async()=>d.connectors.create({...p,account_id:f})),{successLabel:`Created`})}};function m(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <connector-id>`,describe:`Deletes a Magic WAN Connector.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf connectors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await u({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.connectors.delete({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).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 _={command:`edit <connector-id>`,describe:`Edits properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf connectors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):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.connectors.edit({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});i(await o(`Updating`,async()=>d.connectors.edit({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <connector-id>`,describe:`Gets a Magic WAN Connector.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`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.connectors.get({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`device-type`,{type:`string`,description:`Filter connectors by device type.`,choices:[`MANAGED`,`LICENSED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists Magic WAN Connectors.`,builder:d(b),handler:async s=>{let c={device_type:s[`device-type`]};if(s.dryRun){a({command:`cf connectors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors`,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.connectors.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).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 C={command:`update <connector-id>`,describe:`Updates properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:S,handler:async u=>{if(u.dryRun){a({command:`cf connectors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):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.connectors.update({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});i(await o(`Updating`,async()=>d.connectors.update({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}},w={command:`connectors`,describe:`connectors`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w 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{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,i as d,n as f}from"./prompt-CDtLWxNv.mjs";function p(e){return e.option(`configuration-command`,{type:`string`,array:!0,description:`The command that runs when the container starts, passed to the entrypoint.
|
|
3
3
|
You can override this at run-time. If you override only the command,
|
|
4
4
|
it gets passed to the default entrypoint specified in the image.
|
|
5
5
|
`}).option(`configuration-entrypoint`,{type:`string`,array:!0,description:`The entry point for the container, specifying the executable to run when the container starts.
|
|
@@ -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{a as c,i as l,n as u}from"./prompt-CDtLWxNv.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of Content Scanning custom expressions to create.`})}const f={command:`create`,describe:'Create one or more Content Scanning custom expressions, appending them to the existing list of the zone, and return the updated list. Each expression reaches content objects the scanner cannot find automatically, for example `lookup_json_string(http.request.body.raw, "file")`.',builder:d,handler:async o=>{if(o.dryRun){r({command:`cf content-scan expressions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Creating`,async()=>s.contentScan.expressions.create({body:e,zone_id:c})),{successLabel:`Created`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function p(e){return e.positional(`expression-id`,{type:`string`,description:`Defines the unique ID for this Content Scanning custom expression.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <expression-id>`,describe:`Delete the Content Scanning custom expression with the given identifier and return the expressions that remain. Content objects reached only by the deleted expression are no longer scanned.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf content-scan expressions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads/${a[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(a[`expression-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"expression-id":String(a[`expression-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await u({force:!!a.force,message:`This operation deletes a Content Scanning custom expression.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.contentScan.expressions.delete({zone_id:s,expression_id:a[`expression-id`]})),{successLabel:`Deleted`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List the Content Scanning custom expressions configured for the zone, each with its own identifier. A custom expression tells the scanner how to reach content objects in a request it cannot parse on its own, such as files Base64-encoded inside a JSON body.`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf content-scan expressions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads`,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.contentScan.expressions.list({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.positional(`expression-id`,{type:`string`,description:`Defines the unique ID for this Content Scanning custom expression.`,demandOption:!0}).option(`payload`,{type:`string`,description:`Defines the custom content extraction expression used to reach content objects in the request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning custom expression to update.`})}const v={command:`update <expression-id>`,describe:`Update the Content Scanning custom expression with the given identifier and return the updated list of expressions.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf content-scan expressions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/content-upload-scan/payloads/${l[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(l[`expression-id`]))}`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``),"expression-id":String(l[`expression-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({payload:s(l.payload,`payload`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.contentScan.expressions.update({...e,zone_id:d,expression_id:l[`expression-id`]})),{successLabel:`Updated`});return}l.payload===void 0&&(l.payload=await c(`payload`,`Defines the custom content extraction expression used to reach content objects in the request.`));let f=o({payload:s(l.payload,`payload`,`text`)});n(await i(`Updating`,async()=>u.contentScan.expressions.update({...f,zone_id:d,expression_id:l[`expression-id`]})),{successLabel:`Updated`})}},y={command:`expressions`,describe:`Custom expressions that tell the scanner how to reach content objects it cannot parse on its own`,builder:e=>e.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 Content Scanning status for the zone, together with the date the status was last modified.`,builder:b,handler:async a=>{if(a.dryRun){r({command:`cf content-scan get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/settings`,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.contentScan.get({zone_id:s})),{successLabel:`Loaded`})}};function S(e){return e.option(`value`,{type:`string`,description:`The status value for Content Scanning.`,choices:[`enabled`,`disabled`]}).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:`Content Scanning settings to update.`})}const C={command:`update`,describe:"Update the Content Scanning status by setting the status value to `enabled` or `disabled`. This is equivalent to calling the dedicated enable and disable endpoints.",builder:S,handler:async c=>{if(c.dryRun){r({command:`cf content-scan update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({value:s(c.value,`value`,`text`)}):a(c.body)});return}let d=await t(c),f=await e({zone:c.zone},d,{quiet:c.quiet});if(c.zoneId=f,!await u({force:!!c.force,message:`This operation toggles Content Scanning for a zone.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}if(c.body){let e=a(c.body);n(await i(`Deleting`,async()=>d.contentScan.update({...e,zone_id:f})),{successLabel:`Deleted`});return}c.value===void 0&&(c.value=await l(`value`,`The status value for Content Scanning.`,[`enabled`,`disabled`]));let p=o({value:s(c.value,`value`,`text`)});n(await i(`Deleting`,async()=>d.contentScan.update({...p,zone_id:f})),{successLabel:`Deleted`})}},w={command:`content-scan`,describe:`Malicious uploads detection, scan uploaded content in HTTP requests for malware and malicious payloads`,builder:e=>e.command(x).command(C).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-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";function c(e){return e.option(`id`,{type:`string`,description:`The feature identifier.`,choices:[`csam_scanner`]}).option(`value-email`,{type:`string`,description:`Notification email address for CSAM scan results. When changed,
|
|
3
3
|
email verification is triggered automatically.
|
|
4
4
|
`}).option(`value-enabled`,{type:`boolean`,description:`Whether CSAM scanning is enabled for this zone.`}).option(`value-resend-email`,{type:`boolean`,description:`Set to true to trigger re-sending the email verification.
|
|
5
5
|
Write-only; never appears in responses (omitted when false).
|
|
@@ -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";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:`Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and the list of email addresses that receive alerts, if any have been configured.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf ct-alerting get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ct/alerting`,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.ctAlerting.get({zone_id:s})),{successLabel:`Loaded`})}};function l(e){return e.option(`emails`,{type:`string`,array:!0,description:`Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.
|
|
3
3
|
`}).option(`enabled`,{type:`boolean`,description:`Whether CT alerting is enabled for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating CT alerting subscription settings.`})}const u={command:`update`,describe:"Create or update the Certificate Transparency alerting subscription for a zone. Enables or disables email notifications when certificates are issued for the zone's domains. The `enabled` field is required on every request and controls whether the subscription is active. The `emails` field is optional and, when provided, replaces the stored recipient list for the zone. When `emails` is omitted, the stored recipient list is preserved and only the enabled state is toggled. A maximum of 100 email addresses may be configured per zone. Requests that omit `enabled` are rejected with error code 1008. Subscribe and unsubscribe notification emails are only sent for recipients whose effective subscription state changes. Idempotent requests (no state change) send no notification email.",builder:l,handler:async s=>{if(s.dryRun){r({command:`cf ct-alerting update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ct/alerting`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({emails:s.emails,enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.ctAlerting.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({emails:s.emails,enabled:s.enabled});n(await i(`Updating`,async()=>c.ctAlerting.update({...u,zone_id:l})),{successLabel:`Updated`})}},d={command:`ct-alerting`,describe:`ct-alerting`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-BPizUUqP.mjs";import{a as t,r as n}from"./auth-DuLchM18.mjs";import{t as r}from"./output-DgW1hQGX.mjs";import{n as i,t as a}from"./progress-B84wYh91.mjs";import{n as o,t as s}from"./body-parser-CYD7PKFC.mjs";import{n as c}from"./input-validation-BBKJRoRB.mjs";import{a as l,n as u}from"./prompt-CDtLWxNv.mjs";import{t as d}from"./cli-types-BWdZbsFE.mjs";function f(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 certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
3
3
|
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Upload a new SSL certificate for a zone.`,builder:f,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)});r(await a(`Creating`,async()=>u.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-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 h={command:`delete <custom-certificate-id>`,describe:`Remove a SSL certificate from a zone.`,builder:m,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}r(await a(`Deleting`,async()=>o.customCertificates.delete({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
5
5
|
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).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 _={command:`edit <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=o(t.body);r(await a(`Updating`,async()=>l.customCertificates.edit({...e,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Updating`,async()=>l.customCertificates.edit({...d,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`custom-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 y={command:`get <custom-certificate-id>`,describe:`Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`,builder:v,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.customCertificates.get({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`,builder:d(b),handler:async t=>{let o={page:t.page,per_page:t[`per-page`],match:t.match,status:t.status};if(t.dryRun){i({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.customCertificates.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`,builder:S,handler:async s=>{if(s.dryRun){i({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.customCertificates.prioritize.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/custom_certificates/prioritize`)),{successLabel:`Updated`})}},w={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`custom-certificates`,describe:`custom-certificates`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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{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}from"./input-validation-BBKJRoRB.mjs";import{a as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const h={command:`create`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async r=>{if(r.dryRun){o({command:`cf custom-csrs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({common_name:u(r[`common-name`],`common-name`,`text`),country:u(r.country,`country`,`text`),description:u(r.description,`description`,`text`),key_type:u(r[`key-type`],`key-type`,`text`),locality:u(r.locality,`locality`,`text`),name:u(r.name,`name`,`text`),organization:u(r.organization,`organization`,`text`),organizational_unit:u(r[`organizational-unit`],`organizational-unit`,`text`),sans:r.sans,state:u(r.state,`state`,`text`)}):c(r.body)});return}let f=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()=>f.customCsrs.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`common-name`]===void 0&&(r[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),r.country===void 0&&(r.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),r.locality===void 0&&(r.locality=await d(`locality`,`City or locality name.`)),r.organization===void 0&&(r.organization=await d(`organization`,`Organization name.`)),r.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);r.state===void 0&&(r.state=await d(`state`,`State or province name.`));let m=l({common_name:u(r[`common-name`],`common-name`,`text`),country:u(r.country,`country`,`text`),description:u(r.description,`description`,`text`),key_type:u(r[`key-type`],`key-type`,`text`),locality:u(r.locality,`locality`,`text`),name:u(r.name,`name`,`text`),organization:u(r.organization,`organization`,`text`),organizational_unit:u(r[`organizational-unit`],`organizational-unit`,`text`),sans:r.sans,state:u(r.state,`state`,`text`)});a(await s(`Creating`,async()=>f.customCsrs.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required. The list should include the common name.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const _={command:`customCsrsForAZoneCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for a zone. Cloudflare generates and securely stores the private key associated with the CSR. The CSR can then be provided to a Certificate Authority for signing. Once signed, the certificate is uploaded via the Custom SSL endpoint using the CSR ID.`,builder:g,handler:async e=>{if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.customCsrs.customCsrsForAZoneCreateCustomCsr({...r,zone_id:n})),{successLabel:`Created`});return}if(e[`common-name`]===void 0&&(e[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),e.country===void 0&&(e.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),e.locality===void 0&&(e.locality=await d(`locality`,`City or locality name.`)),e.organization===void 0&&(e.organization=await d(`organization`,`Organization name.`)),e.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);e.state===void 0&&(e.state=await d(`state`,`State or province name.`));let f=l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)});a(await s(`Creating`,async()=>t.customCsrs.customCsrsForAZoneCreateCustomCsr({...f,zone_id:n})),{successLabel:`Created`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`customCsrsForAZoneCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:v,handler:async e=>{if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customCsrs.customCsrsForAZoneCustomCsrDetails({zone_id:n,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Loaded`})}};function b(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR 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 x={command:`customCsrsForAZoneDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key. A CSR cannot be deleted if any custom certificates still reference it.`,builder:b,handler:async e=>{if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await f({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>t.customCsrs.customCsrsForAZoneDeleteCustomCsr({zone_id:n,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Deleted`})}};function S(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`customCsrsForAZoneListCustomCsrs`,describe:`List all custom Certificate Signing Requests (CSRs) for a zone.`,builder:S,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneListCustomCsrs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.customCsrs.customCsrsForAZoneListCustomCsrs({zone_id:c,...t})),{successLabel:`Loaded`})}};function w(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR 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 <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf custom-csrs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs/${r[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(r[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(r[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>c.customCsrs.delete({account_id:l,custom_csr_id:r[`custom-csr-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf custom-csrs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs/${r[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(r[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(r[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customCsrs.get({account_id:l,custom_csr_id:r[`custom-csr-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List all custom Certificate Signing Requests (CSRs) for an account.`,builder:p(O),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 custom-csrs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs`,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.customCsrs.list({account_id:u,...c})),{successLabel:`Loaded`})}},A={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-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";import{t as u}from"./cli-types-BWdZbsFE.mjs";function d(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-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 f={command:`delete <certificate-id>`,describe:`Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames certificate-pack certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}/certificate_pack/${a[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(a[`certificate-pack-id`]))}/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-id`]??``),"certificate-pack-id":String(a[`certificate-pack-id`]??``),"certificate-id":String(a[`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.customHostnames.certificatePack.certificates.delete({zone_id:s,custom_hostname_id:a[`custom-hostname-id`],certificate_pack_id:a[`certificate-pack-id`],certificate_id:a[`certificate-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`update <certificate-id>`,describe:`Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.`,builder:p,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames certificate-pack certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/${l[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(l[`custom-hostname-id`]))}/certificate_pack/${l[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(l[`certificate-pack-id`]))}/certificates/${l[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(l[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(l[`custom-hostname-id`]??``),"certificate-pack-id":String(l[`certificate-pack-id`]??``),"certificate-id":String(l[`certificate-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:e,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`});return}l[`custom-certificate`]===void 0&&(l[`custom-certificate`]=await c(`custom-certificate`,`If a custom uploaded certificate is used.`)),l[`custom-key`]===void 0&&(l[`custom-key`]=await c(`custom-key`,`The key for a custom uploaded certificate.`,{kind:`secret`}));let f=o({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`text`)});n(await i(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:f,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`})}},h={command:`certificates`,describe:`Operations for certificate-pack.certificates`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`certificate-pack`,describe:`Operations for certificate-pack`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`hostname`,{type:`string`,description:`The custom hostname that will point to your hostname via CNAME.`}).option(`ssl-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(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).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:`Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}}):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.customHostnames.create({...e,zone_id:d})),{successLabel:`Created`});return}l.hostname===void 0&&(l.hostname=await c(`hostname`,`The custom hostname that will point to your hostname via CNAME.`));let f=o({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}});n(await i(`Creating`,async()=>u.customHostnames.create({...f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`customHostnameForAZoneCustomHostnameDetails <custom-hostname-id>`,describe:`Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames customHostnameForAZoneCustomHostnameDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-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.customHostnames.customHostnameForAZoneCustomHostnameDetails({zone_id:s,custom_hostname_id:a[`custom-hostname-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`custom-hostname-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 S={command:`delete <custom-hostname-id>`,describe:`Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-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.
|
|
4
4
|
`);return}n(await i(`Deleting`,async()=>o.customHostnames.delete({zone_id:s,custom_hostname_id:a[`custom-hostname-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`ssl-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`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <custom-hostname-id>`,describe:`Modify SSL configuration for a custom hostname. When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from 'http' to 'email'. Bundle an existing certificate with another certificate by using the "custom_cert_bundle" field. The bundling process supports combining certificates as long as the following condition is met. One certificate must use the RSA algorithm, and the other must use the ECDSA algorithm.`,builder:C,handler:async c=>{if(c.dryRun){r({command:`cf custom-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/custom_hostnames/${c[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(c[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(c[`custom-hostname-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({custom_origin_server:s(c[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(c[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:s(c[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(c[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:c[`ssl-cloudflare-branding`],custom_certificate:s(c[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(c[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(c[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(c[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:c[`ssl-settings-ciphers`],early_hints:s(c[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(c[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(c[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(c[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(c[`ssl-type`],`ssl-type`,`text`),wildcard:c[`ssl-wildcard`]}}):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.customHostnames.edit({...e,zone_id:u,custom_hostname_id:c[`custom-hostname-id`]})),{successLabel:`Updated`});return}let d=o({custom_origin_server:s(c[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(c[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:s(c[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(c[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:c[`ssl-cloudflare-branding`],custom_certificate:s(c[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(c[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(c[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(c[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:c[`ssl-settings-ciphers`],early_hints:s(c[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(c[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(c[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(c[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(c[`ssl-type`],`ssl-type`,`text`),wildcard:c[`ssl-wildcard`]}});n(await i(`Updating`,async()=>l.customHostnames.edit({...d,zone_id:u,custom_hostname_id:c[`custom-hostname-id`]})),{successLabel:`Updated`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete`,describe:`Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.`,builder:T,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames fallback-origin delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,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});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}n(await i(`Deleting`,async()=>o.customHostnames.fallbackOrigin.delete({zone_id:s})),{successLabel:`Deleted`})}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.`,builder:D,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames fallback-origin get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,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.customHostnames.fallbackOrigin.get({zone_id:s})),{successLabel:`Loaded`})}};function k(e){return e.option(`origin`,{type:`string`,description:`Your origin hostname that requests to your custom hostnames will be sent to.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`update`,describe:`Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.`,builder:k,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames fallback-origin update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({origin:s(l.origin,`origin`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.origin===void 0&&(l.origin=await c(`origin`,`Your origin hostname that requests to your custom hostnames will be sent to.`));let f=o({origin:s(l.origin,`origin`,`text`)});n(await i(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...f,zone_id:d})),{successLabel:`Updated`})}},j={command:`fallback-origin`,describe:`Operations for fallback-origin`,builder:e=>e.command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get`,describe:`Returns custom hostname quota usage for a zone. The allocated quota is a soft limit; creating custom hostnames after usage exceeds this limit can still succeed until the hard cap is reached. Use the exceeded and hard_cap fields to track when usage is above the soft limit and when new custom hostname creation will be rejected.`,builder:M,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/quota`,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.customHostnames.get({zone_id:s})),{successLabel:`Loaded`})}};function P(e){return e.option(`hostname`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-exact`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-starts-with`,{type:`string`,description:`Filters hostnames by a prefix match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.contain' parameters.`}).option(`hostname-contain`,{type:`string`,description:`Filters hostnames by a substring match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.startsWith' parameters.`}).option(`id`,{type:`string`,description:`Hostname ID to match against. This ID was generated and returned during the initial custom_hostname creation. This parameter cannot be used with the 'hostname', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of hostnames per page.`}).option(`order`,{type:`string`,description:`Field to order hostnames by.`,choices:[`ssl`,`ssl_status`]}).option(`direction`,{type:`string`,description:`Direction to order hostnames.`,choices:[`asc`,`desc`]}).option(`ssl-status`,{type:`string`,description:`Filter by SSL certificate status.`,choices:[`initializing`,`pending_validation`,`deleted`,`pending_issuance`,`pending_deployment`,`pending_deletion`,`pending_expiration`,`expired`,`active`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`pending_cleanup`,`staging_deployment`,`staging_active`,`deactivating`,`inactive`,`backup_issued`,`holding_deployment`]}).option(`hostname-status`,{type:`string`,description:`Filter by the hostname's activation status.`,choices:[`active`,`pending`,`active_redeploying`,`moved`,`pending_deletion`,`deleted`,`pending_blocked`,`pending_migration`,`pending_provisioned`,`test_pending`,`test_active`,`test_active_apex`,`test_blocked`,`test_failed`,`provisioned`,`blocked`]}).option(`certificate-authority`,{type:`string`,description:`Filter by the certificate authority that issued the SSL certificate.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`wildcard`,{type:`boolean`,description:`Filter by whether the custom hostname is a wildcard hostname.`}).option(`custom-origin-server`,{type:`string`,description:`Filter by custom origin server name.`}).option(`ssl`,{type:`string`,description:`Whether to filter hostnames based on if they have SSL enabled.`,choices:[`0`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`List, search, sort, and filter all of your custom hostnames.`,builder:u(P),handler:async a=>{let o={hostname:a.hostname,"hostname.exact":a[`hostname-exact`],"hostname.startsWith":a[`hostname-starts-with`],"hostname.contain":a[`hostname-contain`],id:a.id,page:a.page,per_page:a[`per-page`],order:a.order,direction:a.direction,ssl_status:a[`ssl-status`],hostname_status:a[`hostname-status`],certificate_authority:a[`certificate-authority`],wildcard:a.wildcard,custom_origin_server:a[`custom-origin-server`],ssl:a.ssl};if(a.dryRun){r({command:`cf custom-hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.customHostnames.list({zone_id:c,...o})),{successLabel:`Loaded`})}},I={command:`custom-hostnames`,describe:`custom-hostnames`,builder:e=>e.command(v).command(b).command(S).command(w).command(N).command(F).command(g).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-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";function f(e){return e.option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,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 p={command:`create`,describe:`Adds a custom nameserver to the account for use as a vanity nameserver on zones.`,builder:f,handler:async d=>{if(d.dryRun){a({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ns_name:l(d[`ns-name`],`ns-name`,`text`),ns_set:d[`ns-set`]}):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.customNameservers.create({body:e,account_id:p})),{successLabel:`Created`});return}d[`ns-name`]===void 0&&(d[`ns-name`]=await u(`ns-name`,`The FQDN of the name server.`));let m=c({ns_name:l(d[`ns-name`],`ns-name`,`text`),ns_set:d[`ns-set`]});i(await o(`Creating`,async()=>f.customNameservers.create({body:m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,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 h={command:`delete <custom-ns-id>`,describe:`Removes a custom nameserver from the account.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns/${s[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(s[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(s[`custom-ns-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.customNameservers.delete({account_id:l,custom_ns_id:s[`custom-ns-id`]})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`List an account's custom nameservers.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.customNameservers.get({account_id:l})),{successLabel:`Loaded`})}},v={command:`custom-nameservers`,describe:`custom-nameservers`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|