cf 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +189 -187
- package/dist/_meta/commands.json +2591 -2248
- package/dist/_meta/hand-written-commands.json +146 -1
- package/dist/_meta/schemas.json +1548 -1313
- package/dist/{abuse-reports-BbaHw4ST.mjs → abuse-reports-CDFjJ2e8.mjs} +1 -1
- package/dist/{access-D6Xz892p.mjs → access-BoT1waG4.mjs} +1 -1
- package/dist/{account-DvxcqeaK.mjs → account-agnMUKWj.mjs} +1 -1
- package/dist/{account-tags-CeqfEWpz.mjs → account-tags-BRMMHCee.mjs} +1 -1
- package/dist/{accounts-Bx-8BMH9.mjs → accounts-Cut77dAt.mjs} +2 -2
- package/dist/{acm--0opdSGE.mjs → acm-C8WgXNCl.mjs} +1 -1
- package/dist/{addressing-BS1ynzLA.mjs → addressing-CR8EV42x.mjs} +1 -1
- package/dist/{agent-context-BPhyrSns.mjs → agent-context-Wj5TRRbW.mjs} +1 -1
- package/dist/{agent-memory-DczzpEw5.mjs → agent-memory-CVJpKKZy.mjs} +1 -1
- package/dist/{ai-CDdCTcQl.mjs → ai-BbNYt-yI.mjs} +1 -1
- package/dist/{ai-audit-Bx9KMQYh.mjs → ai-audit-mVajM-2i.mjs} +1 -1
- package/dist/{ai-gateway-BSXJEaYS.mjs → ai-gateway-BsepSA_v.mjs} +2 -2
- package/dist/{ai-search-DRQj1aMu.mjs → ai-search-DbEJqm5-.mjs} +1 -1
- package/dist/{ai-security-C_Rb0lGT.mjs → ai-security-DmyB5EYk.mjs} +1 -1
- package/dist/{alerting-BAR9eFs2.mjs → alerting-dmy3hd8O.mjs} +3 -3
- package/dist/analytics-B1xBMla0.mjs +5 -0
- package/dist/{analytics_engine-DkEzlhfT.mjs → analytics_engine-DazCn3iC.mjs} +1 -1
- package/dist/{api-security-jA0lOk6a.mjs → api-security-0HXCzfHk.mjs} +1 -1
- package/dist/{argo-Cz4pDagx.mjs → argo-DSHsE8zv.mjs} +1 -1
- package/dist/{artifacts-BcLTGfAv.mjs → artifacts-CwiU9Mxu.mjs} +1 -1
- package/dist/{audit-logs-DbIv4n6u.mjs → audit-logs-DwFtMDwH.mjs} +1 -1
- package/dist/{auth-rW5d3jtr.mjs → auth-B0ZyXc3y.mjs} +1 -1
- package/dist/{auth-tvDdC1J-.mjs → auth-DWxtJ918.mjs} +2 -2
- package/dist/{billing-Md87QjqW.mjs → billing-Cbpadkgu.mjs} +1 -1
- package/dist/{bot-management-VHMo4hpU.mjs → bot-management-B6M2Vyyn.mjs} +1 -1
- package/dist/{botnet-feed-BHqfo3sa.mjs → botnet-feed-Dn8UuE4h.mjs} +1 -1
- package/dist/{brand-protection-HUeR6Pof.mjs → brand-protection-B5R0b3pu.mjs} +1 -1
- package/dist/{browser-extension-199oZg3X.mjs → browser-extension-D55pYZf_.mjs} +1 -1
- package/dist/{browser-run-DDasyux-.mjs → browser-run-C1b2VkGB.mjs} +1 -1
- package/dist/build-CP2JUfV1.mjs +2 -0
- package/dist/{builds-B-lXn6JR.mjs → builds-CVEXO_4a.mjs} +8 -8
- package/dist/{cache-CevKpiTM.mjs → cache-BU5xX82E.mjs} +1 -1
- package/dist/{certificate-authorities-DAg-aO1B.mjs → certificate-authorities--tZTWJWD.mjs} +1 -1
- package/dist/cf-BV2HLCQm.mjs +18 -0
- package/dist/{chunk-QBZBEHZB-BuiXJn8j.mjs → chunk-QBZBEHZB-BcCMlc8C.mjs} +1 -1
- package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +103 -0
- package/dist/{client-certificates-Bay7oPLE.mjs → client-certificates-DX84qeYG.mjs} +1 -1
- package/dist/{client-side-security-CbU9xn0k.mjs → client-side-security-DsSO2rZQ.mjs} +1 -1
- package/dist/{cloud-connector-AH2ClcSL.mjs → cloud-connector-cf8qlxap.mjs} +1 -1
- package/dist/{cloudforce-one-DwOfS75V.mjs → cloudforce-one-DzVXorbu.mjs} +2 -2
- package/dist/command-BL6weJf3.mjs +3 -0
- package/dist/command-DYrspBc0.mjs +2 -0
- package/dist/{completions-nPO9PdSu.mjs → completions-Dn621okY.mjs} +1 -1
- package/dist/{config-B8lwPpVl.mjs → config-BY6KpMZs.mjs} +1 -1
- package/dist/config.d.mts +1 -1729
- package/dist/config.mjs +1 -1
- package/dist/{connector-interrupts-DcLrqM2V.mjs → connector-interrupts-DqpqPPkp.mjs} +1 -1
- package/dist/{connector-telemetry-events-PrJWgNs9.mjs → connector-telemetry-events-CCD-_B-8.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-CIjJm5yu.mjs → connector-telemetry-snapshots-D3CeGGhk.mjs} +1 -1
- package/dist/{connectors-CEAy30E-.mjs → connectors-aPQspZdg.mjs} +1 -1
- package/dist/{containers-BsbDqbSn.mjs → containers-D0Kjl8h-.mjs} +1 -1
- package/dist/{content-scan-BdK936iO.mjs → content-scan-BVx18XmS.mjs} +1 -1
- package/dist/{cps-oP97-qkm.mjs → cps-ByazyM0x.mjs} +1 -1
- package/dist/{csamScanner-DUNN4INg.mjs → csamScanner-OG5lQxBC.mjs} +1 -1
- package/dist/{ct-alerting-dV_gsV2w.mjs → ct-alerting-BJx5n8Zf.mjs} +1 -1
- package/dist/{custom-certificates-DYspvjo4.mjs → custom-certificates-BuJ2e9TA.mjs} +1 -1
- package/dist/{custom-csrs-DjSWLQRu.mjs → custom-csrs-CR_5qbST.mjs} +1 -1
- package/dist/{custom-hostnames-df1lH6IY.mjs → custom-hostnames-BzDTsQXb.mjs} +1 -1
- package/dist/{custom-nameservers-CLTbN-9R.mjs → custom-nameservers-OfMPRGkD.mjs} +1 -1
- package/dist/custom-pages-BmGXoTIo.mjs +3 -0
- package/dist/d1-DedC8N0N.mjs +21 -0
- package/dist/data-security-B2UB26ry.mjs +7 -0
- package/dist/{dcv-delegation-_r6Vc6VL.mjs → dcv-delegation-C11vmzbG.mjs} +1 -1
- package/dist/{deploy-QTGENpOM.mjs → deploy-BtETDvDA.mjs} +1 -1
- package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-BoLTdQzS.mjs} +1 -1
- package/dist/{dev-CAubuxCc.mjs → dev-B5WcIpEr.mjs} +2 -2
- package/dist/{diagnostics-B0DRh714.mjs → diagnostics-Cf6BLpAo.mjs} +1 -1
- package/dist/dialog-Bud0hiYv.mjs +2 -0
- package/dist/{dist-DW5BPGFs.mjs → dist-BRg_z9Ut.mjs} +1 -1
- package/dist/{shared-YJtB5KZB.mjs → dist-CFQREIRi.mjs} +86 -86
- package/dist/dist-CyisSore.mjs +371 -0
- package/dist/dist-Dr4Hg_Up.mjs +48 -0
- package/dist/{dls-CFzTHcZM.mjs → dls-R6PvHbhj.mjs} +1 -1
- package/dist/{dns-Dw6u-NV1.mjs → dns-Cl8se64c.mjs} +1 -1
- package/dist/{dns-firewall-CIPptslp.mjs → dns-firewall-WtmKilDT.mjs} +1 -1
- package/dist/dry-run-YSQndLvt.mjs +2 -0
- package/dist/{durable-objects-CCkeqqBq.mjs → durable-objects-jfVU6yp_.mjs} +1 -1
- package/dist/{email-auth-kdxO51Oz.mjs → email-auth-DPmZ85eW.mjs} +1 -1
- package/dist/{email-routing-BLggZdQq.mjs → email-routing-Bf6DbNTr.mjs} +1 -1
- package/dist/{email-security-DjADlgdM.mjs → email-security-DTifjSxM.mjs} +1 -1
- package/dist/{email-sending-Cz7E7GoP.mjs → email-sending-Dm3WkFHV.mjs} +1 -1
- package/dist/{error-sanitization-DfLijlBJ.mjs → error-sanitization-D8zuyPj_.mjs} +1 -1
- package/dist/{fieldExtractors-BWaMi6lD.mjs → fieldExtractors-CeXZL0-I.mjs} +1 -1
- package/dist/{firewall-5t6OBIOl.mjs → firewall-D5N2APXO.mjs} +1 -1
- package/dist/{flagship-CzG_VoNR.mjs → flagship-sUOy9jei.mjs} +1 -1
- package/dist/{fraud-UOg_69Ob.mjs → fraud-WLW2Ep1Z.mjs} +1 -1
- package/dist/{google-tag-gateway-DirkD-Q2.mjs → google-tag-gateway-lbww1FaJ.mjs} +1 -1
- package/dist/{healthchecks-BkHZGTp1.mjs → healthchecks-0ih8Qjiw.mjs} +1 -1
- package/dist/{hostnames-EUYOZm21.mjs → hostnames-Ba6FuL8K.mjs} +1 -1
- package/dist/{hyperdrive-ZoLJlJCL.mjs → hyperdrive-DMqcU639.mjs} +1 -1
- package/dist/{iam-BQ2xSgYN.mjs → iam-CXlYm0uC.mjs} +1 -1
- package/dist/{images-CkEq6ScP.mjs → images-D_g1oli6.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DDWEdGyl.mjs → intel-B8bS0ARd.mjs} +1 -1
- package/dist/interactive-CGOh-aYq.mjs +32 -0
- package/dist/{ips-54Qmy-Uw.mjs → ips-68fzniN4.mjs} +1 -1
- package/dist/{keyless-certificates-CXHLc3Qz.mjs → keyless-certificates-CeLnqBvX.mjs} +1 -1
- package/dist/{keys-rvI4TC3Z.mjs → keys-DkVdS2lF.mjs} +1 -1
- package/dist/{kv-CAeN1zBy.mjs → kv-gDAN50BQ.mjs} +1 -1
- package/dist/{leaked-credential-checks-CbbwtG-p.mjs → leaked-credential-checks-DfnvHpvg.mjs} +1 -1
- package/dist/{lifecycle-XswDq0ZB.mjs → lifecycle-CadF_i2n.mjs} +1 -1
- package/dist/{load-balancers-BFwdwAIU.mjs → load-balancers-m0HqyXPZ.mjs} +1 -1
- package/dist/{local-C6XsFD_W.mjs → local-BwL_gesw.mjs} +1 -1
- package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-Dj8k-p62.mjs} +1 -1
- package/dist/{logo-matches-Y3PxVn7t.mjs → logo-matches-DPbHlsKQ.mjs} +1 -1
- package/dist/{logos-BN8SvJhS.mjs → logos-DFBJFAYJ.mjs} +1 -1
- package/dist/{logpush-BnLA4WVm.mjs → logpush-gzmlZayc.mjs} +1 -1
- package/dist/logs-BuzwQgt5.mjs +18 -0
- package/dist/{magic-cloud-networking-wPuLwu-F.mjs → magic-cloud-networking-BbHCi1Vp.mjs} +1 -1
- package/dist/{magic-network-monitoring-BNERUpxS.mjs → magic-network-monitoring-kWMmnPTG.mjs} +1 -1
- package/dist/{magic-transit-6tvVOECW.mjs → magic-transit-ClSmJDKw.mjs} +1 -1
- package/dist/{managed-defense-AYwBOYIH.mjs → managed-defense-EOihg1UR.mjs} +1 -1
- package/dist/{managed-transforms-HZZNrkC7.mjs → managed-transforms-BZ_XdGE2.mjs} +1 -1
- package/dist/{matches-Dp91L3dL.mjs → matches-B6sG0_fr.mjs} +1 -1
- package/dist/{mcp-P7pcieiT.mjs → mcp--kK0vS5i.mjs} +1 -1
- package/dist/{mesh-DjFrk6PL.mjs → mesh-DfXYUHOO.mjs} +1 -1
- package/dist/{mtls-certificates-DZMoef2H.mjs → mtls-certificates-DZd-0X7l.mjs} +1 -1
- package/dist/{network-7cd1U6-I.mjs → network-U6f_5ihp.mjs} +1 -1
- package/dist/{network-interconnects-CQ7cPZjK.mjs → network-interconnects-DKZGTiYM.mjs} +1 -1
- package/dist/oauth-BdVr2hJp.mjs +14 -0
- package/dist/{oauth-clients-P9t-eMnx.mjs → oauth-clients-CY3OkPhC.mjs} +1 -1
- package/dist/{oauth-scopes-C3r9Qh_y.mjs → oauth-scopes-BTY7_5L-.mjs} +1 -1
- package/dist/{observability-M1DnLhMR.mjs → observability-Bsp-LdmJ.mjs} +1 -1
- package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-ClEt4E8F.mjs} +3 -3
- package/dist/{organization-cUE7GDCt.mjs → organization-BSeMdj-7.mjs} +1 -1
- package/dist/{organizations-C-Hcpd0w.mjs → organizations-BroR48Nv.mjs} +1 -1
- package/dist/{origin-ca-certificates-C8cJMyQH.mjs → origin-ca-certificates-jC-EMn6W.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-DjZJCk8M.mjs → origin-post-quantum-encryption-DIspLvA0.mjs} +1 -1
- package/dist/{origin-tls-client-auth-BsjR5EAV.mjs → origin-tls-client-auth-CZ_nUEcM.mjs} +1 -1
- package/dist/{page-rules-B-zq1EUb.mjs → page-rules-ZcdjPohY.mjs} +1 -1
- package/dist/{pages-B6YpkPos.mjs → pages-W4tKa7xk.mjs} +1 -1
- package/dist/pay-per-crawl-BNM1mJmP.mjs +5 -0
- package/dist/pay-per-use-DKxlnkH3.mjs +2 -0
- package/dist/{pipelines-BJc_RylD.mjs → pipelines-Dug0BR-c.mjs} +1 -1
- package/dist/{precursor-CLQu7suY.mjs → precursor-D-11DkRU.mjs} +1 -1
- package/dist/previews-D_Nv4dR6.mjs +4 -0
- package/dist/{progress-V6SZV3Ux.mjs → progress-a5IKeKni.mjs} +1 -1
- package/dist/project-settings-Bc3wYHo8.mjs +3 -0
- package/dist/prompt-BP8XrQSj.mjs +3 -0
- package/dist/{queries-DSrrket-.mjs → queries-BdA2vJoe.mjs} +1 -1
- package/dist/{queues-Tf7kPBpn.mjs → queues-Bu06ZqUE.mjs} +1 -1
- package/dist/{r2-DmKNnxtC.mjs → r2-COC9wMKb.mjs} +1 -1
- package/dist/{r2-data-catalog-DBxoifOq.mjs → r2-data-catalog-CX5Rl5Qx.mjs} +1 -1
- package/dist/{radar-Csk7Ab-b.mjs → radar-L-yoLIHF.mjs} +1 -1
- package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNH2V8qH.mjs} +1 -1
- package/dist/{realtime-CDehZVhV.mjs → realtime-JKIiXfzi.mjs} +1 -1
- package/dist/{registrar-vflzeNQ9.mjs → registrar-_dYUZrK0.mjs} +2 -2
- package/dist/{registrar-sandbox-BxVdfnam.mjs → registrar-sandbox-D1yfW_Q_.mjs} +2 -2
- package/dist/{registry-CWUfXloz.mjs → registry-BrtVdMrC.mjs} +1 -1
- package/dist/{reporting-BaPZ1PHN.mjs → reporting-3fyoMcmb.mjs} +1 -1
- package/dist/request-headers-BhQQAfJt.mjs +2 -0
- package/dist/{request-tracers-C_UVBexV.mjs → request-tracers-TisEth2p.mjs} +1 -1
- package/dist/{resolve-B8CyM1mi.mjs → resolve-CYUp6YgC.mjs} +1 -1
- package/dist/{resource-sharing-CoB4S9j1.mjs → resource-sharing-C4-dnohU.mjs} +1 -1
- package/dist/{resource-tagging-CUiUC5g4.mjs → resource-tagging-BRDifKqM.mjs} +1 -1
- package/dist/{rules-4O8076_s.mjs → rules-BCF3gIkw.mjs} +2 -2
- package/dist/{rulesets-C84MxTYo.mjs → rulesets-wp6rllt3.mjs} +1 -1
- package/dist/{rum-Bvwkrntx.mjs → rum-B77awgoB.mjs} +1 -1
- package/dist/run-BS8otL3u.mjs +2 -0
- package/dist/{schema-C8hU6G9R.mjs → schema-DmuJtMN5.mjs} +1 -1
- package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CUGxFeZe.mjs} +4 -4
- package/dist/{scim-BvxQmde6.mjs → scim-C9BmUYil.mjs} +1 -1
- package/dist/{sdk-C12y5qCN.mjs → sdk-Bvqx-_3z.mjs} +1 -1
- package/dist/{secrets-store-DOKWiC-j.mjs → secrets-store-ckkZR2dM.mjs} +1 -1
- package/dist/{security-center-Bhy_aC-w.mjs → security-center-BCahKT57.mjs} +1 -1
- package/dist/{security-txt-L7HJ9tq5.mjs → security-txt-0SI5du7I.mjs} +1 -1
- package/dist/shared-D0B-7q-D.mjs +2 -0
- package/dist/{smart-shield-COMXuQ1S.mjs → smart-shield-BDPbrZa4.mjs} +1 -1
- package/dist/{snippets-DffQhlKt.mjs → snippets-CVRR_h0i.mjs} +1 -1
- package/dist/spawn-DP4T92ss.mjs +519 -0
- package/dist/{spectrum-Cmf7SqQE.mjs → spectrum-CjNXQIQE.mjs} +3 -3
- package/dist/{speed-m8cdhLFS.mjs → speed-CrXCHk3h.mjs} +1 -1
- package/dist/src-BbnV77C4.mjs +108 -0
- package/dist/{ssl-D4ffsdSw.mjs → ssl-DKORhHkh.mjs} +1 -1
- package/dist/{startup-profile-Dx95Y5cl.mjs → startup-profile-CBIH6yZy.mjs} +3 -3
- package/dist/{state-CHif8Y5I.mjs → state-QUu6HfxC.mjs} +1 -1
- package/dist/{stream-DPF5fojV.mjs → stream-wY3zi3FK.mjs} +1 -1
- package/dist/{submit-Br8hfP0_.mjs → submit-B-4oCBSk.mjs} +1 -1
- package/dist/{tags-Bnt4JuxQ.mjs → tags-5uJEkYJZ.mjs} +1 -1
- package/dist/{telemetry-DjGNSlkU.mjs → telemetry-2s9Y3FaN.mjs} +1 -1
- package/dist/{telemetry-Ch1vCICm.mjs → telemetry-n3NJourL.mjs} +1 -1
- package/dist/{tenant-D8u0CxoC.mjs → tenant-BkFvv2o3.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-BrWMyslZ.mjs → tenant-custom-nameservers-DcjC1q0r.mjs} +1 -1
- package/dist/{tools-D9RZkZRc.mjs → tools-Dz1JCrHd.mjs} +1 -1
- package/dist/tunnel-Cd4ipbvJ.mjs +2 -0
- package/dist/{tunnels-BkNPpTHa.mjs → tunnels-9Zg3ePwD.mjs} +1 -1
- package/dist/{turnstile-MgwRECJv.mjs → turnstile-BTwKYpzD.mjs} +1 -1
- package/dist/{url-info-Ddp7MgcI.mjs → url-info-D7Y61BFd.mjs} +1 -1
- package/dist/{url-normalization-3ptK9ntV.mjs → url-normalization-B4n8HiNQ.mjs} +1 -1
- package/dist/{url-scanner-Psb9ollR.mjs → url-scanner-CiCIltSQ.mjs} +1 -1
- package/dist/{user-DWdshcIu.mjs → user-DDFDGJ0Y.mjs} +1 -1
- package/dist/{values-CDKQL1z2.mjs → values-DRznB_Cl.mjs} +1 -1
- package/dist/{vectorize-CTYYUyQj.mjs → vectorize-CbznPhzq.mjs} +1 -1
- package/dist/waiting-rooms-CKP5hYBK.mjs +11 -0
- package/dist/{web-assets-CpDwDEx8.mjs → web-assets-C-ZoSkkh.mjs} +1 -1
- package/dist/{web3-YsjDyAzH.mjs → web3-DwlN4dOw.mjs} +1 -1
- package/dist/{workers-builds-BWo5vUA9.mjs → workers-builds-ECw_x_kp.mjs} +1 -1
- package/dist/{workers-for-platforms-ASJsxYdM.mjs → workers-for-platforms-BYGy46R6.mjs} +2 -2
- package/dist/{workers-vpc-RkTnRvA2.mjs → workers-vpc-CCosFcxz.mjs} +1 -1
- package/dist/workers-zFMrbUkg.mjs +6 -0
- package/dist/{workflows-KrIFI9ns.mjs → workflows-C8GXGDRW.mjs} +1 -1
- package/dist/{zaraz-DglXbVzZ.mjs → zaraz-B5UIREaz.mjs} +1 -1
- package/dist/{zero-trust-RilTdSjX.mjs → zero-trust-DUp0XoIo.mjs} +50 -50
- package/dist/{zone-DsBtVkvT.mjs → zone-BGLkk-mL.mjs} +1 -1
- package/dist/{zones-BFxvWFQW.mjs → zones-CwYjNXMH.mjs} +1 -1
- package/package.json +11 -11
- package/dist/analytics-BaUZwNc5.mjs +0 -4
- package/dist/build-0QlYUfFS.mjs +0 -2
- package/dist/cf-C11NGkjx.mjs +0 -18
- package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
- package/dist/command-CMzMsll4.mjs +0 -2
- package/dist/custom-pages-DzKnSgL3.mjs +0 -3
- package/dist/d1-JBEqjJoj.mjs +0 -20
- package/dist/data-security-CIktWnXt.mjs +0 -7
- package/dist/dist-12KzRsBM.mjs +0 -387
- package/dist/dist-BCVqQpg2.mjs +0 -2
- package/dist/dist-Cp3uJN1x.mjs +0 -48
- package/dist/dist-S9K_8gq9.mjs +0 -9
- package/dist/dry-run-DiVy1lVo.mjs +0 -2
- package/dist/interactive-B2E03Fs-.mjs +0 -11
- package/dist/interactive-_B-EqD0Y.mjs +0 -23
- package/dist/logexplorer-D8rOPB5I.mjs +0 -17
- package/dist/logs-CDo7Y5sA.mjs +0 -3
- package/dist/oauth-DH3kMXSs.mjs +0 -14
- package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
- package/dist/prompt-DjRTpML4.mjs +0 -3
- package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
- package/dist/request-headers-CC4eHmI2.mjs +0 -3
- package/dist/run-CRfinkSe.mjs +0 -2
- package/dist/schemas-O_ZNaF8R.mjs +0 -65
- package/dist/spawn-C1AISA2V.mjs +0 -526
- package/dist/src-C8phrg-8.mjs +0 -109
- package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
- package/dist/workers-BKKxaZcz.mjs +0 -6
- /package/dist/{alerts-B2SJO4nd.mjs → alerts-CarPLL8k.mjs} +0 -0
- /package/dist/{autorag-iNjZXw1n.mjs → autorag-zK-3harf.mjs} +0 -0
- /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-Cmw7PZ7a.mjs} +0 -0
- /package/dist/{brands-BrVnNrT3.mjs → brands-CpgTsX8h.mjs} +0 -0
- /package/dist/{clear-an9o3dJ3.mjs → clear-C5gzBA8G.mjs} +0 -0
- /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-abvWQN3T.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-BY-dbhQZ.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-DoMvHvCO.mjs} +0 -0
- /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-Cw3G4nap.mjs} +0 -0
- /package/dist/{health-CIUg1C5o.mjs → health-DkEXPkS6.mjs} +0 -0
- /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-nF-0Ze2h.mjs} +0 -0
- /package/dist/{internal-DmpATljO.mjs → internal-4fU2r5en.mjs} +0 -0
- /package/dist/{live-B66u3_0g.mjs → live-B4iGrwY2.mjs} +0 -0
- /package/dist/{metadata-D062SVyy.mjs → metadata-C5fJJr-k.mjs} +0 -0
- /package/dist/{output-COcSQsfn.mjs → output-Z2lQmPUW.mjs} +0 -0
- /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-DNsAFIeM.mjs} +0 -0
- /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-CsOim7bm.mjs} +0 -0
- /package/dist/{ready-C-H2cwp_.mjs → ready-tTe-zcIw.mjs} +0 -0
- /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-B3eTV5yC.mjs} +0 -0
- /package/dist/{refute-uSlzkQKq.mjs → refute-BY76YVrT.mjs} +0 -0
- /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-DdoF_a5y.mjs} +0 -0
- /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-sSgLwwZN.mjs} +0 -0
- /package/dist/{search-BlKeSfVD.mjs → search-BFvQr-sl.mjs} +0 -0
- /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-Cr8hiZPJ.mjs} +0 -0
- /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-DT2mLnu1.mjs} +0 -0
- /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-6gs5iy9T.mjs} +0 -0
- /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-D6XKO2EV.mjs} +0 -0
- /package/dist/{verify-S-TmhUDr.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-Cmw7PZ7a.mjs";import{n as p,t as m}from"./input-validation-nF-0Ze2h.mjs";import{a as h,i as g,n as _}from"./prompt-BP8XrQSj.mjs";import{t as v}from"./cli-types-abvWQN3T.mjs";import{n as ee,t as te}from"./raw-fetch-DNH2V8qH.mjs";function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Binary file to be uploaded to the database.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const b={command:`create`,describe:`Uploads a binary file to Cloudforce One's binary database for malware analysis and threat intelligence correlation.`,builder:y,handler:async l=>c({command:`cloudforce-one binary-storage create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.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:l.body,file:l.file}});return}let c=await i(l),u=l.local?e:await t();if(l.accountId=u,l.file!==void 0||l.body!==void 0){let e=new FormData;if(l.file){let t=m(l.file);e.append(`file`,new Blob([t]),l.file.split(/[\\/]/).filter(Boolean).pop())}else l.body!==void 0&&e.append(`file`,l.body);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${u}/cloudforce-one/binary`,{body:e})),{successLabel:`Created`});return}if(l.body){let e=p(l.body,`body`,`binary`);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${u}/cloudforce-one/binary`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function x(e){return e.positional(`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 S={command:`get <hash>`,describe:`Retrieves a binary file from the Cloudforce One binary storage for analysis.`,builder:x,handler:async r=>c({command:`cloudforce-one binary-storage get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},C={command:`binary-storage`,describe:`Upload and retrieve malware samples and suspicious binaries for analysis`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`domain`,{type:`string`,description:`Domain to monitor (e.g. my-company.com)`}).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 T={command:`create`,describe:`Register a domain for credential monitoring.`,builder:w,handler:async r=>c({command:`cloudforce-one credential-monitor domains create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one credential-monitor domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/credential-monitor/domains`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({domain:p(r.domain,`domain`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.credentialMonitor.domains.create({...e,account_id:l})),{successLabel:`Created`});return}r.domain===void 0&&(r.domain=await h(`domain`,`Domain to monitor (e.g. my-company.com)`));let d=f({domain:p(r.domain,`domain`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.credentialMonitor.domains.create({...d,account_id:l})),{successLabel:`Created`})})};function E(e){return e.positional(`id`,{type:`string`,description:`Domain 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 D={command:`delete <id>`,describe:`Remove a domain from credential monitoring.`,builder:E,handler:async r=>c({command:`cloudforce-one credential-monitor domains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one credential-monitor domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/credential-monitor/domains/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.credentialMonitor.domains.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})})};function O(e){return e.option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Items per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List all domains registered for credential monitoring.`,builder:O,handler:async r=>c({command:`cloudforce-one credential-monitor domains list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf cloudforce-one credential-monitor domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/credential-monitor/domains`,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.credentialMonitor.domains.list({account_id:u,...c})),{successLabel:`Loaded`})})},A={command:`domains`,describe:`Operations for credential-monitor.domains`,builder:e=>e.command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`domain`,{type:`string`,description:`Filter by domain (exact match)`}).option(`username`,{type:`string`,description:`Filter by username (partial match)`}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Items per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Get credential matches for the account's monitored domains.`,builder:j,handler:async r=>c({command:`cloudforce-one credential-monitor matches list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={domain:r.domain,username:r.username,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf cloudforce-one credential-monitor matches list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/v2/credential-monitor/matches`,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.credentialMonitor.matches.list({account_id:u,...c})),{successLabel:`Loaded`})})},N={command:`matches`,describe:`Operations for credential-monitor.matches`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`credential-monitor`,describe:`Operations for credential-monitor`,builder:e=>e.command(A).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(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 UUIDs to filter by, or one standalone scope value: 'all'/'*' for all accessible non-analytics event datasets (analytics datasets are silently excluded), 'analytics' for isAnalytics=true datasets, or 'operational' for isAnalytics=false datasets. If not provided, uses the 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 I={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:F,handler:async r=>c({command:`cloudforce-one events aggregate get`,classification:{safeFlags:[`group-by-date`,`dry-run`]}},r,async()=>{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`})})},L={command:`aggregate`,describe:`Operations for events.aggregate`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Lists categories`,builder:R,handler:async r=>c({command:`cloudforce-one events categories catalog get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},B={command:`catalog`,describe:`Operations for events.categories.catalog`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(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 H={command:`create <category-id>`,describe:`Updates a category`,builder:V,handler:async r=>c({command:`cloudforce-one events categories create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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/event-categories/by-id/${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?f({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:p(r.name,`name`,`text`),shortname:p(r.shortname,`shortname`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.events.categories.create({...e,account_id:l,category_id:r[`category-id`]})),{successLabel:`Created`});return}let d=f({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:p(r.name,`name`,`text`),shortname:p(r.shortname,`shortname`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.events.categories.create({...d,account_id:l,category_id:r[`category-id`]})),{successLabel:`Created`})})},U={command:`categories`,describe:`Operations for events.categories`,builder:e=>e.command(H).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(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 G={command:`create <event-id>`,describe:`Updates an event`,builder:W,handler:async r=>c({command:`cloudforce-one events create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?f({attacker:p(r.attacker,`attacker`,`text`),attackerCountry:p(r[`attacker-country`],`attacker-country`,`text`),category:p(r.category,`category`,`text`),createdAt:p(r[`created-at`],`created-at`,`text`),datasetId:p(r[`dataset-id`],`dataset-id`,`text`),date:p(r.date,`date`,`text`),event:p(r.event,`event`,`text`),indicator:p(r.indicator,`indicator`,`text`),indicatorType:p(r[`indicator-type`],`indicator-type`,`text`),insight:p(r.insight,`insight`,`text`),raw:{source:p(r[`raw-source`],`raw-source`,`text`),tlp:p(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:p(r[`target-country`],`target-country`,`text`),targetIndustry:p(r[`target-industry`],`target-industry`,`text`),tlp:p(r.tlp,`tlp`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.events.create({...e,account_id:l,event_id:r[`event-id`]})),{successLabel:`Created`});return}r[`dataset-id`]===void 0&&(r[`dataset-id`]=await h(`dataset-id`,`Dataset ID containing the event to update.`));let d=f({attacker:p(r.attacker,`attacker`,`text`),attackerCountry:p(r[`attacker-country`],`attacker-country`,`text`),category:p(r.category,`category`,`text`),createdAt:p(r[`created-at`],`created-at`,`text`),datasetId:p(r[`dataset-id`],`dataset-id`,`text`),date:p(r.date,`date`,`text`),event:p(r.event,`event`,`text`),indicator:p(r.indicator,`indicator`,`text`),indicatorType:p(r[`indicator-type`],`indicator-type`,`text`),insight:p(r.insight,`insight`,`text`),raw:{source:p(r[`raw-source`],`raw-source`,`text`),tlp:p(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:p(r[`target-country`],`target-country`,`text`),targetIndustry:p(r[`target-industry`],`target-industry`,`text`),tlp:p(r.tlp,`tlp`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.events.create({...d,account_id:l,event_id:r[`event-id`]})),{successLabel:`Created`})})};function K(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 q={command:`create <dataset-id>`,describe:`Copies specified events from one dataset to another dataset`,builder:K,handler:async r=>c({command:`cloudforce-one events dataset copy create`,classification:{safeFlags:[`keep-raw-data`,`dry-run`]}},r,async()=>{let c={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:c,bodyKind:`json`,body:r.body===void 0?f({destDatasetId:p(r[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:r[`event-ids`]}):u(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=u(r.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.copy.create({...e,account_id:d,dataset_id:r[`dataset-id`],...c})),{successLabel:`Created`});return}if(r[`dest-dataset-id`]===void 0&&(r[`dest-dataset-id`]=await h(`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 m=f({destDatasetId:p(r[`dest-dataset-id`],`dest-dataset-id`,`text`),eventIds:r[`event-ids`]});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>l.cloudforceOne.events.dataset.copy.create({...m,account_id:d,dataset_id:r[`dataset-id`],...c})),{successLabel:`Created`})})},J={command:`copy`,describe:`Operations for events.dataset.copy`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(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 X={command:`create <dataset-id>`,describe:`Updates an existing dataset`,builder:Y,handler:async r=>c({command:`cloudforce-one events dataset create`,classification:{safeFlags:[`is-public`,`dry-run`]}},r,async()=>{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?f({isPublic:r[`is-public`],name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.events.dataset.create({...e,account_id:l,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 h(`name`,`Used to describe the dataset within the account context.`));let d=f({isPublic:r[`is-public`],name:p(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.events.dataset.create({...d,account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})})};function Z(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 Q={command:`delete <dataset-id>`,describe:`Soft-deletes a dataset given a datasetId.`,builder:Z,handler:async r=>c({command:`cloudforce-one events dataset delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.events.dataset.delete({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Deleted`})})};function ne(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 re={command:`get <event-id>`,describe:`Retrieves a specific event by its UUID.`,builder:ne,handler:async r=>c({command:`cloudforce-one events dataset events get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},ie={command:`events`,describe:`Operations for events.dataset.events`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(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 oe={command:`create`,describe:`Create a group`,builder:ae,handler:async r=>c({command:`cloudforce-one events dataset groups create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?f({description:p(r.description,`description`,`text`),name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.events.dataset.groups.create({...e,account_id:l})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await h(`description`,`The description field`)),r.name===void 0&&(r.name=await h(`name`,`The name field`));let d=f({description:p(r.description,`description`,`text`),name:p(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.events.dataset.groups.create({...d,account_id:l})),{successLabel:`Created`})})};function se(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 ce={command:`delete <group-id>`,describe:`Delete a group for an account`,builder:se,handler:async r=>c({command:`cloudforce-one events dataset groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.events.dataset.groups.delete({account_id:l,group_id:r[`group-id`]})),{successLabel:`Deleted`})})};function le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`group`,describe:`List groups for an account`,builder:le,handler:async r=>c({command:`cloudforce-one events dataset groups get group`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 de(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 fe={command:`v2 <group-id>`,describe:`Read a group for an account`,builder:de,handler:async r=>c({command:`cloudforce-one events dataset groups get v2`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},pe={command:`get`,describe:`Operations for events.dataset.groups.get`,builder:e=>e.command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(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 he={command:`create <group-id>`,describe:`Create a group member`,builder:me,handler:async r=>c({command:`cloudforce-one events dataset groups members create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?f({accountTag:p(r[`account-tag`],`account-tag`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.events.dataset.groups.members.create({...e,account_id:l,group_id:r[`group-id`]})),{successLabel:`Created`});return}let d=f({accountTag:p(r[`account-tag`],`account-tag`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.events.dataset.groups.members.create({...d,account_id:l,group_id:r[`group-id`]})),{successLabel:`Created`})})};function ge(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 _e={command:`delete <member-id>`,describe:`Delete a group member`,builder:ge,handler:async r=>c({command:`cloudforce-one events dataset groups members delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -21,7 +21,7 @@ import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kM
|
|
|
21
21
|
`);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.cloudforceOne.rules.delete({...e,account_id:l,id:r.id})),{successLabel:`Deleted`});return}let d=f({commit_message:p(r[`commit-message`],`commit-message`,`text`)});a(await s(`Deleting`,async()=>c.cloudforceOne.rules.delete({...d,account_id:l,id:r.id})),{successLabel:`Deleted`})})};function ka(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 Aa={command:`deleteAll`,describe:`Delete all rules in an account.`,builder:ka,handler:async r=>c({command:`cloudforce-one rules deleteAll`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules deleteAll`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
22
22
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.rules.deleteAll({account_id:l})),{successLabel:`Deleted`})})};function ja(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the approval.`,demandOption:!0}).option(`module`,{type:`string`,description:`Structured rule module.`,choices:[`eml`]}).option(`condition-operator`,{type:`string`,description:`The condition.operator field`,choices:[`and`,`or`]}).option(`condition-type`,{type:`string`,description:`The condition.type field`,choices:[`group`]}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`,default:!0}).option(`meta`,{type:`string`,description:`The meta field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`status`,{type:`string`,description:`Disposition for matching email. This emits status metadata with the selected value.`,choices:[`silent`,`blocking`],default:`silent`}).option(`strings`,{type:`string`,description:`The strings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ma={command:`resubmit <id>`,describe:`Validates and compiles a complete structured email rule, then creates an immutable pending revision of its rejected approval.`,builder:v(ja),handler:async r=>c({command:`cloudforce-one rules email approvals resubmit`,classification:{safeFlags:[`module`,`condition-operator`,`condition-type`,`enabled`,`status`,`dry-run`]}},r,async()=>{let c={module:r.module};if(r.dryRun){o({command:`cf cloudforce-one rules email approvals resubmit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/approvals/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/resubmit`,pathParams:{id:String(r.id??``)},query:c,bodyKind:`json`,body:r.body===void 0?f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)}):u(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=u(r.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>l.cloudforceOne.rules.email.approvals.resubmit({...e,account_id:m,id:r.id,...c})),{successLabel:`Created`});return}r[`condition-operator`]===void 0&&(r[`condition-operator`]=await g(`condition-operator`,`The condition.operator field`,[`and`,`or`])),r[`condition-type`]===void 0&&(r[`condition-type`]=await g(`condition-type`,`The condition.type field`,[`group`])),r.name===void 0&&(r.name=await h(`name`,`The name field`));let _=f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>l.cloudforceOne.rules.email.approvals.resubmit({..._,account_id:m,id:r.id,...c})),{successLabel:`Created`})})},Na={command:`approvals`,describe:`Operations for rules.email.approvals`,builder:e=>e.command(Ma).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pa(e){return e.option(`condition-operator`,{type:`string`,description:`The condition.operator field`,choices:[`and`,`or`]}).option(`condition-type`,{type:`string`,description:`The condition.type field`,choices:[`group`]}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`,default:!0}).option(`meta`,{type:`string`,description:`The meta field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`status`,{type:`string`,description:`Disposition for matching email. This emits status metadata with the selected value.`,choices:[`silent`,`blocking`],default:`silent`}).option(`strings`,{type:`string`,description:`The strings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Fa={command:`create`,describe:`Create a structured email rule.`,builder:Pa,handler:async r=>c({command:`cloudforce-one rules email create`,classification:{safeFlags:[`condition-operator`,`condition-type`,`enabled`,`status`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.rules.email.create({...e,account_id:l})),{successLabel:`Created`});return}r[`condition-operator`]===void 0&&(r[`condition-operator`]=await g(`condition-operator`,`The condition.operator field`,[`and`,`or`])),r[`condition-type`]===void 0&&(r[`condition-type`]=await g(`condition-type`,`The condition.type field`,[`group`])),r.name===void 0&&(r.name=await h(`name`,`The name field`));let m=f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)});a(await s(`Creating`,async()=>c.cloudforceOne.rules.email.create({...m,account_id:l})),{successLabel:`Created`})})};function Ia(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,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 La={command:`delete <id>`,describe:`Delete an existing structured email rule.`,builder:Ia,handler:async r=>c({command:`cloudforce-one rules email delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
23
23
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.rules.email.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})})};function Ra(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const za={command:`get <id>`,describe:`Get a structured email rule by ID.`,builder:Ra,handler:async r=>c({command:`cloudforce-one rules email get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.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.rules.email.get({account_id:l,id:r.id})),{successLabel:`Loaded`})})};function Ba(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`search`,{type:`string`,description:`Search`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Va={command:`list`,describe:`Returns structured email rules.`,builder:Ba,handler:async r=>c({command:`cloudforce-one rules email list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,offset:r.offset,search:r.search};if(r.dryRun){o({command:`cf cloudforce-one rules email list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured`,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.rules.email.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Ha(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ua={command:`get`,describe:`Get the field catalog for structured email rules.`,builder:Ha,handler:async r=>c({command:`cloudforce-one rules email schema get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email schema get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/schema`,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.rules.email.schema.get({account_id:l})),{successLabel:`Loaded`})})},Wa={command:`schema`,describe:`Operations for rules.email.schema`,builder:e=>e.command(Ua).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ga(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`sample-json`,{type:`string`,description:`The sample_json 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 Ka={command:`test <id>`,describe:`Test a structured email rule against sample email JSON.`,builder:Ga,handler:async r=>c({command:`cloudforce-one rules email test`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email test`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/test`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?f({sample_json:p(r[`sample-json`],`sample-json`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.rules.email.test({...e,account_id:l,id:r.id})),{successLabel:`Created`});return}r[`sample-json`]===void 0&&(r[`sample-json`]=await h(`sample-json`,`The sample_json field`));let d=f({sample_json:p(r[`sample-json`],`sample-json`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.rules.email.test({...d,account_id:l,id:r.id})),{successLabel:`Created`})})};function qa(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`condition-operator`,{type:`string`,description:`The condition.operator field`,choices:[`and`,`or`]}).option(`condition-type`,{type:`string`,description:`The condition.type field`,choices:[`group`]}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`meta`,{type:`string`,description:`The meta field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`status`,{type:`string`,description:`Disposition for matching email. This emits status metadata with the selected value.`,choices:[`silent`,`blocking`]}).option(`strings`,{type:`string`,description:`The strings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`condition-operator`,`condition-type`].some(t=>e[t]!==void 0)){let t=[`condition-operator`,`condition-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --condition-* flag is set`)}return!0})}const Ja={command:`update <id>`,describe:`Updates an existing structured email rule.`,builder:qa,handler:async r=>c({command:`cloudforce-one rules email update`,classification:{safeFlags:[`condition-operator`,`condition-type`,`enabled`,`status`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.rules.email.update({...e,account_id:l,id:r.id})),{successLabel:`Updated`});return}let m=f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)});a(await s(`Updating`,async()=>c.cloudforceOne.rules.email.update({...m,account_id:l,id:r.id})),{successLabel:`Updated`})})};function Ya(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the approval.`,demandOption:!0}).option(`module`,{type:`string`,description:`Structured rule module.`,choices:[`eml`]}).option(`condition-operator`,{type:`string`,description:`The condition.operator field`,choices:[`and`,`or`]}).option(`condition-type`,{type:`string`,description:`The condition.type field`,choices:[`group`]}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`meta`,{type:`string`,description:`The meta field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`status`,{type:`string`,description:`Disposition for matching email. This emits status metadata with the selected value.`,choices:[`silent`,`blocking`]}).option(`strings`,{type:`string`,description:`The strings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xa={command:`updatePendingApproval <id>`,describe:`Validate, compile, and replace the proposed structured email rule on a pending approval. Only the original requester may update it.`,builder:v(Ya),handler:async r=>c({command:`cloudforce-one rules email updatePendingApproval`,classification:{safeFlags:[`module`,`condition-operator`,`condition-type`,`enabled`,`status`,`dry-run`]}},r,async()=>{let c={module:r.module};if(r.dryRun){o({command:`cf cloudforce-one rules email updatePendingApproval`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/approvals/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},query:c,bodyKind:`json`,body:r.body===void 0?f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)}):u(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=u(r.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>l.cloudforceOne.rules.email.updatePendingApproval({...e,account_id:m,id:r.id,...c})),{successLabel:`Updated`});return}r[`condition-operator`]===void 0&&(r[`condition-operator`]=await g(`condition-operator`,`The condition.operator field`,[`and`,`or`])),r[`condition-type`]===void 0&&(r[`condition-type`]=await g(`condition-type`,`The condition.type field`,[`group`])),r.name===void 0&&(r.name=await h(`name`,`The name field`));let _=f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>l.cloudforceOne.rules.email.updatePendingApproval({..._,account_id:m,id:r.id,...c})),{successLabel:`Updated`})})};function Za(e){return e.option(`condition-operator`,{type:`string`,description:`The condition.operator field`,choices:[`and`,`or`]}).option(`condition-type`,{type:`string`,description:`The condition.type field`,choices:[`group`]}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`,default:!0}).option(`existing-rule-id`,{type:`string`,description:`Existing rule ID to exclude from duplicate-name checks when validating an update.`}).option(`meta`,{type:`string`,description:`The meta field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`status`,{type:`string`,description:`Disposition for matching email. This emits status metadata with the selected value.`,choices:[`silent`,`blocking`],default:`silent`}).option(`strings`,{type:`string`,description:`The strings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Qa={command:`validate`,describe:`Validates structured email rule syntax and metadata.`,builder:Za,handler:async r=>c({command:`cloudforce-one rules email validate`,classification:{safeFlags:[`condition-operator`,`condition-type`,`enabled`,`status`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules email validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/structured/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,existing_rule_id:p(r[`existing-rule-id`],`existing-rule-id`,`text`),meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.rules.email.validate({...e,account_id:l})),{successLabel:`Created`});return}r[`condition-operator`]===void 0&&(r[`condition-operator`]=await g(`condition-operator`,`The condition.operator field`,[`and`,`or`])),r[`condition-type`]===void 0&&(r[`condition-type`]=await g(`condition-type`,`The condition.type field`,[`group`])),r.name===void 0&&(r.name=await h(`name`,`The name field`));let m=f({condition:{operator:p(r[`condition-operator`],`condition-operator`,`text`),type:p(r[`condition-type`],`condition-type`,`text`)},description:p(r.description,`description`,`text`),enabled:r.enabled,existing_rule_id:p(r[`existing-rule-id`],`existing-rule-id`,`text`),meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),status:p(r.status,`status`,`text`),strings:d(r.strings,`strings`)});a(await s(`Creating`,async()=>c.cloudforceOne.rules.email.validate({...m,account_id:l})),{successLabel:`Created`})})},$a={command:`email`,describe:`Operations for rules.email`,builder:e=>e.command(Fa).command(La).command(za).command(Va).command(Ka).command(Ja).command(Xa).command(Qa).command(Na).command(Wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function eo(e){return e.option(`namespace`,{type:`string`,array:!0,description:`The namespace field`}).option(`tag-match`,{type:`string`,array:!0,description:`The tag_match field`}).option(`worker-name`,{type:`string`,array:!0,description:`The worker_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 to={command:`create`,describe:`Add regex patterns to per-account exemption rules (union semantics). Missing keys leave that type untouched; duplicates are silently deduped.`,builder:eo,handler:async r=>c({command:`cloudforce-one rules exemptions create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules exemptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/exemptions`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({namespace:r.namespace,tag_match:r[`tag-match`],worker_name:r[`worker-name`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.rules.exemptions.create({body:e,account_id:l})),{successLabel:`Created`});return}let d=f({namespace:r.namespace,tag_match:r[`tag-match`],worker_name:r[`worker-name`]});a(await s(`Creating`,async()=>c.cloudforceOne.rules.exemptions.create({body:d,account_id:l})),{successLabel:`Created`})})};function no(e){return e.option(`namespace`,{type:`string`,array:!0,description:`The namespace field`}).option(`tag-match`,{type:`string`,array:!0,description:`The tag_match field`}).option(`worker-name`,{type:`string`,array:!0,description:`The worker_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ro={command:`delete`,describe:`Remove regex patterns from per-account exemption rules. Missing keys leave that type untouched; non-existent patterns are silently skipped.`,builder:no,handler:async r=>c({command:`cloudforce-one rules exemptions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules exemptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/exemptions`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({namespace:r.namespace,tag_match:r[`tag-match`],worker_name:r[`worker-name`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
24
|
-
`);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.cloudforceOne.rules.exemptions.delete({body:e,account_id:l})),{successLabel:`Deleted`});return}let d=f({namespace:r.namespace,tag_match:r[`tag-match`],worker_name:r[`worker-name`]});a(await s(`Deleting`,async()=>c.cloudforceOne.rules.exemptions.delete({body:d,account_id:l})),{successLabel:`Deleted`})})};function io(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ao={command:`get`,describe:`Get all exemption rule patterns for the account, grouped by type.`,builder:io,handler:async r=>c({command:`cloudforce-one rules exemptions get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules exemptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/exemptions`,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.rules.exemptions.get({account_id:l})),{successLabel:`Loaded`})})};function oo(e){return e.option(`namespace`,{type:`string`,description:`The namespace field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`tag-match`,{type:`string`,description:`The tag_match field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`worker-name`,{type:`string`,description:`The worker_name field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const so={command:`update`,describe:`Replace existing exemption patterns with new values. Each key maps to an array of {old_pattern, new_pattern} entries. Missing keys leave that type untouched. Fails if any old pattern is not found or any new pattern already exists.`,builder:oo,handler:async r=>c({command:`cloudforce-one rules exemptions update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules exemptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/exemptions`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({namespace:d(r.namespace,`namespace`),tag_match:d(r[`tag-match`],`tag-match`),worker_name:d(r[`worker-name`],`worker-name`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.rules.exemptions.update({...e,account_id:l})),{successLabel:`Updated`});return}let p=f({namespace:d(r.namespace,`namespace`),tag_match:d(r[`tag-match`],`tag-match`),worker_name:d(r[`worker-name`],`worker-name`)});a(await s(`Updating`,async()=>c.cloudforceOne.rules.exemptions.update({...p,account_id:l})),{successLabel:`Updated`})})},co={command:`exemptions`,describe:`Operations for rules.exemptions`,builder:e=>e.command(to).command(ro).command(ao).command(so).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lo(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uo={command:`get <id>`,describe:`Get a single rule by ID.`,builder:lo,handler:async r=>c({command:`cloudforce-one rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.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.rules.get({account_id:l,id:r.id})),{successLabel:`Loaded`})})};function fo(e){return e.option(`namespace`,{type:`string`,description:`Selects namespaces. Repeat the parameter to select multiple namespaces (for example, namespace=foo&namespace=bar).`}).option(`path`,{type:`string`,description:"Selects paths with exact-match semantics. Omit the parameter to return rules from all paths. Pass an empty string (path=) to return only rules with an empty or uncategorized path. Pass a value (for example, path=yara) to match that exact path. Repeat the parameter (for example, path=yara&path=expr) to OR-match multiple paths with SQL `IN (...)` semantics. The `recursive` flag affects only customer-account namespace selection."}).option(`recursive`,{type:`string`,description:`For customer accounts, true enables descendant matching for namespaces. Paths always use exact matching.`,choices:[`true`,`false`]}).option(`search`,{type:`string`,description:`Search`}).option(`is-public`,{type:`string`,description:`Limits rules to the specified public visibility.`,choices:[`true`,`false`]}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const po={command:`list`,describe:`Returns all rules for an account with optional filtering.`,builder:v(fo),handler:async r=>c({command:`cloudforce-one rules list`,classification:{safeFlags:[`recursive`,`is-public`,`dry-run`]}},r,async()=>{let c={namespace:r.namespace,path:r.path,recursive:r.recursive,search:r.search,is_public:r[`is-public`],limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf cloudforce-one rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules`,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.rules.list({account_id:u,...c})),{successLabel:`Loaded`})})};function mo(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ho={command:`get`,describe:`Get DFP managed rule metadata (name and description) from YARA rules.`,builder:mo,handler:async r=>c({command:`cloudforce-one rules managed get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules managed get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/managed`,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.rules.managed.get({account_id:l})),{successLabel:`Loaded`})})},go={command:`managed`,describe:`Operations for rules.managed`,builder:e=>e.command(ho).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _o(e){return e.option(`namespace`,{type:`string`,description:`Selects namespaces. Repeat the parameter to select multiple namespaces (for example, namespace=foo&namespace=bar).`}).option(`path`,{type:`string`,description:"Selects paths with exact-match semantics. Omit the parameter to return rules from all paths. Pass an empty string (path=) to return only rules with an empty or uncategorized path. Pass a value (for example, path=yara) to match that exact path. Repeat the parameter (for example, path=yara&path=expr) to OR-match multiple paths with SQL `IN (...)` semantics. The `recursive` flag affects only customer-account namespace selection."}).option(`recursive`,{type:`string`,description:`For customer accounts, true enables descendant matching for namespaces. Paths always use exact matching.`,choices:[`true`,`false`]}).option(`search`,{type:`string`,description:`Search`}).option(`is-public`,{type:`string`,description:`Limits rules to the specified public visibility.`,choices:[`true`,`false`]}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`query`,{type:`string`,description:`Natural-language or keyword search query.`,demandOption:!0}).option(`language`,{type:`string`,description:`Limits results to the specified rule language.`,choices:[`yara`,`js`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vo={command:`search`,describe:`Search rules using hybrid, vector, keyword, or exact retrieval, backed by AI Search with a SQL fallback.`,builder:v(_o),handler:async r=>c({command:`cloudforce-one rules search`,classification:{safeFlags:[`recursive`,`is-public`,`language`,`dry-run`]}},r,async()=>{let c={namespace:r.namespace,path:r.path,recursive:r.recursive,search:r.search,is_public:r[`is-public`],limit:r.limit,offset:r.offset,query:r.query,language:r.language};if(r.dryRun){o({command:`cf cloudforce-one rules search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/search`,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.rules.search({account_id:u,...c})),{successLabel:`Loaded`})})};function yo(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bo={command:`get`,describe:`Get statistics about rules for the dashboard.`,builder:yo,handler:async r=>c({command:`cloudforce-one rules stats get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules stats get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/stats`,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.rules.stats.get({account_id:l})),{successLabel:`Loaded`})})},xo={command:`stats`,describe:`Operations for rules.stats`,builder:e=>e.command(bo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function So(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Co={command:`get`,describe:`Get the folder tree structure for rules navigation.`,builder:So,handler:async r=>c({command:`cloudforce-one rules tree get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules tree get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/tree`,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.rules.tree.get({account_id:l})),{successLabel:`Loaded`})})},wo={command:`tree`,describe:`Operations for rules.tree`,builder:e=>e.command(Co).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function To(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`commit-message`,{type:`string`,description:`Human-readable justification for this change. Required for internal-account submissions; optional for customer accounts and automated sync.`}).option(`content`,{type:`string`,description:`The content field`}).option(`description`,{type:`string`,description:`Human-readable description of the rule. Auto-extracted from YARA meta if present.`}).option(`enabled`,{type:`boolean`,description:`Whether this rule is active for dice consumers.`}).option(`is-public`,{type:`boolean`,description:`Whether this rule is visible to other internal accounts.`}).option(`meta`,{type:`string`,description:`Adds YARA meta entries to the rule's meta block and stores them in rule_meta alongside content metadata. Use valid YARA identifiers for keys; exclude 'name', 'enabled', and 'description'. You may repeat keys. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`namespaces`,{type:`string`,array:!0,description:`The namespaces field`}).option(`path`,{type:`string`,description:`Path change goes through approval workflow.`}).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 Eo={command:`update <id>`,describe:`Updates an existing rule.`,builder:To,handler:async r=>c({command:`cloudforce-one rules update`,classification:{safeFlags:[`enabled`,`is-public`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?f({commit_message:p(r[`commit-message`],`commit-message`,`text`),content:p(r.content,`content`,`text`),description:p(r.description,`description`,`text`),enabled:r.enabled,is_public:r[`is-public`],meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.rules.update({...e,account_id:l,id:r.id})),{successLabel:`Updated`});return}let m=f({commit_message:p(r[`commit-message`],`commit-message`,`text`),content:p(r.content,`content`,`text`),description:p(r.description,`description`,`text`),enabled:r.enabled,is_public:r[`is-public`],meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)});a(await s(`Updating`,async()=>c.cloudforceOne.rules.update({...m,account_id:l,id:r.id})),{successLabel:`Updated`})})};function Do(e){return e.option(`content`,{type:`string`,description:`The content field`}).option(`exclude-rule-id`,{type:`string`,description:`The excludeRuleId field`}).option(`name`,{type:`string`,description:`The name field`}).option(`namespaces`,{type:`string`,array:!0,description:`The namespaces field`}).option(`path`,{type:`string`,description:`The path 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 Oo={command:`validate`,describe:`Validates rule syntax, name uniqueness, namespace, and metadata.`,builder:Do,handler:async r=>c({command:`cloudforce-one rules validate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({content:p(r.content,`content`,`text`),excludeRuleId:p(r[`exclude-rule-id`],`exclude-rule-id`,`text`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.rules.validate({...e,account_id:l})),{successLabel:`Created`});return}r.content===void 0&&(r.content=await h(`content`,`The content field`)),r.name===void 0&&(r.name=await h(`name`,`The name field`));let d=f({content:p(r.content,`content`,`text`),excludeRuleId:p(r[`exclude-rule-id`],`exclude-rule-id`,`text`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.rules.validate({...d,account_id:l})),{successLabel:`Created`})})},ko={command:`rules`,describe:`Rule management operations`,builder:e=>e.command(Ea).command(Oa).command(Aa).command(uo).command(po).command(vo).command(Eo).command(Oo).command(wa).command($a).command(co).command(go).command(xo).command(wo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ao(e){return e.option(`frequency`,{type:`number`,description:`Defines the number of days between each scan (0 = One-off scan).`}).option(`ips`,{type:`string`,array:!0,description:`Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000.`}).option(`ports`,{type:`string`,array:!0,description:`Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports.`}).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 jo={command:`create`,describe:`Creates a new scan configuration for Cloudforce One's network scanning service.`,builder:Ao,handler:async r=>c({command:`cloudforce-one scans config create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({frequency:r.frequency,ips:r.ips,ports:r.ports}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.scans.config.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.ips===void 0)throw Error(`--ips is required (or pass --body with this field set).`);let d=f({frequency:r.frequency,ips:r.ips,ports:r.ports});a(await s(`Creating`,async()=>c.cloudforceOne.scans.config.create({...d,account_id:l})),{successLabel:`Created`})})};function Mo(e){return e.positional(`config-id`,{type:`string`,description:`Defines the Config 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 No={command:`delete <config-id>`,describe:`Deletes a scan configuration from Cloudforce One's network scanning service.`,builder:Mo,handler:async r=>c({command:`cloudforce-one scans config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/config/${r[`config-id`]==null?`<config-id>`:encodeURIComponent(String(r[`config-id`]))}`,pathParams:{"config-id":String(r[`config-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.cloudforceOne.rules.exemptions.delete({body:e,account_id:l})),{successLabel:`Deleted`});return}let d=f({namespace:r.namespace,tag_match:r[`tag-match`],worker_name:r[`worker-name`]});a(await s(`Deleting`,async()=>c.cloudforceOne.rules.exemptions.delete({body:d,account_id:l})),{successLabel:`Deleted`})})};function io(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ao={command:`get`,describe:`Get all exemption rule patterns for the account, grouped by type.`,builder:io,handler:async r=>c({command:`cloudforce-one rules exemptions get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules exemptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/exemptions`,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.rules.exemptions.get({account_id:l})),{successLabel:`Loaded`})})};function oo(e){return e.option(`namespace`,{type:`string`,description:`The namespace field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`tag-match`,{type:`string`,description:`The tag_match field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`worker-name`,{type:`string`,description:`The worker_name field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const so={command:`update`,describe:`Replace existing exemption patterns with new values. Each key maps to an array of {old_pattern, new_pattern} entries. Missing keys leave that type untouched. Fails if any old pattern is not found or any new pattern already exists.`,builder:oo,handler:async r=>c({command:`cloudforce-one rules exemptions update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules exemptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/exemptions`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({namespace:d(r.namespace,`namespace`),tag_match:d(r[`tag-match`],`tag-match`),worker_name:d(r[`worker-name`],`worker-name`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.rules.exemptions.update({...e,account_id:l})),{successLabel:`Updated`});return}let p=f({namespace:d(r.namespace,`namespace`),tag_match:d(r[`tag-match`],`tag-match`),worker_name:d(r[`worker-name`],`worker-name`)});a(await s(`Updating`,async()=>c.cloudforceOne.rules.exemptions.update({...p,account_id:l})),{successLabel:`Updated`})})},co={command:`exemptions`,describe:`Operations for rules.exemptions`,builder:e=>e.command(to).command(ro).command(ao).command(so).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lo(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uo={command:`get <id>`,describe:`Get a single rule by ID.`,builder:lo,handler:async r=>c({command:`cloudforce-one rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.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.rules.get({account_id:l,id:r.id})),{successLabel:`Loaded`})})};function fo(e){return e.option(`namespace`,{type:`string`,description:`Selects namespaces. Repeat the parameter to select multiple namespaces (for example, namespace=foo&namespace=bar).`}).option(`path`,{type:`string`,description:"Selects paths with exact-match semantics. Omit the parameter to return rules from all paths. Pass an empty string (path=) to return only rules with an empty or uncategorized path. Pass a value (for example, path=yara) to match that exact path. Repeat the parameter (for example, path=yara&path=expr) to OR-match multiple paths with SQL `IN (...)` semantics. The `recursive` flag affects only customer-account namespace selection."}).option(`recursive`,{type:`string`,description:`For customer accounts, true enables descendant matching for namespaces. Paths always use exact matching.`,choices:[`true`,`false`]}).option(`search`,{type:`string`,description:`Search`}).option(`is-public`,{type:`string`,description:`Limits rules to the specified public visibility.`,choices:[`true`,`false`]}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const po={command:`list`,describe:`Returns all rules for an account with optional filtering.`,builder:v(fo),handler:async r=>c({command:`cloudforce-one rules list`,classification:{safeFlags:[`recursive`,`is-public`,`dry-run`]}},r,async()=>{let c={namespace:r.namespace,path:r.path,recursive:r.recursive,search:r.search,is_public:r[`is-public`],limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf cloudforce-one rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules`,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.rules.list({account_id:u,...c})),{successLabel:`Loaded`})})};function mo(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ho={command:`get`,describe:`Get DFP managed rule metadata (name and description) from YARA rules.`,builder:mo,handler:async r=>c({command:`cloudforce-one rules managed get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules managed get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/managed`,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.rules.managed.get({account_id:l})),{successLabel:`Loaded`})})},go={command:`managed`,describe:`Operations for rules.managed`,builder:e=>e.command(ho).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _o(e){return e.option(`namespace`,{type:`string`,description:`Selects namespaces. Repeat the parameter to select multiple namespaces (for example, namespace=foo&namespace=bar).`}).option(`path`,{type:`string`,description:"Selects paths with exact-match semantics. Omit the parameter to return rules from all paths. Pass an empty string (path=) to return only rules with an empty or uncategorized path. Pass a value (for example, path=yara) to match that exact path. Repeat the parameter (for example, path=yara&path=expr) to OR-match multiple paths with SQL `IN (...)` semantics. The `recursive` flag affects only customer-account namespace selection."}).option(`recursive`,{type:`string`,description:`For customer accounts, true enables descendant matching for namespaces. Paths always use exact matching.`,choices:[`true`,`false`]}).option(`search`,{type:`string`,description:`Search`}).option(`is-public`,{type:`string`,description:`Limits rules to the specified public visibility.`,choices:[`true`,`false`]}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`query`,{type:`string`,description:`Natural-language or keyword search query.`,demandOption:!0}).option(`search-mode`,{type:`string`,description:`Retrieval strategy used for the query.`,choices:[`exact`,`hybrid`,`vector`,`keyword`]}).option(`language`,{type:`string`,description:`Limits results to the specified rule language.`,choices:[`yara`,`js`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vo={command:`search`,describe:`Search rules using hybrid, vector, keyword, or exact retrieval, backed by AI Search with a SQL fallback.`,builder:v(_o),handler:async r=>c({command:`cloudforce-one rules search`,classification:{safeFlags:[`recursive`,`is-public`,`search-mode`,`language`,`dry-run`]}},r,async()=>{let c={namespace:r.namespace,path:r.path,recursive:r.recursive,search:r.search,is_public:r[`is-public`],limit:r.limit,offset:r.offset,query:r.query,mode:r[`search-mode`],language:r.language};if(r.dryRun){o({command:`cf cloudforce-one rules search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/search`,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.rules.search({account_id:u,...c})),{successLabel:`Loaded`})})};function yo(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bo={command:`get`,describe:`Get statistics about rules for the dashboard.`,builder:yo,handler:async r=>c({command:`cloudforce-one rules stats get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules stats get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/stats`,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.rules.stats.get({account_id:l})),{successLabel:`Loaded`})})},xo={command:`stats`,describe:`Operations for rules.stats`,builder:e=>e.command(bo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function So(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Co={command:`get`,describe:`Get the folder tree structure for rules navigation.`,builder:So,handler:async r=>c({command:`cloudforce-one rules tree get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules tree get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/tree`,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.rules.tree.get({account_id:l})),{successLabel:`Loaded`})})},wo={command:`tree`,describe:`Operations for rules.tree`,builder:e=>e.command(Co).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function To(e){return e.positional(`id`,{type:`string`,description:`The unique identifier for the rule.`,demandOption:!0}).option(`commit-message`,{type:`string`,description:`Human-readable justification for this change. Required for internal-account submissions; optional for customer accounts and automated sync.`}).option(`content`,{type:`string`,description:`The content field`}).option(`description`,{type:`string`,description:`Human-readable description of the rule. Auto-extracted from YARA meta if present.`}).option(`enabled`,{type:`boolean`,description:`Whether this rule is active for dice consumers.`}).option(`is-public`,{type:`boolean`,description:`Whether this rule is visible to other internal accounts.`}).option(`meta`,{type:`string`,description:`Adds YARA meta entries to the rule's meta block and stores them in rule_meta alongside content metadata. Use valid YARA identifiers for keys; exclude 'name', 'enabled', and 'description'. You may repeat keys. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`namespaces`,{type:`string`,array:!0,description:`The namespaces field`}).option(`path`,{type:`string`,description:`Path change goes through approval workflow.`}).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 Eo={command:`update <id>`,describe:`Updates an existing rule.`,builder:To,handler:async r=>c({command:`cloudforce-one rules update`,classification:{safeFlags:[`enabled`,`is-public`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?f({commit_message:p(r[`commit-message`],`commit-message`,`text`),content:p(r.content,`content`,`text`),description:p(r.description,`description`,`text`),enabled:r.enabled,is_public:r[`is-public`],meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.rules.update({...e,account_id:l,id:r.id})),{successLabel:`Updated`});return}let m=f({commit_message:p(r[`commit-message`],`commit-message`,`text`),content:p(r.content,`content`,`text`),description:p(r.description,`description`,`text`),enabled:r.enabled,is_public:r[`is-public`],meta:d(r.meta,`meta`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)});a(await s(`Updating`,async()=>c.cloudforceOne.rules.update({...m,account_id:l,id:r.id})),{successLabel:`Updated`})})};function Do(e){return e.option(`content`,{type:`string`,description:`The content field`}).option(`exclude-rule-id`,{type:`string`,description:`The excludeRuleId field`}).option(`name`,{type:`string`,description:`The name field`}).option(`namespaces`,{type:`string`,array:!0,description:`The namespaces field`}).option(`path`,{type:`string`,description:`The path 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 Oo={command:`validate`,describe:`Validates rule syntax, name uniqueness, namespace, and metadata.`,builder:Do,handler:async r=>c({command:`cloudforce-one rules validate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one rules validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/rules/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({content:p(r.content,`content`,`text`),excludeRuleId:p(r[`exclude-rule-id`],`exclude-rule-id`,`text`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.rules.validate({...e,account_id:l})),{successLabel:`Created`});return}r.content===void 0&&(r.content=await h(`content`,`The content field`)),r.name===void 0&&(r.name=await h(`name`,`The name field`));let d=f({content:p(r.content,`content`,`text`),excludeRuleId:p(r[`exclude-rule-id`],`exclude-rule-id`,`text`),name:p(r.name,`name`,`text`),namespaces:r.namespaces,path:p(r.path,`path`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.rules.validate({...d,account_id:l})),{successLabel:`Created`})})},ko={command:`rules`,describe:`Rule management operations`,builder:e=>e.command(Ea).command(Oa).command(Aa).command(uo).command(po).command(vo).command(Eo).command(Oo).command(wa).command($a).command(co).command(go).command(xo).command(wo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ao(e){return e.option(`frequency`,{type:`number`,description:`Defines the number of days between each scan (0 = One-off scan).`}).option(`ips`,{type:`string`,array:!0,description:`Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000.`}).option(`ports`,{type:`string`,array:!0,description:`Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports.`}).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 jo={command:`create`,describe:`Creates a new scan configuration for Cloudforce One's network scanning service.`,builder:Ao,handler:async r=>c({command:`cloudforce-one scans config create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({frequency:r.frequency,ips:r.ips,ports:r.ports}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.scans.config.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.ips===void 0)throw Error(`--ips is required (or pass --body with this field set).`);let d=f({frequency:r.frequency,ips:r.ips,ports:r.ports});a(await s(`Creating`,async()=>c.cloudforceOne.scans.config.create({...d,account_id:l})),{successLabel:`Created`})})};function Mo(e){return e.positional(`config-id`,{type:`string`,description:`Defines the Config 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 No={command:`delete <config-id>`,describe:`Deletes a scan configuration from Cloudforce One's network scanning service.`,builder:Mo,handler:async r=>c({command:`cloudforce-one scans config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/config/${r[`config-id`]==null?`<config-id>`:encodeURIComponent(String(r[`config-id`]))}`,pathParams:{"config-id":String(r[`config-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
25
25
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.scans.config.delete({account_id:l,config_id:r[`config-id`]})),{successLabel:`Deleted`})})};function Po(e){return e.positional(`config-id`,{type:`string`,description:`Defines the Config ID.`,demandOption:!0}).option(`frequency`,{type:`number`,description:`Defines the number of days between each scan (0 = One-off scan).`}).option(`ips`,{type:`string`,array:!0,description:`Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000.`}).option(`ports`,{type:`string`,array:!0,description:`Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports.`}).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 Fo={command:`edit <config-id>`,describe:`Updates an existing scan configuration in Cloudforce One's network scanning service.`,builder:Po,handler:async r=>c({command:`cloudforce-one scans config edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans config edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/config/${r[`config-id`]==null?`<config-id>`:encodeURIComponent(String(r[`config-id`]))}`,pathParams:{"config-id":String(r[`config-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({frequency:r.frequency,ips:r.ips,ports:r.ports}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.scans.config.edit({...e,account_id:l,config_id:r[`config-id`]})),{successLabel:`Updated`});return}let d=f({frequency:r.frequency,ips:r.ips,ports:r.ports});a(await s(`Updating`,async()=>c.cloudforceOne.scans.config.edit({...d,account_id:l,config_id:r[`config-id`]})),{successLabel:`Updated`})})};function Io(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lo={command:`list`,describe:`Lists scan configurations for Cloudforce One's network scanning service.`,builder:Io,handler:async r=>c({command:`cloudforce-one scans config list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans config list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/config`,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.scans.config.list({account_id:l})),{successLabel:`Loaded`})})},Ro={command:`config`,describe:`Operations for scans.config`,builder:e=>e.command(jo).command(No).command(Fo).command(Lo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zo(e){return e.positional(`config-id`,{type:`string`,description:`Defines the Config ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bo={command:`get <config-id>`,describe:`Retrieves the latest scan results for a Cloudforce One scan configuration, including discovered open ports.`,builder:zo,handler:async r=>c({command:`cloudforce-one scans results get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans results get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/scans/results/${r[`config-id`]==null?`<config-id>`:encodeURIComponent(String(r[`config-id`]))}`,pathParams:{"config-id":String(r[`config-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.scans.results.get({account_id:l,config_id:r[`config-id`]})),{successLabel:`Loaded`})})};function Vo(e){return e.positional(`config-id`,{type:`string`,description:`Defines the Config ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ho={command:`getBanners <config-id>`,describe:`Retrieves the latest banner grab results for a Cloudforce One scan configuration, including service banners from open ports.`,builder:Vo,handler:async r=>c({command:`cloudforce-one scans results getBanners`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one scans results getBanners`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/banner/${r[`config-id`]==null?`<config-id>`:encodeURIComponent(String(r[`config-id`]))}`,pathParams:{"config-id":String(r[`config-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.scans.results.getBanners({account_id:l,config_id:r[`config-id`]})),{successLabel:`Loaded`})})},Uo={command:`results`,describe:`Operations for scans.results`,builder:e=>e.command(Bo).command(Ho).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Wo={command:`scans`,describe:`Scan URLs, IPs, and domains for threat intelligence indicators`,builder:e=>e.command(Ro).command(Uo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Go(e){return e.option(`dataset-ids`,{type:`string`,description:`Array of dataset IDs to query attackers from. If not provided, uses the default dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ko={command:`list`,describe:`Lists known threat attackers tracked in Cloudforce One threat intelligence.`,builder:Go,handler:async r=>c({command:`cloudforce-one threat-events attackers list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={datasetIds:r[`dataset-ids`]};if(r.dryRun){o({command:`cf cloudforce-one threat-events attackers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/attackers`,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.threatEvents.attackers.list({account_id:u,...c})),{successLabel:`Loaded`})})},qo={command:`attackers`,describe:`Operations for threat-events.attackers`,builder:e=>e.command(Ko).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jo(e){return e.option(`data`,{type:`string`,description:`The data field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dataset-id`,{type:`string`,description:`The datasetId field`}).option(`include-created-events`,{type:`boolean`,description:`When true, response includes array of created event UUIDs and shard IDs. Useful for tracking which events were created and where.`}).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 Yo={command:`bulk-create`,describe:"The `datasetId` parameter must be defined. To list existing datasets (and their IDs) in your account, use the [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) endpoint.",builder:Jo,handler:async r=>c({command:`cloudforce-one threat-events bulk-create`,classification:{safeFlags:[`include-created-events`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/create/bulk`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({data:d(r.data,`data`),datasetId:p(r[`dataset-id`],`dataset-id`,`text`),includeCreatedEvents:r[`include-created-events`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.bulkCreate({...e,account_id:l})),{successLabel:`Created`});return}if(r.data===void 0)throw Error(`--data is required (or pass --body with this field set).`);r[`dataset-id`]===void 0&&(r[`dataset-id`]=await h(`dataset-id`,`The datasetId field`));let m=f({data:d(r.data,`data`),datasetId:p(r[`dataset-id`],`dataset-id`,`text`),includeCreatedEvents:r[`include-created-events`]});a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.bulkCreate({...m,account_id:l})),{successLabel:`Created`})})};function Xo(e){return e.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 Zo={command:`create`,describe:`Creates a new threat event category in Cloudforce One for organizing and classifying threat events.`,builder:Xo,handler:async r=>c({command:`cloudforce-one threat-events categories create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/categories/create`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:p(r.name,`name`,`text`),shortname:p(r.shortname,`shortname`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.categories.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`kill-chain`]===void 0)throw Error(`--kill-chain is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await h(`name`,`The name field`));let d=f({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:p(r.name,`name`,`text`),shortname:p(r.shortname,`shortname`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.categories.create({...d,account_id:l})),{successLabel:`Created`})})};function Qo(e){return e.positional(`category-id`,{type:`string`,description:`Category UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const $o={command:`delete <category-id>`,describe:`Removes a threat event category from Cloudforce One.`,builder:Qo,handler:async r=>c({command:`cloudforce-one threat-events categories delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events categories delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/event-categories/by-id/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
26
26
|
`);return}a(await s(`Deleting`,async()=>c.cloudforceOne.threatEvents.categories.delete({account_id:l,category_id:r[`category-id`]})),{successLabel:`Deleted`})})};function es(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 ts={command:`edit <category-id>`,describe:`Partially updates a threat event category in Cloudforce One, modifying specific fields without replacing the entire category.`,builder:es,handler:async r=>c({command:`cloudforce-one threat-events categories edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events categories edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/event-categories/by-id/${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?f({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:p(r.name,`name`,`text`),shortname:p(r.shortname,`shortname`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.categories.edit({...e,account_id:l,category_id:r[`category-id`]})),{successLabel:`Updated`});return}let d=f({killChain:r[`kill-chain`],mitreAttack:r[`mitre-attack`],mitreCapec:r[`mitre-capec`],name:p(r.name,`name`,`text`),shortname:p(r.shortname,`shortname`,`text`)});a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.categories.edit({...d,account_id:l,category_id:r[`category-id`]})),{successLabel:`Updated`})})};function ns(e){return e.positional(`category-id`,{type:`string`,description:`Category UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rs={command:`get <category-id>`,describe:`Retrieves details for a specific threat event category.`,builder:ns,handler:async r=>c({command:`cloudforce-one threat-events categories get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events categories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/event-categories/by-id/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-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.threatEvents.categories.get({account_id:l,category_id:r[`category-id`]})),{successLabel:`Loaded`})})};function is(e){return e.option(`dataset-ids`,{type:`string`,description:`Array of dataset IDs to query categories from. If not provided, uses the default dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const as={command:`list`,describe:`Lists all threat event categories configured for classifying and organizing threat events.`,builder:is,handler:async r=>c({command:`cloudforce-one threat-events categories list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={datasetIds:r[`dataset-ids`]};if(r.dryRun){o({command:`cf cloudforce-one threat-events categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/categories`,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.threatEvents.categories.list({account_id:u,...c})),{successLabel:`Loaded`})})},os={command:`categories`,describe:`Operations for threat-events.categories`,builder:e=>e.command(Zo).command($o).command(ts).command(rs).command(as).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ss(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cs={command:`list`,describe:`Lists countries referenced in Cloudforce One threat intelligence data.`,builder:ss,handler:async r=>c({command:`cloudforce-one threat-events countries list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events countries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/countries`,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.threatEvents.countries.list({account_id:l})),{successLabel:`Loaded`})})},ls={command:`countries`,describe:`Operations for threat-events.countries`,builder:e=>e.command(cs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function us(e){return e.positional(`account-id-path`,{type:`string`,description:`Account ID.`,demandOption:!0}).option(`account-id`,{type:`number`,description:`The accountId field`}).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(`dataset-id`,{type:`string`,description:`The datasetId field`}).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(`indicators`,{type:`string`,description:`Array of indicators for this event. Supports multiple indicators per event for complex scenarios. Provide as a JSON array of objects or @path/to/file.json.`}).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(`source-resource-id`,{type:`string`,description:`The source.resourceId field`}).option(`source-resource-type`,{type:`string`,description:`The source.resourceType field`,choices:[`article`]}).option(`source-system`,{type:`string`,description:`The source.system field`,choices:[`threat-signals`]}).option(`source-title`,{type:`string`,description:`Threat Signals article title; null for historical provenance without a stored title.`}).option(`tags`,{type:`string`,array:!0,description:`The tags 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)`}).check(e=>{if([`source-resource-id`,`source-resource-type`,`source-system`,`source-title`].some(t=>e[t]!==void 0)){let t=[`source-resource-id`,`source-resource-type`,`source-system`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const ds={command:`create <account-id-path>`,describe:"To create a dataset, see the [`Create Dataset`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/create/) endpoint. When `datasetId` parameter is unspecified, it will be created in a default dataset named `Cloudforce One Threat Events`.",builder:us,handler:async e=>c({command:`cloudforce-one threat-events create`,classification:{safeFlags:[`source-resource-type`,`source-system`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf cloudforce-one threat-events create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/cloudforce-one/events/create`,pathParams:{"account-id-path":String(e[`account-id-path`]??``)},bodyKind:`json`,body:e.body===void 0?f({accountId:e[`account-id`],attacker:p(e.attacker,`attacker`,`text`),attackerCountry:p(e[`attacker-country`],`attacker-country`,`text`),category:p(e.category,`category`,`text`),datasetId:p(e[`dataset-id`],`dataset-id`,`text`),date:p(e.date,`date`,`text`),event:p(e.event,`event`,`text`),indicator:p(e.indicator,`indicator`,`text`),indicatorType:p(e[`indicator-type`],`indicator-type`,`text`),indicators:d(e.indicators,`indicators`),insight:p(e.insight,`insight`,`text`),raw:{source:p(e[`raw-source`],`raw-source`,`text`),tlp:p(e[`raw-tlp`],`raw-tlp`,`text`)},source:{resourceId:p(e[`source-resource-id`],`source-resource-id`,`text`),resourceType:p(e[`source-resource-type`],`source-resource-type`,`text`),system:p(e[`source-system`],`source-system`,`text`),title:p(e[`source-title`],`source-title`,`text`)},tags:e.tags,targetCountry:p(e[`target-country`],`target-country`,`text`),targetIndustry:p(e[`target-industry`],`target-industry`,`text`),tlp:p(e.tlp,`tlp`,`text`)}):u(e.body)});return}let t=await i(e);if(e.body){let n=u(e.body);a(await s(`Creating`,async()=>t.cloudforceOne.threatEvents.create({...n,account_id_path:e[`account-id-path`]})),{successLabel:`Created`});return}e.category===void 0&&(e.category=await h(`category`,`The category field`)),e.date===void 0&&(e.date=await h(`date`,`The date field`)),e.event===void 0&&(e.event=await h(`event`,`The event field`)),e.tlp===void 0&&(e.tlp=await h(`tlp`,`The tlp field`));let n=f({accountId:e[`account-id`],attacker:p(e.attacker,`attacker`,`text`),attackerCountry:p(e[`attacker-country`],`attacker-country`,`text`),category:p(e.category,`category`,`text`),datasetId:p(e[`dataset-id`],`dataset-id`,`text`),date:p(e.date,`date`,`text`),event:p(e.event,`event`,`text`),indicator:p(e.indicator,`indicator`,`text`),indicatorType:p(e[`indicator-type`],`indicator-type`,`text`),indicators:d(e.indicators,`indicators`),insight:p(e.insight,`insight`,`text`),raw:{source:p(e[`raw-source`],`raw-source`,`text`),tlp:p(e[`raw-tlp`],`raw-tlp`,`text`)},source:{resourceId:p(e[`source-resource-id`],`source-resource-id`,`text`),resourceType:p(e[`source-resource-type`],`source-resource-type`,`text`),system:p(e[`source-system`],`source-system`,`text`),title:p(e[`source-title`],`source-title`,`text`)},tags:e.tags,targetCountry:p(e[`target-country`],`target-country`,`text`),targetIndustry:p(e[`target-industry`],`target-industry`,`text`),tlp:p(e.tlp,`tlp`,`text`)});a(await s(`Creating`,async()=>t.cloudforceOne.threatEvents.create({...n,account_id_path:e[`account-id-path`]})),{successLabel:`Created`})})};function fs(e){return e.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 ps={command:`create`,describe:`Creates a new threat event dataset in Cloudforce One for organizing related threat events.`,builder:fs,handler:async r=>c({command:`cloudforce-one threat-events datasets create`,classification:{safeFlags:[`is-public`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset/create`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({isPublic:r[`is-public`],name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.datasets.create({...e,account_id:l})),{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 h(`name`,`Used to describe the dataset within the account context.`));let d=f({isPublic:r[`is-public`],name:p(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.datasets.create({...d,account_id:l})),{successLabel:`Created`})})};function ms(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 hs={command:`edit <dataset-id>`,describe:`Partially updates a threat event dataset in Cloudforce One, modifying specific fields without replacing the entire dataset configuration.`,builder:ms,handler:async r=>c({command:`cloudforce-one threat-events datasets edit`,classification:{safeFlags:[`is-public`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events datasets edit`,method:`PATCH`,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?f({isPublic:r[`is-public`],name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.datasets.edit({...e,account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Updated`});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 h(`name`,`Used to describe the dataset within the account context.`));let d=f({isPublic:r[`is-public`],name:p(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.datasets.edit({...d,account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Updated`})})};function gs(e){return e.positional(`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 _s={command:`get <dataset-id>`,describe:`Retrieves details for a specific threat event dataset.`,builder:gs,handler:async r=>c({command:`cloudforce-one threat-events datasets get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events datasets 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`]))}`,pathParams:{"dataset-id":String(r[`dataset-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.threatEvents.datasets.get({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Loaded`})})};function vs(e){return e.option(`include-deleted`,{type:`boolean`,description:"When true, include soft-deleted datasets in the response. Each item includes a `deletedAt` field (ISO 8601 or null). Default: false."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ys={command:`list`,describe:`Lists all threat event datasets configured in Cloudforce One.`,builder:vs,handler:async r=>c({command:`cloudforce-one threat-events datasets list`,classification:{safeFlags:[`include-deleted`,`dry-run`]}},r,async()=>{let c={includeDeleted:r[`include-deleted`]};if(r.dryRun){o({command:`cf cloudforce-one threat-events datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/dataset`,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.threatEvents.datasets.list({account_id:u,...c})),{successLabel:`Loaded`})})};function bs(e){return e.positional(`event-id`,{type:`string`,description:`Event ID.`,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 xs={command:`raw <event-id>`,describe:`Retrieves the raw data associated with an event. Searches across all shards in the dataset.`,builder:bs,handler:async r=>c({command:`cloudforce-one threat-events datasets raw`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events datasets raw`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/events/${r[`event-id`]==null?`<event-id>`:encodeURIComponent(String(r[`event-id`]))}/raw`,pathParams:{"event-id":String(r[`event-id`]??``),"dataset-id":String(r[`dataset-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.threatEvents.datasets.raw({account_id:l,dataset_id:r[`dataset-id`],event_id:r[`event-id`]})),{successLabel:`Loaded`})})},Ss={command:`datasets`,describe:`Operations for threat-events.datasets`,builder:e=>e.command(ps).command(hs).command(_s).command(ys).command(xs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Cs(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 ws={command:`edit <event-id>`,describe:`Partially updates a threat event in Cloudforce One, modifying specific fields without replacing the entire event.`,builder:Cs,handler:async r=>c({command:`cloudforce-one threat-events edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events edit`,method:`PATCH`,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?f({attacker:p(r.attacker,`attacker`,`text`),attackerCountry:p(r[`attacker-country`],`attacker-country`,`text`),category:p(r.category,`category`,`text`),createdAt:p(r[`created-at`],`created-at`,`text`),datasetId:p(r[`dataset-id`],`dataset-id`,`text`),date:p(r.date,`date`,`text`),event:p(r.event,`event`,`text`),indicator:p(r.indicator,`indicator`,`text`),indicatorType:p(r[`indicator-type`],`indicator-type`,`text`),insight:p(r.insight,`insight`,`text`),raw:{source:p(r[`raw-source`],`raw-source`,`text`),tlp:p(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:p(r[`target-country`],`target-country`,`text`),targetIndustry:p(r[`target-industry`],`target-industry`,`text`),tlp:p(r.tlp,`tlp`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.edit({...e,account_id:l,event_id:r[`event-id`]})),{successLabel:`Updated`});return}r[`dataset-id`]===void 0&&(r[`dataset-id`]=await h(`dataset-id`,`Dataset ID containing the event to update.`));let d=f({attacker:p(r.attacker,`attacker`,`text`),attackerCountry:p(r[`attacker-country`],`attacker-country`,`text`),category:p(r.category,`category`,`text`),createdAt:p(r[`created-at`],`created-at`,`text`),datasetId:p(r[`dataset-id`],`dataset-id`,`text`),date:p(r.date,`date`,`text`),event:p(r.event,`event`,`text`),indicator:p(r.indicator,`indicator`,`text`),indicatorType:p(r[`indicator-type`],`indicator-type`,`text`),insight:p(r.insight,`insight`,`text`),raw:{source:p(r[`raw-source`],`raw-source`,`text`),tlp:p(r[`raw-tlp`],`raw-tlp`,`text`)},targetCountry:p(r[`target-country`],`target-country`,`text`),targetIndustry:p(r[`target-industry`],`target-industry`,`text`),tlp:p(r.tlp,`tlp`,`text`)});a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.edit({...d,account_id:l,event_id:r[`event-id`]})),{successLabel:`Updated`})})};function Ts(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`tags`,{type:`string`,array:!0,description:`The tags 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 Es={command:`create <event-id>`,describe:`Adds a tag to a threat event in Cloudforce One for classification and filtering.`,builder:Ts,handler:async r=>c({command:`cloudforce-one threat-events event-tags create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events event-tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/event_tag/${r[`event-id`]==null?`<event-id>`:encodeURIComponent(String(r[`event-id`]))}/create`,pathParams:{"event-id":String(r[`event-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({tags:r.tags}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.eventTags.create({...e,account_id:l,event_id:r[`event-id`]})),{successLabel:`Created`});return}if(r.tags===void 0)throw Error(`--tags is required (or pass --body with this field set).`);let d=f({tags:r.tags});a(await s(`Creating`,async()=>c.cloudforceOne.threatEvents.eventTags.create({...d,account_id:l,event_id:r[`event-id`]})),{successLabel:`Created`})})};function Ds(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`tags`,{type:`string`,array:!0,description:`The tags field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Os={command:`delete <event-id>`,describe:`Removes a tag from a threat event in Cloudforce One.`,builder:Ds,handler:async r=>c({command:`cloudforce-one threat-events event-tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events event-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/event_tag/${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?f({tags:r.tags}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
27
27
|
`);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.cloudforceOne.threatEvents.eventTags.delete({...e,account_id:l,event_id:r[`event-id`]})),{successLabel:`Deleted`});return}if(r.tags===void 0)throw Error(`--tags is required (or pass --body with this field set).`);let d=f({tags:r.tags});a(await s(`Deleting`,async()=>c.cloudforceOne.threatEvents.eventTags.delete({...d,account_id:l,event_id:r[`event-id`]})),{successLabel:`Deleted`})})},ks={command:`event-tags`,describe:`Operations for threat-events.event-tags`,builder:e=>e.command(Es).command(Os).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function As(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const js={command:`get <event-id>`,describe:`This Method is deprecated. Please use /events/dataset/:dataset_id/events/:event_id instead.`,builder:As,handler:async r=>c({command:`cloudforce-one threat-events get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events get`,method:`GET`,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:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.cloudforceOne.threatEvents.get({account_id:l,event_id:r[`event-id`]})),{successLabel:`Loaded`})})};function Ms(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ns={command:`list`,describe:`This Method is deprecated. Please use /events/dataset/:dataset_id/indicatorTypes instead.`,builder:Ms,handler:async r=>c({command:`cloudforce-one threat-events indicator-types list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events indicator-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/indicatorTypes`,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.threatEvents.indicatorTypes.list({account_id:l})),{successLabel:`Loaded`})})},Ps={command:`indicator-types`,describe:`Operations for threat-events.indicator-types`,builder:e=>e.command(Ns).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fs(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination. When provided, filters are embedded in the cursor so you only need to pass cursor and pageSize. Returned in the previous response's result_info.cursor field. Use cursor-based pagination for deep pagination (beyond 100,000 records) or for optimal performance.`}).option(`search`,{type:`string`,description:`Search`}).option(`page`,{type:`number`,description:`Page number (1-indexed) for offset-based pagination. Limited to offset of 100,000 records. For deep pagination, use cursor-based pagination instead.`}).option(`page-size`,{type:`number`,description:`Number of results per page. Maximum 25,000.`}).option(`order-by`,{type:`string`,description:`OrderBy`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`dataset-id`,{type:`string`,description:`Dataset UUIDs to query, or one standalone scope value: 'all'/'*' for the legacy all-datasets behavior, 'analytics' for isAnalytics=true datasets, or 'operational' for isAnalytics=false datasets. If not provided, uses the default dataset.`}).option(`force-refresh`,{type:`boolean`,description:`ForceRefresh`}).option(`format`,{type:`string`,description:`Format`,choices:[`json`,`stix2`,`taxii`]}).option(`cache`,{type:`string`,description:`Cache strategy. 'from-graph' serves results from the graph-node KV cache when all requested UUIDs are cached; falls back to normal path on partial/zero hit.`,choices:[`from-graph`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Is={command:`list`,describe:"Use `datasetId=all` or `datasetId=*` for the legacy all-datasets scope, `datasetId=analytics` for datasets with `isAnalytics=true`, or `datasetId=operational` for datasets with `isAnalytics=false` (limited to 50). Scope values must be used alone. When `datasetId` is unspecified, events are listed from the default Cloudforce One Threat Events dataset. To list existing datasets, use the [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) endpoint.",builder:v(Fs),handler:async r=>c({command:`cloudforce-one threat-events list`,classification:{safeFlags:[`order`,`force-refresh`,`format`,`cache`,`dry-run`]}},r,async()=>{let c={cursor:r.cursor,search:r.search,page:r.page,pageSize:r[`page-size`],orderBy:r[`order-by`],order:r.order,datasetId:r[`dataset-id`],forceRefresh:r[`force-refresh`],format:r.format,cache:r.cache};if(r.dryRun){o({command:`cf cloudforce-one threat-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events`,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.threatEvents.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Ls(e){return e.positional(`raw-id`,{type:`string`,description:`Raw Event UUID.`,demandOption:!0}).option(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`source`,{type:`string`,description:`The source 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 Rs={command:`edit <raw-id>`,describe:`Partially updates raw threat event data in Cloudforce One, modifying specific fields of the event.`,builder:Ls,handler:async r=>c({command:`cloudforce-one threat-events raw edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events raw edit`,method:`PATCH`,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`]))}/raw/${r[`raw-id`]==null?`<raw-id>`:encodeURIComponent(String(r[`raw-id`]))}`,pathParams:{"event-id":String(r[`event-id`]??``),"raw-id":String(r[`raw-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({source:p(r.source,`source`,`text`),tlp:p(r.tlp,`tlp`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.raw.edit({...e,account_id:l,event_id:r[`event-id`],raw_id:r[`raw-id`]})),{successLabel:`Updated`});return}let d=f({source:p(r.source,`source`,`text`),tlp:p(r.tlp,`tlp`,`text`)});a(await s(`Updating`,async()=>c.cloudforceOne.threatEvents.raw.edit({...d,account_id:l,event_id:r[`event-id`],raw_id:r[`raw-id`]})),{successLabel:`Updated`})})};function zs(e){return e.positional(`raw-id`,{type:`string`,description:`Raw Event UUID.`,demandOption:!0}).option(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bs={command:`get <raw-id>`,describe:`Retrieves raw threat event data for a specific event in Cloudforce One.`,builder:zs,handler:async r=>c({command:`cloudforce-one threat-events raw get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events raw get`,method:`GET`,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`]))}/raw/${r[`raw-id`]==null?`<raw-id>`:encodeURIComponent(String(r[`raw-id`]))}`,pathParams:{"event-id":String(r[`event-id`]??``),"raw-id":String(r[`raw-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.threatEvents.raw.get({account_id:l,event_id:r[`event-id`],raw_id:r[`raw-id`]})),{successLabel:`Loaded`})})},Vs={command:`raw`,describe:`Operations for threat-events.raw`,builder:e=>e.command(Rs).command(Bs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Hs(e){return e.positional(`event-id`,{type:`string`,description:`Event UUID.`,demandOption:!0}).option(`events`,{type:`string`,array:!0,description:`The events field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Us={command:`delete <event-id>`,describe:`Removes a reference link between related threat events in Cloudforce One.`,builder:Hs,handler:async r=>c({command:`cloudforce-one threat-events relate delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf cloudforce-one threat-events relate delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cloudforce-one/events/relate/${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?f({events:r.events}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{n as e,t}from"./project-settings-Bc3wYHo8.mjs";import{t as n}from"./output-Z2lQmPUW.mjs";import*as r from"node:path";import*as i from"node:fs/promises";import{generateTypes as a,loadAndParseConfig as o}from"@cloudflare/config";import{RUNTIME_TYPES_MARKER as s,generateRuntimeTypes as c}from"@cloudflare/runtime-types";const l=r.join(`.cloudflare`,`types`,`index.d.ts`);function u(e){return e.option(`include-runtime`,{type:`boolean`,description:`Include Cloudflare Workers runtime types`,default:!0})}function d(e){return e.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
|
|
3
|
+
`)}function f(e,t){let n=r.relative(e,t).split(r.sep).join(`/`);return n.startsWith(`.`)?n:`./${n}`}const p={command:`types`,describe:`Generate types from cloudflare.config.ts`,builder:u,handler:async u=>{if(u.local)throw Error(`--local is not supported by cf workers types.`);let p=e();if(p===null)throw Error(`${t} is required by cf workers types.`);let m=await o(p,{isPreview:!1,mode:u.mode});if(!m.result.success)throw Error(`Invalid ${t}:\n${d(m.result.error.issues)}`);let h=m.result.data.worker;if(h===void 0)throw Error(`${t} must define a Worker to generate types.`);let g=r.dirname(p),_=r.join(g,l),v;try{v=await i.readFile(_,`utf8`)}catch{}let y=a({configPath:f(r.dirname(_),p),packageName:`cf/config`});if(u.includeRuntime){let{runtimeHeader:e,runtimeTypes:t}=await c({compatibilityDate:h.compatibilityDate,compatibilityFlags:h.compatibilityFlags??[],existingContent:v});y+=`\n${e}\n${s}\n${t}`}v!==y&&(await i.mkdir(r.dirname(_),{recursive:!0}),await i.writeFile(_,y)),n({path:r.relative(process.cwd(),_)},{quiet:u.quiet})}};export{p as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{y as e}from"./dist-CyisSore.mjs";import{t}from"./chunk-QBZBEHZB-BcCMlc8C.mjs";import{analyseBundle as n,getBundleSize as r,summarizeStartupProfile as i}from"./startup-profile-CBIH6yZy.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{a as s,i as c,n as l,r as u}from"./build-CP2JUfV1.mjs";import{t as d}from"./deploy-input-BoLTdQzS.mjs";import f from"node:path";import{writeFile as p}from"node:fs/promises";import{readBuildOutput as m}from"@cloudflare/build-output-utils";function h(e){return e.option(`outfile`,{type:`string`,description:`Output file for the startup CPU profile`,default:`worker-startup.cpuprofile`,requiresArg:!0}).option(`prebuilt`,{type:`boolean`,description:`Use existing Build Output Specification files without building`,default:!1})}const g={command:`check`,describe:`Profile a Worker's startup performance`,builder:h,handler:async h=>{if(h.local)throw Error(`--local is not supported by cf workers check.`);h.prebuilt||await l(h.mode,{output:h.quiet?`silent`:`stderr`});let{workers:{default:g},rootConfig:_}=await m(process.cwd());c(h.mode,_.buildContext.mode,{requireRequestedMode:h.prebuilt});let{wranglerConfig:v,builtConfig:y}=u(g,_),b=d(g,y);if(!b.resolvedEntryPointPath)throw new s(`Startup profiling requires a Worker entrypoint; assets-only projects cannot be profiled.`);if(b.bundleType===`commonjs`)throw new s(`Startup profiling does not support service-worker format Workers. Refer to https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ for migration guidance.`);let x=t({name:v.name??g.config.name??`worker`,main:{name:y.manifest?.mainModule??f.basename(b.resolvedEntryPointPath),filePath:b.resolvedEntryPointPath,content:b.content,type:b.bundleType},modules:b.modules,sourceMaps:b.sourceMaps,compatibility_date:v.compatibility_date,compatibility_flags:v.compatibility_flags??[],assets:void 0,containers:void 0,migrations:void 0,exports:void 0,keepVars:void 0,keepSecrets:void 0,logpush:void 0,placement:void 0,tail_consumers:void 0,streaming_tail_consumers:void 0,limits:void 0,annotations:void 0,observability:void 0,cache:void 0,package_dependencies:void 0},e(v),{dryRun:!0,unsafe:v.unsafe}),S=await r(x),C=h.quiet?await n(x):await o(`Profiling Worker startup`,()=>n(x)),w=i(C);await p(h.outfile,JSON.stringify(C)),a({bundle:{sizeBytes:S.size,gzipSizeBytes:S.gzipSize},startup:{profileWindowMs:w.profileWindow/1e3,sampledTimeMs:w.sampledTime/1e3,activeTimeMs:w.activeTime/1e3,garbageCollectionTimeMs:w.garbageCollectionTime/1e3,idleTimeMs:w.idleTime/1e3,sampleCount:w.sampleCount},profile:h.outfile,note:`This profile was measured locally. Use it to understand where startup time is spent, not to predict startup time on Cloudflare.`},{quiet:h.quiet})}};export{g as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./metadata-
|
|
2
|
+
import{n as e,t}from"./metadata-C5fJJr-k.mjs";import n from"node:assert";function r(e,t){return`#compdef ${e}
|
|
3
3
|
compdef _${e} ${e}
|
|
4
4
|
|
|
5
5
|
# zsh completion for ${e} -*- shell-script -*-
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e,t}from"./state-
|
|
2
|
+
import{r as e,t}from"./state-QUu6HfxC.mjs";import{randomUUID as n}from"node:crypto";const r=new Date(`2026-01-01T00:00:00.000Z`),i=`CF_SEND_TELEMETRY`,a=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function o(){let e=process.env[i];if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function s(){let r=t();if(typeof r.deviceId==`string`&&a.test(r.deviceId))return r.deviceId;let i=n();return e({deviceId:i}),i}function c(){return t().deviceId===void 0}function l(){let e=o();if(e!==void 0)return{enabled:e,source:`env`};let n=t().telemetry?.preference;return n?.enabled===!1?{enabled:!1,source:`config`}:n?.enabled===!0?{enabled:!0,source:typeof n.date==`string`&&new Date(n.date)>=r?`config`:`default`}:{enabled:!0,source:`default`}}function u(t){e({telemetry:{preference:{enabled:t,date:new Date().toISOString()}}})}function d(){return t().telemetry?.bannerLastShown}function f(t){e({telemetry:{bannerLastShown:t}})}export{o as a,f as c,s as i,u as l,r as n,c as o,d as r,l as s,i as t};
|