cf 0.7.0 → 0.8.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 (174) hide show
  1. package/dist/_meta/agent-context.json +1 -1
  2. package/dist/_meta/commands.json +9 -112
  3. package/dist/{abuse-reports-BsF9JZPW.mjs → abuse-reports-C6GFnuYE.mjs} +1 -1
  4. package/dist/{account-D8mYiWxQ.mjs → account-DxzpnGA8.mjs} +1 -1
  5. package/dist/{accounts-CJci1Oez.mjs → accounts-6RFDuFLF.mjs} +1 -1
  6. package/dist/{acm-CmCd985Q.mjs → acm-Bndi5Jqo.mjs} +1 -1
  7. package/dist/{addressing-R7p6TRBe.mjs → addressing-C8HB4n_n.mjs} +1 -1
  8. package/dist/ai-B4La9Oqk.mjs +8 -0
  9. package/dist/{ai-audit-B0vJNOZG.mjs → ai-audit-B9kKFhoY.mjs} +1 -1
  10. package/dist/{ai-gateway-D3vJR3My.mjs → ai-gateway-Bx9MzNxL.mjs} +1 -1
  11. package/dist/{ai-search-CNg7W7U4.mjs → ai-search-BgIOIgXd.mjs} +1 -1
  12. package/dist/{alerting-_sdM0B0S.mjs → alerting-DVI-v6mE.mjs} +1 -1
  13. package/dist/{analytics-BFBJhDrP.mjs → analytics-B98epmDb.mjs} +1 -1
  14. package/dist/{analytics_engine-CWhFvyeK.mjs → analytics_engine-DwDePA2c.mjs} +1 -1
  15. package/dist/{api-gateway-D4AIEtUq.mjs → api-gateway-DW2GX64w.mjs} +1 -1
  16. package/dist/{argo-Bjk6nFfs.mjs → argo-DKEx-B66.mjs} +1 -1
  17. package/dist/{artifacts-Ba4b3iOa.mjs → artifacts-BEU8fBqt.mjs} +1 -1
  18. package/dist/{audit-logs-BE0T5All.mjs → audit-logs-DZiEPYL0.mjs} +1 -1
  19. package/dist/{auth-D_zyQbDR.mjs → auth-009DISzb.mjs} +1 -1
  20. package/dist/{auth-CZ0E51rF.mjs → auth-B1CY5zpC.mjs} +2 -2
  21. package/dist/{billing-Dz6Zj8Eq.mjs → billing-10B4_1qb.mjs} +1 -1
  22. package/dist/{bot-management-pFwIbFi-.mjs → bot-management-D51WzJBO.mjs} +1 -1
  23. package/dist/{botnet-feed-BY9uGChY.mjs → botnet-feed-Dw-leAwX.mjs} +1 -1
  24. package/dist/{brand-protection-DkPAk2Cz.mjs → brand-protection-BTYkTsER.mjs} +1 -1
  25. package/dist/{browser-extension-D9P6Yv8i.mjs → browser-extension-BFa5Ky8u.mjs} +1 -1
  26. package/dist/{browser-run-DhHtz4y3.mjs → browser-run-BMA8Z_hI.mjs} +1 -1
  27. package/dist/build-C1FOoThn.mjs +70 -0
  28. package/dist/{cache-DVhkiIGK.mjs → cache-DrX4gWvg.mjs} +1 -1
  29. package/dist/{calls-95zjvIcO.mjs → calls-m4WyL1Rb.mjs} +1 -1
  30. package/dist/{certificate-authorities-BowBqbVq.mjs → certificate-authorities-BA-S8NE-.mjs} +1 -1
  31. package/dist/{cf-BLT7uKJF.mjs → cf-BhDnTcDR.mjs} +7 -7
  32. package/dist/chunk-2SIGYDH3-_JSHaszR.mjs +473 -0
  33. package/dist/{chunk-6IEM75FG-BEjRFMGh.mjs → chunk-Q72B4Q5Z-B-N_eqrM.mjs} +1 -1
  34. package/dist/{client-certificates-D6mE4vJu.mjs → client-certificates-5h-fXoNq.mjs} +1 -1
  35. package/dist/{cloud-connector-DmwsjeFN.mjs → cloud-connector-ywFQuqtV.mjs} +1 -1
  36. package/dist/{cloudforce-one-CG3TT7IN.mjs → cloudforce-one-CPx4C-r3.mjs} +1 -1
  37. package/dist/{completions-DMc_PlIw.mjs → completions-CCRu-jvY.mjs} +1 -1
  38. package/dist/{connectivity-DJkE3crz.mjs → connectivity-y-Gav-Ge.mjs} +1 -1
  39. package/dist/{connector-interrupts-DTgQ7onV.mjs → connector-interrupts-Bs-jfuh8.mjs} +1 -1
  40. package/dist/{connector-telemetry-events-D0rTHDou.mjs → connector-telemetry-events-Bc6f3xpx.mjs} +1 -1
  41. package/dist/{connector-telemetry-snapshots--0QmD3z6.mjs → connector-telemetry-snapshots-Bl54XZ3h.mjs} +1 -1
  42. package/dist/{connectors-zWaZTi2A.mjs → connectors-BnQq_R19.mjs} +1 -1
  43. package/dist/{content-scanning-CGvGf04y.mjs → content-scanning-Bxk-WkSL.mjs} +1 -1
  44. package/dist/{ct-alerting-ebSPSWNC.mjs → ct-alerting-BSn2Jqou.mjs} +1 -1
  45. package/dist/{custom-certificates-CWUrPYLP.mjs → custom-certificates-BBqr4S9W.mjs} +1 -1
  46. package/dist/{custom-csrs-CRtdrF9R.mjs → custom-csrs-CXeBzLUy.mjs} +1 -1
  47. package/dist/{custom-hostnames-CVQSksqq.mjs → custom-hostnames-CfCOedoN.mjs} +1 -1
  48. package/dist/{custom-nameservers-BRwbIdsX.mjs → custom-nameservers-RPXeu7f_.mjs} +1 -1
  49. package/dist/{custom-pages-Ci8sTQX7.mjs → custom-pages-xGG1xo88.mjs} +1 -1
  50. package/dist/{d1-78Ym1P6D.mjs → d1-CRIOfBsJ.mjs} +1 -1
  51. package/dist/{data-security-zmFoMwRU.mjs → data-security-D5Sw5rwj.mjs} +1 -1
  52. package/dist/{dcv-delegation-Dd4FZ2IG.mjs → dcv-delegation-BBnlgr6F.mjs} +1 -1
  53. package/dist/deploy-D0_KIUpW.mjs +2 -0
  54. package/dist/deploy-input-CdWrpzPA.mjs +1178 -0
  55. package/dist/{dev-DSslyDXx.mjs → dev-Bz87BeKt.mjs} +1 -1
  56. package/dist/{diagnostics-B8Ev5m_o.mjs → diagnostics-C1qryRf4.mjs} +1 -1
  57. package/dist/{dispatch-namespaces-Dm5vGeEP.mjs → dispatch-namespaces-DbosPgPV.mjs} +1 -1
  58. package/dist/{dist-BH-4NQOV.mjs → dist-C-6VkMPZ.mjs} +35 -35
  59. package/dist/dist-CnaLMpVH.mjs +18 -0
  60. package/dist/{dns-D7VAaCyO.mjs → dns-ByufYrJH.mjs} +1 -1
  61. package/dist/{dns-firewall-ByLCsf0q.mjs → dns-firewall-CiokCKRr.mjs} +1 -1
  62. package/dist/{durable-objects-BIpvyu9m.mjs → durable-objects-DjF-WAD3.mjs} +1 -1
  63. package/dist/{email-auth-Cx--s8W4.mjs → email-auth-B4BIYMb-.mjs} +1 -1
  64. package/dist/{email-routing-CiDbivcN.mjs → email-routing-BbbtpVyS.mjs} +1 -1
  65. package/dist/{email-security-BYeAuSc6.mjs → email-security-DuBVypAO.mjs} +1 -1
  66. package/dist/{email-sending-Dg2rSmHH.mjs → email-sending-5g-k05Lv.mjs} +1 -1
  67. package/dist/{filters-DZ8YnQ90.mjs → filters-CzJmLFcS.mjs} +1 -1
  68. package/dist/{firewall-DEd1hs_I.mjs → firewall-CjmeWA2M.mjs} +1 -1
  69. package/dist/{flagship-DVw7xGoP.mjs → flagship-BfyVrWP-.mjs} +1 -1
  70. package/dist/{fraud-BbGS3FZs.mjs → fraud-reRvxNg-.mjs} +1 -1
  71. package/dist/{google-tag-gateway-CBnRGYQR.mjs → google-tag-gateway-CGwzMZU1.mjs} +1 -1
  72. package/dist/{healthchecks-Da9N3ix4.mjs → healthchecks-BhCsPWcG.mjs} +1 -1
  73. package/dist/{hostnames-mimZu2tB.mjs → hostnames-JpgQW4kn.mjs} +1 -1
  74. package/dist/{hyperdrive-BNdvxOos.mjs → hyperdrive-iwYttuwV.mjs} +1 -1
  75. package/dist/{iam-DGQ-OgRl.mjs → iam-ffI98_4v.mjs} +1 -1
  76. package/dist/{images-CI6Iy9ho.mjs → images-Bgb9DGlr.mjs} +1 -1
  77. package/dist/index.mjs +1 -1
  78. package/dist/{intel-BDB-aRtU.mjs → intel-DVRjKpyU.mjs} +1 -1
  79. package/dist/{ips-B9UuPvsY.mjs → ips-BtLRO19r.mjs} +1 -1
  80. package/dist/{keyless-certificates-Ua9uJgPt.mjs → keyless-certificates-13w8KOcC.mjs} +1 -1
  81. package/dist/{kv-BHerx4dZ.mjs → kv-CvQyF_NB.mjs} +1 -1
  82. package/dist/{leaked-credential-checks-B8Vunj9h.mjs → leaked-credential-checks-DvY8VReW.mjs} +1 -1
  83. package/dist/{load-balancers-DSjS5WKw.mjs → load-balancers-6lgExyS7.mjs} +1 -1
  84. package/dist/{logexplorer-DBIfTlRP.mjs → logexplorer-DBfrK1hn.mjs} +1 -1
  85. package/dist/{logo-matches-C00iGpzW.mjs → logo-matches-XS2RaxQu.mjs} +1 -1
  86. package/dist/{logos-CJLhx1go.mjs → logos-COtlpbRq.mjs} +1 -1
  87. package/dist/{logpush-Cr1U-eK-.mjs → logpush-CIpiK3Xl.mjs} +1 -1
  88. package/dist/{logs-DMvtchc6.mjs → logs-0KjIf_3g.mjs} +1 -1
  89. package/dist/{magic-cloud-networking-FQfO8QWH.mjs → magic-cloud-networking-q_d9-he-.mjs} +1 -1
  90. package/dist/{magic-network-monitoring-CDd70fJQ.mjs → magic-network-monitoring-DLNCrUsn.mjs} +1 -1
  91. package/dist/{magic-transit-DiKiPUax.mjs → magic-transit-sIwSlzoK.mjs} +1 -1
  92. package/dist/{managed-transforms-fPVUTrAv.mjs → managed-transforms-BKRjmzJS.mjs} +1 -1
  93. package/dist/{matches-B0yHbQ2I.mjs → matches-DZLS60M2.mjs} +1 -1
  94. package/dist/{moq-UgBawOXe.mjs → moq-Dbb9QhC1.mjs} +1 -1
  95. package/dist/{mtls-certificates-xKUbC5EL.mjs → mtls-certificates-BpIqoWpc.mjs} +1 -1
  96. package/dist/{network-interconnects-BJzOE2ny.mjs → network-interconnects-DZwGJFYT.mjs} +1 -1
  97. package/dist/{oauth-DBJ5GSFk.mjs → oauth-DC9g9uK_.mjs} +1 -1
  98. package/dist/{observability-B-1y36QS.mjs → observability-CVLjPAir.mjs} +1 -1
  99. package/dist/{open-YWOUIZ5Y-CFRcYALi.mjs → open-PBXRGS4R-D5C2-7de.mjs} +1 -1
  100. package/dist/{organization-Dq3PClZ7.mjs → organization-BGF8N1QQ.mjs} +1 -1
  101. package/dist/{organizations-AhsQkHyX.mjs → organizations-BInE8nlx.mjs} +1 -1
  102. package/dist/{origin-ca-certificates-CRgF0UyU.mjs → origin-ca-certificates-wPzWcEa0.mjs} +1 -1
  103. package/dist/{origin-post-quantum-encryption-BXTx7DPa.mjs → origin-post-quantum-encryption-t1Cl9hiy.mjs} +1 -1
  104. package/dist/{origin-tls-client-auth-BDw5q-6G.mjs → origin-tls-client-auth-Cvr9D8eq.mjs} +1 -1
  105. package/dist/{page-rules-DqYQ23eg.mjs → page-rules-CMo73oVb.mjs} +1 -1
  106. package/dist/{page-shield-DKdlZOLO.mjs → page-shield-Z23iqabu.mjs} +1 -1
  107. package/dist/{pages-BsXF11Kv.mjs → pages-ByaZvYjA.mjs} +1 -1
  108. package/dist/{pay-per-crawl-BGAwuAP3.mjs → pay-per-crawl-BXTenh_d.mjs} +1 -1
  109. package/dist/{pipelines-D_QhSnGW.mjs → pipelines-7KWm5BYN.mjs} +1 -1
  110. package/dist/{progress-O88q63Bk.mjs → progress-BLQ2xXwD.mjs} +1 -1
  111. package/dist/{prompt-DTAWiEm2.mjs → prompt-DcfYBioA.mjs} +1 -1
  112. package/dist/{queries-CAE95-OH.mjs → queries-Cgx1lQbn.mjs} +1 -1
  113. package/dist/{queues-BBz35Mqd.mjs → queues-jnugmCYI.mjs} +1 -1
  114. package/dist/{r2-Zp99S5xF.mjs → r2-Dllx7F7a.mjs} +1 -1
  115. package/dist/{r2-data-catalog-BeVLZwrE.mjs → r2-data-catalog-CaAAPwKp.mjs} +1 -1
  116. package/dist/{radar-Cij-XVQJ.mjs → radar-DLSHX2_1.mjs} +1 -1
  117. package/dist/{rate-limits-DSdToIWv.mjs → rate-limits-DlVTd6QY.mjs} +1 -1
  118. package/dist/{raw-fetch-DgezeshQ.mjs → raw-fetch-CeW1mW_u.mjs} +1 -1
  119. package/dist/{realtime-kit-9rJcapfM.mjs → realtime-kit-ct8Fu2kO.mjs} +1 -1
  120. package/dist/{registrar-CXViZlah.mjs → registrar-CKTB7QTM.mjs} +1 -1
  121. package/dist/{registrar-sandbox-CvQyjXLJ.mjs → registrar-sandbox-1-nNk6Uy.mjs} +1 -1
  122. package/dist/{request-tracers-DATfBnE9.mjs → request-tracers-DO6lno0x.mjs} +1 -1
  123. package/dist/{resource-sharing-Cmhn6ghR.mjs → resource-sharing-DYhXJw44.mjs} +1 -1
  124. package/dist/{resource-tagging-BTn05AOj.mjs → resource-tagging-CcKWMF9l.mjs} +1 -1
  125. package/dist/{rules-ens3OHme.mjs → rules-DQKR3qb7.mjs} +1 -1
  126. package/dist/{rulesets-bkreZRao.mjs → rulesets-B9fZb_JY.mjs} +1 -1
  127. package/dist/{rum-CpgXFcwl.mjs → rum-BaJio_GD.mjs} +1 -1
  128. package/dist/{schema-validation-Ca6o94ts.mjs → schema-validation-Cqv8KT1B.mjs} +1 -1
  129. package/dist/{scim-C4oT8TMc.mjs → scim-DkYH1dep.mjs} +1 -1
  130. package/dist/{secrets-store-CWEuiDNo.mjs → secrets-store-CMR_pA1t.mjs} +1 -1
  131. package/dist/{security-center-BOvm7xy6.mjs → security-center-DCHfgCq6.mjs} +1 -1
  132. package/dist/{security-txt-BCAUBctN.mjs → security-txt-D19uTyaf.mjs} +1 -1
  133. package/dist/{session-B1ARgLG7.mjs → session-CQpgz61H.mjs} +1 -1
  134. package/dist/{share-DhmVspmL.mjs → share-CfJbt0WU.mjs} +1 -1
  135. package/dist/shared-D0xvDsDl.mjs +2 -0
  136. package/dist/{smart-shield-DZm4fn6z.mjs → smart-shield-BG5WOmi1.mjs} +1 -1
  137. package/dist/{snippets-oQ0u26-z.mjs → snippets-CYiSdx7R.mjs} +1 -1
  138. package/dist/{spawn-ChG5Xi9Z.mjs → spawn-j3dn7A69.mjs} +1 -1
  139. package/dist/{spectrum-Cnkee5Ww.mjs → spectrum-Qvq3yJax.mjs} +1 -1
  140. package/dist/{speed-DqNnvLBD.mjs → speed-vpoB9msm.mjs} +1 -1
  141. package/dist/{src-By-zTCHz.mjs → src-Bn0FyQIp.mjs} +5 -5
  142. package/dist/{ssl-tS3CYZsZ.mjs → ssl-Qw8eVAiS.mjs} +1 -1
  143. package/dist/{state-OsdDJvdj.mjs → state-C2cBU9iK.mjs} +1 -1
  144. package/dist/{stream-Bud9Os5V.mjs → stream-BNbkY3zI.mjs} +1 -1
  145. package/dist/{submit-BtP8she2.mjs → submit-pQNW7uWj.mjs} +1 -1
  146. package/dist/{tenant-CMwHa-tU.mjs → tenant-xkvdAutS.mjs} +1 -1
  147. package/dist/{token-validation-BYC7HTok.mjs → token-validation-5F2AbQCz.mjs} +1 -1
  148. package/dist/triggers-CYdZhJYr.mjs +2 -0
  149. package/dist/{turnstile-CP4nScaL.mjs → turnstile-BSIaunXn.mjs} +1 -1
  150. package/dist/{ui-BNoF0KpD.mjs → ui-CTo5OG9r.mjs} +1 -1
  151. package/dist/{url-info-Chs9h7Y-.mjs → url-info-Q7m7AVih.mjs} +1 -1
  152. package/dist/{url-normalization-XYxW5Gj0.mjs → url-normalization-Bs2m5jlD.mjs} +1 -1
  153. package/dist/{url-scanner-D4pYNlO-.mjs → url-scanner-CYmT3C99.mjs} +1 -1
  154. package/dist/{user-DtefniLc.mjs → user-Bay_0p3C.mjs} +1 -1
  155. package/dist/{vectorize-BeAY2g-7.mjs → vectorize-cP2OuB5N.mjs} +1 -1
  156. package/dist/{versions-dMW3bLVv.mjs → versions-D7F26fhH.mjs} +1 -1
  157. package/dist/{waiting-rooms-K78HeeTg.mjs → waiting-rooms-B5HR1-37.mjs} +1 -1
  158. package/dist/{web3-Dhw79l4S.mjs → web3-DqCXM4sx.mjs} +1 -1
  159. package/dist/{workers-l3zMNOU6.mjs → workers-Cu-A8AZc.mjs} +1 -1
  160. package/dist/{workers-builds-CuOAB3u4.mjs → workers-builds-CmCg27M-.mjs} +1 -1
  161. package/dist/{workflows-rb7RYBKP.mjs → workflows-DavS4SEh.mjs} +1 -1
  162. package/dist/{zaraz-CHecMYuo.mjs → zaraz-CKcVy5Xa.mjs} +1 -1
  163. package/dist/{zero-trust-DAZoa-Aj.mjs → zero-trust-BKVqb2yq.mjs} +1 -1
  164. package/dist/{zone-BnnqJwW-.mjs → zone-BOcuY4sU.mjs} +1 -1
  165. package/dist/{zones-DpI2YikF.mjs → zones-BR-9WaY7.mjs} +1 -1
  166. package/package.json +5 -4
  167. package/dist/ai-BzJg0RIX.mjs +0 -3
  168. package/dist/build-CWuStmDi.mjs +0 -2
  169. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +0 -397
  170. package/dist/deploy-CVvkZFjR.mjs +0 -2
  171. package/dist/lib-Og5sB51C.mjs +0 -68
  172. package/dist/shared-Bod3-Exx.mjs +0 -990
  173. /package/dist/{schema-DCF4yEp_.mjs → schema-DAW-B7wT.mjs} +0 -0
  174. /package/dist/{tools-Dru4l8yh.mjs → tools-BpNGzfj2.mjs} +0 -0
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./auth-CZ0E51rF.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-O88q63Bk.mjs";import{t as i}from"./cli-types-CFw6Xygp.mjs";function a(e){return e.positional(`organization-id`,{type:`string`,description:`Identifies the Cloudflare organization.`,demandOption:!0}).option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`get <organization-id>`,describe:"Returns cost and usage data for all accounts within an organization, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. The response includes usage for every account belonging to the specified organization. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.",builder:a,handler:async i=>{let a={from:i.from,to:i.to};if(i.dryRun){n({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.billing.usage.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},s={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},c={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function l(e){return e.positional(`organization-id`,{type:`string`,description:`The unique id that identifies the organization.`,demandOption:!0}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor's user ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an organization.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor's user ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:i(l),handler:async i=>{let a={action_result:i[`action-result`],action_type:i[`action-type`],actor_context:i[`actor-context`],actor_email:i[`actor-email`],actor_id:i[`actor-id`],actor_ip_address:i[`actor-ip-address`],actor_token_id:i[`actor-token-id`],actor_token_name:i[`actor-token-name`],actor_type:i[`actor-type`],id:i.id,raw_cf_ray_id:i[`raw-cf-ray-id`],raw_method:i[`raw-method`],raw_status_code:i[`raw-status-code`],raw_uri:i[`raw-uri`],resource_id:i[`resource-id`],resource_product:i[`resource-product`],resource_type:i[`resource-type`],resource_scope:i[`resource-scope`],"action_result.not":i[`action-result-not`],"action_type.not":i[`action-type-not`],"actor_context.not":i[`actor-context-not`],"actor_email.not":i[`actor-email-not`],"actor_id.not":i[`actor-id-not`],"actor_ip_address.not":i[`actor-ip-address-not`],"actor_token_id.not":i[`actor-token-id-not`],"actor_token_name.not":i[`actor-token-name-not`],"actor_type.not":i[`actor-type-not`],"id.not":i[`id-not`],"raw_cf_ray_id.not":i[`raw-cf-ray-id-not`],"raw_method.not":i[`raw-method-not`],"raw_status_code.not":i[`raw-status-code-not`],"raw_uri.not":i[`raw-uri-not`],"resource_id.not":i[`resource-id-not`],"resource_product.not":i[`resource-product-not`],"resource_type.not":i[`resource-type-not`],"resource_scope.not":i[`resource-scope-not`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},d={command:`audit`,describe:`Logs operations`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(c).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
2
+ import{n as e}from"./auth-B1CY5zpC.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-BLQ2xXwD.mjs";import{t as i}from"./cli-types-CFw6Xygp.mjs";function a(e){return e.positional(`organization-id`,{type:`string`,description:`Identifies the Cloudflare organization.`,demandOption:!0}).option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`get <organization-id>`,describe:"Returns cost and usage data for all accounts within an organization, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. The response includes usage for every account belonging to the specified organization. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.",builder:a,handler:async i=>{let a={from:i.from,to:i.to};if(i.dryRun){n({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.billing.usage.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},s={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},c={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function l(e){return e.positional(`organization-id`,{type:`string`,description:`The unique id that identifies the organization.`,demandOption:!0}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor's user ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an organization.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor's user ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:i(l),handler:async i=>{let a={action_result:i[`action-result`],action_type:i[`action-type`],actor_context:i[`actor-context`],actor_email:i[`actor-email`],actor_id:i[`actor-id`],actor_ip_address:i[`actor-ip-address`],actor_token_id:i[`actor-token-id`],actor_token_name:i[`actor-token-name`],actor_type:i[`actor-type`],id:i.id,raw_cf_ray_id:i[`raw-cf-ray-id`],raw_method:i[`raw-method`],raw_status_code:i[`raw-status-code`],raw_uri:i[`raw-uri`],resource_id:i[`resource-id`],resource_product:i[`resource-product`],resource_type:i[`resource-type`],resource_scope:i[`resource-scope`],"action_result.not":i[`action-result-not`],"action_type.not":i[`action-type-not`],"actor_context.not":i[`actor-context-not`],"actor_email.not":i[`actor-email-not`],"actor_id.not":i[`actor-id-not`],"actor_ip_address.not":i[`actor-ip-address-not`],"actor_token_id.not":i[`actor-token-id-not`],"actor_token_name.not":i[`actor-token-name-not`],"actor_type.not":i[`actor-type-not`],"id.not":i[`id-not`],"raw_cf_ray_id.not":i[`raw-cf-ray-id-not`],"raw_method.not":i[`raw-method-not`],"raw_status_code.not":i[`raw-status-code-not`],"raw_uri.not":i[`raw-uri-not`],"resource_id.not":i[`resource-id-not`],"resource_product.not":i[`resource-product-not`],"resource_type.not":i[`resource-type-not`],"resource_scope.not":i[`resource-scope-not`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},d={command:`audit`,describe:`Logs operations`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(c).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{n as e}from"./auth-CZ0E51rF.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-O88q63Bk.mjs";import{n as i,t as a}from"./body-parser-BO6mfo_W.mjs";import{n as o}from"./input-validation-BwUR9z8e.mjs";import{n as s,r as c,t as l}from"./prompt-DTAWiEm2.mjs";import{t as u}from"./cli-types-CFw6Xygp.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 l=>{if(l.dryRun){n({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:l.body===void 0?a({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]}):i(l.body)});return}let u=await e(l);if(l.body){let e=i(l.body);t(await r(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);l[`request-type`]===void 0&&(l[`request-type`]=await s(`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:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]});t(await r(`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await l({force:!!i.force})){process.stderr.write(`Aborted.
2
+ import{n as e}from"./auth-B1CY5zpC.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-BLQ2xXwD.mjs";import{n as i,t as a}from"./body-parser-BO6mfo_W.mjs";import{n as o}from"./input-validation-BwUR9z8e.mjs";import{n as s,r as c,t as l}from"./prompt-DcfYBioA.mjs";import{t as u}from"./cli-types-CFw6Xygp.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 l=>{if(l.dryRun){n({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:l.body===void 0?a({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]}):i(l.body)});return}let u=await e(l);if(l.body){let e=i(l.body);t(await r(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);l[`request-type`]===void 0&&(l[`request-type`]=await s(`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:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]});t(await r(`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await l({force:!!i.force})){process.stderr.write(`Aborted.
3
3
  `);return}t(await r(`Deleting`,async()=>a.originCaCertificates.delete({certificate_id:i[`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.originCaCertificates.get({certificate_id:i[`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 i=>{let a={zone_id:i[`zone-id`],page:i.page,per_page:i[`per-page`],limit:i.limit,offset:i.offset};if(i.dryRun){n({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.originCaCertificates.list(a)),{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{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c}from"./prompt-DTAWiEm2.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 a=>{if(a.dryRun){r({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.originPostQuantumEncryption.get({zone_id:s})),{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){r({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?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`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{D as e}from"./oauth-DC9g9uK_.mjs";import{n as t}from"./auth-B1CY5zpC.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-BLQ2xXwD.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c}from"./prompt-DcfYBioA.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 a=>{if(a.dryRun){r({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.originPostQuantumEncryption.get({zone_id:s})),{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){r({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?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`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}from"./oauth-DBJ5GSFk.mjs";import{i as t,n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{n as o,t as s}from"./body-parser-BO6mfo_W.mjs";import{n as c}from"./input-validation-BwUR9z8e.mjs";import{r as l,t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.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 t=>{let o={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.originTlsClientAuth.hostnameAssociations.list({zone_id:c,...o})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The hostname certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
2
+ import{D as e}from"./oauth-DC9g9uK_.mjs";import{i as t,n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{n as o,t as s}from"./body-parser-BO6mfo_W.mjs";import{n as c}from"./input-validation-BwUR9z8e.mjs";import{r as l,t as u}from"./prompt-DcfYBioA.mjs";import{t as d}from"./cli-types-CFw6Xygp.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 t=>{let o={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.originTlsClientAuth.hostnameAssociations.list({zone_id:c,...o})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The hostname certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>o.originTlsClientAuth.hostnameCertificates.delete({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.get({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.list({zone_id:s})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{hostname:String(t.hostname??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnames.get({zone_id:s,hostname:t.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 s=>{if(s.dryRun){i({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.originTlsClientAuth.hostnames.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.settings.get({zone_id:s})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({enabled:t.enabled}):o(t.body)});return}let c=await n(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=o(t.body);r(await a(`Updating`,async()=>c.originTlsClientAuth.settings.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=s({enabled:t.enabled});r(await a(`Updating`,async()=>c.originTlsClientAuth.settings.update({...u,zone_id:l})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's leaf certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
4
4
  `);return}r(await a(`Deleting`,async()=>o.originTlsClientAuth.zoneCertificates.delete({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.get({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.list({zone_id:s})),{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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{t as c}from"./prompt-DTAWiEm2.mjs";import{t as l}from"./cli-types-CFw6Xygp.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{D as e}from"./oauth-DC9g9uK_.mjs";import{n as t}from"./auth-B1CY5zpC.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-BLQ2xXwD.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{t as c}from"./prompt-DcfYBioA.mjs";import{t as l}from"./cli-types-CFw6Xygp.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}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c,r as l,t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.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 a=>{if(a.dryRun){r({command:`cf page-shield connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/connections/${a[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(a[`connection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"connection-id":String(a[`connection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.connections.get({zone_id:s,connection_id:a[`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}from"./oauth-DC9g9uK_.mjs";import{n as t}from"./auth-B1CY5zpC.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-BLQ2xXwD.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c,r as l,t as u}from"./prompt-DcfYBioA.mjs";import{t as d}from"./cli-types-CFw6Xygp.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 a=>{if(a.dryRun){r({command:`cf page-shield connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/connections/${a[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(a[`connection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"connection-id":String(a[`connection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.connections.get({zone_id:s,connection_id:a[`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{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.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{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{r as f,t as p}from"./prompt-DcfYBioA.mjs";import{t as m}from"./cli-types-CFw6Xygp.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){a({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({build_config:{build_caching:n[`build-config-build-caching`],build_command:u(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(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:u(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:u(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(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:u(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:u(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(n.name,`name`,`text`),production_branch:u(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:u(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(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:u(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:u(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(n[`source-type`],`source-type`,`text`)}}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.pages.projects.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await f(`name`,`Name of the project.`)),n[`production-branch`]===void 0&&(n[`production-branch`]=await f(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=l({build_config:{build_caching:n[`build-config-build-caching`],build_command:u(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(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:u(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:u(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(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:u(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:u(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(n.name,`name`,`text`),production_branch:u(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:u(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(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:u(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:u(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(n[`source-type`],`source-type`,`text`)}});i(await o(`Creating`,async()=>d.pages.projects.create({...m,account_id:p})),{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 n=>{if(n.dryRun){a({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>c.pages.projects.delete({account_id:l,project_name:n[`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 c=>{if(c.dryRun){a({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${c[`project-name`]==null?`<project-name>`:encodeURIComponent(String(c[`project-name`]))}/deployments`,pathParams:{"project-name":String(c[`project-name`]??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file,branch:c.branch,"commit-dirty":c[`commit-dirty`],"commit-hash":c[`commit-hash`],"commit-message":c[`commit-message`],manifest:c.manifest,"pages-build-output-dir":c[`pages-build-output-dir`],"wrangler-config-hash":c[`wrangler-config-hash`]}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.branch!==void 0||c[`commit-dirty`]!==void 0||c[`commit-hash`]!==void 0||c[`commit-message`]!==void 0||c.manifest!==void 0||c[`pages-build-output-dir`]!==void 0||c[`wrangler-config-hash`]!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`_headers`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`_headers`,c.body);c.branch!==void 0&&e.append(`branch`,String(u(c.branch,`branch`,`text`)??``)),c[`commit-dirty`]!==void 0&&e.append(`commit_dirty`,String(u(c[`commit-dirty`],`commit-dirty`,`text`)??``)),c[`commit-hash`]!==void 0&&e.append(`commit_hash`,String(u(c[`commit-hash`],`commit-hash`,`text`)??``)),c[`commit-message`]!==void 0&&e.append(`commit_message`,String(u(c[`commit-message`],`commit-message`,`text`)??``)),c.manifest!==void 0&&e.append(`manifest`,String(u(c.manifest,`manifest`,`text`)??``)),c[`pages-build-output-dir`]!==void 0&&e.append(`pages_build_output_dir`,String(u(c[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),c[`wrangler-config-hash`]!==void 0&&e.append(`wrangler_config_hash`,String(u(c[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.pages.projects.deployments.create({account_id:f,project_name:c[`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 n=>{let c={force:n.force};if(n.dryRun){a({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,!await p({force:!!n.force})){process.stderr.write(`Aborted.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,O as t,w as n}from"./oauth-DBJ5GSFk.mjs";import{n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{t as c}from"./cli-types-CFw6Xygp.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:`list`,describe:`Lists the crawlers known to pay-per-crawl.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl crawlers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/crawlers`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.crawlers.list({account_id:l})),{successLabel:`Loaded`})}},d={command:`crawlers`,describe:`Operations for crawlers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get-signature-link`,describe:`Gets a download link for the account's signed pay-per-crawl terms.`,builder:f,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl terms get-signature-link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/signature_link`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.terms.getSignatureLink({account_id:l})),{successLabel:`Loaded`})}};function m(e){return e.option(`remote`,{type:`boolean`,description:`Refresh the signature status from Ironclad.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get-signature`,describe:`Gets the account's pay-per-crawl terms signature status.`,builder:m,handler:async e=>{let c={remote:e.remote};if(e.dryRun){a({command:`cf pay-per-crawl terms get-signature`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Loading`,async()=>l.payPerCrawl.terms.getSignature({account_id:u,...c})),{successLabel:`Loaded`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets the pay-per-crawl terms and conditions contract.`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl terms get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.terms.get({account_id:l})),{successLabel:`Loaded`})}};function v(e){return e.option(`event-type`,{type:`string`,description:`The terms activity to record.`,choices:[`agreed`,`displayed`],demandOption:!0}).option(`vid`,{type:`string`,description:`Ironclad contract version ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`send-signature-event`,describe:`Records that an account displayed or agreed to the pay-per-crawl terms.`,builder:c(v),handler:async e=>{let c={event_type:e[`event-type`],vid:e.vid};if(e.dryRun){a({command:`cf pay-per-crawl terms send-signature-event`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Creating`,async()=>l.payPerCrawl.terms.sendSignatureEvent({account_id:u,...c})),{successLabel:`Created`})}},b={command:`terms`,describe:`Operations for terms`,builder:e=>e.command(_).command(h).command(p).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-can-be-enabled`,describe:`Gets whether pay-per-crawl can be enabled for a zone.`,builder:x,handler:async t=>{if(t.dryRun){a({command:`cf pay-per-crawl zones get-can-be-enabled`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/pay-per-crawl/can_be_enabled`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.payPerCrawl.zones.getCanBeEnabled({zone_id:s})),{successLabel:`Loaded`})}},C={command:`zones`,describe:`Operations for zones`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`pay-per-crawl`,describe:`pay-per-crawl`,builder:e=>e.command(d).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
2
+ import{D as e,O as t,w as n}from"./oauth-DC9g9uK_.mjs";import{n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{t as c}from"./cli-types-CFw6Xygp.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:`list`,describe:`Lists the crawlers known to pay-per-crawl.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl crawlers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/crawlers`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.crawlers.list({account_id:l})),{successLabel:`Loaded`})}},d={command:`crawlers`,describe:`Operations for crawlers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get-signature-link`,describe:`Gets a download link for the account's signed pay-per-crawl terms.`,builder:f,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl terms get-signature-link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/signature_link`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.terms.getSignatureLink({account_id:l})),{successLabel:`Loaded`})}};function m(e){return e.option(`remote`,{type:`boolean`,description:`Refresh the signature status from Ironclad.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get-signature`,describe:`Gets the account's pay-per-crawl terms signature status.`,builder:m,handler:async e=>{let c={remote:e.remote};if(e.dryRun){a({command:`cf pay-per-crawl terms get-signature`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Loading`,async()=>l.payPerCrawl.terms.getSignature({account_id:u,...c})),{successLabel:`Loaded`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets the pay-per-crawl terms and conditions contract.`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl terms get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.terms.get({account_id:l})),{successLabel:`Loaded`})}};function v(e){return e.option(`event-type`,{type:`string`,description:`The terms activity to record.`,choices:[`agreed`,`displayed`],demandOption:!0}).option(`vid`,{type:`string`,description:`Ironclad contract version ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`send-signature-event`,describe:`Records that an account displayed or agreed to the pay-per-crawl terms.`,builder:c(v),handler:async e=>{let c={event_type:e[`event-type`],vid:e.vid};if(e.dryRun){a({command:`cf pay-per-crawl terms send-signature-event`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Creating`,async()=>l.payPerCrawl.terms.sendSignatureEvent({account_id:u,...c})),{successLabel:`Created`})}},b={command:`terms`,describe:`Operations for terms`,builder:e=>e.command(_).command(h).command(p).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-can-be-enabled`,describe:`Gets whether pay-per-crawl can be enabled for a zone.`,builder:x,handler:async t=>{if(t.dryRun){a({command:`cf pay-per-crawl zones get-can-be-enabled`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/pay-per-crawl/can_be_enabled`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.payPerCrawl.zones.getCanBeEnabled({zone_id:s})),{successLabel:`Loaded`})}},C={command:`zones`,describe:`Operations for zones`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`pay-per-crawl`,describe:`pay-per-crawl`,builder:e=>e.command(d).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DTAWiEm2.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new Pipeline.`,builder:p,handler:async u=>{if(u.dryRun){i({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Pipeline.`)),u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)});r(await a(`Creating`,async()=>f.pipelines.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:h,handler:async s=>{if(s.dryRun){i({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DcfYBioA.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new Pipeline.`,builder:p,handler:async u=>{if(u.dryRun){i({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Pipeline.`)),u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)});r(await a(`Creating`,async()=>f.pipelines.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:h,handler:async s=>{if(s.dryRun){i({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>c.pipelines.delete({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <pipeline-id>`,describe:`Get Pipeline details.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.get({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`legacy-create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async f=>{if(f.dryRun){i({command:`cf pipelines legacy-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.pipelines.legacyCreate({...e,account_id:m})),{successLabel:`Created`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});r(await a(`Creating`,async()=>p.pipelines.legacyCreate({...h,account_id:m})),{successLabel:`Created`})}};function x(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:x,handler:async s=>{if(s.dryRun){i({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
4
4
  `);return}r(await a(`Deleting`,async()=>c.pipelines.legacyDelete({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async s=>{if(s.dryRun){i({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.legacyGet({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`legacy-list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:T,handler:async s=>{let c={search:s.search,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.legacyList({account_id:u,...c})),{successLabel:`Loaded`})}};function D(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`]}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async f=>{if(f.dryRun){i({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${f[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(f[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(f[`pipeline-name`]??``)},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Updating`,async()=>p.pipelines.legacyUpdate({...e,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});r(await a(`Updating`,async()=>p.pipelines.legacyUpdate({...h,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`})}};function k(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List/Filter Pipelines in Account.`,builder:k,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],name:s.name};if(s.dryRun){i({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`config-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`,`config-rolling-policy-file-size-bytes`,`config-rolling-policy-inactivity-seconds`,`config-rolling-policy-interval-seconds`,`config-namespace`,`config-table-name`,`config-token`].some(t=>e[t]!==void 0)){let t={"config-credentials-access-key-id":[`config-namespace`,`config-table-name`,`config-token`],"config-credentials-secret-access-key":[`config-namespace`,`config-table-name`,`config-token`]},n=[`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0}).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-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 --format-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-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 --schema-* flag is set`)}return!0})}const M={command:`create`,describe:`Create a new Sink.`,builder:j,handler:async f=>{if(f.dryRun){i({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:l(f[`format-type`],`format-type`,`text`),compression:l(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{format:{decimal_encoding:l(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:l(f[`schema-format-type`],`schema-format-type`,`text`),compression:l(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`Defines the name of the Sink.`)),f.type===void 0&&(f.type=await u(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:l(f[`format-type`],`format-type`,`text`),compression:l(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{format:{decimal_encoding:l(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:l(f[`schema-format-type`],`schema-format-type`,`text`),compression:l(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)});r(await a(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function N(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete sink forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`delete <sink-id>`,describe:`Delete Sink in Account.`,builder:N,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await f({force:!!s.force})){process.stderr.write(`Aborted.
5
5
  `);return}r(await a(`Deleting`,async()=>l.pipelines.sinks.delete({account_id:u,sink_id:s[`sink-id`],...c})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:F,handler:async s=>{if(s.dryRun){i({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.sinks.get({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List/Filter Sinks in Account.`,builder:L,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.sinks.list({account_id:u,...c})),{successLabel:`Loaded`})}},z={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding 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)`}).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-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 --format-* flag is set`)}return!0}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].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 --http-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-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 --schema-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].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 --worker_binding-* flag is set`)}return!0})}const V={command:`create`,describe:`Create a new Stream.`,builder:B,handler:async u=>{if(u.dryRun){i({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({format:{decimal_encoding:l(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:l(u[`format-type`],`format-type`,`text`),compression:l(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:l(u.name,`name`,`text`),schema:{format:{decimal_encoding:l(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:l(u[`schema-format-type`],`schema-format-type`,`text`),compression:l(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Stream.`));let m=c({format:{decimal_encoding:l(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:l(u[`format-type`],`format-type`,`text`),compression:l(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:l(u.name,`name`,`text`),schema:{format:{decimal_encoding:l(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:l(u[`schema-format-type`],`schema-format-type`,`text`),compression:l(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}});r(await a(`Creating`,async()=>f.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete stream forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:H,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await f({force:!!s.force})){process.stderr.write(`Aborted.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,t}from"./session-B1ARgLG7.mjs";import{r as n}from"./theme-DbNbIY4d.mjs";import{a as r}from"./dist-B7hsuvbF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
2
+ import{a as e,t}from"./session-CQpgz61H.mjs";import{r as n}from"./theme-DbNbIY4d.mjs";import{a as r}from"./dist-B7hsuvbF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,t}from"./session-B1ARgLG7.mjs";import{n,t as r}from"./theme-DbNbIY4d.mjs";import{C as i,p as a}from"./oauth-DBJ5GSFk.mjs";import{i as o,o as s,r as c,t as l}from"./dist-B7hsuvbF.mjs";function u(){t(e)}async function d(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
2
+ import{a as e,t}from"./session-CQpgz61H.mjs";import{n,t as r}from"./theme-DbNbIY4d.mjs";import{C as i,p as a}from"./oauth-DC9g9uK_.mjs";import{i as o,o as s,r as c,t as l}from"./dist-B7hsuvbF.mjs";function u(){t(e)}async function d(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
3
3
  `)?t.slice(0,-1):t}async function f(e,t,n){let r=n?.kind??`text`;if(a()){if(r===`secret`){let t=await d();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let o=`Enter value for --${e}`,l=t||n?.question||o;u();let f=r===`secret`?await c({message:l,mask:`•`,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`}):await s({message:l,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`});return(i(f)||typeof f!=`string`)&&process.exit(130),f}async function p(e,t,n){if(a())throw Error(`--${e} is required (one of: ${n.join(`, `)}). Pass --${e} <value> or run interactively.`);let r=`Select value for --${e}`,s=t||r;u();let c=await o({message:s,options:n.map(e=>({value:e,label:e}))});return(i(c)||typeof c!=`string`)&&process.exit(130),c}async function m(e={}){if(e.force===!0)return!0;let t=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(a()){let e=n();return process.stderr.write(`${e.hex(r.warning)(`?`)} ${t}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}u();let o=await l({message:t,initialValue:!1});return i(o)&&process.exit(130),o===!0}export{p as n,f as r,m as t};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{t as u}from"./prompt-DTAWiEm2.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:d,handler:async c=>{if(c.dryRun){i({command:`cf queries bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries/bulk`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Creating`,async()=>l.queries.bulk.create({...e,account_id:u})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>l.queries.bulk.create({account_id:u})),{successLabel:`Created`})}},p={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).option(`max-time`,{type:`string`,description:`The max_time field`}).option(`min-time`,{type:`string`,description:`The min_time 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:`Return a success message after creating new saved string queries`,builder:m,handler:async u=>{let d={id:u.id,tag:u.tag,scan:u.scan};if(u.dryRun){i({command:`cf queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:d,bodyKind:`json`,body:u.body===void 0?c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r(await a(`Creating`,async()=>f.queries.create({...e,account_id:p,...d})),{successLabel:`Created`});return}let m=c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`)});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r(await a(`Creating`,async()=>f.queries.create({...m,account_id:p,...d})),{successLabel:`Created`})}};function g(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).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`,describe:`Return a success message after deleting saved string queries by ID`,builder:g,handler:async s=>{let c={id:s.id,tag:s.tag,scan:s.scan};if(s.dryRun){i({command:`cf queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),d=s.local?o:await t();if(s.accountId=d,!await u({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{t as u}from"./prompt-DcfYBioA.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:d,handler:async c=>{if(c.dryRun){i({command:`cf queries bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries/bulk`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Creating`,async()=>l.queries.bulk.create({...e,account_id:u})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>l.queries.bulk.create({account_id:u})),{successLabel:`Created`})}},p={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).option(`max-time`,{type:`string`,description:`The max_time field`}).option(`min-time`,{type:`string`,description:`The min_time 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:`Return a success message after creating new saved string queries`,builder:m,handler:async u=>{let d={id:u.id,tag:u.tag,scan:u.scan};if(u.dryRun){i({command:`cf queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:d,bodyKind:`json`,body:u.body===void 0?c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r(await a(`Creating`,async()=>f.queries.create({...e,account_id:p,...d})),{successLabel:`Created`});return}let m=c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`)});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r(await a(`Creating`,async()=>f.queries.create({...m,account_id:p,...d})),{successLabel:`Created`})}};function g(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).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`,describe:`Return a success message after deleting saved string queries by ID`,builder:g,handler:async s=>{let c={id:s.id,tag:s.tag,scan:s.scan};if(s.dryRun){i({command:`cf queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),d=s.local?o:await t();if(s.accountId=d,!await u({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>l.queries.delete({account_id:d,...c})),{successLabel:`Deleted`})}},v={command:`queries`,describe:`queries`,builder:e=>e.command(h).command(_).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{n as d,r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";function h(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const ee={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:h,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)}):c(n.body)});return}let p=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}n.type===void 0&&(n.type=await d(`type`,`The type field`,[`worker`,`http_pull`])),n.type===`worker`&&n[`script-name`]===void 0&&(n[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)});i(await o(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function g(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:g,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{n as d,r as f,t as p}from"./prompt-DcfYBioA.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";function h(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const ee={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:h,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)}):c(n.body)});return}let p=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}n.type===void 0&&(n.type=await d(`type`,`The type field`,[`worker`,`http_pull`])),n.type===`worker`&&n[`script-name`]===void 0&&(n[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)});i(await o(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function g(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:g,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.queues.consumers.delete({account_id:l,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:v,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.consumers.get({account_id:l,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Returns the consumers for a Queue`,builder:b,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.consumers.list({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const C={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:S,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)}):c(n.body)});return}let p=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Updated`});return}n.type===void 0&&(n.type=await d(`type`,`The type field`,[`worker`,`http_pull`])),n.type===`worker`&&n[`script-name`]===void 0&&(n[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)});i(await o(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Updated`})}},w={command:`consumers`,describe:`Operations for consumers`,builder:e=>e.command(ee).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Create a new queue`,builder:T,handler:async n=>{if(n.dryRun){a({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({queue_name:u(n[`queue-name`],`queue-name`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.queues.create({...e,account_id:p})),{successLabel:`Created`});return}n[`queue-name`]===void 0&&(n[`queue-name`]=await f(`queue-name`,`The queue_name field`));let m=l({queue_name:u(n[`queue-name`],`queue-name`,`text`)});i(await o(`Creating`,async()=>d.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:D,handler:async n=>{if(n.dryRun){a({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>c.queues.delete({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:k,handler:async n=>{if(n.dryRun){a({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({queue_name:u(n[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:n[`settings-delivery-delay`],delivery_paused:n[`settings-delivery-paused`],message_retention_period:n[`settings-message-retention-period`]}}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.queues.edit({body:e,account_id:f,queue_id:n[`queue-id`]})),{successLabel:`Updated`});return}let p=l({queue_name:u(n[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:n[`settings-delivery-delay`],delivery_paused:n[`settings-delivery-paused`],message_retention_period:n[`settings-message-retention-period`]}});i(await o(`Updating`,async()=>d.queues.edit({body:p,account_id:f,queue_id:n[`queue-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:j,handler:async n=>{if(n.dryRun){a({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.get({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Returns the queues owned by an account.`,builder:N,handler:async n=>{if(n.dryRun){a({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.list({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:F,handler:async n=>{if(n.dryRun){a({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:c(n.body)});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.queues.messages.ackPreview({...e,account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.queues.messages.ackPreview({account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function L(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:L,handler:async n=>{if(n.dryRun){a({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:c(n.body)});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.queues.messages.ack({...e,account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.queues.messages.ack({account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function z(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:z,handler:async n=>{if(n.dryRun){a({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({delay_seconds:n[`delay-seconds`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.bulkPush({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:n[`delay-seconds`]});i(await o(`Creating`,async()=>u.queues.messages.bulkPush({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function V(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`extendLeases <queue-id>`,describe:"Extend the lease on a message. This creates a new lease ID on your message without incrementing the message's `attempts` counter.",builder:V,handler:async n=>{if(n.dryRun){a({command:`cf queues messages extendLeases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({visibility_timeout_ms:n[`visibility-timeout-ms`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.extendLeases({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({visibility_timeout_ms:n[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>u.queues.messages.extendLeases({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`peek <queue-id>`,describe:`Peek messages from a Queue without leasing them. Messages remain available for subsequent peek or pull operations.`,builder:U,handler:async n=>{if(n.dryRun){a({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({batch_size:n[`batch-size`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.peek({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:n[`batch-size`]});i(await o(`Creating`,async()=>u.queues.messages.peek({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function W(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:W,handler:async n=>{if(n.dryRun){a({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({batch_size:n[`batch-size`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Loading`,async()=>u.queues.messages.preview({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Loaded`});return}let f=l({batch_size:n[`batch-size`]});i(await o(`Loading`,async()=>u.queues.messages.preview({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}};function K(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:K,handler:async n=>{if(n.dryRun){a({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({batch_size:n[`batch-size`],visibility_timeout_ms:n[`visibility-timeout-ms`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.pull({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:n[`batch-size`],visibility_timeout_ms:n[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>u.queues.messages.pull({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function J(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`purge <queue-id>`,describe:`Delete peeked messages from a Queue by their ref. Purged messages aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:J,handler:async l=>{if(l.dryRun){a({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await r(l),d=l.local?s:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>u.queues.messages.purge({...e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>n(u,`POST`,`/accounts/${d}/queues/${encodeURIComponent(String(l[`queue-id`]))}/messages/purge`)),{successLabel:`Created`})}};function X(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:X,handler:async n=>{if(n.dryRun){a({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({delay_seconds:n[`delay-seconds`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.push({body:e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:n[`delay-seconds`]});i(await o(`Creating`,async()=>u.queues.messages.push({body:f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}},Q={command:`messages`,describe:`Operations for messages`,builder:e=>e.command(R).command(I).command(B).command(H).command(te).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:ne,handler:async n=>{if(n.dryRun){a({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/purge`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({delete_messages_permanently:n[`delete-messages-permanently`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,!await p({force:!!n.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
5
5
  `);return}if(n.body){let e=c(n.body);i(await o(`Deleting`,async()=>u.queues.purge.start({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Deleted`});return}let f=l({delete_messages_permanently:n[`delete-messages-permanently`]});i(await o(`Deleting`,async()=>u.queues.purge.start({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Deleted`})}};function ie(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:ie,handler:async n=>{if(n.dryRun){a({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/purge`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.purge.status({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}},oe={command:`purge`,describe:`Operations for purge`,builder:e=>e.command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workers.script`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-script-tag`,{type:`string`,description:`Tag of the Worker script`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-model-name`,[`source-worker-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-script-tag`,[`source-model-name`,`source-worker-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`,`source-script-tag`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const ce={command:`create`,describe:`Create a new event subscription for a queue`,builder:se,handler:async n=>{if(n.dryRun){a({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({destination:{queue_id:u(n[`destination-queue-id`],`destination-queue-id`,`text`),type:u(n[`destination-type`],`destination-type`,`text`)},enabled:n.enabled,events:n.events,name:u(n.name,`name`,`text`),source:{type:u(n[`source-type`],`source-type`,`text`),model_name:u(n[`source-model-name`],`source-model-name`,`text`),worker_name:u(n[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(n[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(n[`source-workflow-name`],`source-workflow-name`,`text`)}}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.queues.subscriptions.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({destination:{queue_id:u(n[`destination-queue-id`],`destination-queue-id`,`text`),type:u(n[`destination-type`],`destination-type`,`text`)},enabled:n.enabled,events:n.events,name:u(n.name,`name`,`text`),source:{type:u(n[`source-type`],`source-type`,`text`),model_name:u(n[`source-model-name`],`source-model-name`,`text`),worker_name:u(n[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(n[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(n[`source-workflow-name`],`source-workflow-name`,`text`)}});i(await o(`Creating`,async()=>d.queues.subscriptions.create({...p,account_id:f})),{successLabel:`Created`})}};function le(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ue={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:le,handler:async n=>{if(n.dryRun){a({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions/${n[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(n[`subscription-id`]))}`,pathParams:{"subscription-id":String(n[`subscription-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.