cf 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
- package/dist/{accounts-CjtZ8x1z.mjs → accounts-B_joQcMi.mjs} +9 -9
- package/dist/{acm-C2lYIWs1.mjs → acm-_kIHqYME.mjs} +2 -2
- package/dist/{addressing-CHFK6uxW.mjs → addressing-CaFlw8y1.mjs} +10 -10
- package/dist/{agent-context-CgGCT0xU.mjs → agent-context-DMPfi54f.mjs} +1 -1
- package/dist/ai-CqnhNb_c.mjs +2 -0
- package/dist/ai-gateway-pgYGI519.mjs +8 -0
- package/dist/ai-search-eqQMPQol.mjs +7 -0
- package/dist/ai_gateway--vuVLnOm.mjs +4 -0
- package/dist/{alerting-Bk85NNf5.mjs → alerting-CPxHiYHb.mjs} +5 -5
- package/dist/{analytics-CkhhhZWZ.mjs → analytics-DSSRDZz8.mjs} +1 -1
- package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
- package/dist/{api-gateway-CWdR4Ne7.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
- package/dist/argo-aC6A3JyX.mjs +2 -0
- package/dist/artifacts-HD4V2xpK.mjs +4 -0
- package/dist/audit-logs-BuExU_nz.mjs +2 -0
- package/dist/auth-CSC4yhEJ.mjs +9 -0
- package/dist/auth-D5hNsOFq.mjs +5 -0
- package/dist/billing-COaghyxl.mjs +2 -0
- package/dist/bot-management-DmEzeV1Y.mjs +5 -0
- package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
- package/dist/brand-protection-dPrGe8sL.mjs +3 -0
- package/dist/{browser-rendering-Rae0AUt0.mjs → browser-rendering-BiSGnpBf.mjs} +3 -3
- package/dist/{build-BE4o4imx.mjs → build-HuS9-R0V.mjs} +2 -2
- package/dist/{cache-B7pRbpTy.mjs → cache-CY-7Lt71.mjs} +4 -4
- package/dist/{calls-DXRWsZ8n.mjs → calls-wOQGDWPl.mjs} +3 -3
- package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
- package/dist/client-certificates-CRf41xLe.mjs +3 -0
- package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
- package/dist/{cloudforce-one-B6HYfk5Z.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
- package/dist/{completions-D_9WsLG7.mjs → completions-DOeHPdCG.mjs} +2 -2
- package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
- package/dist/connectivity-Bx3MgTHX.mjs +3 -0
- package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
- package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
- package/dist/connectors-DRt4e6d_.mjs +3 -0
- package/dist/{content-scanning-CnW2A0pv.mjs → content-scanning-Cd2vy5Sz.mjs} +3 -3
- package/dist/context-jpewmual.mjs +2 -0
- package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
- package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
- package/dist/custom-nameservers-CWqA51in.mjs +3 -0
- package/dist/custom-pages-DeUKEFGe.mjs +4 -0
- package/dist/d1-DvWY9Gp4.mjs +4 -0
- package/dist/data-security-BPo6dIWu.mjs +6 -0
- package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
- package/dist/{deploy-KBRFIatG.mjs → deploy-dVrgDUOp.mjs} +1 -1
- package/dist/{dev-pPazzZvt.mjs → dev-C01_Lby6.mjs} +1 -1
- package/dist/diagnostics-6nKPmVgz.mjs +3 -0
- package/dist/{dispatch-namespaces-Cz2rajnP.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
- package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
- package/dist/{dist-DA54ZQu0.mjs → dist-t_YrL25p.mjs} +1 -1
- package/dist/{dns-62t95Xif.mjs → dns-ClciFGxx.mjs} +13 -13
- package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
- package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
- package/dist/{email-routing-BDUYYeV3.mjs → email-routing-CGXhFqF5.mjs} +9 -9
- package/dist/{email-security-ChHA6eqQ.mjs → email-security-D5viPq8S.mjs} +7 -7
- package/dist/email-sending-C2jpc3gh.mjs +3 -0
- package/dist/{filters-qJpU9uAS.mjs → filters-bzsFcWt0.mjs} +3 -3
- package/dist/{firewall-C3DDwfwh.mjs → firewall-DYZcTtIC.mjs} +10 -10
- package/dist/{fraud-DY3YXFVf.mjs → fraud-C03MtdZb.mjs} +1 -1
- package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
- package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
- package/dist/hostnames-CFgIVI3s.mjs +3 -0
- package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
- package/dist/iam-DqVPzGrb.mjs +6 -0
- package/dist/{images-D1jI3r3O.mjs → images-BYfl4YgR.mjs} +6 -6
- package/dist/index.mjs +1 -1
- package/dist/intel-duTEPIHc.mjs +3 -0
- package/dist/{ips-B6JETVOY.mjs → ips-nv9INuWZ.mjs} +1 -1
- package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
- package/dist/{kv-CSWoD9ks.mjs → kv-CZoV4tiv.mjs} +4 -4
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
- package/dist/{load-balancers-Du1tNuUt.mjs → load-balancers--OMg0HNt.mjs} +5 -5
- package/dist/{logpush-SuJyO-uX.mjs → logpush-C0_lZTyY.mjs} +3 -3
- package/dist/{logs-DcDNRPRl.mjs → logs-BtpWZQfV.mjs} +2 -2
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
- package/dist/{magic-network-monitoring-CqtvOePQ.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
- package/dist/{magic-transit-BTbkhBtF.mjs → magic-transit-CLhMcJ_-.mjs} +32 -32
- package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
- package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
- package/dist/{network-interconnects-DsiNytOU.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
- package/dist/oauth-Bk-F-tIO.mjs +52 -0
- package/dist/{observability-CLqZ7OSi.mjs → observability-BynRbTF4.mjs} +3 -3
- package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
- package/dist/{organizations-aRi1bhFC.mjs → organizations-BqJHyvMK.mjs} +3 -3
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
- package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
- package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
- package/dist/{page-rules-CYqtPU1p.mjs → page-rules-EZHJePmn.mjs} +4 -4
- package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CXJioWPs.mjs} +5 -5
- package/dist/{pages-ChurJ2H7.mjs → pages-D4aYteKk.mjs} +8 -8
- package/dist/{pipelines-CeyujvRf.mjs → pipelines-G8Iusxq-.mjs} +5 -5
- package/dist/progress-DrDErV9w.mjs +2 -0
- package/dist/queues-DEkbKqZX.mjs +6 -0
- package/dist/{r2-BtuTO3vQ.mjs → r2-CV0IkCAW.mjs} +9 -9
- package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
- package/dist/{radar-CzGM92uM.mjs → radar-D986zPJr.mjs} +1 -1
- package/dist/{rate-limits-Bbk7HxP7.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
- package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
- package/dist/{realtime-kit-CivLpkpg.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
- package/dist/{registrar-8IeA5DKd.mjs → registrar-CDIwTz3G.mjs} +6 -6
- package/dist/request-tracers-D7SFMDik.mjs +2 -0
- package/dist/{resource-sharing-B-Pcto7-.mjs → resource-sharing-YIQ04jXE.mjs} +4 -4
- package/dist/{resource-tagging-Bpb6Qq1M.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
- package/dist/rules-DHjLP5Kx.mjs +4 -0
- package/dist/{rulesets-lYczEcJp.mjs → rulesets-q4QABpKs.mjs} +7 -7
- package/dist/rum-SmT4HZmM.mjs +4 -0
- package/dist/{schema-hefO-tzo.mjs → schema-BR31o4P6.mjs} +1 -1
- package/dist/{schema-validation-DTq517Em.mjs → schema-validation-vVetgC_P.mjs} +5 -5
- package/dist/{scim-BiLfOQ89.mjs → scim-ChOkZpNx.mjs} +2 -2
- package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
- package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-BAK9G12O.mjs} +12 -12
- package/dist/security-center-eScuYDKP.mjs +2 -0
- package/dist/security-txt-x7R4gmQu.mjs +3 -0
- package/dist/session-DHYCE-PM.mjs +93 -0
- package/dist/shared-BAjo72Lz.mjs +2 -0
- package/dist/{smart-shield-DblHIce0.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
- package/dist/snippets-DrlgYJYp.mjs +4 -0
- package/dist/{spawn-DK7pott_.mjs → spawn-CCGzKlC4.mjs} +1 -1
- package/dist/{spectrum-CnrG0jIC.mjs → spectrum-pVGxb7u5.mjs} +6 -6
- package/dist/speed-ZFrMWDgd.mjs +4 -0
- package/dist/src-DU7FBCOX.mjs +108 -0
- package/dist/ssl-9JY05sYt.mjs +15 -0
- package/dist/{stream-CGTRN4ZN.mjs → stream-tRU39b8K.mjs} +13 -13
- package/dist/{tenants-o_M62Y1n.mjs → tenants-HLGUazms.mjs} +1 -1
- package/dist/{token-validation-Ca5AGEns.mjs → token-validation-_VdamKpz.mjs} +4 -4
- package/dist/{tools-DtNNmO6l.mjs → tools-D_hfUU_Z.mjs} +1 -1
- package/dist/{turnstile-l7mo9BWL.mjs → turnstile-BRzXd28B.mjs} +4 -4
- package/dist/{ui-B97lRnOv.mjs → ui-erjBdVKL.mjs} +1 -1
- package/dist/url-normalization-D-NxuLtN.mjs +3 -0
- package/dist/url-scanner-BzzR6iDx.mjs +2 -0
- package/dist/{user-CiyYZ69X.mjs → user-C4omq__w.mjs} +1 -1
- package/dist/vectorize-By6EqcNR.mjs +4 -0
- package/dist/{versions-B6E8WQyA.mjs → versions-CBHwWPAM.mjs} +1 -1
- package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
- package/dist/{web3-DlHE0CZc.mjs → web3-DQ5dmE9W.mjs} +3 -3
- package/dist/{workers-DRAkU6YR.mjs → workers-D8Be7_as.mjs} +14 -14
- package/dist/workers-builds-BE3W3qNk.mjs +7 -0
- package/dist/{workflows-z6oapEJs.mjs → workflows-BWWufqFA.mjs} +3 -3
- package/dist/zaraz-Bsa9AvVL.mjs +2 -0
- package/dist/{zero-trust-fyyIelWx.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
- package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
- package/dist/{zones-MSULnDwW.mjs → zones-BXtdwt6E.mjs} +6 -6
- package/package.json +1 -1
- package/dist/ai-DS3i-I1a.mjs +0 -2
- package/dist/ai-gateway-RIsegO2x.mjs +0 -8
- package/dist/ai-search-Dcj4BauG.mjs +0 -7
- package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
- package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
- package/dist/argo-DnJRVnGX.mjs +0 -2
- package/dist/artifacts-BVWKiJUl.mjs +0 -4
- package/dist/audit-logs-DjTstbzL.mjs +0 -2
- package/dist/auth-BqDOIrKX.mjs +0 -150
- package/dist/auth-DKkSwnxh.mjs +0 -5
- package/dist/billing-3rEqF83h.mjs +0 -2
- package/dist/bot-management-CJxD1pqi.mjs +0 -5
- package/dist/botnet-feed-MG91D7BR.mjs +0 -3
- package/dist/brand-protection-CK7gJi06.mjs +0 -3
- package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
- package/dist/client-certificates-B0ebLJdk.mjs +0 -3
- package/dist/cloud-connector-BOjaggJk.mjs +0 -2
- package/dist/connectivity-welFvZ7X.mjs +0 -3
- package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
- package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
- package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
- package/dist/connectors-3vjrdFLB.mjs +0 -3
- package/dist/context-CONbNKO-.mjs +0 -2
- package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
- package/dist/custom-pages-5fCSP8in.mjs +0 -4
- package/dist/d1-CyiRbZZn.mjs +0 -4
- package/dist/data-security-Casx4OS_.mjs +0 -6
- package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
- package/dist/diagnostics-BqYDoDfw.mjs +0 -3
- package/dist/dns-firewall-Coy8d47t.mjs +0 -57
- package/dist/durable-objects-BSuRERkw.mjs +0 -2
- package/dist/email-sending-CVrRqn6S.mjs +0 -3
- package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
- package/dist/hostnames-BdAQo1Mr.mjs +0 -3
- package/dist/hyperdrive-99OJV9nl.mjs +0 -18
- package/dist/iam-BRbpg3lN.mjs +0 -6
- package/dist/intel-C3ajLpXd.mjs +0 -3
- package/dist/keyless-certificates-C4MZ4xnf.mjs +0 -3
- package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
- package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
- package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
- package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
- package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
- package/dist/progress-Cent9Lsg.mjs +0 -2
- package/dist/queues-Rf_n11Cx.mjs +0 -6
- package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
- package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
- package/dist/request-tracers-D1aH4NmL.mjs +0 -2
- package/dist/rules-B10XWY10.mjs +0 -4
- package/dist/rum-B5GUKa4I.mjs +0 -4
- package/dist/security-center-AVpTOBK3.mjs +0 -2
- package/dist/security-txt-DVlh8y9l.mjs +0 -3
- package/dist/shared-0bwWVDLo.mjs +0 -2
- package/dist/snippets-DrpqSXYC.mjs +0 -4
- package/dist/speed-BzRY3Xlh.mjs +0 -4
- package/dist/src-D9_Gq68b.mjs +0 -108
- package/dist/ssl-Cp6tQkZH.mjs +0 -15
- package/dist/url-normalization-D1CogSIG.mjs +0 -3
- package/dist/url-scanner-BnJHJqcz.mjs +0 -2
- package/dist/vectorize-D3LgMLOn.mjs +0 -4
- package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
- package/dist/zaraz-CyzfYOEU.mjs +0 -2
- package/dist/zero_trust-BAhlNkjo.mjs +0 -3
- /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
- /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
- /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-BeyOc81z.mjs} +0 -0
- /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
- /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
- /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
- /package/dist/{metadata-jh2EIan8.mjs → metadata-OOwvpR8m.mjs} +0 -0
- /package/dist/{resolve-D1mG0REg.mjs → resolve-C3h-mwp7.mjs} +0 -0
- /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
package/dist/iam-BRbpg3lN.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,T as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";import{t as f}from"./cli-types-CMNMD1V7.mjs";function p(e){return e.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/permission_groups/${t[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(t[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(t[`permission-group-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.permissionGroups.get({account_id:a,permission_group_id:t[`permission-group-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List all the permissions groups for an account.`,builder:h,handler:async t=>{let n={id:t.id,name:t.name,label:t.label,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/permission_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.permissionGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}},_={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:v,handler:async n=>{if(n.dryRun){c({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({name:u(n.name,`name`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the resource group`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:b,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}s(await l(`Deleting`,async()=>a.iam.resourceGroups.delete({account_id:o,resource_group_id:t[`resource-group-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:S,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.resourceGroups.get({account_id:a,resource_group_id:t[`resource-group-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List all the resource groups for an account.`,builder:w,handler:async t=>{let n={id:t.id,name:t.name};if(t.dryRun){c({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.resourceGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}};function E(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`)}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.resourceGroups.update({...e,account_id:f,resource_group_id:t[`resource-group-id`]})),{successLabel:`Updated`});return}let p=o({name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>n.iam.resourceGroups.update({...p,account_id:f,resource_group_id:t[`resource-group-id`]})),{successLabel:`Updated`})}},O={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:k,handler:async t=>{if(t.dryRun){c({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Creating`,async()=>n.iam.sso.beginVerification({account_id:a,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Created`})}};function j(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:j,handler:async n=>{if(n.dryRun){c({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({begin_verification:n[`begin-verification`],email_domain:u(n[`email-domain`],`email-domain`,`text`),use_fedramp_language:n[`use-fedramp-language`]}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}n[`email-domain`]===void 0&&(n[`email-domain`]=await t(`email-domain`,`Email domain of the new SSO connector`));let m=o({begin_verification:n[`begin-verification`],email_domain:u(n[`email-domain`],`email-domain`,`text`),use_fedramp_language:n[`use-fedramp-language`]});s(await l(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:N,handler:async t=>{if(t.dryRun){c({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}s(await l(`Deleting`,async()=>a.iam.sso.delete({account_id:o,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:F,handler:async t=>{if(t.dryRun){c({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.sso.get({account_id:a,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:I,handler:async t=>{if(t.dryRun){c({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.sso.list({account_id:a})),{successLabel:`Loaded`})}};function R(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:R,handler:async t=>{if(t.dryRun){c({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({enabled:t.enabled,use_fedramp_language:t[`use-fedramp-language`]}):a(t.body)});return}let n=await i(t),u=t.local?d:await r(n);if(t.accountId=u,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.sso.update({...e,account_id:u,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=o({enabled:t.enabled,use_fedramp_language:t[`use-fedramp-language`]});s(await l(`Updating`,async()=>n.iam.sso.update({...f,account_id:u,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Updated`})}},B={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(A).command(M).command(P).command(ee).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`create`,describe:`Create a new user group under the specified account.`,builder:V,handler:async n=>{if(n.dryRun){c({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({name:u(n.name,`name`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.iam.userGroups.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the User group.`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.iam.userGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function U(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const W={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:U,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}s(await l(`Deleting`,async()=>a.iam.userGroups.delete({account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Deleted`})}};function G(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:G,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.iam.userGroups.get({account_id:a,user_group_id:t[`user-group-id`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List all the user groups for an account.`,builder:f(q),handler:async t=>{let n={id:t.id,name:t.name,fuzzyName:t[`fuzzy-name`],page:t.page,per_page:t[`per-page`],direction:t.direction};if(t.dryRun){c({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.userGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:Y,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),o=t.local?d:await r(n);if(t.accountId=o,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.iam.userGroups.members.create({body:e,account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Z(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Q={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:Z,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members/${t[`member-id`]==null?`<member-id>`:encodeURIComponent(String(t[`member-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``),"member-id":String(t[`member-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}s(await l(`Deleting`,async()=>a.iam.userGroups.members.delete({account_id:o,user_group_id:t[`user-group-id`],member_id:t[`member-id`]})),{successLabel:`Deleted`})}};function $(e){return e.option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`list`,describe:`List all the members attached to a user group.`,builder:f($),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],fuzzyEmail:t[`fuzzy-email`],direction:t.direction};if(t.dryRun){c({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.iam.userGroups.members.list({account_id:o,user_group_id:t[`user-group-id`],...n})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Set/Replace members to a user group.`})}const re={command:`update <user-group-id>`,describe:`Replace the set of members attached to a User Group.`,builder:ne,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),o=t.local?d:await r(n);if(t.accountId=o,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.userGroups.members.update({body:e,account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},ie={command:`members`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(X).command(Q).command(te).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`update <user-group-id>`,describe:`Modify an existing user group.`,builder:ae,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`)}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.userGroups.update({...e,account_id:f,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`});return}let p=o({name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>n.iam.userGroups.update({...p,account_id:f,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`})}},se={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(H).command(W).command(K).command(J).command(oe).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(_).command(O).command(B).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ce as default};
|
package/dist/intel-C3ajLpXd.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,T as t,_ as n,i as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u,t as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";import{n as m,t as ee}from"./raw-fetch-DnbAMFBp.mjs";function h(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:p(h),handler:async t=>{if(t.dryRun){c({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/asn/${t.asn==null?`<asn>`:encodeURIComponent(String(t.asn))}`,pathParams:{asn:String(t.asn??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.asn.get({account_id:a,asn:t.asn})),{successLabel:`Loaded`})}};function _(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:p(_),handler:async t=>{if(t.dryRun){c({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/asn/${t.asn==null?`<asn>`:encodeURIComponent(String(t.asn))}/subnets`,pathParams:{asn:String(t.asn??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.asn.subnets.get({account_id:a,asn:t.asn})),{successLabel:`Loaded`})}},y={command:`subnets`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(g).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.attackSurfaceReport.issueTypes.get({account_id:a})),{successLabel:`Loaded`})}},C={command:`issue-types`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:p(w),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.class({account_id:o,...r})),{successLabel:`Loaded`})}};function E(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({dismiss:t.dismiss}):a(t.body)});return}let r=await i(t),u=t.local?f:await n(r);if(t.accountId=u,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.attackSurfaceReport.issues.dismiss({...e,account_id:u,issue_id:t[`issue-id`]})),{successLabel:`Updated`});return}let d=o({dismiss:t.dismiss});s(await l(`Updating`,async()=>r.intel.attackSurfaceReport.issues.dismiss({...d,account_id:u,issue_id:t[`issue-id`]})),{successLabel:`Updated`})}};function O(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:p(O),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.list({account_id:o,...r})),{successLabel:`Loaded`})}};function A(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:p(A),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.severity({account_id:o,...r})),{successLabel:`Loaded`})}};function M(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:p(M),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.type({account_id:o,...r})),{successLabel:`Loaded`})}},P={command:`issues`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`attack-surface-report`,describe:`Operations for attack-surface-report`,builder:e=>e.command(C).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:p(I),handler:async t=>{let r={start_end_params:t[`start-end-params`],ipv4:t.ipv4,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/dns`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.dns.list({account_id:o,...r})),{successLabel:`Loaded`})}},R={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:z,handler:async t=>{let r={domain:t.domain};if(t.dryRun){c({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain-history`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domainHistory.get({account_id:o,...r})),{successLabel:`Loaded`})}},V={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:H,handler:async t=>{let r={domain:t.domain,include_ranking:t[`include-ranking`],skip_ranking:t[`skip-ranking`]};if(t.dryRun){c({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domains.bulks.get({account_id:o,...r})),{successLabel:`Loaded`})}},W={command:`bulks`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:G,handler:async t=>{let r={domain:t.domain,skip_dns:t[`skip-dns`],skip_ranking:t[`skip-ranking`]};if(t.dryRun){c({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domains.get({account_id:o,...r})),{successLabel:`Loaded`})}},q={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(K).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:J,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.intel.indicatorFeeds.create({...e,account_id:d})),{successLabel:`Created`});return}let p=o({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`)});s(await l(`Creating`,async()=>r.intel.indicatorFeeds.create({...p,account_id:d})),{successLabel:`Created`})}};function X(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:X,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/data`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,m((await l(`Loading`,async()=>ee(`/accounts/${a}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/data`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).toString(`utf-8`))}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:p(Z),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/download`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.downloads.get({account_id:a,feed_id:t[`feed-id`]})),{successLabel:`Loaded`})}},ne={command:`downloads`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:p(re),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.get({account_id:a,feed_id:t[`feed-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:ae,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.list({account_id:a})),{successLabel:`Loaded`})}};function se(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:se,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({account_tag:u(t[`account-tag`],`account-tag`,`text`),feed_id:t[`feed-id`]}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.indicatorFeeds.permissions.create({body:e,account_id:d})),{successLabel:`Updated`});return}let p=o({account_tag:u(t[`account-tag`],`account-tag`,`text`),feed_id:t[`feed-id`]});s(await l(`Updating`,async()=>r.intel.indicatorFeeds.permissions.create({body:p,account_id:d})),{successLabel:`Updated`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`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 ue={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:le,handler:async r=>{if(r.dryRun){c({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account_tag:u(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):a(r.body)});return}let d=await i(r),p=r.local?f:await n(d);if(r.accountId=p,!await t({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}if(r.body){let e=a(r.body);s(await l(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:e,account_id:p})),{successLabel:`Deleted`});return}let m=o({account_tag:u(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});s(await l(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:m,account_id:p})),{successLabel:`Deleted`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Lists current access permissions for custom threat indicator feeds.`,builder:de,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds permissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/view`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.permissions.list({account_id:a})),{successLabel:`Loaded`})}},pe={command:`permissions`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`source`,{type:`string`,description:"The file to upload. Either a plain STIX2/CRDF body or a gzipped one (recognised by `0x1f 0x8b` magic bytes or a `.gz` filename suffix). "})}const he={command:`update <feed-id>`,describe:"Revises the raw data entries in a custom threat indicator feed. Accepts both plain and gzipped STIX2/CRDF bodies. Gzip is detected by RFC 1952 magic bytes (`0x1f 0x8b`) and/or a `.gz` filename suffix (case-insensitive) — either signal alone is sufficient to trigger the gzip path; if the body is not valid gzip, the upload fails fast. Customers are encouraged to gzip larger uploads — the api-gateway 500 MB body cap applies to the on-the-wire (compressed) size, so gzip lets a single upload carry several GiB of decompressed STIX.",builder:p(me),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds snapshots update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/snapshot`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file,source:t.source}});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,t.file!==void 0||t.body!==void 0||t.source!==void 0){let e=new FormData;if(t.file){let n=d(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);t.source!==void 0&&e.append(`source`,String(u(t.source,`source`,`text`)??``)),s(await l(`Updating`,async()=>r(a,`PUT`,`/accounts/${o}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/snapshot`,{body:e})),{successLabel:`Updated`});return}if(t.body){let e=u(t.body,`body`,`binary`);s(await l(`Updating`,async()=>r(a,`PUT`,`/accounts/${o}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/snapshot`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>a.intel.indicatorFeeds.snapshots.update({account_id:o,feed_id:t[`feed-id`]})),{successLabel:`Updated`})}},ge={command:`snapshots`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The new description of the feed`}).option(`is-attributable`,{type:`boolean`,description:`The new is_attributable value of the feed`}).option(`is-downloadable`,{type:`boolean`,description:`The new is_downloadable value of the feed`}).option(`is-public`,{type:`boolean`,description:`The new is_public value of the feed`}).option(`name`,{type:`string`,description:`The new name of the feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update <feed-id>`,describe:`Revises details for a specific custom threat indicator feed.`,builder:p(_e),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({description:u(t.description,`description`,`text`),is_attributable:t[`is-attributable`],is_downloadable:t[`is-downloadable`],is_public:t[`is-public`],name:u(t.name,`name`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.indicatorFeeds.update({...e,account_id:d,feed_id:t[`feed-id`]})),{successLabel:`Updated`});return}let p=o({description:u(t.description,`description`,`text`),is_attributable:t[`is-attributable`],is_downloadable:t[`is-downloadable`],is_public:t[`is-public`],name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>r.intel.indicatorFeeds.update({...p,account_id:d,feed_id:t[`feed-id`]})),{successLabel:`Updated`})}},ye={command:`indicator-feeds`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(Y).command(te).command(ie).command(oe).command(ve).command(ne).command(pe).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Returns a list of available IP list categories (e.g., anonymizer, botnetcc, malware, tor, vpn, open_proxies). This endpoint provides metadata about which IP lists are available in the system.`,builder:be,handler:async t=>{if(t.dryRun){c({command:`cf intel ip-lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/ip-lists`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.ipLists.get({account_id:a})),{successLabel:`Loaded`})}},xe={command:`ip-lists`,describe:`Curated IP lists used for threat detection and policy enforcement`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`ipv6`,{type:`string`,description:`Ipv6`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get`,describe:"Gets the geolocation, ASN, infrastructure type of the ASN, and any security threat categories of an IP address. **Must provide ip query parameters.** For example, `/intel/ip?ipv4=1.1.1.1` or `/intel/ip?ipv6=2001:db8::1`.",builder:Se,handler:async t=>{let r={ipv4:t.ipv4,ipv6:t.ipv6};if(t.dryRun){c({command:`cf intel ips get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/ip`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.ips.get({account_id:o,...r})),{successLabel:`Loaded`})}},we={command:`ips`,describe:`IP address intelligence — geolocation, risk assessment, and hosting provider details`,builder:e=>e.command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.option(`content-adds`,{type:`string`,array:!0,description:`Content category IDs to add.`}).option(`content-removes`,{type:`string`,array:!0,description:`Content category IDs to remove.`}).option(`indicator-type`,{type:`string`,description:`The indicator_type field`,choices:[`domain`,`ipv4`,`ipv6`,`url`]}).option(`ip`,{type:`string`,description:"Provide only if indicator_type is `ipv4` or `ipv6`."}).option(`security-adds`,{type:`string`,array:!0,description:`Security category IDs to add.`}).option(`security-removes`,{type:`string`,array:!0,description:`Security category IDs to remove.`}).option(`url`,{type:`string`,description:"Provide only if indicator_type is `domain` or `url`. Example if indicator_type is `domain`: `example.com`. Example if indicator_type is `url`: `https://example.com/news/`."}).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 Ee={command:`create`,describe:"Allows you to submit requests to change a domain’s category. Requests that include category `169` (New Domains) or category `177` (Newly Seen) in any of `content_adds`, `content_removes`, `security_adds`, or `security_removes` will be rejected with a `400 Bad Request`. These categories are automatically managed and fall off 30 days after they are applied.",builder:Te,handler:async t=>{if(t.dryRun){c({command:`cf intel miscategorizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/miscategorization`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({content_adds:t[`content-adds`],content_removes:t[`content-removes`],indicator_type:u(t[`indicator-type`],`indicator-type`,`text`),ip:u(t.ip,`ip`,`text`),security_adds:t[`security-adds`],security_removes:t[`security-removes`],url:u(t.url,`url`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.intel.miscategorizations.create({...e,account_id:d})),{successLabel:`Created`});return}let p=o({content_adds:t[`content-adds`],content_removes:t[`content-removes`],indicator_type:u(t[`indicator-type`],`indicator-type`,`text`),ip:u(t.ip,`ip`,`text`),security_adds:t[`security-adds`],security_removes:t[`security-removes`],url:u(t.url,`url`,`text`)});s(await l(`Creating`,async()=>r.intel.miscategorizations.create({...p,account_id:d})),{successLabel:`Created`})}},De={command:`miscategorizations`,describe:`Report and track domain miscategorization corrections`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get`,describe:`Retrieves WHOIS registration data for a domain, including registrant and nameserver information.`,builder:Oe,handler:async t=>{let r={domain:t.domain};if(t.dryRun){c({command:`cf intel whois get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/whois`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.whois.get({account_id:o,...r})),{successLabel:`Loaded`})}},Ae={command:`whois`,describe:`WHOIS registration data for domains including registrant, registrar, and nameservers`,builder:e=>e.command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},je={command:`intel`,describe:`Threat intelligence lookups — IP reputation, domain info, ASN details, WHOIS, and indicator feeds`,builder:e=>e.command(b).command(F).command(R).command(V).command(q).command(ye).command(xe).command(we).command(De).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{je as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{D as e,S as t,T as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";function u(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or SSL certificate and intermediate(s).`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`,default:24008}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tunnel-* flag is set`)}return!0})}const d={command:`create`,describe:`Creates a Keyless SSL configuration that allows SSL/TLS termination without exposing private keys to Cloudflare. Keys remain on your infrastructure.`,builder:u,handler:async n=>{if(n.dryRun){s({command:`cf keyless-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({bundle_method:l(n[`bundle-method`],`bundle-method`,`text`),certificate:l(n.certificate,`certificate`,`text`),host:l(n.host,`host`,`text`),name:l(n.name,`name`,`text`),port:n.port,tunnel:{private_ip:l(n[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(n[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.keylessCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(n.certificate===void 0&&(n.certificate=await e(`certificate`,`The zone's SSL certificate or SSL certificate and intermediate(s).`)),n.host===void 0&&(n.host=await e(`host`,`The keyless SSL name.`)),n.port===void 0)throw Error(`--port is required (or pass --body with this field set).`);let f=a({bundle_method:l(n[`bundle-method`],`bundle-method`,`text`),certificate:l(n.certificate,`certificate`,`text`),host:l(n.host,`host`,`text`),name:l(n.name,`name`,`text`),port:n.port,tunnel:{private_ip:l(n[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(n[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});o(await c(`Creating`,async()=>u.keylessCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <keyless-certificate-id>`,describe:`Removes a Keyless SSL configuration. SSL connections will no longer use the keyless server for cryptographic operations.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates/${e[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(e[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(e[`keyless-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>i.keylessCertificates.delete({zone_id:a,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether or not the Keyless SSL is on or off.`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tunnel-* flag is set`)}return!0})}const h={command:`edit <keyless-certificate-id>`,describe:`This will update attributes of a Keyless SSL. Consists of one or more of the following: host,name,port.`,builder:m,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates/${e[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(e[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(e[`keyless-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({enabled:e.enabled,host:l(e.host,`host`,`text`),name:l(e.name,`name`,`text`),port:e.port,tunnel:{private_ip:l(e[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(e[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):i(e.body)});return}let n=await r(e),u=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.keylessCertificates.edit({...t,zone_id:u,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Updated`});return}let d=a({enabled:e.enabled,host:l(e.host,`host`,`text`),name:l(e.name,`name`,`text`),port:e.port,tunnel:{private_ip:l(e[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:l(e[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});o(await c(`Updating`,async()=>n.keylessCertificates.edit({...d,zone_id:u,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Updated`})}};function g(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <keyless-certificate-id>`,describe:`Get details for one Keyless SSL configuration.`,builder:g,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates/${e[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(e[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(e[`keyless-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.keylessCertificates.get({zone_id:i,keyless_certificate_id:e[`keyless-certificate-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List all Keyless SSL configurations for a given zone.`,builder:v,handler:async e=>{if(e.dryRun){s({command:`cf keyless-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.keylessCertificates.list({zone_id:i})),{successLabel:`Loaded`})}},b={command:`keyless-certificates`,describe:`Use your own SSL certificates without exposing private keys — keys stay on your infrastructure`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{S as e,T as t,n}from"./auth-BqDOIrKX.mjs";import{n as r,t as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c}from"./input-validation-CTqtyiY9.mjs";function l(e){return e.option(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines the overall status for Leaked Credential Checks.`})}const u={command:`create`,describe:`Updates the current status of Leaked Credential Checks.`,builder:l,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({enabled:t.enabled}):r(t.body)});return}let c=await n(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=r(t.body);a(await s(`Creating`,async()=>c.leakedCredentialChecks.create({body:e,zone_id:l})),{successLabel:`Created`});return}let u=i({enabled:t.enabled});a(await s(`Creating`,async()=>c.leakedCredentialChecks.create({body:u,zone_id:l})),{successLabel:`Created`})}};function d(e){return e.option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const f={command:`create`,describe:`Create user-defined detection pattern for Leaked Credential Checks.`,builder:d,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)}):r(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=r(t.body);a(await s(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)});a(await s(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:d,zone_id:u})),{successLabel:`Created`})}};function p(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <detection-id>`,describe:`Remove user-defined detection pattern for Leaked Credential Checks.`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/leaked-credential-checks/detections/${r[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(r[`detection-id`]))}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"detection-id":String(r[`detection-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=await e({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await t({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>i.leakedCredentialChecks.detections.delete({zone_id:c,detection_id:r[`detection-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <detection-id>`,describe:`Get user-defined detection pattern for Leaked Credential Checks.`,builder:h,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections/${t[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(t[`detection-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"detection-id":String(t[`detection-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.leakedCredentialChecks.detections.get({zone_id:i,detection_id:t[`detection-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List user-defined detection patterns for Leaked Credential Checks.`,builder:_,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.leakedCredentialChecks.detections.list({zone_id:i})),{successLabel:`Loaded`})}};function y(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const b={command:`update <detection-id>`,describe:`Update user-defined detection pattern for Leaked Credential Checks.`,builder:y,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections/${t[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(t[`detection-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"detection-id":String(t[`detection-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)}):r(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=r(t.body);a(await s(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:e,zone_id:u,detection_id:t[`detection-id`]})),{successLabel:`Updated`});return}let d=i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)});a(await s(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:d,zone_id:u,detection_id:t[`detection-id`]})),{successLabel:`Updated`})}},x={command:`detections`,describe:`Operations for detections`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Retrieves the current status of Leaked Credential Checks.`,builder:S,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.leakedCredentialChecks.get({zone_id:i})),{successLabel:`Loaded`})}},w={command:`leaked-credential-checks`,describe:`leaked-credential-checks`,builder:e=>e.command(u).command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,r as c,t as l}from"./body-parser-CBpeIUns.mjs";import{t as u}from"./output-CUxZRM5A.mjs";import{n as d,t as f}from"./progress-Cent9Lsg.mjs";import{n as p}from"./input-validation-CTqtyiY9.mjs";import{t as m}from"./local-D8bhHUMK.mjs";import{t as h}from"./cli-types-CMNMD1V7.mjs";import{n as g,t as _}from"./raw-fetch-DnbAMFBp.mjs";function v(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).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 ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async r=>{let h={};if(r.forwarded!==void 0&&(h.forwarded=String(r.forwarded)),r.dryRun){d({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({description:p(r.description,`description`,`text`),destination_type:p(r[`destination-type`],`destination-type`,`text`),name:p(r.name,`name`,`text`),policy:p(r.policy,`policy`,`text`),update_mode:p(r[`update-mode`],`update-mode`,`text`)}):s(r.body)});return}let g=await o(r),_=r.local?m:await i(g);if(r.accountId=_,r.body){let e=s(r.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}r[`destination-type`]===void 0&&(r[`destination-type`]=await n(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),r.name===void 0&&(r.name=await t(`name`,`The name field`)),r[`update-mode`]===void 0&&(r[`update-mode`]=await n(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};r.description!==void 0&&c(v,[`description`],p(r.description,`description`,`text`)),r[`destination-type`]!==void 0&&c(v,[`destination_type`],p(r[`destination-type`],`destination-type`,`text`)),r.name!==void 0&&c(v,[`name`],p(r.name,`name`,`text`)),r.policy!==void 0&&c(v,[`policy`],p(r.policy,`policy`,`text`)),r[`update-mode`]!==void 0&&c(v,[`update_mode`],p(r[`update-mode`],`update-mode`,`text`)),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).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 y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async t=>{let n={delete_destination:t[`delete-destination`]};if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs/${t[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(t[`sync-id`]))}`,pathParams:{"sync-id":String(t[`sync-id`]??``)},query:n,bodyKind:`none`});return}let a=await o(t),s=t.local?m:await i(a);if(t.accountId=s,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}u(await f(`Deleting`,async()=>a.magicCloudNetworking.catalogSyncs.delete({account_id:s,sync_id:t[`sync-id`],...n})),{successLabel:`Deleted`})}};function b(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).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:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:b,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs/${t[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(t[`sync-id`]))}`,pathParams:{"sync-id":String(t[`sync-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({description:p(t.description,`description`,`text`),name:p(t.name,`name`,`text`),policy:p(t.policy,`policy`,`text`),update_mode:p(t[`update-mode`],`update-mode`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:r,sync_id:t[`sync-id`]})),{successLabel:`Updated`});return}let a=l({description:p(t.description,`description`,`text`),name:p(t.name,`name`,`text`),policy:p(t.policy,`policy`,`text`),update_mode:p(t[`update-mode`],`update-mode`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.edit({body:a,account_id:r,sync_id:t[`sync-id`]})),{successLabel:`Updated`})}};function S(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:S,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs/${t[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(t[`sync-id`]))}`,pathParams:{"sync-id":String(t[`sync-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.magicCloudNetworking.catalogSyncs.get({account_id:r,sync_id:t[`sync-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:w,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.magicCloudNetworking.catalogSyncs.list({account_id:r})),{successLabel:`Loaded`})}};function E(e){return e.option(`destination-type`,{type:`string`,description:`Specify type of destination, omit to return all.`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:h(E),handler:async t=>{let n={destination_type:t[`destination-type`]};if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs prebuilt-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs/prebuilt-policies`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({account_id:a,...n})),{successLabel:`Loaded`})}},O={command:`prebuilt-policies`,describe:`Synchronize cloud resource inventories from AWS, Azure, and GCP into a unified catalog`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:k,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs/${t[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(t[`sync-id`]))}/refresh`,pathParams:{"sync-id":String(t[`sync-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Creating`,async()=>n.magicCloudNetworking.catalogSyncs.refresh({account_id:r,sync_id:t[`sync-id`]})),{successLabel:`Created`})}};function j(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:j,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking catalog-syncs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/catalog-syncs/${t[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(t[`sync-id`]))}`,pathParams:{"sync-id":String(t[`sync-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({description:p(t.description,`description`,`text`),name:p(t.name,`name`,`text`),policy:p(t.policy,`policy`,`text`),update_mode:p(t[`update-mode`],`update-mode`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.update({body:e,account_id:r,sync_id:t[`sync-id`]})),{successLabel:`Updated`});return}let a=l({description:p(t.description,`description`,`text`),name:p(t.name,`name`,`text`),policy:p(t.policy,`policy`,`text`),update_mode:p(t[`update-mode`],`update-mode`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.update({body:a,account_id:r,sync_id:t[`sync-id`]})),{successLabel:`Updated`})}},N={command:`catalog-syncs`,describe:`Synchronize cloud resource inventories from AWS, Azure, and GCP into a unified catalog`,builder:e=>e.command(ee).command(y).command(x).command(C).command(T).command(A).command(M).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_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 F={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:P,handler:async r=>{let h={};if(r.forwarded!==void 0&&(h.forwarded=String(r.forwarded)),r.dryRun){d({command:`cf magic-cloud-networking cloud-integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({cloud_type:p(r[`cloud-type`],`cloud-type`,`text`),description:p(r.description,`description`,`text`),friendly_name:p(r[`friendly-name`],`friendly-name`,`text`)}):s(r.body)});return}let g=await o(r),_=r.local?m:await i(g);if(r.accountId=_,r.body){let e=s(r.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}r[`cloud-type`]===void 0&&(r[`cloud-type`]=await n(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),r[`friendly-name`]===void 0&&(r[`friendly-name`]=await t(`friendly-name`,`The friendly_name field`));let v={};r[`cloud-type`]!==void 0&&c(v,[`cloud_type`],p(r[`cloud-type`],`cloud-type`,`text`)),r.description!==void 0&&c(v,[`description`],p(r.description,`description`,`text`)),r[`friendly-name`]!==void 0&&c(v,[`friendly_name`],p(r[`friendly-name`],`friendly-name`,`text`)),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function I(e){return e.positional(`provider-id`,{type:`string`,description:`Provider 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 L={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:I,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/${t[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(t[`provider-id`]))}`,pathParams:{"provider-id":String(t[`provider-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}u(await f(`Deleting`,async()=>n.magicCloudNetworking.cloudIntegrations.delete({account_id:a,provider_id:t[`provider-id`]})),{successLabel:`Deleted`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:R,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations discover-all`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/discover`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Creating`,async()=>n.magicCloudNetworking.cloudIntegrations.discoverAll({account_id:r})),{successLabel:`Created`})}};function B(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:B,handler:async t=>{let n={v2:t.v2};if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations discover`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/${t[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(t[`provider-id`]))}/discover`,pathParams:{"provider-id":String(t[`provider-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Creating`,async()=>r.magicCloudNetworking.cloudIntegrations.discover({account_id:a,provider_id:t[`provider-id`],...n})),{successLabel:`Created`})}};function H(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:H,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/${t[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(t[`provider-id`]))}`,pathParams:{"provider-id":String(t[`provider-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({aws_arn:p(t[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(t[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(t[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(t.description,`description`,`text`),friendly_name:p(t[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(t[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(t[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:r,provider_id:t[`provider-id`]})),{successLabel:`Updated`});return}let a=l({aws_arn:p(t[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(t[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(t[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(t.description,`description`,`text`),friendly_name:p(t[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(t[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(t[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.edit({body:a,account_id:r,provider_id:t[`provider-id`]})),{successLabel:`Updated`})}};function W(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:W,handler:async t=>{let n={status:t.status};if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/${t[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(t[`provider-id`]))}`,pathParams:{"provider-id":String(t[`provider-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.cloudIntegrations.get({account_id:a,provider_id:t[`provider-id`],...n})),{successLabel:`Loaded`})}};function K(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:K,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations initial-setup`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/${t[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(t[`provider-id`]))}/initial_setup`,pathParams:{"provider-id":String(t[`provider-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.magicCloudNetworking.cloudIntegrations.initialSetup({account_id:r,provider_id:t[`provider-id`]})),{successLabel:`Loaded`})}};function J(e){return e.option(`status`,{type:`boolean`,description:`Status`}).option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:J,handler:async t=>{let n={status:t.status,order_by:t[`order-by`],desc:t.desc,cloudflare:t.cloudflare};if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.cloudIntegrations.list({account_id:a,...n})),{successLabel:`Loaded`})}};function X(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:X,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking cloud-integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/providers/${t[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(t[`provider-id`]))}`,pathParams:{"provider-id":String(t[`provider-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({aws_arn:p(t[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(t[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(t[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(t.description,`description`,`text`),friendly_name:p(t[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(t[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(t[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:r,provider_id:t[`provider-id`]})),{successLabel:`Updated`});return}let a=l({aws_arn:p(t[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(t[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(t[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(t.description,`description`,`text`),friendly_name:p(t[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(t[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(t[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.update({body:a,account_id:r,provider_id:t[`provider-id`]})),{successLabel:`Updated`})}},Q={command:`cloud-integrations`,describe:`Cloud provider credentials and integrations for resource discovery and on-ramp provisioning`,builder:e=>e.command(F).command(L).command(V).command(z).command(U).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes 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 re={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:ne,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps address-spaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:t.body===void 0?l({prefixes:t.prefixes}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:r})),{successLabel:`Updated`});return}if(t.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let a=l({prefixes:t.prefixes});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.edit({body:a,account_id:r})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ie,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps address-spaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.list({account_id:r})),{successLabel:`Loaded`})}};function oe(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes 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 se={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:oe,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps address-spaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:t.body===void 0?l({prefixes:t.prefixes}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:r})),{successLabel:`Updated`});return}if(t.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let a=l({prefixes:t.prefixes});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.update({body:a,account_id:r})),{successLabel:`Updated`})}},ce={command:`address-spaces`,describe:`On-ramp connections that bridge cloud VPCs/VNets to your Cloudflare network`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:le,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps apply`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}/apply`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Creating`,async()=>n.magicCloudNetworking.onRamps.apply({account_id:r,onramp_id:t[`onramp-id`]})),{successLabel:`Created`})}};function de(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`adopted-hub-id`,{type:`string`,description:`The adopted_hub_id field`}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`cloud-asn`,{type:`number`,description:`Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect.`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`dynamic-routing`,{type:`boolean`,description:`Enables BGP routing. When enabling this feature, set both install_routes_in_cloud and install_routes_in_magic_wan to false.`}).option(`hub-provider-id`,{type:`string`,description:`The hub_provider_id field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`region`,{type:`string`,description:`The region field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`OnrampTypeSingle`,`OnrampTypeHub`]}).option(`vpc`,{type:`string`,description:`The vpc 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 fe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:de,handler:async r=>{let h={};if(r.forwarded!==void 0&&(h.forwarded=String(r.forwarded)),r.dryRun){d({command:`cf magic-cloud-networking on-ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({adopted_hub_id:p(r[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],cloud_asn:r[`cloud-asn`],cloud_type:p(r[`cloud-type`],`cloud-type`,`text`),description:p(r.description,`description`,`text`),dynamic_routing:r[`dynamic-routing`],hub_provider_id:p(r[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:p(r.name,`name`,`text`),region:p(r.region,`region`,`text`),type:p(r.type,`type`,`text`),vpc:p(r.vpc,`vpc`,`text`)}):s(r.body)});return}let g=await o(r),_=r.local?m:await i(g);if(r.accountId=_,r.body){let e=s(r.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}if(r[`cloud-type`]===void 0&&(r[`cloud-type`]=await n(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),r[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(r[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(r[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await t(`name`,`The name field`)),r.type===void 0&&(r.type=await n(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};r[`adopted-hub-id`]!==void 0&&c(v,[`adopted_hub_id`],p(r[`adopted-hub-id`],`adopted-hub-id`,`text`)),r[`attached-hubs`]!==void 0&&c(v,[`attached_hubs`],r[`attached-hubs`]),r[`attached-vpcs`]!==void 0&&c(v,[`attached_vpcs`],r[`attached-vpcs`]),r[`cloud-asn`]!==void 0&&c(v,[`cloud_asn`],r[`cloud-asn`]),r[`cloud-type`]!==void 0&&c(v,[`cloud_type`],p(r[`cloud-type`],`cloud-type`,`text`)),r.description!==void 0&&c(v,[`description`],p(r.description,`description`,`text`)),r[`dynamic-routing`]!==void 0&&c(v,[`dynamic_routing`],r[`dynamic-routing`]),r[`hub-provider-id`]!==void 0&&c(v,[`hub_provider_id`],p(r[`hub-provider-id`],`hub-provider-id`,`text`)),r[`install-routes-in-cloud`]!==void 0&&c(v,[`install_routes_in_cloud`],r[`install-routes-in-cloud`]),r[`install-routes-in-magic-wan`]!==void 0&&c(v,[`install_routes_in_magic_wan`],r[`install-routes-in-magic-wan`]),r[`manage-hub-to-hub-attachments`]!==void 0&&c(v,[`manage_hub_to_hub_attachments`],r[`manage-hub-to-hub-attachments`]),r[`manage-vpc-to-hub-attachments`]!==void 0&&c(v,[`manage_vpc_to_hub_attachments`],r[`manage-vpc-to-hub-attachments`]),r.name!==void 0&&c(v,[`name`],p(r.name,`name`,`text`)),r.region!==void 0&&c(v,[`region`],p(r.region,`region`,`text`)),r.type!==void 0&&c(v,[`type`],p(r.type,`type`,`text`)),r.vpc!==void 0&&c(v,[`vpc`],p(r.vpc,`vpc`,`text`)),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function pe(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`destroy`,{type:`boolean`,description:`Destroy`}).option(`force`,{type:`boolean`,description:`Force`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:pe,handler:async t=>{let n={destroy:t.destroy,force:t.force};if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},query:n,bodyKind:`none`});return}let a=await o(t),s=t.local?m:await i(a);if(t.accountId=s,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}u(await f(`Deleting`,async()=>a.magicCloudNetworking.onRamps.delete({account_id:s,onramp_id:t[`onramp-id`],...n})),{successLabel:`Deleted`})}};function he(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc 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 ge={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:he,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({attached_hubs:t[`attached-hubs`],attached_vpcs:t[`attached-vpcs`],description:p(t.description,`description`,`text`),install_routes_in_cloud:t[`install-routes-in-cloud`],install_routes_in_magic_wan:t[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:t[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:t[`manage-vpc-to-hub-attachments`],name:p(t.name,`name`,`text`),vpc:p(t.vpc,`vpc`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.edit({body:e,account_id:r,onramp_id:t[`onramp-id`]})),{successLabel:`Updated`});return}let a=l({attached_hubs:t[`attached-hubs`],attached_vpcs:t[`attached-vpcs`],description:p(t.description,`description`,`text`),install_routes_in_cloud:t[`install-routes-in-cloud`],install_routes_in_magic_wan:t[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:t[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:t[`manage-vpc-to-hub-attachments`],name:p(t.name,`name`,`text`),vpc:p(t.vpc,`vpc`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.edit({body:a,account_id:r,onramp_id:t[`onramp-id`]})),{successLabel:`Updated`})}};function _e(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ve={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:_e,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}/export`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r;let a=await f(`Loading`,async()=>_(`/accounts/${r}/magic/cloud/onramps/${encodeURIComponent(String(t[`onramp-id`]))}/export`,{method:`POST`,localEndpoint:t.local?t.localEndpoint:void 0}));g(t.text===!0?a.toString(`utf-8`):a)}};function ye(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`post-apply-resources`,{type:`boolean`,description:`Post apply resources`}).option(`planned-resources`,{type:`boolean`,description:`Planned resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:ye,handler:async t=>{let n={status:t.status,vpcs:t.vpcs,post_apply_resources:t[`post-apply-resources`],planned_resources:t[`planned-resources`]};if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.onRamps.get({account_id:a,onramp_id:t[`onramp-id`],...n})),{successLabel:`Loaded`})}};function xe(e){return e.option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:xe,handler:async t=>{let n={order_by:t[`order-by`],desc:t.desc,status:t.status,vpcs:t.vpcs};if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.onRamps.list({account_id:a,...n})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:Ce,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}/plan`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,u(await f(`Creating`,async()=>n.magicCloudNetworking.onRamps.plan({account_id:r,onramp_id:t[`onramp-id`]})),{successLabel:`Created`})}};function Te(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc 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 Ee={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Te,handler:async t=>{if(t.dryRun){d({command:`cf magic-cloud-networking on-ramps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/onramps/${t[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(t[`onramp-id`]))}`,pathParams:{"onramp-id":String(t[`onramp-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({attached_hubs:t[`attached-hubs`],attached_vpcs:t[`attached-vpcs`],description:p(t.description,`description`,`text`),install_routes_in_cloud:t[`install-routes-in-cloud`],install_routes_in_magic_wan:t[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:t[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:t[`manage-vpc-to-hub-attachments`],name:p(t.name,`name`,`text`),vpc:p(t.vpc,`vpc`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.update({body:e,account_id:r,onramp_id:t[`onramp-id`]})),{successLabel:`Updated`});return}let a=l({attached_hubs:t[`attached-hubs`],attached_vpcs:t[`attached-vpcs`],description:p(t.description,`description`,`text`),install_routes_in_cloud:t[`install-routes-in-cloud`],install_routes_in_magic_wan:t[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:t[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:t[`manage-vpc-to-hub-attachments`],name:p(t.name,`name`,`text`),vpc:p(t.vpc,`vpc`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.update({body:a,account_id:r,onramp_id:t[`onramp-id`]})),{successLabel:`Updated`})}},De={command:`on-ramps`,describe:`On-ramp connections that bridge cloud VPCs/VNets to your Cloudflare network`,builder:e=>e.command(ue).command(fe).command(me).command(ge).command(ve).command(be).command(Se).command(we).command(Ee).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const Oe={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:$,handler:async t=>{let n={provider_id:t[`provider-id`],resource_type:t[`resource-type`],resource_id:t[`resource-id`],region:t.region,resource_group:t[`resource-group`],search:t.search,order_by:t[`order-by`],desc:t.desc,v2:t.v2};if(t.dryRun){d({command:`cf magic-cloud-networking resources export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/resources/export`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a;let s=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),c=await f(`Loading`,async()=>_(`/accounts/${a}/magic/cloud/resources/export${s?`?`+s:``}`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));g(t.text===!0?c.toString(`utf-8`):c)}};function ke(e){return e.positional(`resource-id`,{type:`string`,description:`Resource ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:ke,handler:async t=>{let n={v2:t.v2};if(t.dryRun){d({command:`cf magic-cloud-networking resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/resources/${t[`resource-id`]==null?`<resource-id>`:encodeURIComponent(String(t[`resource-id`]))}`,pathParams:{"resource-id":String(t[`resource-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.resources.get({account_id:a,resource_id:t[`resource-id`],...n})),{successLabel:`Loaded`})}};function je(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`managed`,{type:`boolean`,description:`Managed`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:h(je),handler:async t=>{let n={provider_id:t[`provider-id`],resource_type:t[`resource-type`],resource_id:t[`resource-id`],region:t.region,resource_group:t[`resource-group`],managed:t.managed,search:t.search,order_by:t[`order-by`],desc:t.desc,per_page:t[`per-page`],page:t.page,cloudflare:t.cloudflare,v2:t.v2};if(t.dryRun){d({command:`cf magic-cloud-networking resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/resources`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.magicCloudNetworking.resources.list({account_id:a,...n})),{successLabel:`Loaded`})}};function Ne(e){return e.option(`policy`,{type:`string`,description:`The policy 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 Pe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Ne,handler:async n=>{if(n.dryRun){d({command:`cf magic-cloud-networking resources policy-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/cloud/resources/policy-preview`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({policy:p(n.policy,`policy`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);u(await f(`Creating`,async()=>r.magicCloudNetworking.resources.policyPreview({...e,account_id:a})),{successLabel:`Created`});return}n.policy===void 0&&(n.policy=await t(`policy`,`The policy field`));let c=l({policy:p(n.policy,`policy`,`text`)});u(await f(`Creating`,async()=>r.magicCloudNetworking.resources.policyPreview({...c,account_id:a})),{successLabel:`Created`})}},Fe={command:`resources`,describe:`Discovered cloud resources (VPCs, subnets, route tables) from connected cloud accounts`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`magic-cloud-networking`,describe:`Multi-cloud networking — discover cloud resources, manage on-ramps, and automate cross-cloud connectivity`,builder:e=>e.command(N).command(Q).command(De).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{S as e,T as t,n}from"./auth-BqDOIrKX.mjs";import{n as r}from"./body-parser-CBpeIUns.mjs";import{t as i}from"./output-CUxZRM5A.mjs";import{n as a,t as o}from"./progress-Cent9Lsg.mjs";function s(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 c={command:`delete`,describe:`Disables all Managed Transforms.`,builder:s,handler:async r=>{if(r.dryRun){a({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let s=await n(r),c=await e({zone:r.zone},s,{quiet:r.quiet});if(r.zoneId=c,!await t({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>s.managedTransforms.delete({zone_id:c})),{successLabel:`Deleted`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A Managed Transforms patch object. Both fields are optional; only the sections provided will be updated.`})}const u={command:`edit`,describe:`Updates the status of one or more Managed Transforms.`,builder:l,handler:async t=>{if(t.dryRun){a({command:`cf managed-transforms edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:r(t.body)});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});if(t.zoneId=c,t.body){let e=r(t.body);i(await o(`Updating`,async()=>s.managedTransforms.edit({...e,zone_id:c})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>s.managedTransforms.edit({zone_id:c})),{successLabel:`Updated`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:d,handler:async t=>{if(t.dryRun){a({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),s=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>r.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})}},p={command:`managed-transforms`,describe:`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,builder:e=>e.command(c).command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,T as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";import{t as f}from"./cli-types-CMNMD1V7.mjs";function p(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/mtls_certificates/${t[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(t[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(t[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.mtlsCertificates.associations.get({account_id:a,mtls_certificate_id:t[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async n=>{if(n.dryRun){c({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({ca:n.ca,certificates:u(n.certificates,`certificates`,`text`),name:u(n.name,`name`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(n.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);n.certificates===void 0&&(n.certificates=await t(`certificates`,`The uploaded root CA certificate.`));let m=o({ca:n.ca,certificates:u(n.certificates,`certificates`,`text`),name:u(n.name,`name`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async t=>{if(t.dryRun){c({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/mtls_certificates/${t[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(t[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(t[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}s(await l(`Deleting`,async()=>a.mtlsCertificates.delete({account_id:o,mtls_certificate_id:t[`mtls-certificate-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:b,handler:async t=>{if(t.dryRun){c({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/mtls_certificates/${t[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(t[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(t[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.mtlsCertificates.get({account_id:a,mtls_certificate_id:t[`mtls-certificate-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:f(S),handler:async t=>{let n={type:t.type};if(t.dryRun){c({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/mtls_certificates`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.mtlsCertificates.list({account_id:o,...n})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{D as e,E as t,T as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./cli-types-CMNMD1V7.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`hostnames`,{type:`string`,array:!0,description:"Array of hostnames or wildcard names bound to the certificate.\nHostnames must be fully qualified domain names (FQDNs) belonging to zones on your account (e.g., `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` prefix for a single level (e.g., `*.example.com`). Double wildcards (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically converted to punycode."}).option(`request-type`,{type:`string`,description:`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,choices:[`origin-rsa`,`origin-ecc`,`keyless-certificate`]}).option(`requested-validity`,{type:`number`,description:`The number of days for which the certificate should be valid.`,default:5475}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create an Origin CA certificate. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:d,handler:async n=>{if(n.dryRun){s({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({csr:l(n.csr,`csr`,`text`),hostnames:n.hostnames,request_type:l(n[`request-type`],`request-type`,`text`),requested_validity:n[`requested-validity`]}):i(n.body)});return}let u=await r(n);if(n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(n.csr===void 0&&(n.csr=await e(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),n.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);n[`request-type`]===void 0&&(n[`request-type`]=await t(`request-type`,`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,[`origin-rsa`,`origin-ecc`,`keyless-certificate`]));let d=a({csr:l(n.csr,`csr`,`text`),hostnames:n.hostnames,request_type:l(n[`request-type`],`request-type`,`text`),requested_validity:n[`requested-validity`]});o(await c(`Creating`,async()=>u.originCaCertificates.create({...d})),{successLabel:`Created`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <certificate-id>`,describe:`Revoke an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let t=await r(e);if(!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>t.originCaCertificates.delete({certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <certificate-id>`,describe:`Get an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let t=await r(e);o(await c(`Loading`,async()=>t.originCaCertificates.get({certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`zone-id`,{type:`string`,description:`Identifier.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List all existing Origin CA certificates for a given zone. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:u(_),handler:async e=>{let t={zone_id:e[`zone-id`],page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){s({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:t,bodyKind:`none`});return}let n=await r(e);o(await c(`Loading`,async()=>n.originCaCertificates.list(t)),{successLabel:`Loaded`})}},y={command:`origin-ca-certificates`,describe:`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,n}from"./auth-BqDOIrKX.mjs";import{n as r,t as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c}from"./input-validation-CTqtyiY9.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.originPostQuantumEncryption.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Post Quantum Encryption Setting.`,choices:[`preferred`,`supported`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`update`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf origin-post-quantum-encryption update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({value:c(l.value,`value`,`text`)}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await e(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=i({value:c(l.value,`value`,`text`)});a(await s(`Updating`,async()=>u.originPostQuantumEncryption.update({...f,zone_id:d})),{successLabel:`Updated`})}},p={command:`origin-post-quantum-encryption`,describe:`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{i as e,t}from"./session-CsvPYFj8.mjs";import{r as n}from"./theme-CFHr0Dh9.mjs";import{a as r}from"./dist-DA54ZQu0.mjs";import{t as i}from"./output-CUxZRM5A.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
|
package/dist/queues-Rf_n11Cx.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";function m(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const h={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:m,handler:async r=>{if(r.dryRun){l({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}r.type===void 0&&(r.type=await n(`type`,`The type field`,[`worker`,`http_pull`])),r.type===`worker`&&r[`script-name`]===void 0&&(r[`script-name`]=await t(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)});c(await u(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:ee,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers/${t[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(t[`consumer-id`]))}`,pathParams:{"consumer-id":String(t[`consumer-id`]??``),"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>n.queues.consumers.delete({account_id:o,queue_id:t[`queue-id`],consumer_id:t[`consumer-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers/${t[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(t[`consumer-id`]))}`,pathParams:{"consumer-id":String(t[`consumer-id`]??``),"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.consumers.get({account_id:r,queue_id:t[`queue-id`],consumer_id:t[`consumer-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Returns the consumers for a Queue`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.consumers.list({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const S={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:x,handler:async r=>{if(r.dryRun){l({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Updated`});return}r.type===void 0&&(r.type=await n(`type`,`The type field`,[`worker`,`http_pull`])),r.type===`worker`&&r[`script-name`]===void 0&&(r[`script-name`]=await t(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)});c(await u(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Updated`})}},C={command:`consumers`,describe:`Operations for consumers`,builder:e=>e.command(h).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`queue-name`,{type:`string`,description:`The queue_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 T={command:`create`,describe:`Create a new queue`,builder:w,handler:async n=>{if(n.dryRun){l({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({queue_name:d(n[`queue-name`],`queue-name`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.queues.create({...e,account_id:p})),{successLabel:`Created`});return}n[`queue-name`]===void 0&&(n[`queue-name`]=await t(`queue-name`,`The queue_name field`));let m=s({queue_name:d(n[`queue-name`],`queue-name`,`text`)});c(await u(`Creating`,async()=>r.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function E(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:E,handler:async t=>{if(t.dryRun){l({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>n.queues.delete({account_id:o,queue_id:t[`queue-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:O,handler:async t=>{if(t.dryRun){l({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({queue_name:d(t[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:t[`settings-delivery-delay`],delivery_paused:t[`settings-delivery-paused`],message_retention_period:t[`settings-message-retention-period`]}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.queues.edit({body:e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Updated`});return}let p=s({queue_name:d(t[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:t[`settings-delivery-delay`],delivery_paused:t[`settings-delivery-paused`],message_retention_period:t[`settings-message-retention-period`]}});c(await u(`Updating`,async()=>n.queues.edit({body:p,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Updated`})}};function A(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:A,handler:async t=>{if(t.dryRun){l({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.get({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Returns the queues owned by an account.`,builder:M,handler:async t=>{if(t.dryRun){l({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.list({account_id:r})),{successLabel:`Loaded`})}};function P(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:P,handler:async t=>{if(t.dryRun){l({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.ackPreview({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.queues.messages.ackPreview({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function I(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:I,handler:async t=>{if(t.dryRun){l({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.ack({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.queues.messages.ack({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function R(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).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 z={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:R,handler:async t=>{if(t.dryRun){l({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({delay_seconds:t[`delay-seconds`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.bulkPush({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}let d=s({delay_seconds:t[`delay-seconds`]});c(await u(`Creating`,async()=>n.queues.messages.bulkPush({...d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function te(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:te,handler:async t=>{if(t.dryRun){l({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({batch_size:t[`batch-size`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Loading`,async()=>n.queues.messages.preview({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`});return}let d=s({batch_size:t[`batch-size`]});c(await u(`Loading`,async()=>n.queues.messages.preview({...d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}};function V(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).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:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:V,handler:async t=>{if(t.dryRun){l({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({batch_size:t[`batch-size`],visibility_timeout_ms:t[`visibility-timeout-ms`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.pull({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}let d=s({batch_size:t[`batch-size`],visibility_timeout_ms:t[`visibility-timeout-ms`]});c(await u(`Creating`,async()=>n.queues.messages.pull({...d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:U,handler:async t=>{if(t.dryRun){l({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({delay_seconds:t[`delay-seconds`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.push({body:e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}let d=s({delay_seconds:t[`delay-seconds`]});c(await u(`Creating`,async()=>n.queues.messages.push({body:d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}},G={command:`messages`,describe:`Operations for messages`,builder:e=>e.command(L).command(F).command(z).command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).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 q={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:K,handler:async t=>{if(t.dryRun){l({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/purge`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({delete_messages_permanently:t[`delete-messages-permanently`]}):o(t.body)});return}let n=await a(t),d=t.local?f:await i(n);if(t.accountId=d,!await r({force:!!t.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(t.body){let e=o(t.body);c(await u(`Deleting`,async()=>n.queues.purge.start({...e,account_id:d,queue_id:t[`queue-id`]})),{successLabel:`Deleted`});return}let p=s({delete_messages_permanently:t[`delete-messages-permanently`]});c(await u(`Deleting`,async()=>n.queues.purge.start({...p,account_id:d,queue_id:t[`queue-id`]})),{successLabel:`Deleted`})}};function J(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:J,handler:async t=>{if(t.dryRun){l({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/purge`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.purge.status({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}},X={command:`purge`,describe:`Operations for purge`,builder:e=>e.command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-workflow-name`,{type:`string`,description:`Name of the 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)`}).conflicts(`source-model-name`,[`source-worker-name`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-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 --destination-* flag is set`)}return!0})}const Q={command:`create`,describe:`Create a new event subscription for a queue`,builder:Z,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({destination:{queue_id:d(t[`destination-queue-id`],`destination-queue-id`,`text`),type:d(t[`destination-type`],`destination-type`,`text`)},enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`),source:{type:d(t[`source-type`],`source-type`,`text`),model_name:d(t[`source-model-name`],`source-model-name`,`text`),worker_name:d(t[`source-worker-name`],`source-worker-name`,`text`),workflow_name:d(t[`source-workflow-name`],`source-workflow-name`,`text`)}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.subscriptions.create({...e,account_id:r})),{successLabel:`Created`});return}let p=s({destination:{queue_id:d(t[`destination-queue-id`],`destination-queue-id`,`text`),type:d(t[`destination-type`],`destination-type`,`text`)},enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`),source:{type:d(t[`source-type`],`source-type`,`text`),model_name:d(t[`source-model-name`],`source-model-name`,`text`),worker_name:d(t[`source-worker-name`],`source-worker-name`,`text`),workflow_name:d(t[`source-workflow-name`],`source-workflow-name`,`text`)}});c(await u(`Creating`,async()=>n.queues.subscriptions.create({...p,account_id:r})),{successLabel:`Created`})}};function ne(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:ne,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions/${t[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(t[`subscription-id`]))}`,pathParams:{"subscription-id":String(t[`subscription-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}c(await u(`Deleting`,async()=>n.queues.subscriptions.delete({account_id:o,subscription_id:t[`subscription-id`]})),{successLabel:`Deleted`})}};function ie(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`get <subscription-id>`,describe:`Get details about an existing event subscription`,builder:ie,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions/${t[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(t[`subscription-id`]))}`,pathParams:{"subscription-id":String(t[`subscription-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.subscriptions.get({account_id:r,subscription_id:t[`subscription-id`]})),{successLabel:`Loaded`})}};function oe(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:p(oe),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){l({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.queues.subscriptions.list({account_id:o,...n})),{successLabel:`Loaded`})}};function se(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).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([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-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 --destination-* flag is set`)}return!0})}const ce={command:`update <subscription-id>`,describe:`Update an existing event subscription`,builder:se,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions/${t[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(t[`subscription-id`]))}`,pathParams:{"subscription-id":String(t[`subscription-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({destination:{queue_id:d(t[`destination-queue-id`],`destination-queue-id`,`text`),type:d(t[`destination-type`],`destination-type`,`text`)},enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.queues.subscriptions.update({...e,account_id:r,subscription_id:t[`subscription-id`]})),{successLabel:`Updated`});return}let p=s({destination:{queue_id:d(t[`destination-queue-id`],`destination-queue-id`,`text`),type:d(t[`destination-type`],`destination-type`,`text`)},enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`)});c(await u(`Updating`,async()=>n.queues.subscriptions.update({...p,account_id:r,subscription_id:t[`subscription-id`]})),{successLabel:`Updated`})}},le={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Q).command(re).command(ae).command($).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).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 de={command:`update <queue-id>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:ue,handler:async t=>{if(t.dryRun){l({command:`cf queues update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({queue_name:d(t[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:t[`settings-delivery-delay`],delivery_paused:t[`settings-delivery-paused`],message_retention_period:t[`settings-message-retention-period`]}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.queues.update({body:e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Updated`});return}let p=s({queue_name:d(t[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:t[`settings-delivery-delay`],delivery_paused:t[`settings-delivery-paused`],message_retention_period:t[`settings-message-retention-period`]}});c(await u(`Updating`,async()=>n.queues.update({body:p,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Updated`})}},fe={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).command(de).command(C).command(G).command(X).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{fe as default};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,T as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";function f(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const p={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:f,handler:async n=>{if(n.dryRun){c({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?o({token:u(n.token,`token`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:n[`bucket-name`]})),{successLabel:`Created`});return}n.token===void 0&&(n.token=await t(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=o({token:u(n.token,`token`,`text`)});s(await l(`Creating`,async()=>f.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:n[`bucket-name`]})),{successLabel:`Created`})}},m={command:`credentials`,describe:`Operations for credentials`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to disable as catalog.`,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 g={command:`disable <bucket-name>`,describe:`Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force,message:`This operation turns off the data catalog for the bucket. Existing namespace or table state remains, but writes stop.`})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}s(await l(`Deleting`,async()=>a.r2DataCatalog.disable({account_id:o,bucket_name:t[`bucket-name`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to enable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`enable <bucket-name>`,describe:`Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.`,builder:_,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Creating`,async()=>n.r2DataCatalog.enable({account_id:a,bucket_name:t[`bucket-name`]})),{successLabel:`Created`})}};function y(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <bucket-name>`,describe:`Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.`,builder:y,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.get({account_id:a,bucket_name:t[`bucket-name`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.list({account_id:a})),{successLabel:`Loaded`})}};function C(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.maintenanceConfigs.get({account_id:a,bucket_name:t[`bucket-name`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update catalog maintenance configuration.`})}const E={command:`update <bucket-name>`,describe:`Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`json`,body:t.body===void 0?o({snapshot_expiration:{max_snapshot_age:u(t[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:t[`snapshot-expiration-min-snapshots-to-keep`]}}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:t[`bucket-name`]})),{successLabel:`Created`});return}let p=o({snapshot_expiration:{max_snapshot_age:u(t[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:t[`snapshot-expiration-min-snapshots-to-keep`]}});s(await l(`Creating`,async()=>n.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:t[`bucket-name`]})),{successLabel:`Created`})}},D={command:`maintenance-configs`,describe:`Operations for maintenance-configs`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
|
|
4
|
-
Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of namespaces to return per page.
|
|
5
|
-
Defaults to 100, maximum 1000.`}).option(`parent`,{type:`string`,description:`Parent namespace to filter by. Only returns direct children of this namespace.
|
|
6
|
-
For nested namespaces, use %1F as separator (e.g., "bronze%1Fanalytics").
|
|
7
|
-
Omit this parameter to list top-level namespaces.`}).option(`return-uuids`,{type:`boolean`,description:`Whether to include namespace UUIDs in the response.
|
|
8
|
-
Set to true to receive the namespace_uuids array.`}).option(`return-details`,{type:`boolean`,description:`Whether to include additional metadata (timestamps).
|
|
9
|
-
When true, response includes created_at and updated_at arrays.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Returns a list of namespaces in the specified R2 catalog. Supports hierarchical filtering and pagination for efficient traversal of large namespace hierarchies.`,builder:O,handler:async t=>{let n={page_token:t[`page-token`],page_size:t[`page-size`],parent:t.parent,return_uuids:t[`return-uuids`],return_details:t[`return-details`]};if(t.dryRun){c({command:`cf r2-data-catalog namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/namespaces`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.r2DataCatalog.namespaces.list({account_id:o,bucket_name:t[`bucket-name`],...n})),{successLabel:`Loaded`})}};function A(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier.
|
|
10
|
-
For nested namespaces, use %1F as separator (e.g., "bronze%1Fanalytics").`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
|
|
11
|
-
Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of tables to return per page.
|
|
12
|
-
Defaults to 100, maximum 1000.`}).option(`return-uuids`,{type:`boolean`,description:`Whether to include table UUIDs in the response.
|
|
13
|
-
Set to true to receive the table_uuids array.`}).option(`return-details`,{type:`boolean`,description:`Whether to include additional metadata (timestamps, locations).
|
|
14
|
-
When true, response includes created_at, updated_at, metadata_locations, and locations arrays.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Returns a list of tables in the specified namespace within an R2 catalog. Supports pagination for efficient traversal of large table collections.`,builder:A,handler:async t=>{let n={page_token:t[`page-token`],page_size:t[`page-size`],return_uuids:t[`return-uuids`],return_details:t[`return-details`]};if(t.dryRun){c({command:`cf r2-data-catalog namespaces tables list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/namespaces/${t.namespace==null?`<namespace>`:encodeURIComponent(String(t.namespace))}/tables`,pathParams:{"bucket-name":String(t[`bucket-name`]??``),namespace:String(t.namespace??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.r2DataCatalog.namespaces.tables.list({account_id:o,bucket_name:t[`bucket-name`],namespace:t.namespace,...n})),{successLabel:`Loaded`})}};function M(e){return e.positional(`table-name`,{type:`string`,description:`The table name.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier (use %1F as separator for nested namespaces).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <table-name>`,describe:`Retrieve the maintenance configuration for a specific table, including compaction settings.`,builder:M,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog namespaces tables maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/namespaces/${t.namespace==null?`<namespace>`:encodeURIComponent(String(t.namespace))}/tables/${t[`table-name`]==null?`<table-name>`:encodeURIComponent(String(t[`table-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(t[`bucket-name`]??``),namespace:String(t.namespace??``),"table-name":String(t[`table-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.namespaces.tables.maintenanceConfigs.get({account_id:a,bucket_name:t[`bucket-name`],namespace:t.namespace,table_name:t[`table-name`]})),{successLabel:`Loaded`})}};function P(e){return e.positional(`table-name`,{type:`string`,description:`The table name.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier (use %1F as separator for nested namespaces).`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update table maintenance configuration.`})}const F={command:`update <table-name>`,describe:`Update the maintenance configuration for a specific table. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:P,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog namespaces tables maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/namespaces/${t.namespace==null?`<namespace>`:encodeURIComponent(String(t.namespace))}/tables/${t[`table-name`]==null?`<table-name>`:encodeURIComponent(String(t[`table-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(t[`bucket-name`]??``),namespace:String(t.namespace??``),"table-name":String(t[`table-name`]??``)},bodyKind:`json`,body:t.body===void 0?o({snapshot_expiration:{max_snapshot_age:u(t[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:t[`snapshot-expiration-min-snapshots-to-keep`]}}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.r2DataCatalog.namespaces.tables.maintenanceConfigs.update({...e,account_id:f,bucket_name:t[`bucket-name`],namespace:t.namespace,table_name:t[`table-name`]})),{successLabel:`Created`});return}let p=o({snapshot_expiration:{max_snapshot_age:u(t[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:t[`snapshot-expiration-min-snapshots-to-keep`]}});s(await l(`Creating`,async()=>n.r2DataCatalog.namespaces.tables.maintenanceConfigs.update({...p,account_id:f,bucket_name:t[`bucket-name`],namespace:t.namespace,table_name:t[`table-name`]})),{successLabel:`Created`})}},I={command:`maintenance-configs`,describe:`Operations for namespaces.tables.maintenance-configs`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`tables`,describe:`Operations for namespaces.tables`,builder:e=>e.command(j).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(k).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`r2-data-catalog`,describe:`Iceberg-compatible data catalog for R2 — organize objects into tables and namespaces for SQL query engines`,builder:e=>e.command(g).command(v).command(b).command(S).command(m).command(D).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{s as e}from"./session-CsvPYFj8.mjs";import{g as t}from"./dist-DpDjsWWn.mjs";import{a as n,r,v as i}from"./auth-BqDOIrKX.mjs";import{n as a}from"./local-D8bhHUMK.mjs";async function o(o,s={}){let{method:c=`GET`,localEndpoint:l}=s,u=`${t({compliance_region:i()})}${o}`,d={...n()};s.headers&&Object.assign(d,s.headers);let f=globalThis.fetch;l===void 0?d.Authorization=`Bearer ${await r()}`:f=a({endpoint:l});let p,m=s.body;m!=null&&(m instanceof FormData?p=m:Buffer.isBuffer(m)||m instanceof Uint8Array||m instanceof ArrayBuffer?(p=m,d[`Content-Type`]??=s.contentType??`application/octet-stream`):typeof m==`string`?(p=m,s.contentType&&(d[`Content-Type`]??=s.contentType)):(p=JSON.stringify(m),d[`Content-Type`]??=s.contentType??`application/json`));let h=await f(u,{method:c,headers:d,...p===void 0?{}:{body:p}});if(!h.ok){let t=h.headers.get(`content-type`)??``,n;try{n=t.includes(`application/json`)?await h.json():await h.text()}catch{n=null}throw new e({statusCode:h.status,body:n,rawResponse:{status:h.status,statusText:h.statusText,url:h.url||u,headers:h.headers,redirected:h.redirected,type:h.type}})}let g=await h.arrayBuffer();return Buffer.from(g)}function s(e){process.stdout.write(e)}export{s as n,o as t};
|