cf 0.3.0 → 0.4.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.
Files changed (171) hide show
  1. package/dist/_meta/agent-context.json +26 -21
  2. package/dist/_meta/commands.json +7696 -18100
  3. package/dist/_meta/schemas.json +6411 -13925
  4. package/dist/{abuse-reports-dMIfUJ8v.mjs → abuse-reports-Dy76QPNP.mjs} +1 -1
  5. package/dist/{accounts-Kx1epdA1.mjs → accounts-CjtZ8x1z.mjs} +2 -2
  6. package/dist/{acm-Utu252kC.mjs → acm-C2lYIWs1.mjs} +1 -1
  7. package/dist/{addressing-CBq7Z7Vq.mjs → addressing-CHFK6uxW.mjs} +1 -1
  8. package/dist/{agent-context-BGTU299M.mjs → agent-context-CgGCT0xU.mjs} +1 -1
  9. package/dist/{ai-DOOKLPkG.mjs → ai-DS3i-I1a.mjs} +1 -1
  10. package/dist/{ai-gateway-Cj1T3avF.mjs → ai-gateway-RIsegO2x.mjs} +1 -1
  11. package/dist/ai-search-Dcj4BauG.mjs +7 -0
  12. package/dist/{ai_gateway-C3fH22C0.mjs → ai_gateway-w7YwfcPE.mjs} +1 -1
  13. package/dist/{alerting-CqmEIaKn.mjs → alerting-Bk85NNf5.mjs} +1 -1
  14. package/dist/{analytics-Dv-X8x7D.mjs → analytics-CkhhhZWZ.mjs} +1 -1
  15. package/dist/{analytics_engine-DdXVR8z2.mjs → analytics_engine-B7qgDJCA.mjs} +1 -1
  16. package/dist/{api-gateway-CNv0IHTU.mjs → api-gateway-CWdR4Ne7.mjs} +1 -1
  17. package/dist/{argo-CX_A4kcn.mjs → argo-DnJRVnGX.mjs} +1 -1
  18. package/dist/artifacts-BVWKiJUl.mjs +4 -0
  19. package/dist/{audit-logs-BfBf3oo-.mjs → audit-logs-DjTstbzL.mjs} +1 -1
  20. package/dist/auth-BqDOIrKX.mjs +150 -0
  21. package/dist/auth-DKkSwnxh.mjs +5 -0
  22. package/dist/billing-3rEqF83h.mjs +2 -0
  23. package/dist/{bot-management-CFvtVx62.mjs → bot-management-CJxD1pqi.mjs} +1 -1
  24. package/dist/{botnet-feed-B-M4Yu0W.mjs → botnet-feed-MG91D7BR.mjs} +1 -1
  25. package/dist/{brand-protection-D05Eg-_6.mjs → brand-protection-CK7gJi06.mjs} +1 -1
  26. package/dist/browser-rendering-Rae0AUt0.mjs +4 -0
  27. package/dist/{build-DYkGW4dh.mjs → build-BE4o4imx.mjs} +131 -131
  28. package/dist/{cache-DsoW6Xwv.mjs → cache-B7pRbpTy.mjs} +1 -1
  29. package/dist/{calls-CZbO7TyR.mjs → calls-DXRWsZ8n.mjs} +3 -3
  30. package/dist/{certificate-authorities-D2yr7_3t.mjs → certificate-authorities-BR3gXBLs.mjs} +1 -1
  31. package/dist/chunk-6IEM75FG-U3L9fKgi.mjs +2 -0
  32. package/dist/{client-certificates-MJcDsTId.mjs → client-certificates-B0ebLJdk.mjs} +1 -1
  33. package/dist/{cloud-connector-DWOrN2eM.mjs → cloud-connector-BOjaggJk.mjs} +1 -1
  34. package/dist/{cloudforce-one-2Bhz8YdW.mjs → cloudforce-one-B6HYfk5Z.mjs} +1 -1
  35. package/dist/{completions-BwRpZQVn.mjs → completions-D_9WsLG7.mjs} +1 -1
  36. package/dist/config-7CBz8Xm0.mjs +2 -0
  37. package/dist/{connectivity-BX8C7tvK.mjs → connectivity-welFvZ7X.mjs} +1 -1
  38. package/dist/connector-interrupts-DTV3F-50.mjs +2 -0
  39. package/dist/connector-telemetry-events-kDqb_AGm.mjs +2 -0
  40. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +2 -0
  41. package/dist/connectors-3vjrdFLB.mjs +3 -0
  42. package/dist/content-scanning-CnW2A0pv.mjs +4 -0
  43. package/dist/{context-DGlHRGWM.mjs → context-CONbNKO-.mjs} +1 -1
  44. package/dist/{custom-certificates-aAiEguR7.mjs → custom-certificates-CnYh6Yi-.mjs} +1 -1
  45. package/dist/{custom-hostnames-AG5yBHIi.mjs → custom-hostnames-C2upqZso.mjs} +1 -1
  46. package/dist/{custom-nameservers-D1DtlRue.mjs → custom-nameservers-BGkAD_PZ.mjs} +1 -1
  47. package/dist/{custom-pages-DQCi2plU.mjs → custom-pages-5fCSP8in.mjs} +1 -1
  48. package/dist/{d1-DbnYhw45.mjs → d1-CyiRbZZn.mjs} +1 -1
  49. package/dist/data-security-Casx4OS_.mjs +6 -0
  50. package/dist/{dcv-delegation-CHspSzTI.mjs → dcv-delegation-DVYO10oA.mjs} +1 -1
  51. package/dist/{deploy-CQial3kN.mjs → deploy-KBRFIatG.mjs} +1 -1
  52. package/dist/{dev-B38LfCTl.mjs → dev-pPazzZvt.mjs} +1 -1
  53. package/dist/{diagnostics-BJQGjVJn.mjs → diagnostics-BqYDoDfw.mjs} +1 -1
  54. package/dist/{dispatch-namespaces-DmHvoBOg.mjs → dispatch-namespaces-Cz2rajnP.mjs} +1 -1
  55. package/dist/{dist-AIcZFk0U.mjs → dist-DA54ZQu0.mjs} +7 -7
  56. package/dist/dist-DpDjsWWn.mjs +306 -0
  57. package/dist/{dns-VMhQSr5n.mjs → dns-62t95Xif.mjs} +1 -1
  58. package/dist/{dns-firewall-B4DVXFBQ.mjs → dns-firewall-Coy8d47t.mjs} +1 -1
  59. package/dist/{durable-objects-CTboySEo.mjs → durable-objects-BSuRERkw.mjs} +1 -1
  60. package/dist/{email-routing-tIR2SFu-.mjs → email-routing-BDUYYeV3.mjs} +1 -1
  61. package/dist/{email-security-Ca1id3rZ.mjs → email-security-ChHA6eqQ.mjs} +1 -1
  62. package/dist/{email-sending-DwWKc5jC.mjs → email-sending-CVrRqn6S.mjs} +1 -1
  63. package/dist/{filters-A4dg_a68.mjs → filters-qJpU9uAS.mjs} +1 -1
  64. package/dist/{firewall-DWPQgYd9.mjs → firewall-C3DDwfwh.mjs} +1 -1
  65. package/dist/{fraud-BMkSsJGU.mjs → fraud-DY3YXFVf.mjs} +1 -1
  66. package/dist/{google-tag-gateway-BGD49nRC.mjs → google-tag-gateway-B00MHDfB.mjs} +1 -1
  67. package/dist/{healthchecks-CtIfrFql.mjs → healthchecks-Drvb79v0.mjs} +1 -1
  68. package/dist/{hostnames-BiomxukN.mjs → hostnames-BdAQo1Mr.mjs} +1 -1
  69. package/dist/{hyperdrive-Da104VaQ.mjs → hyperdrive-99OJV9nl.mjs} +1 -1
  70. package/dist/{iam-BIGKo0WW.mjs → iam-BRbpg3lN.mjs} +1 -1
  71. package/dist/images-D1jI3r3O.mjs +7 -0
  72. package/dist/index.mjs +1 -1
  73. package/dist/{intel-CY6_79v8.mjs → intel-C3ajLpXd.mjs} +1 -1
  74. package/dist/{ips-K4bzaGqd.mjs → ips-B6JETVOY.mjs} +1 -1
  75. package/dist/{keyless-certificates-CZC-L8gM.mjs → keyless-certificates-C4MZ4xnf.mjs} +1 -1
  76. package/dist/{kv-8o27w_pY.mjs → kv-CSWoD9ks.mjs} +1 -1
  77. package/dist/{leaked-credential-checks-qLzRyu85.mjs → leaked-credential-checks-Dgs2oKm9.mjs} +2 -2
  78. package/dist/{load-balancers-DtG8nj25.mjs → load-balancers-Du1tNuUt.mjs} +1 -1
  79. package/dist/{logpush-4L0njy1d.mjs → logpush-SuJyO-uX.mjs} +1 -1
  80. package/dist/{logs-B_Yp95hv.mjs → logs-DcDNRPRl.mjs} +1 -1
  81. package/dist/{magic-cloud-networking-CSOM3EM-.mjs → magic-cloud-networking-D-T0RCvi.mjs} +1 -1
  82. package/dist/{magic-network-monitoring-BnwvM4-I.mjs → magic-network-monitoring-CqtvOePQ.mjs} +1 -1
  83. package/dist/{magic-transit-CXDyvhxq.mjs → magic-transit-BTbkhBtF.mjs} +32 -33
  84. package/dist/{managed-transforms-D15yVbZx.mjs → managed-transforms-CfUBSz9p.mjs} +1 -1
  85. package/dist/{mtls-certificates-D8k0AXWK.mjs → mtls-certificates-Cf1O8c2E.mjs} +1 -1
  86. package/dist/{network-interconnects-rrr7red3.mjs → network-interconnects-DsiNytOU.mjs} +1 -1
  87. package/dist/{observability-DWvpqnQJ.mjs → observability-CLqZ7OSi.mjs} +1 -1
  88. package/dist/open-YWOUIZ5Y-BpqIuBsR.mjs +4 -0
  89. package/dist/{organizations-T77D50Sq.mjs → organizations-aRi1bhFC.mjs} +2 -2
  90. package/dist/{origin-ca-certificates-DXIvD8H5.mjs → origin-ca-certificates-BB4H89a_.mjs} +1 -1
  91. package/dist/{origin-post-quantum-encryption-C8oOczyV.mjs → origin-post-quantum-encryption-DurP3PXG.mjs} +1 -1
  92. package/dist/{origin-tls-client-auth-CaVW1Ztp.mjs → origin-tls-client-auth-CnQNy9-l.mjs} +1 -1
  93. package/dist/{output-BJFNwj7b.mjs → output-CUxZRM5A.mjs} +1 -1
  94. package/dist/{page-rules-CjZPTMQX.mjs → page-rules-CYqtPU1p.mjs} +1 -1
  95. package/dist/{page-shield-D5RRNJCY.mjs → page-shield-D8l9ZMUl.mjs} +1 -1
  96. package/dist/{pages-CWJtJnL0.mjs → pages-ChurJ2H7.mjs} +1 -1
  97. package/dist/{pipelines-B0L_7j9e.mjs → pipelines-CeyujvRf.mjs} +1 -1
  98. package/dist/{progress-CrCGTq7N.mjs → progress-Cent9Lsg.mjs} +1 -1
  99. package/dist/{queues-CN6DPhRR.mjs → queues-Rf_n11Cx.mjs} +1 -1
  100. package/dist/{r2-DQIcyRtA.mjs → r2-BtuTO3vQ.mjs} +1 -1
  101. package/dist/{r2-data-catalog-Bbo93TJx.mjs → r2-data-catalog-Debz38kv.mjs} +1 -1
  102. package/dist/radar-CzGM92uM.mjs +2 -0
  103. package/dist/{rate-limits-DcrQV6Ar.mjs → rate-limits-Bbk7HxP7.mjs} +1 -1
  104. package/dist/{raw-fetch-Dlccg0Tr.mjs → raw-fetch-DnbAMFBp.mjs} +1 -1
  105. package/dist/{realtime-kit-CaquuVOE.mjs → realtime-kit-CivLpkpg.mjs} +1 -1
  106. package/dist/{registrar-Ko-xZemf.mjs → registrar-8IeA5DKd.mjs} +1 -1
  107. package/dist/{request-tracers-DOW_reTJ.mjs → request-tracers-D1aH4NmL.mjs} +1 -1
  108. package/dist/{resource-sharing-D7TX0JV0.mjs → resource-sharing-B-Pcto7-.mjs} +3 -3
  109. package/dist/{resource-tagging-C3qtLzCz.mjs → resource-tagging-Bpb6Qq1M.mjs} +1 -1
  110. package/dist/{rules-BXRADHL5.mjs → rules-B10XWY10.mjs} +1 -1
  111. package/dist/{rulesets-CBgpeSvJ.mjs → rulesets-lYczEcJp.mjs} +1 -1
  112. package/dist/{rum-BjPptTUP.mjs → rum-B5GUKa4I.mjs} +3 -3
  113. package/dist/{schema-D16TgWBg.mjs → schema-hefO-tzo.mjs} +1 -1
  114. package/dist/{schema-validation-Dgv_opM3.mjs → schema-validation-DTq517Em.mjs} +1 -1
  115. package/dist/{scim-DdSEr4kZ.mjs → scim-BiLfOQ89.mjs} +1 -1
  116. package/dist/{secrets-store-7BfyvJLb.mjs → secrets-store-CBX0dvHL.mjs} +1 -1
  117. package/dist/{security-center-DAy6AKtT.mjs → security-center-AVpTOBK3.mjs} +1 -1
  118. package/dist/{security-txt-xAMb7K6Y.mjs → security-txt-DVlh8y9l.mjs} +1 -1
  119. package/dist/{session-COHHdS7A.mjs → session-CsvPYFj8.mjs} +2 -2
  120. package/dist/shared-0bwWVDLo.mjs +2 -0
  121. package/dist/{smart-shield-TeWZFnH2.mjs → smart-shield-DblHIce0.mjs} +1 -1
  122. package/dist/{snippets-CCSsCXVs.mjs → snippets-DrpqSXYC.mjs} +1 -1
  123. package/dist/{spawn-DcppKGI5.mjs → spawn-DK7pott_.mjs} +1 -1
  124. package/dist/{spectrum-CTTZID8u.mjs → spectrum-CnrG0jIC.mjs} +2 -2
  125. package/dist/speed-BzRY3Xlh.mjs +4 -0
  126. package/dist/{src-BW6vfAwE.mjs → src-D9_Gq68b.mjs} +10 -10
  127. package/dist/{ssl-BWA2LdwC.mjs → ssl-Cp6tQkZH.mjs} +1 -1
  128. package/dist/stream-CGTRN4ZN.mjs +14 -0
  129. package/dist/{tenants-Bd7NGQ_m.mjs → tenants-o_M62Y1n.mjs} +1 -1
  130. package/dist/{token-validation-DAgtFOvs.mjs → token-validation-Ca5AGEns.mjs} +1 -1
  131. package/dist/{tools-DXQmfFuE.mjs → tools-DtNNmO6l.mjs} +1 -1
  132. package/dist/{turnstile-cfdaO4ca.mjs → turnstile-l7mo9BWL.mjs} +2 -2
  133. package/dist/{ui-D4KtlMh9.mjs → ui-B97lRnOv.mjs} +1 -1
  134. package/dist/{url-normalization-B5RN4nLD.mjs → url-normalization-D1CogSIG.mjs} +1 -1
  135. package/dist/{url-scanner-BrZ1L9OC.mjs → url-scanner-BnJHJqcz.mjs} +1 -1
  136. package/dist/{user-CAo-yCJA.mjs → user-CiyYZ69X.mjs} +2 -2
  137. package/dist/{vectorize-C7_oQlaI.mjs → vectorize-D3LgMLOn.mjs} +1 -1
  138. package/dist/{versions-CUwWJWmy.mjs → versions-B6E8WQyA.mjs} +1 -1
  139. package/dist/{waiting-rooms-Dln5ICg5.mjs → waiting-rooms-Bhy_nuV3.mjs} +1 -1
  140. package/dist/{web3-HQJRm38W.mjs → web3-DlHE0CZc.mjs} +1 -1
  141. package/dist/{workers-Dg7ddG2Q.mjs → workers-DRAkU6YR.mjs} +1 -1
  142. package/dist/{workers-builds-AVfx8IyL.mjs → workers-builds-BmNjiHDZ.mjs} +1 -1
  143. package/dist/{workflows-VquuSh2J.mjs → workflows-z6oapEJs.mjs} +1 -1
  144. package/dist/{zaraz-xYSWIV4P.mjs → zaraz-CyzfYOEU.mjs} +1 -1
  145. package/dist/{zero-trust-CP96wnSh.mjs → zero-trust-fyyIelWx.mjs} +44 -44
  146. package/dist/zero_trust-BAhlNkjo.mjs +3 -0
  147. package/dist/{zones-BSgmZ9WC.mjs → zones-MSULnDwW.mjs} +4 -4
  148. package/package.json +4 -4
  149. package/dist/ai-search-CQF_Sn7d.mjs +0 -7
  150. package/dist/auth-SyWhMmPu.mjs +0 -6
  151. package/dist/auth-ffdf9yR0.mjs +0 -135
  152. package/dist/autorag-BuGhGTeZ.mjs +0 -2
  153. package/dist/billing-PoG81XaQ.mjs +0 -2
  154. package/dist/browser-rendering-xu8F_Rrv.mjs +0 -4
  155. package/dist/config-DYzlVxcB.mjs +0 -2
  156. package/dist/content-scanning-r6uzMO1r.mjs +0 -4
  157. package/dist/data-security-D_EtYBfo.mjs +0 -6
  158. package/dist/dist-DNBSHor6.mjs +0 -301
  159. package/dist/images-BO8FbDAa.mjs +0 -5
  160. package/dist/radar-Bxb0WX8V.mjs +0 -2
  161. package/dist/shared-AGtpXwwL.mjs +0 -2
  162. package/dist/speed-CuzTE0AL.mjs +0 -4
  163. package/dist/stream-GFsIZ-pP.mjs +0 -14
  164. /package/dist/{body-parser-DKa8Ipg1.mjs → body-parser-CBpeIUns.mjs} +0 -0
  165. /package/dist/{cli-types-CRIDdDw3.mjs → cli-types-CMNMD1V7.mjs} +0 -0
  166. /package/dist/{input-validation-zEO81MWN.mjs → input-validation-CTqtyiY9.mjs} +0 -0
  167. /package/dist/{lib-Eu1wXxuh.mjs → lib-B6xvCJjc.mjs} +0 -0
  168. /package/dist/{local-VJaJ3BZ1.mjs → local-D8bhHUMK.mjs} +0 -0
  169. /package/dist/{metadata-5VwHPW6C.mjs → metadata-jh2EIan8.mjs} +0 -0
  170. /package/dist/{resolve-4-OSeHlK.mjs → resolve-D1mG0REg.mjs} +0 -0
  171. /package/dist/{theme-BklJDrb2.mjs → theme-CFHr0Dh9.mjs} +0 -0
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{S as e,T as t,n}from"./auth-ffdf9yR0.mjs";import{n as r}from"./body-parser-DKa8Ipg1.mjs";import{t as i}from"./output-BJFNwj7b.mjs";import{n as a,t as o}from"./progress-CrCGTq7N.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.
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
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 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";import{t as f}from"./cli-types-CRIDdDw3.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.
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
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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
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.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
3
3
 
4
4
  Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
5
5
  key is not treated as a secret value. This is *only* supported for preventing
@@ -1,4 +1,4 @@
1
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-ffdf9yR0.mjs";import{n as o,t as s}from"./body-parser-DKa8Ipg1.mjs";import{t as c}from"./output-BJFNwj7b.mjs";import{n as l,t as u}from"./progress-CrCGTq7N.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";import{t as p}from"./cli-types-CRIDdDw3.mjs";function m(e){return e.option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:m,handler:async r=>{if(r.dryRun){l({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled,name:d(r.name,`name`,`text`),skipPreflightCheck:r[`skip-preflight-check`]}):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.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`configuration-type`]===void 0&&(r[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),r[`configuration-url`]===void 0&&(r[`configuration-url`]=await t(`configuration-url`,`The configuration.url field`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await t(`name`,`The name field`));let h=s({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled,name:d(r.name,`name`,`text`),skipPreflightCheck:r[`skip-preflight-check`]});c(await u(`Creating`,async()=>p.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`slug`,{type:`string`,description:`Slug`,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 _={command:`delete <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},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.
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.option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:m,handler:async r=>{if(r.dryRun){l({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled,name:d(r.name,`name`,`text`),skipPreflightCheck:r[`skip-preflight-check`]}):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.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`configuration-type`]===void 0&&(r[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),r[`configuration-url`]===void 0&&(r[`configuration-url`]=await t(`configuration-url`,`The configuration.url field`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await t(`name`,`The name field`));let h=s({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled,name:d(r.name,`name`,`text`),skipPreflightCheck:r[`skip-preflight-check`]});c(await u(`Creating`,async()=>p.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`slug`,{type:`string`,description:`Slug`,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 _={command:`delete <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},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
3
  `);return}c(await u(`Deleting`,async()=>n.observability.destinations.delete({account_id:o,slug:t.slug})),{successLabel:`Deleted`})}};function v(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List your Workers Observability Telemetry Destinations.`,builder:p(v),handler:async t=>{let n={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`]};if(t.dryRun){l({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/destinations`,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.observability.destinations.list({account_id:o,...n})),{successLabel:`Loaded`})}};function b(e){return e.positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled 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 x={command:`update <slug>`,describe:`Update an existing Workers Observability Telemetry Destination.`,builder:b,handler:async r=>{if(r.dryRun){l({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/destinations/${r.slug==null?`<slug>`:encodeURIComponent(String(r.slug))}`,pathParams:{slug:String(r.slug??``)},bodyKind:`json`,body:r.body===void 0?s({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled}):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.observability.destinations.update({...e,account_id:m,slug:r.slug})),{successLabel:`Updated`});return}if(r[`configuration-type`]===void 0&&(r[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),r[`configuration-url`]===void 0&&(r[`configuration-url`]=await t(`configuration-url`,`The configuration.url field`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=s({configuration:{type:d(r[`configuration-type`],`configuration-type`,`text`),url:d(r[`configuration-url`],`configuration-url`,`text`)},enabled:r.enabled});c(await u(`Updating`,async()=>p.observability.destinations.update({...h,account_id:m,slug:r.slug})),{successLabel:`Updated`})}},S={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const w={command:`create`,describe:`Persist query for later use.`,builder:C,handler:async n=>{if(n.dryRun){l({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`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.observability.queries.create({...e,account_id:p})),{successLabel:`Created`});return}n.description===void 0&&(n.description=await t(`description`,`The description field`)),n.name===void 0&&(n.name=await t(`name`,`Query name`)),n[`parameters-order-by-value`]===void 0&&(n[`parameters-order-by-value`]=await t(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});c(await u(`Creating`,async()=>r.observability.queries.create({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <queryId>`,describe:`Delete a saved query.`,builder:T,handler:async t=>{if(t.dryRun){l({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-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
4
  `);return}c(await u(`Deleting`,async()=>n.observability.queries.delete({account_id:o,queryId:t[`query-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const O={command:`edit <queryId>`,describe:`Update saved query.`,builder:D,handler:async n=>{if(n.dryRun){l({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/queries/${n[`query-id`]==null?`<query-id>`:encodeURIComponent(String(n[`query-id`]))}`,pathParams:{"query-id":String(n[`query-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`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(`Updating`,async()=>r.observability.queries.edit({...e,account_id:p,queryId:n[`query-id`]})),{successLabel:`Updated`});return}n.description===void 0&&(n.description=await t(`description`,`The description field`)),n.name===void 0&&(n.name=await t(`name`,`Query name`)),n[`parameters-order-by-value`]===void 0&&(n[`parameters-order-by-value`]=await t(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});c(await u(`Updating`,async()=>r.observability.queries.edit({...m,account_id:p,queryId:n[`query-id`]})),{successLabel:`Updated`})}};function k(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <queryId>`,describe:`Retrieve a saved query.`,builder:k,handler:async t=>{if(t.dryRun){l({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-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.observability.queries.get({account_id:r,queryId:t[`query-id`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List saved queries.`,builder:p(j),handler:async t=>{let n={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`]};if(t.dryRun){l({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/queries`,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.observability.queries.list({account_id:o,...n})),{successLabel:`Loaded`})}},N={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`from`,{type:`number`,description:`The from field`}).option(`key-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`key-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`limit`,{type:`number`,description:`Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering.`}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`to`,{type:`number`,description:`The to field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Find keys in your telemetry events matching a specific filter or needle.`})}const F={command:`keys`,describe:`List all the keys in your telemetry events.`,builder:P,handler:async t=>{if(t.dryRun){l({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({datasets:t.datasets,from:t.from,keyNeedle:{isRegex:t[`key-needle-is-regex`],matchCase:t[`key-needle-match-case`]},limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},to:t.to}):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.observability.telemetry.keys({...e,account_id:r})),{successLabel:`Created`});return}let d=s({datasets:t.datasets,from:t.from,keyNeedle:{isRegex:t[`key-needle-is-regex`],matchCase:t[`key-needle-match-case`]},limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},to:t.to});c(await u(`Creating`,async()=>n.observability.telemetry.keys({...d,account_id:r})),{successLabel:`Created`})}};function I(e){return e.option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`dry`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, and invocation views. Pass the $metadata.id of the last returned item to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': Durable Object agent summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query your observability events, requests, and traces to build visualizations and identify insights.`}).check(e=>{if([`parameters-datasets`,`parameters-filter-combination`,`parameters-limit`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0)){let t=[`parameters-order-by-value`].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 --parameters-* flag is set`)}return!0})}const L={command:`query`,describe:`Run a temporary or saved query.`,builder:I,handler:async n=>{if(n.dryRun){l({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({chart:n.chart,compare:n.compare,dry:n.dry,granularity:n.granularity,ignoreSeries:n[`ignore-series`],limit:n.limit,offset:d(n.offset,`offset`,`text`),offsetBy:n[`offset-by`],offsetDirection:d(n[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(n[`query-id`],`query-id`,`text`),timeframe:{from:n[`timeframe-from`],to:n[`timeframe-to`]},view:d(n.view,`view`,`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(`Loading`,async()=>r.observability.telemetry.query({...e,account_id:p})),{successLabel:`Loaded`});return}if(n[`query-id`]===void 0&&(n[`query-id`]=await t(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),n[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(n[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=s({chart:n.chart,compare:n.compare,dry:n.dry,granularity:n.granularity,ignoreSeries:n[`ignore-series`],limit:n.limit,offset:d(n.offset,`offset`,`text`),offsetBy:n[`offset-by`],offsetDirection:d(n[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(n[`query-id`],`query-id`,`text`),timeframe:{from:n[`timeframe-from`],to:n[`timeframe-to`]},view:d(n.view,`view`,`text`)});c(await u(`Loading`,async()=>r.observability.telemetry.query({...m,account_id:p})),{successLabel:`Loaded`})}};function R(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`key`,{type:`string`,description:`The key field`}).option(`limit`,{type:`number`,description:`The limit field`,default:50}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`timeframe-from`,{type:`number`,description:`The timeframe.from field`}).option(`timeframe-to`,{type:`number`,description:`The timeframe.to field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`string`,`boolean`,`number`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Retrieve values from your telemetry events.`})}const z={command:`values`,describe:`List unique values found in your events.`,builder:R,handler:async r=>{if(r.dryRun){l({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({datasets:r.datasets,key:d(r.key,`key`,`text`),limit:r.limit,needle:{isRegex:r[`needle-is-regex`],matchCase:r[`needle-match-case`]},timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},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.observability.telemetry.values({...e,account_id:m})),{successLabel:`Created`});return}if(r.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(r.key===void 0&&(r.key=await t(`key`,`The key field`)),r[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(r[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await n(`type`,`The type field`,[`string`,`boolean`,`number`]));let h=s({datasets:r.datasets,key:d(r.key,`key`,`text`),limit:r.limit,needle:{isRegex:r[`needle-is-regex`],matchCase:r[`needle-match-case`]},timeframe:{from:r[`timeframe-from`],to:r[`timeframe-to`]},type:d(r.type,`type`,`text`)});c(await u(`Creating`,async()=>p.observability.telemetry.values({...h,account_id:m})),{successLabel:`Created`})}},B={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`observability`,describe:`observability`,builder:e=>e.command(S).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{n as e}from"./chunk-6IEM75FG-U3L9fKgi.mjs";import t from"node:fs";import n from"node:os";import r from"node:path";import i,{execFile as a}from"node:child_process";import{promisify as o}from"node:util";import{Buffer as s}from"node:buffer";import{fileURLToPath as c}from"node:url";import l,{constants as u}from"node:fs/promises";import d from"node:process";var f;function p(){try{return t.statSync(`/.dockerenv`),!0}catch{return!1}}e(p,`hasDockerEnv`);function m(){try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}e(m,`hasDockerCGroup`);function h(){return f===void 0&&(f=p()||m()),f}e(h,`isDocker`);var g,_=e(()=>{try{return t.statSync(`/run/.containerenv`),!0}catch{return!1}},`hasContainerEnv`);function v(){return g===void 0&&(g=_()||h()),g}e(v,`isInsideContainer`);var y=e(()=>{if(d.platform!==`linux`)return!1;if(n.release().toLowerCase().includes(`microsoft`))return!v();try{return t.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`)?!v():!1}catch{return!1}},`isWsl`),b=d.env.__IS_WSL_TEST__?y:y(),ee=o(i.execFile),x=e(()=>`${d.env.SYSTEMROOT||d.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,`powerShellPath`),S=e(async(e,t={})=>{let{powerShellPath:n,...r}=t,i=S.encodeCommand(e);return ee(n??x(),[...S.argumentsPrefix,i],{encoding:`utf8`,...r})},`executePowerShell`);S.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],S.encodeCommand=e=>s.from(e,`utf16le`).toString(`base64`),S.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function C(e){for(let t of e.split(`
3
+ `)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}e(C,`parseMountPointFromConfig`);var te=o(i.execFile),ne=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await l.access(n,u.F_OK),r=!0}catch{}if(!r)return e;let i=C(await l.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),w=b?e(async()=>`${await ne()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,`powerShellPathFromWsl`):x,T,E=e(async()=>(T??=(async()=>{try{let e=await w();return await l.access(e,u.X_OK),!0}catch{return!1}})(),T),`canAccessPowerShell`),D=e(async()=>{let e=await w(),{stdout:t}=await S(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()},`wslDefaultBrowser`),O=e(async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await te(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}},`convertWslPathToWindows`);function k(t,n,r){let i=e(e=>Object.defineProperty(t,n,{value:e,enumerable:!0,writable:!0}),`define`);return Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){let e=r();return i(e),e},set(e){i(e)}}),t}e(k,`defineLazyProperty`);var A=o(a);async function j(){if(d.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await A(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}e(j,`defaultBrowserId`);var M=o(a);async function N(e,{humanReadableOutput:t=!0,signal:n}={}){if(d.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:a}=await M(`osascript`,[`-e`,e,r],i);return a.trim()}e(N,`runAppleScript`);async function P(e){return N(`tell application "Finder" to set app_path to application file id "${e}" as string
4
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}e(P,`bundleName`);var F=o(a),I={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},L=new Map(Object.entries(I)),R=class extends Error{static{e(this,`UnknownBrowserError`)}};async function z(e=F){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new R(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=I[r];if(!i)throw new R(`Unknown browser ID: ${r}`);return i}e(z,`defaultBrowser`);var B=o(a),V=e(e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),`titleize`);async function H(){if(d.platform===`darwin`){let e=await j();return{name:await P(e),id:e}}if(d.platform===`linux`){let{stdout:e}=await B(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:V(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(d.platform===`win32`)return z();throw Error(`Only macOS, Linux, and Windows are supported`)}e(H,`defaultBrowser`);var U=!!(d.env.SSH_CONNECTION||d.env.SSH_CLIENT||d.env.SSH_TTY),W=Symbol(`fallbackAttempt`),G=import.meta.url?r.dirname(c(import.meta.url)):``,K=r.join(G,`xdg-open`),{platform:q,arch:J}=d,Y=e(async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},`tryEachApp`),X=e(async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[W]===!0;if(delete e[W],Array.isArray(e.app))return Y(e.app,t=>X({...e,app:t,[W]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return Y(n,t=>X({...e,app:{name:t,arguments:r},[W]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(b){let e=await D();a=L.get(e)??{}}else a=await H();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return X({...e,app:{name:$[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let a,o=[],s={},c=!1;if(b&&!v()&&!U&&!n&&(c=await E()),q===`darwin`)a=`open`,e.wait&&o.push(`--wait-apps`),e.background&&o.push(`--background`),e.newInstance&&o.push(`--new`),n&&o.push(`-a`,n);else if(q===`win32`||c){a=await w(),o.push(...S.argumentsPrefix),b||(s.windowsVerbatimArguments=!0),b&&e.target&&(e.target=await O(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push(S.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push(S.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>S.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=S.encodeCommand(t.join(` `)),e.wait||(s.stdio=`ignore`)}else{if(n)a=n;else{let e=!G||G===`/`,t=!1;try{await l.access(K,u.X_OK),t=!0}catch{}a=d.versions.electron??(q===`android`||e||!t)?`xdg-open`:K}r.length>0&&o.push(...r),e.wait||(s.stdio=`ignore`,s.detached=!0)}q===`darwin`&&r.length>0&&o.push(`--args`,...r),e.target&&o.push(e.target);let f=i.spawn(a,o,s);return e.wait?new Promise((t,n)=>{f.once(`error`,n),f.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(f)})}):t?new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.once(`close`,n=>{if(f.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}f.unref(),e(f)})})}):(f.unref(),new Promise((e,t)=>{f.once(`error`,t),f.once(`spawn`,()=>{f.off(`error`,t),e(f)})}))},`baseOpen`),re=e((e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return X({...t,target:e})},`open`);function Z(e){if(typeof e==`string`||Array.isArray(e))return e;let{[J]:t}=e;if(!t)throw Error(`${J} is not supported`);return t}e(Z,`detectArchBinary`);function Q({[q]:e},{wsl:t}={}){if(t&&b)return Z(t);if(!e)throw Error(`${q} is not supported`);return Z(e)}e(Q,`detectPlatformBinary`);var $={browser:`browser`,browserPrivate:`browserPrivate`};k($,`chrome`,()=>Q({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),k($,`brave`,()=>Q({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),k($,`firefox`,()=>Q({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),k($,`edge`,()=>Q({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),k($,`safari`,()=>Q({darwin:`Safari`}));var ie=re;export{ie as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";import{t as f}from"./cli-types-CRIDdDw3.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf organizations account-organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/organizations`,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.organizations.accountOrganizations.list({account_id:a})),{successLabel:`Loaded`})}},h={command:`account-organizations`,describe:`Operations for account-organizations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const _={command:`create`,describe:`Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:g,handler:async e=>{if(e.dryRun){c({command:`cf organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(e.body)});return}let n=await i(e);if(e.body){let t=a(e.body);s(await l(`Creating`,async()=>n.organizations.create({...t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The name field`));let r=o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}});s(await l(`Creating`,async()=>n.organizations.create({...r})),{successLabel:`Created`})}};function v(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <organization-id>`,describe:`Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`,builder:v,handler:async e=>{if(e.dryRun){c({command:`cf organizations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);if(!await n({force:!!e.force})){process.stderr.write(`Aborted.
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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf organizations account-organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/organizations`,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.organizations.accountOrganizations.list({account_id:a})),{successLabel:`Loaded`})}},h={command:`account-organizations`,describe:`Operations for account-organizations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const _={command:`create`,describe:`Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:g,handler:async e=>{if(e.dryRun){c({command:`cf organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(e.body)});return}let n=await i(e);if(e.body){let t=a(e.body);s(await l(`Creating`,async()=>n.organizations.create({...t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The name field`));let r=o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}});s(await l(`Creating`,async()=>n.organizations.create({...r})),{successLabel:`Created`})}};function v(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <organization-id>`,describe:`Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`,builder:v,handler:async e=>{if(e.dryRun){c({command:`cf organizations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);if(!await n({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}s(await l(`Deleting`,async()=>t.organizations.delete({organization_id:e[`organization-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <organization-id>`,describe:`Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf organizations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);s(await l(`Loading`,async()=>t.organizations.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
4
4
  by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
5
5
  particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
@@ -38,4 +38,4 @@ string.`}).option(`order-by`,{type:`string`,description:"Field to order results
38
38
  provided will retrieve the next page.
39
39
 
40
40
  Parameters used to filter the retrieved list must remain in subsequent
41
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <organization-id>`,describe:`Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(B),handler:async e=>{let t={account_pubname:e[`account-pubname`],"account_pubname.startsWith":e[`account-pubname-starts-with`],"account_pubname.endsWith":e[`account-pubname-ends-with`],"account_pubname.contains":e[`account-pubname-contains`],name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],order_by:e[`order-by`],direction:e.direction,page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){c({command:`cf organizations organization-accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.organizationAccounts.get({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},H={command:`organization-accounts`,describe:`Operations for organization-accounts`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <organization-id>`,describe:`Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:U,handler:async e=>{if(e.dryRun){c({command:`cf organizations organization-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);s(await l(`Loading`,async()=>t.organizations.organizationProfile.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function G(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <organization-id>`,describe:`Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:G,handler:async e=>{if(e.dryRun){c({command:`cf organizations organization-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({business_address:u(e[`business-address`],`business-address`,`text`),business_email:u(e[`business-email`],`business-email`,`text`),business_name:u(e[`business-name`],`business-name`,`text`),business_phone:u(e[`business-phone`],`business-phone`,`text`),external_metadata:u(e[`external-metadata`],`external-metadata`,`text`)}):a(e.body)});return}let n=await i(e);if(e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.organizations.organizationProfile.update({body:t,organization_id:e[`organization-id`]})),{successLabel:`Updated`});return}e[`business-address`]===void 0&&(e[`business-address`]=await t(`business-address`,`The business_address field`)),e[`business-email`]===void 0&&(e[`business-email`]=await t(`business-email`,`The business_email field`)),e[`business-name`]===void 0&&(e[`business-name`]=await t(`business-name`,`The business_name field`)),e[`business-phone`]===void 0&&(e[`business-phone`]=await t(`business-phone`,`The business_phone field`)),e[`external-metadata`]===void 0&&(e[`external-metadata`]=await t(`external-metadata`,`The external_metadata field`));let r=o({business_address:u(e[`business-address`],`business-address`,`text`),business_email:u(e[`business-email`],`business-email`,`text`),business_name:u(e[`business-name`],`business-name`,`text`),business_phone:u(e[`business-phone`],`business-phone`,`text`),external_metadata:u(e[`external-metadata`],`external-metadata`,`text`)});s(await l(`Updating`,async()=>n.organizations.organizationProfile.update({body:r,organization_id:e[`organization-id`]})),{successLabel:`Updated`})}},q={command:`organization-profile`,describe:`Operations for organization-profile`,builder:e=>e.command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Lists all organization shares.`,builder:f(J),handler:async e=>{let t={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf organizations shares list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/shares`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.shares.list({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},X={command:`shares`,describe:`Shares operations`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const Q={command:`update <organization-id>`,describe:`Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:Z,handler:async e=>{if(e.dryRun){c({command:`cf organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(e.body)});return}let n=await i(e);if(e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.organizations.update({body:t,organization_id:e[`organization-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await t(`name`,`The name field`));let r=o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}});s(await l(`Updating`,async()=>n.organizations.update({body:r,organization_id:e[`organization-id`]})),{successLabel:`Updated`})}},$={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(_).command(y).command(x).command(C).command(Q).command(h).command(D).command(z).command(A).command(H).command(q).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
41
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <organization-id>`,describe:`Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(B),handler:async e=>{let t={account_pubname:e[`account-pubname`],"account_pubname.startsWith":e[`account-pubname-starts-with`],"account_pubname.endsWith":e[`account-pubname-ends-with`],"account_pubname.contains":e[`account-pubname-contains`],name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],order_by:e[`order-by`],direction:e.direction,page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){c({command:`cf organizations organization-accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.organizationAccounts.get({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},H={command:`organization-accounts`,describe:`Operations for organization-accounts`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <organization-id>`,describe:`Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:U,handler:async e=>{if(e.dryRun){c({command:`cf organizations organization-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);s(await l(`Loading`,async()=>t.organizations.organizationProfile.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function G(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <organization-id>`,describe:`Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:G,handler:async e=>{if(e.dryRun){c({command:`cf organizations organization-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({business_address:u(e[`business-address`],`business-address`,`text`),business_email:u(e[`business-email`],`business-email`,`text`),business_name:u(e[`business-name`],`business-name`,`text`),business_phone:u(e[`business-phone`],`business-phone`,`text`),external_metadata:u(e[`external-metadata`],`external-metadata`,`text`)}):a(e.body)});return}let n=await i(e);if(e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.organizations.organizationProfile.update({body:t,organization_id:e[`organization-id`]})),{successLabel:`Updated`});return}e[`business-address`]===void 0&&(e[`business-address`]=await t(`business-address`,`The business_address field`)),e[`business-email`]===void 0&&(e[`business-email`]=await t(`business-email`,`The business_email field`)),e[`business-name`]===void 0&&(e[`business-name`]=await t(`business-name`,`The business_name field`)),e[`business-phone`]===void 0&&(e[`business-phone`]=await t(`business-phone`,`The business_phone field`)),e[`external-metadata`]===void 0&&(e[`external-metadata`]=await t(`external-metadata`,`The external_metadata field`));let r=o({business_address:u(e[`business-address`],`business-address`,`text`),business_email:u(e[`business-email`],`business-email`,`text`),business_name:u(e[`business-name`],`business-name`,`text`),business_phone:u(e[`business-phone`],`business-phone`,`text`),external_metadata:u(e[`external-metadata`],`external-metadata`,`text`)});s(await l(`Updating`,async()=>n.organizations.organizationProfile.update({body:r,organization_id:e[`organization-id`]})),{successLabel:`Updated`})}},q={command:`organization-profile`,describe:`Operations for organization-profile`,builder:e=>e.command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Lists all organization shares.`,builder:f(J),handler:async e=>{let t={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf organizations shares list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/shares`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.shares.list({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},X={command:`shares`,describe:`Operations for shares`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const Q={command:`update <organization-id>`,describe:`Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:Z,handler:async e=>{if(e.dryRun){c({command:`cf organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(e.body)});return}let n=await i(e);if(e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.organizations.update({body:t,organization_id:e[`organization-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await t(`name`,`The name field`));let r=o({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}});s(await l(`Updating`,async()=>n.organizations.update({body:r,organization_id:e[`organization-id`]})),{successLabel:`Updated`})}},$={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(_).command(y).command(x).command(C).command(Q).command(h).command(D).command(z).command(A).command(H).command(q).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,E as t,T as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./cli-types-CRIDdDw3.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.
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
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 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{E as e,S as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c}from"./input-validation-zEO81MWN.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};
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,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,S as t,T as n,i as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of associations per page.`}).option(`status`,{type:`string`,description:`Filter associations by status. Use comma-separated values to filter by multiple statuses, or "all" to include every status. Defaults to "active" if not provided.`,choices:[`active`,`pending_deployment`,`pending_deletion`,`deleted`,`deployment_timed_out`,`deletion_timed_out`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`List certificate ID - hostname associations for the given zone. Shows which hostnames are associated to which certificates for authenticated origin pulls.`,builder:d(f),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,s(await l(`Loading`,async()=>r.originTlsClientAuth.hostnameAssociations.list({zone_id:a,...n})),{successLabel:`Loaded`})}},m={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`certificate`,{type:`string`,description:`The hostname certificate.`}).option(`private-key`,{type:`string`,description:`The hostname certificate's private key.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Upload a certificate to be used for client authentication on a hostname. 10 hostname certificates per zone are allowed.`,builder:h,handler:async n=>{if(n.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({certificate:u(n.certificate,`certificate`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}n.certificate===void 0&&(n.certificate=await e(`certificate`,`The hostname certificate.`)),n[`private-key`]===void 0&&(n[`private-key`]=await e(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=o({certificate:u(n.certificate,`certificate`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function _(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 v={command:`delete <certificate-id>`,describe:"Removes a client certificate used for authenticated origin pulls on a specific hostname. Note: Before deleting the certificate, you must first invalidate the hostname for client authentication by sending a PUT request with `enabled` set to null. After invalidating the association, the certificate can be safely deleted.",builder:_,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
2
+ import{D as e,S as t,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}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./cli-types-CMNMD1V7.mjs";function f(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of associations per page.`}).option(`status`,{type:`string`,description:`Filter associations by status. Use comma-separated values to filter by multiple statuses, or "all" to include every status. Defaults to "active" if not provided.`,choices:[`active`,`pending_deployment`,`pending_deletion`,`deleted`,`deployment_timed_out`,`deletion_timed_out`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`List certificate ID - hostname associations for the given zone. Shows which hostnames are associated to which certificates for authenticated origin pulls.`,builder:d(f),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,s(await l(`Loading`,async()=>r.originTlsClientAuth.hostnameAssociations.list({zone_id:a,...n})),{successLabel:`Loaded`})}},m={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`certificate`,{type:`string`,description:`The hostname certificate.`}).option(`private-key`,{type:`string`,description:`The hostname certificate's private key.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Upload a certificate to be used for client authentication on a hostname. 10 hostname certificates per zone are allowed.`,builder:h,handler:async n=>{if(n.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({certificate:u(n.certificate,`certificate`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}n.certificate===void 0&&(n.certificate=await e(`certificate`,`The hostname certificate.`)),n[`private-key`]===void 0&&(n[`private-key`]=await e(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=o({certificate:u(n.certificate,`certificate`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function _(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 v={command:`delete <certificate-id>`,describe:"Removes a client certificate used for authenticated origin pulls on a specific hostname. Note: Before deleting the certificate, you must first invalidate the hostname for client authentication by sending a PUT request with `enabled` set to null. After invalidating the association, the certificate can be safely deleted.",builder:_,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}s(await l(`Deleting`,async()=>r.originTlsClientAuth.hostnameCertificates.delete({zone_id:a,certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function y(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 b={command:`get <certificate-id>`,describe:`Get the certificate by ID to be used for client authentication on a hostname.`,builder:y,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.originTlsClientAuth.hostnameCertificates.get({zone_id:r,certificate_id:e[`certificate-id`]})),{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:`Lists all client certificates configured for per-hostname authenticated origin pulls on the zone.`,builder:x,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.originTlsClientAuth.hostnameCertificates.list({zone_id:r})),{successLabel:`Loaded`})}},C={command:`hostname-certificates`,describe:`Operations for hostname-certificates`,builder:e=>e.command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`hostname`,{type:`string`,description:`The hostname on the origin for which the client certificate uploaded will be used.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <hostname>`,describe:`Retrieves the client certificate authentication status for a specific hostname, showing whether authenticated origin pulls are enabled.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.originTlsClientAuth.hostnames.get({zone_id:r,hostname:e.hostname})),{successLabel:`Loaded`})}};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`update`,describe:`Associate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname even if activated at the zone level. 100 maximum associations on a single certificate are allowed. Note: Use a null value for parameter *enabled* to invalidate the association.`,builder:E,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let n=await i(e),o=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=o,e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.originTlsClientAuth.hostnames.update({...t,zone_id:o})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>r(n,`PUT`,`/zones/${e.zoneId}/origin_tls_client_auth/hostnames`)),{successLabel:`Updated`})}},O={command:`hostnames`,describe:`Operations for hostnames`,builder:e=>e.command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Get whether zone-level authenticated origin pulls is enabled or not. It is false by default.`,builder:k,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.originTlsClientAuth.settings.get({zone_id:r})),{successLabel:`Loaded`})}};function j(e){return e.option(`enabled`,{type:`boolean`,description:`Indicates whether zone-level authenticated origin pulls is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update`,describe:`Enable or disable zone-level authenticated origin pulls. 'enabled' should be set true either before/after the certificate is uploaded to see the certificate in use.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({enabled:e.enabled}):a(e.body)});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.originTlsClientAuth.settings.update({...t,zone_id:r})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({enabled:e.enabled});s(await l(`Updating`,async()=>n.originTlsClientAuth.settings.update({...u,zone_id:r})),{successLabel:`Updated`})}},N={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`certificate`,{type:`string`,description:`The zone's leaf certificate.`}).option(`private-key`,{type:`string`,description:`The zone's private key.`}).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:`Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is important to keep only one certificate active. Also, make sure to enable zone-level authenticated origin pulls by making a PUT call to settings endpoint to see the uploaded certificate in use.`,builder:P,handler:async n=>{if(n.dryRun){c({command:`cf origin-tls-client-auth zone-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({certificate:u(n.certificate,`certificate`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Creating`,async()=>r.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}n.certificate===void 0&&(n.certificate=await e(`certificate`,`The zone's leaf certificate.`)),n[`private-key`]===void 0&&(n[`private-key`]=await e(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=o({certificate:u(n.certificate,`certificate`,`text`),private_key:u(n[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.zoneCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function I(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 L={command:`delete <certificate-id>`,describe:`Removes a client certificate used for zone-level authenticated origin pulls.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
4
4
  `);return}s(await l(`Deleting`,async()=>r.originTlsClientAuth.zoneCertificates.delete({zone_id:a,certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function R(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 z={command:`get <certificate-id>`,describe:`Retrieves details for a specific client certificate used in zone-level authenticated origin pulls.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.originTlsClientAuth.zoneCertificates.get({zone_id:r,certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`Lists all client certificates configured for zone-level authenticated origin pulls.`,builder:B,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.originTlsClientAuth.zoneCertificates.list({zone_id:r})),{successLabel:`Loaded`})}},H={command:`zone-certificates`,describe:`Operations for zone-certificates`,builder:e=>e.command(F).command(L).command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`origin-tls-client-auth`,describe:`Authenticated Origin Pulls — require Cloudflare to present a client certificate when connecting to your origin`,builder:e=>e.command(m).command(C).command(O).command(N).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e,r as t,t as n}from"./theme-BklJDrb2.mjs";function r(e){return typeof e==`object`&&e&&`result`in e&&Array.isArray(e.result)&&`result_info`in e?e.result:e}function i(t,i={}){if(!i.quiet){if(t=r(t),t==null){if(i.successLabel&&process.stderr.isTTY){let t=e();process.stderr.write(`${t.hex(n.success)(`✓`)} ${i.successLabel}\n`)}return}console.log(a(t))}}function a(n){let r=JSON.stringify(n,null,2);if(!t()||r.length>5e4)return r;let i=e();return r.replace(/"([^"]+)":/g,(e,t)=>`${i.cyan(`"${t}"`)}:`).replace(/: "([^"]*)"/g,(e,t)=>`: ${i.green(`"${t}"`)}`).replace(/: (-?\d+\.?\d*)/g,(e,t)=>`: ${i.yellow(t)}`).replace(/: (true|false)/g,(e,t)=>`: ${i.magenta(t)}`).replace(/: (null)/g,(e,t)=>`: ${i.dim(t)}`)}export{i as t};
2
+ import{n as e,r as t,t as n}from"./theme-CFHr0Dh9.mjs";function r(e){return typeof e==`object`&&e&&`result`in e&&Array.isArray(e.result)&&`result_info`in e?e.result:e}function i(t,i={}){if(!i.quiet){if(t=r(t),t==null){if(i.successLabel&&process.stderr.isTTY){let t=e();process.stderr.write(`${t.hex(n.success)(`✓`)} ${i.successLabel}\n`)}return}console.log(a(t))}}function a(n){let r=JSON.stringify(n,null,2);if(!t()||r.length>5e4)return r;let i=e();return r.replace(/"([^"]+)":/g,(e,t)=>`${i.cyan(`"${t}"`)}:`).replace(/: "([^"]*)"/g,(e,t)=>`: ${i.green(`"${t}"`)}`).replace(/: (-?\d+\.?\d*)/g,(e,t)=>`: ${i.yellow(t)}`).replace(/: (true|false)/g,(e,t)=>`: ${i.magenta(t)}`).replace(/: (null)/g,(e,t)=>`: ${i.dim(t)}`)}export{i as t};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{S as e,T as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";import{t as l}from"./cli-types-CRIDdDw3.mjs";function u(e){return e.option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
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";import{t as l}from"./cli-types-CMNMD1V7.mjs";function u(e){return e.option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
3
3
  over another. A higher number indicates a higher priority. For example,
4
4
  if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
5
5
  specific Page Rule to take precedence (rule B: \`/images/special/*\`),
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,E as t,S as n,T as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.positional(`connection-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <connection-id>`,describe:`Fetches a connection detected by Page Shield by connection ID.`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf page-shield connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/page_shield/connections/${e[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(e[`connection-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"connection-id":String(e[`connection-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.pageShield.connections.get({zone_id:r,connection_id:e[`connection-id`]})),{successLabel:`Loaded`})}};function m(e){return e.option(`exclude-urls`,{type:`string`,description:`Excludes connections whose URL contains one of the URL-encoded URLs separated by commas.`}).option(`urls`,{type:`string`,description:`Includes connections whose URL contain one or more URL-encoded URLs separated by commas.`}).option(`hosts`,{type:`string`,description:`Includes connections that match one or more URL-encoded hostnames separated by commas.
2
+ import{D as e,E as t,S as n,T 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"./cli-types-CMNMD1V7.mjs";function f(e){return e.positional(`connection-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <connection-id>`,describe:`Fetches a connection detected by Page Shield by connection ID.`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf page-shield connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/page_shield/connections/${e[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(e[`connection-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"connection-id":String(e[`connection-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.pageShield.connections.get({zone_id:r,connection_id:e[`connection-id`]})),{successLabel:`Loaded`})}};function m(e){return e.option(`exclude-urls`,{type:`string`,description:`Excludes connections whose URL contains one of the URL-encoded URLs separated by commas.`}).option(`urls`,{type:`string`,description:`Includes connections whose URL contain one or more URL-encoded URLs separated by commas.`}).option(`hosts`,{type:`string`,description:`Includes connections that match one or more URL-encoded hostnames separated by commas.
3
3
 
4
4
  Wildcards are supported at the start and end of each hostname to support starts with, ends with
5
5
  and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,i,n as a}from"./auth-ffdf9yR0.mjs";import{n as o,t as s}from"./body-parser-DKa8Ipg1.mjs";import{t as c}from"./output-BJFNwj7b.mjs";import{n as l,t as u}from"./progress-CrCGTq7N.mjs";import{n as d,t as f}from"./input-validation-zEO81MWN.mjs";import{t as p}from"./local-VJaJ3BZ1.mjs";import{t as m}from"./cli-types-CRIDdDw3.mjs";function ee(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
2
+ import{C as e,D as t,T as n,_ as r,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,t as f}from"./input-validation-CTqtyiY9.mjs";import{t as p}from"./local-D8bhHUMK.mjs";import{t as m}from"./cli-types-CMNMD1V7.mjs";function ee(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
3
3
  When disabled, no deployments (production or preview) will be triggered automatically.
4
4
  `}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).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([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].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 --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-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 --source-* flag is set`)}return!0})}const h={command:`create`,describe:`Create a new project.`,builder:ee,handler:async n=>{if(n.dryRun){l({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({build_config:{build_caching:n[`build-config-build-caching`],build_command:d(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:d(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(n.name,`name`,`text`),production_branch:d(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:d(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:d(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:d(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(n[`source-type`],`source-type`,`text`)}}):o(n.body)});return}let i=await a(n),f=n.local?p:await r(i);if(n.accountId=f,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.pages.projects.create({...e,account_id:f})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the project.`)),n[`production-branch`]===void 0&&(n[`production-branch`]=await t(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=s({build_config:{build_caching:n[`build-config-build-caching`],build_command:d(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:d(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(n.name,`name`,`text`),production_branch:d(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:d(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:d(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:d(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(n[`source-type`],`source-type`,`text`)}});c(await u(`Creating`,async()=>i.pages.projects.create({...m,account_id:f})),{successLabel:`Created`})}};function g(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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 _={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
5
5
  `);return}c(await u(`Deleting`,async()=>i.pages.projects.delete({account_id:o,project_name:t[`project-name`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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(`branch`,{type:`string`,description:"The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default."}).option(`commit-dirty`,{type:`string`,description:`Boolean string indicating if the working directory has uncommitted changes.`}).option(`commit-hash`,{type:`string`,description:`Git commit SHA associated with this deployment.`}).option(`commit-message`,{type:`string`,description:`Git commit message associated with this deployment.`}).option(`manifest`,{type:`string`,description:`JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. `}).option(`pages-build-output-dir`,{type:`string`,description:`The build output directory path.`}).option(`wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration file used for this deployment.`})}const y={command:`create <project-name>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:v,handler:async t=>{if(t.dryRun){l({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/deployments`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file,branch:t.branch,"commit-dirty":t[`commit-dirty`],"commit-hash":t[`commit-hash`],"commit-message":t[`commit-message`],manifest:t.manifest,"pages-build-output-dir":t[`pages-build-output-dir`],"wrangler-config-hash":t[`wrangler-config-hash`]}});return}let n=await a(t),o=t.local?p:await r(n);if(t.accountId=o,t.file!==void 0||t.body!==void 0||t.branch!==void 0||t[`commit-dirty`]!==void 0||t[`commit-hash`]!==void 0||t[`commit-message`]!==void 0||t.manifest!==void 0||t[`pages-build-output-dir`]!==void 0||t[`wrangler-config-hash`]!==void 0){let e=new FormData;if(t.file){let n=f(t.file);e.append(`_headers`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`_headers`,t.body);t.branch!==void 0&&e.append(`branch`,String(d(t.branch,`branch`,`text`)??``)),t[`commit-dirty`]!==void 0&&e.append(`commit_dirty`,String(d(t[`commit-dirty`],`commit-dirty`,`text`)??``)),t[`commit-hash`]!==void 0&&e.append(`commit_hash`,String(d(t[`commit-hash`],`commit-hash`,`text`)??``)),t[`commit-message`]!==void 0&&e.append(`commit_message`,String(d(t[`commit-message`],`commit-message`,`text`)??``)),t.manifest!==void 0&&e.append(`manifest`,String(d(t.manifest,`manifest`,`text`)??``)),t[`pages-build-output-dir`]!==void 0&&e.append(`pages_build_output_dir`,String(d(t[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),t[`wrangler-config-hash`]!==void 0&&e.append(`wrangler_config_hash`,String(d(t[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),c(await u(`Creating`,async()=>i(n,`POST`,`/accounts/${o}/pages/projects/${encodeURIComponent(String(t[`project-name`]))}/deployments`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=d(t.body,`body`,`binary`);c(await u(`Creating`,async()=>i(n,`POST`,`/accounts/${o}/pages/projects/${encodeURIComponent(String(t[`project-name`]))}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.pages.projects.deployments.create({account_id:o,project_name:t[`project-name`]})),{successLabel:`Created`})}};function b(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Allow deletion of aliased non-production deployments when a normal delete would be rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:b,handler:async t=>{let i={force:t.force};if(t.dryRun){l({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/deployments/${t[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(t[`deployment-id`]))}`,pathParams:{"deployment-id":String(t[`deployment-id`]??``),"project-name":String(t[`project-name`]??``)},query:i,bodyKind:`none`});return}let o=await a(t),s=t.local?p:await r(o);if(t.accountId=s,!await n({force:!!t.force})){process.stderr.write(`Aborted.