cf 0.9.1 → 0.11.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 (363) hide show
  1. package/README.md +20 -5
  2. package/dist/_meta/agent-context.json +46 -39
  3. package/dist/_meta/commands.json +9358 -10581
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +14870 -14667
  6. package/dist/abuse-reports-sDBTV0qZ.mjs +8 -0
  7. package/dist/{access-CxyW_sIW.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/account-tags-Bz3JG5hI.mjs +9 -0
  10. package/dist/accounts-DCuW3xyZ.mjs +28 -0
  11. package/dist/{acm-CHacxa3s.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BnqNmmYN.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-qa8SkXlD.mjs → alerting-4T8gmZs-.mjs} +4 -4
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-MfHbfZyf.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/args-DlUhyGU0.mjs +2 -0
  26. package/dist/artifacts-BBfXNfUg.mjs +4 -0
  27. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  28. package/dist/{auth-DuLchM18.mjs → auth-D3X9HYhD.mjs} +3 -3
  29. package/dist/auth-DPhNN3Ly.mjs +5 -0
  30. package/dist/billing-B9e4PnvN.mjs +3 -0
  31. package/dist/body-parser-BshbixEq.mjs +2 -0
  32. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  33. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  34. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  35. package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  36. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  37. package/dist/build-D0FhOj40.mjs +8 -0
  38. package/dist/{cache-Cl7vKJwH.mjs → cache-C6V7PbQM.mjs} +1 -1
  39. package/dist/{calls-DtK_ANxq.mjs → calls-Bye8Tyy-.mjs} +1 -1
  40. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  41. package/dist/cf-Ds4JFovl.mjs +18 -0
  42. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  44. package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  45. package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  46. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  47. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  48. package/dist/command-C9VP3xaA.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  50. package/dist/config.d.mts +1460 -1348
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  53. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  54. package/dist/connector-telemetry-events-latest-BbpcII3_.mjs +2 -0
  55. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  56. package/dist/connector-telemetry-snapshots-latest-DuCiimXl.mjs +2 -0
  57. package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  58. package/dist/containers-BrQtGiNp.mjs +58 -0
  59. package/dist/{content-scan-D03UfK2X.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  60. package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  61. package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  62. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  63. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  64. package/dist/custom-hostnames-C0eiGvG9.mjs +5 -0
  65. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  66. package/dist/custom-pages-DTINMR30.mjs +3 -0
  67. package/dist/d1-sKdExJYF.mjs +20 -0
  68. package/dist/data-security-mV3a6UfW.mjs +7 -0
  69. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  70. package/dist/delegate.mjs +1 -1
  71. package/dist/{deploy-DGlmjPTS.mjs → deploy-BL59O1O1.mjs} +1 -1
  72. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  73. package/dist/{dev-BbLV0Ti-.mjs → dev-BDaavgH1.mjs} +2 -2
  74. package/dist/diagnostics-CJV6qWUA.mjs +3 -0
  75. package/dist/{directory-CCndFkbQ.mjs → directory-B5zCMusW.mjs} +1 -1
  76. package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  77. package/dist/dist-BHi7UhXO.mjs +72 -0
  78. package/dist/dist-BWpErtDM.mjs +384 -0
  79. package/dist/{dls-BBq99pjI.mjs → dls-t0hnIe_P.mjs} +1 -1
  80. package/dist/dns-C8FC2hbh.mjs +29 -0
  81. package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  84. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  85. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  86. package/dist/email-routing-CF3_Z957.mjs +6 -0
  87. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  88. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  89. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  90. package/dist/firewall-8YWWy4iB.mjs +11 -0
  91. package/dist/flagship-C4x0l-8J.mjs +4 -0
  92. package/dist/{fraud-AH47n-wL.mjs → fraud-HR_SdUx3.mjs} +1 -1
  93. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  94. package/dist/{healthchecks-DfEUG007.mjs → healthchecks-4qOvjrTN.mjs} +2 -2
  95. package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-DehdYOMz.mjs} +1 -1
  96. package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  97. package/dist/iam-DR72hmii.mjs +6 -0
  98. package/dist/images-CeKc5JPh.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/intel-DtFix9WL.mjs +8 -0
  101. package/dist/{interactive-mV8PABm6.mjs → interactive-C7M55Wxx.mjs} +1 -1
  102. package/dist/ips-CtWCjXAN.mjs +2 -0
  103. package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  104. package/dist/keys-BmhG6Kn1.mjs +2 -0
  105. package/dist/{kv-Bi9B4E0A.mjs → kv-BuVPAuZP.mjs} +1 -1
  106. package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  107. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  108. package/dist/{local-DTyuGwTw.mjs → local-Be3lg_9E.mjs} +1 -1
  109. package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  110. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  111. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  112. package/dist/logos-DRYjGBDq.mjs +3 -0
  113. package/dist/logpush-Dve9jOMp.mjs +4 -0
  114. package/dist/{logs-DmWWL5f9.mjs → logs-SC86FE89.mjs} +1 -1
  115. package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  116. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  117. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  118. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  119. package/dist/matches-Iss9Fo4R.mjs +2 -0
  120. package/dist/mcp-8wxXT6JU.mjs +4 -0
  121. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  122. package/dist/{moq-CJpE-eNj.mjs → moq-ZKMFOeVz.mjs} +1 -1
  123. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  124. package/dist/{network-D2WRXCDe.mjs → network-B1lBARU9.mjs} +1 -1
  125. package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  126. package/dist/oauth-DuEONNgC.mjs +14 -0
  127. package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  128. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  129. package/dist/observability-Jya7-zkl.mjs +4 -0
  130. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  131. package/dist/{organization-D41rIvJa.mjs → organization-CYxYV4e0.mjs} +6 -6
  132. package/dist/organizations-SacGUW44.mjs +2 -0
  133. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  134. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  135. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  136. package/dist/{output-DgW1hQGX.mjs → output-Ccqw2WOb.mjs} +1 -1
  137. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  138. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  139. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  140. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  141. package/dist/precursor-iwK-1P_d.mjs +4 -0
  142. package/dist/progress-BqQcF5QH.mjs +2 -0
  143. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  144. package/dist/prompt-B0sWIs9c.mjs +3 -0
  145. package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  146. package/dist/queries-c7zvnfEQ.mjs +3 -0
  147. package/dist/queues-BU6y16qS.mjs +6 -0
  148. package/dist/r2-Jo3QMahK.mjs +24 -0
  149. package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  150. package/dist/radar-DIYAMEof.mjs +2 -0
  151. package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-DewOcznT.mjs} +1 -1
  152. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  153. package/dist/realtimekit-cnZEVNDn.mjs +7 -0
  154. package/dist/registrar-BsWr_aPM.mjs +23 -0
  155. package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-BlcpUyIH.mjs} +6 -6
  156. package/dist/{registry-DDcSvd8H.mjs → registry-jifR3_Y6.mjs} +1 -1
  157. package/dist/reporting--1AyTV7k.mjs +2 -0
  158. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  159. package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  160. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  161. package/dist/rules-BfjzALMi.mjs +4 -0
  162. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  163. package/dist/rum-CjmIckiR.mjs +4 -0
  164. package/dist/{schema-BeXPWeK9.mjs → schema-1mwmslUV.mjs} +1 -1
  165. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  166. package/dist/{scim-BgGsmHrL.mjs → scim-pApmzA5B.mjs} +1 -1
  167. package/dist/sdk-ZctLa5jW.mjs +3 -0
  168. package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  169. package/dist/security-center-Djm06dq-.mjs +2 -0
  170. package/dist/{security-txt-Be2Bif0z.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  171. package/dist/{share-Bz2tFTUP.mjs → share-Dj-MNXrw.mjs} +4 -4
  172. package/dist/shared-BJvq4DkR.mjs +290 -0
  173. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  174. package/dist/snippets-Dyz0PH60.mjs +4 -0
  175. package/dist/{spawn-CHkoow5W.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  176. package/dist/{spectrum-BA0a42eM.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  177. package/dist/{speed-mmOjxOzo.mjs → speed-BKepWBXj.mjs} +1 -1
  178. package/dist/src-gJma71Ec.mjs +108 -0
  179. package/dist/{ssl-Yr6kELqg.mjs → ssl-KdFiY3ev.mjs} +1 -1
  180. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  181. package/dist/{state-DZC531l2.mjs → state-Cu3cItUg.mjs} +1 -1
  182. package/dist/{stream-Cu0kYWbc.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  183. package/dist/submit-BxbKKhBn.mjs +2 -0
  184. package/dist/tags-DA8dq9fx.mjs +2 -0
  185. package/dist/tenant-DLXw48hS.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  187. package/dist/{tools-D2Xxfkrc.mjs → tools-x8bj9E6b.mjs} +1 -1
  188. package/dist/{tunnel-CDYkWjnt.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  189. package/dist/tunnels-CC10EOsU.mjs +2 -0
  190. package/dist/turnstile-CH58hnf4.mjs +23 -0
  191. package/dist/{ui-DIpjthrV.mjs → ui-CmnnBm_O.mjs} +1 -1
  192. package/dist/url-info-BpCgdUtL.mjs +2 -0
  193. package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  194. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  195. package/dist/user-2-NGebfI.mjs +12 -0
  196. package/dist/values-S_bNv819.mjs +2 -0
  197. package/dist/{vectorize-CjXfiFH4.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  198. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  199. package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  200. package/dist/web3-GnUocVYH.mjs +4 -0
  201. package/dist/workers-J1-PLwdl.mjs +28 -0
  202. package/dist/{workers-builds-B44wc67O.mjs → workers-builds-DCHmWOMS.mjs} +4 -4
  203. package/dist/{workflows-rFuQWClt.mjs → workflows-CArfEI2c.mjs} +2 -2
  204. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  205. package/dist/zero-trust-DVdUPtj1.mjs +93 -0
  206. package/dist/zone-DMAfrDJX.mjs +2 -0
  207. package/dist/zones-CNwxUi7I.mjs +21 -0
  208. package/package.json +10 -7
  209. package/dist/abuse-reports-CzDAjFpo.mjs +0 -8
  210. package/dist/account-Dd4-tDYJ.mjs +0 -2
  211. package/dist/account-tags-65fAlHrf.mjs +0 -9
  212. package/dist/accounts-Bp5KGc6r.mjs +0 -28
  213. package/dist/agent-memory-D--BQS0W.mjs +0 -6
  214. package/dist/ai-BnVlQDiI.mjs +0 -5
  215. package/dist/ai-audit-CfpDKXkD.mjs +0 -2
  216. package/dist/ai-gateway-oG4j_oYN.mjs +0 -13
  217. package/dist/ai-search-B2l3B_jn.mjs +0 -7
  218. package/dist/ai-security-byjIIrfl.mjs +0 -4
  219. package/dist/analytics-DeIKjC9n.mjs +0 -3
  220. package/dist/analytics_engine-BnECMIWJ.mjs +0 -2
  221. package/dist/argo-DFerMyXF.mjs +0 -2
  222. package/dist/artifacts-CtyEYYDa.mjs +0 -4
  223. package/dist/audit-logs-retFtvow.mjs +0 -2
  224. package/dist/auth-aazs91XL.mjs +0 -5
  225. package/dist/billing-CxQVqpGZ.mjs +0 -3
  226. package/dist/body-parser-CYD7PKFC.mjs +0 -2
  227. package/dist/bot-management-Rli7v7tg.mjs +0 -5
  228. package/dist/botnet-feed-Cw6XSEf8.mjs +0 -3
  229. package/dist/brand-protection-CTvnHGfV.mjs +0 -3
  230. package/dist/browser-run-FwtwnBzA.mjs +0 -4
  231. package/dist/build-Dji9BYmV.mjs +0 -2
  232. package/dist/certificate-authorities-DZP1RzAs.mjs +0 -2
  233. package/dist/cf-oSz9pud_.mjs +0 -18
  234. package/dist/chunk-LQW53VED-Xakf_rUn.mjs +0 -499
  235. package/dist/cloud-connector-BpVcvhjZ.mjs +0 -2
  236. package/dist/cloudforce-one-2PecncfX.mjs +0 -30
  237. package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
  238. package/dist/connector-telemetry-events-D5_3X7XW.mjs +0 -2
  239. package/dist/connector-telemetry-snapshots-CJ9gLRFR.mjs +0 -2
  240. package/dist/containers-Bog7j0Hw.mjs +0 -54
  241. package/dist/custom-certificates-4y35UC1X.mjs +0 -5
  242. package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
  243. package/dist/custom-hostnames-CDIAnsRa.mjs +0 -5
  244. package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
  245. package/dist/custom-pages-vfDxrXbt.mjs +0 -4
  246. package/dist/d1-Cllm-iTT.mjs +0 -20
  247. package/dist/data-security-rnoSCEdL.mjs +0 -7
  248. package/dist/dcv-delegation-DCRCOL6l.mjs +0 -2
  249. package/dist/deploy-input-DhCo1I0I.mjs +0 -242
  250. package/dist/diagnostics-D5Yo2xqx.mjs +0 -3
  251. package/dist/dist-COfwjT96.mjs +0 -72
  252. package/dist/dns-DdQYtenF.mjs +0 -29
  253. package/dist/durable-objects-BvxXBht_.mjs +0 -2
  254. package/dist/email-CGOC_evd.mjs +0 -2
  255. package/dist/email-auth-DFvXKSkg.mjs +0 -2
  256. package/dist/email-routing-QBRPBlyl.mjs +0 -6
  257. package/dist/email-security-BFagcRPP.mjs +0 -18
  258. package/dist/email-sending-Ddhe7xjN.mjs +0 -7
  259. package/dist/filters-CGisPGD1.mjs +0 -4
  260. package/dist/firewall-DD8U-Brd.mjs +0 -11
  261. package/dist/flagship-FJHc4mFi.mjs +0 -4
  262. package/dist/google-tag-gateway-149kbuG_.mjs +0 -2
  263. package/dist/iam-BhHYhMXO.mjs +0 -6
  264. package/dist/images-CDViyKtZ.mjs +0 -8
  265. package/dist/intel-YHZbPlS3.mjs +0 -8
  266. package/dist/ips-BpCdldFx.mjs +0 -2
  267. package/dist/keys-yYtv7Ztr.mjs +0 -2
  268. package/dist/load-balancers-jRCN75mX.mjs +0 -7
  269. package/dist/logexplorer-kO8CULiK.mjs +0 -24
  270. package/dist/logo-matches-LyDAYPbI.mjs +0 -2
  271. package/dist/logos-O9f5bGSB.mjs +0 -3
  272. package/dist/logpush-dtXLu3Ck.mjs +0 -5
  273. package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
  274. package/dist/magic-transit-DwgZeIj-.mjs +0 -111
  275. package/dist/managed-transforms-DCmogkxv.mjs +0 -3
  276. package/dist/matches-BAeN8VM1.mjs +0 -2
  277. package/dist/mcp-DKZ2D050.mjs +0 -4
  278. package/dist/media-CnxgOViL.mjs +0 -2
  279. package/dist/mesh-CzIPtuaM.mjs +0 -4
  280. package/dist/mtls-certificates-Bbm_1lQI.mjs +0 -3
  281. package/dist/oauth-BPizUUqP.mjs +0 -15
  282. package/dist/oauth-scopes-CmbgsPYd.mjs +0 -2
  283. package/dist/observability-DXYgDdU5.mjs +0 -4
  284. package/dist/organizations-eNzfOwlP.mjs +0 -2
  285. package/dist/origin-ca-certificates-DaiAmw45.mjs +0 -3
  286. package/dist/origin-post-quantum-encryption-7YztBged.mjs +0 -2
  287. package/dist/origin-tls-client-auth-DRwURM8s.mjs +0 -4
  288. package/dist/page-rules-B2Csdc4h.mjs +0 -18
  289. package/dist/pages-BAL6Q7OY.mjs +0 -14
  290. package/dist/pay-per-crawl-C-1-ZAtn.mjs +0 -4
  291. package/dist/pipelines-cyQOuFLb.mjs +0 -6
  292. package/dist/precursor-BrweY39h.mjs +0 -4
  293. package/dist/progress-B84wYh91.mjs +0 -2
  294. package/dist/prompt-CDtLWxNv.mjs +0 -3
  295. package/dist/queries-oM8uGZy5.mjs +0 -3
  296. package/dist/queues-CTx04ZNw.mjs +0 -6
  297. package/dist/r2-CnlIUn7R.mjs +0 -24
  298. package/dist/radar-CGNgGh8v.mjs +0 -2
  299. package/dist/raw-fetch-Dz-QBoP_.mjs +0 -2
  300. package/dist/realtimekit-BPwzhNS9.mjs +0 -7
  301. package/dist/registrar-BEcb90RX.mjs +0 -21
  302. package/dist/reporting-CLbjHlnw.mjs +0 -2
  303. package/dist/request-tracers-BcKpofP1.mjs +0 -2
  304. package/dist/resource-tagging-DGEyVTDN.mjs +0 -2
  305. package/dist/rules-CmuB5rIN.mjs +0 -4
  306. package/dist/rulesets-CGaMq8vG.mjs +0 -8
  307. package/dist/rum-QT6EP4JK.mjs +0 -4
  308. package/dist/schema-flags-DHryz6SF.mjs +0 -5
  309. package/dist/sdk-m4xeaua4.mjs +0 -3
  310. package/dist/security-center-BNm4uPVB.mjs +0 -2
  311. package/dist/session-Ckt20hHa.mjs +0 -2
  312. package/dist/shared-BzPQog8H.mjs +0 -2
  313. package/dist/smart-shield-SODkOUyO.mjs +0 -4
  314. package/dist/snippets-B5jY8v_7.mjs +0 -4
  315. package/dist/src-CHW7s5IS.mjs +0 -108
  316. package/dist/submit-Dl_27e0n.mjs +0 -2
  317. package/dist/tags-Cdo_Pwtr.mjs +0 -2
  318. package/dist/tenant-EX-ANl6X.mjs +0 -2
  319. package/dist/tenant-custom-nameservers-BPHUeckw.mjs +0 -3
  320. package/dist/triggers-Bf9hbP3h.mjs +0 -2
  321. package/dist/tunnels-CgyX8R2J.mjs +0 -2
  322. package/dist/turnstile-BUtzlW-0.mjs +0 -23
  323. package/dist/url-info-CJsa1Oc9.mjs +0 -2
  324. package/dist/url-scanner-Cz-yl0_3.mjs +0 -2
  325. package/dist/user-BxHjEqpd.mjs +0 -12
  326. package/dist/values-C43NurfT.mjs +0 -2
  327. package/dist/versions-BFbc90Wu.mjs +0 -2
  328. package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
  329. package/dist/web3-Ctv9HGiR.mjs +0 -4
  330. package/dist/workers-D-YbIedB.mjs +0 -24
  331. package/dist/zaraz-BA6kY-b6.mjs +0 -2
  332. package/dist/zero-trust-DOFLlUz1.mjs +0 -102
  333. package/dist/zone-B_rgejLV.mjs +0 -2
  334. package/dist/zone-tags-BWdza4rH.mjs +0 -9
  335. package/dist/zones-DTWO7Vvn.mjs +0 -21
  336. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  337. /package/dist/{alerts-B85uj2Vx.mjs → alerts-15-IW4jE.mjs} +0 -0
  338. /package/dist/{autorag-Do9l_LyY.mjs → autorag-CFwRkEKw.mjs} +0 -0
  339. /package/dist/{brands-DateHCdd.mjs → brands-BgT1vu9B.mjs} +0 -0
  340. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  341. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  342. /package/dist/{clear-CB2kgcEB.mjs → clear-BlCK85Me.mjs} +0 -0
  343. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  344. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  345. /package/dist/{health-buY5f5pp.mjs → health-DZFfafkX.mjs} +0 -0
  346. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  347. /package/dist/{internal-CwyoJUHh.mjs → internal-BKHC2D1Y.mjs} +0 -0
  348. /package/dist/{live-wEpA5V_n.mjs → live-DwCvDmaH.mjs} +0 -0
  349. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  350. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  351. /package/dist/{ready-CBSCPiHE.mjs → ready-D9H2zHHI.mjs} +0 -0
  352. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  353. /package/dist/{refute-u7ZPQJZy.mjs → refute-2W8NLCN4.mjs} +0 -0
  354. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-B8CyM1mi.mjs} +0 -0
  355. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  356. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-CWhta3x7.mjs} +0 -0
  357. /package/dist/{search-D9WDwnV4.mjs → search-DZmBQJL9.mjs} +0 -0
  358. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  359. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-C98A0bqq.mjs} +0 -0
  360. /package/dist/{theme-BePJemMn.mjs → theme-CrIBazAF.mjs} +0 -0
  361. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  362. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  363. /package/dist/{verify-2yi0H93r.mjs → verify-4e4L9IRk.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";import{n as i,t as a}from"./body-parser-CYD7PKFC.mjs";import{n as o}from"./input-validation-BBKJRoRB.mjs";import{a as s,n as c}from"./prompt-CDtLWxNv.mjs";import{t as l}from"./cli-types-BWdZbsFE.mjs";function u(e){return e.option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
2
+ import{r as e}from"./auth-D3X9HYhD.mjs";import{t}from"./output-Ccqw2WOb.mjs";import{t as n}from"./dry-run-DL2V6yFm.mjs";import{t as r}from"./progress-BqQcF5QH.mjs";import{n as i,r as a,t as o}from"./body-parser-BshbixEq.mjs";import{n as s}from"./input-validation-QDIYu7Vb.mjs";import{a as c,n as l}from"./prompt-B0sWIs9c.mjs";import{t as u}from"./cli-types-DAYeL_Mj.mjs";function d(e){return e.option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
3
3
  a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
4
4
  a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
5
5
  a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
@@ -11,8 +11,8 @@ string.`}).option(`order-by`,{type:`string`,description:"Field to order results
11
11
  provided will retrieve the next page.
12
12
 
13
13
  Parameters used to filter the retrieved list must remain in subsequent
14
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:l(u),handler:async i=>{let a={account_pubname:i[`account-pubname`],"account_pubname.startsWith":i[`account-pubname-starts-with`],"account_pubname.endsWith":i[`account-pubname-ends-with`],"account_pubname.contains":i[`account-pubname-contains`],name:i.name,"name.startsWith":i[`name-starts-with`],"name.endsWith":i[`name-ends-with`],"name.contains":i[`name-contains`],order_by:i[`order-by`],direction:i.direction,include_tags:i[`include-tags`],page_token:i[`page-token`],page_size:i[`page-size`]};if(i.dryRun){n({command:`cf organization account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.account.list({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},f={command:`account`,describe:`Operations for account`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const m={command:`create`,describe:`Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:p,handler:async c=>{if(c.dryRun){n({command:`cf organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:c.body===void 0?a({name:o(c.name,`name`,`text`),parent:{id:o(c[`parent-id`],`parent-id`,`text`)},profile:{business_address:o(c[`profile-business-address`],`profile-business-address`,`text`),business_email:o(c[`profile-business-email`],`profile-business-email`,`text`),business_name:o(c[`profile-business-name`],`profile-business-name`,`text`),business_phone:o(c[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:o(c[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):i(c.body)});return}let l=await e(c);if(c.body){let e=i(c.body);t(await r(`Creating`,async()=>l.organization.create({...e})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await s(`name`,`The name field`));let u=a({name:o(c.name,`name`,`text`),parent:{id:o(c[`parent-id`],`parent-id`,`text`)},profile:{business_address:o(c[`profile-business-address`],`profile-business-address`,`text`),business_email:o(c[`profile-business-email`],`profile-business-email`,`text`),business_name:o(c[`profile-business-name`],`profile-business-name`,`text`),business_phone:o(c[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:o(c[`profile-external-metadata`],`profile-external-metadata`,`text`)}});t(await r(`Creating`,async()=>l.organization.create({...u})),{successLabel:`Created`})}};function h(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <organization-id>`,describe:`Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`,builder:h,handler:async i=>{if(i.dryRun){n({command:`cf organization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}`,pathParams:{"organization-id":String(i[`organization-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await c({force:!!i.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
15
- `);return}t(await r(`Deleting`,async()=>a.organization.delete({organization_id:i[`organization-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <organization-id>`,describe:`Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:_,handler:async i=>{if(i.dryRun){n({command:`cf organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}`,pathParams:{"organization-id":String(i[`organization-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.organization.get({organization_id:i[`organization-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
14
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:u(d),handler:async i=>{let a={account_pubname:i[`account-pubname`],"account_pubname.startsWith":i[`account-pubname-starts-with`],"account_pubname.endsWith":i[`account-pubname-ends-with`],"account_pubname.contains":i[`account-pubname-contains`],name:i.name,"name.startsWith":i[`name-starts-with`],"name.endsWith":i[`name-ends-with`],"name.contains":i[`name-contains`],order_by:i[`order-by`],direction:i.direction,include_tags:i[`include-tags`],page_token:i[`page-token`],page_size:i[`page-size`]};if(i.dryRun){n({command:`cf organization account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.account.list({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},p={command:`account`,describe:`Operations for account`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const h={command:`create`,describe:`Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:m,handler:async a=>{if(a.dryRun){n({command:`cf organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:a.body===void 0?o({name:s(a.name,`name`,`text`),parent:{id:s(a[`parent-id`],`parent-id`,`text`)},profile:{business_address:s(a[`profile-business-address`],`profile-business-address`,`text`),business_email:s(a[`profile-business-email`],`profile-business-email`,`text`),business_name:s(a[`profile-business-name`],`profile-business-name`,`text`),business_phone:s(a[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:s(a[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):i(a.body)});return}let l=await e(a);if(a.body){let e=i(a.body);t(await r(`Creating`,async()=>l.organization.create({...e})),{successLabel:`Created`});return}a.name===void 0&&(a.name=await c(`name`,`The name field`));let u=o({name:s(a.name,`name`,`text`),parent:{id:s(a[`parent-id`],`parent-id`,`text`)},profile:{business_address:s(a[`profile-business-address`],`profile-business-address`,`text`),business_email:s(a[`profile-business-email`],`profile-business-email`,`text`),business_name:s(a[`profile-business-name`],`profile-business-name`,`text`),business_phone:s(a[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:s(a[`profile-external-metadata`],`profile-external-metadata`,`text`)}});t(await r(`Creating`,async()=>l.organization.create({...u})),{successLabel:`Created`})}};function g(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <organization-id>`,describe:`Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`,builder:g,handler:async i=>{if(i.dryRun){n({command:`cf organization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}`,pathParams:{"organization-id":String(i[`organization-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await l({force:!!i.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
15
+ `);return}t(await r(`Deleting`,async()=>a.organization.delete({organization_id:i[`organization-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <organization-id>`,describe:`Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:v,handler:async i=>{if(i.dryRun){n({command:`cf organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}`,pathParams:{"organization-id":String(i[`organization-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.organization.get({organization_id:i[`organization-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
16
16
  by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
17
17
  particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
18
18
  particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
@@ -33,9 +33,9 @@ an organization has no parent (i.e. it is a 'root' organization)."`}).option(`pa
33
33
  provided will retrieve the next page.
34
34
 
35
35
  Parameters used to filter the retrieved list must remain in subsequent
36
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Retrieve a list of organizations a particular user has access to. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:l(y),handler:async i=>{let a={id:i.id,name:i.name,"name.startsWith":i[`name-starts-with`],"name.endsWith":i[`name-ends-with`],"name.contains":i[`name-contains`],"containing.account":i[`containing-account`],"containing.user":i[`containing-user`],"containing.organization":i[`containing-organization`],"parent.id":i[`parent-id`],page_token:i[`page-token`],page_size:i[`page-size`]};if(i.dryRun){n({command:`cf organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.list(a)),{successLabel:`Loaded`})}};function x(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create <organization-id>`,describe:`Batch create multiple memberships that grant access to a specific Organization.`,builder:x,handler:async a=>{if(a.dryRun){n({command:`cf organization member batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let o=await e(a);if(a.body){let e=i(a.body);t(await r(`Creating`,async()=>o.organization.member.batch.create({...e,organization_id:a[`organization-id`]})),{successLabel:`Created`});return}if(a.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},C={command:`batch`,describe:`Operations for member.batch`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).option(`member-user-email`,{type:`string`,description:`The member.user.email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create <organization-id>`,describe:`Create a membership that grants access to a specific Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:w,handler:async c=>{if(c.dryRun){n({command:`cf organization member create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${c[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(c[`organization-id`]))}/members`,pathParams:{"organization-id":String(c[`organization-id`]??``)},bodyKind:`json`,body:c.body===void 0?a({member:{status:o(c[`member-status`],`member-status`,`text`),user:{email:o(c[`member-user-email`],`member-user-email`,`text`)}}}):i(c.body)});return}let l=await e(c);if(c.body){let e=i(c.body);t(await r(`Creating`,async()=>l.organization.member.create({...e,organization_id:c[`organization-id`]})),{successLabel:`Created`});return}c[`member-user-email`]===void 0&&(c[`member-user-email`]=await s(`member-user-email`,`The member.user.email field`));let u=a({member:{status:o(c[`member-status`],`member-status`,`text`),user:{email:o(c[`member-user-email`],`member-user-email`,`text`)}}});t(await r(`Creating`,async()=>l.organization.member.create({...u,organization_id:c[`organization-id`]})),{successLabel:`Created`})}};function E(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`delete <member-id>`,describe:`Delete a membership to a particular Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:E,handler:async a=>{if(a.dryRun){n({command:`cf organization member delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``),"member-id":String(a[`member-id`]??``)},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let o=await e(a);if(!await c({force:!!a.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
37
- `);return}if(a.body){let e=i(a.body);t(await r(`Deleting`,async()=>o.organization.member.delete({...e,organization_id:a[`organization-id`],member_id:a[`member-id`]})),{successLabel:`Deleted`});return}t(await r(`Deleting`,async()=>o.organization.member.delete({organization_id:a[`organization-id`],member_id:a[`member-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <member-id>`,describe:`Retrieve a single membership from an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:O,handler:async i=>{if(i.dryRun){n({command:`cf organization member get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/members/${i[`member-id`]==null?`<member-id>`:encodeURIComponent(String(i[`member-id`]))}`,pathParams:{"organization-id":String(i[`organization-id`]??``),"member-id":String(i[`member-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.organization.member.get({organization_id:i[`organization-id`],member_id:i[`member-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
36
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Retrieve a list of organizations a particular user has access to. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:u(b),handler:async i=>{let a={id:i.id,name:i.name,"name.startsWith":i[`name-starts-with`],"name.endsWith":i[`name-ends-with`],"name.contains":i[`name-contains`],"containing.account":i[`containing-account`],"containing.user":i[`containing-user`],"containing.organization":i[`containing-organization`],"parent.id":i[`parent-id`],page_token:i[`page-token`],page_size:i[`page-size`]};if(i.dryRun){n({command:`cf organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.list(a)),{successLabel:`Loaded`})}};function S(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`members`,{type:`string`,description:`The members field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create <organization-id>`,describe:`Batch create multiple memberships that grant access to a specific Organization.`,builder:S,handler:async s=>{if(s.dryRun){n({command:`cf organization member batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${s[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(s[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(s[`organization-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({members:a(s.members,`members`)}):i(s.body)});return}let c=await e(s);if(s.body){let e=i(s.body);t(await r(`Creating`,async()=>c.organization.member.batch.create({...e,organization_id:s[`organization-id`]})),{successLabel:`Created`});return}if(s.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let l=o({members:a(s.members,`members`)});t(await r(`Creating`,async()=>c.organization.member.batch.create({...l,organization_id:s[`organization-id`]})),{successLabel:`Created`})}},w={command:`batch`,describe:`Operations for member.batch`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).option(`member-user-email`,{type:`string`,description:`The member.user.email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create <organization-id>`,describe:`Create a membership that grants access to a specific Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:T,handler:async a=>{if(a.dryRun){n({command:`cf organization member create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`json`,body:a.body===void 0?o({member:{status:s(a[`member-status`],`member-status`,`text`),user:{email:s(a[`member-user-email`],`member-user-email`,`text`)}}}):i(a.body)});return}let l=await e(a);if(a.body){let e=i(a.body);t(await r(`Creating`,async()=>l.organization.member.create({...e,organization_id:a[`organization-id`]})),{successLabel:`Created`});return}a[`member-user-email`]===void 0&&(a[`member-user-email`]=await c(`member-user-email`,`The member.user.email field`));let u=o({member:{status:s(a[`member-status`],`member-status`,`text`),user:{email:s(a[`member-user-email`],`member-user-email`,`text`)}}});t(await r(`Creating`,async()=>l.organization.member.create({...u,organization_id:a[`organization-id`]})),{successLabel:`Created`})}};function D(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`delete <member-id>`,describe:`Delete a membership to a particular Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:D,handler:async a=>{if(a.dryRun){n({command:`cf organization member delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``),"member-id":String(a[`member-id`]??``)},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let o=await e(a);if(!await l({force:!!a.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
37
+ `);return}if(a.body){let e=i(a.body);t(await r(`Deleting`,async()=>o.organization.member.delete({...e,organization_id:a[`organization-id`],member_id:a[`member-id`]})),{successLabel:`Deleted`});return}t(await r(`Deleting`,async()=>o.organization.member.delete({organization_id:a[`organization-id`],member_id:a[`member-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <member-id>`,describe:`Retrieve a single membership from an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:k,handler:async i=>{if(i.dryRun){n({command:`cf organization member get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/members/${i[`member-id`]==null?`<member-id>`:encodeURIComponent(String(i[`member-id`]))}`,pathParams:{"organization-id":String(i[`organization-id`]??``),"member-id":String(i[`member-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.organization.member.get({organization_id:i[`organization-id`],member_id:i[`member-id`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
38
38
  provided will retrieve the next page.
39
39
 
40
40
  Parameters used to filter the retrieved list must remain in subsequent
41
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`List memberships for an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:l(A),handler:async i=>{let a={status:i.status,"user.email":i[`user-email`],"user.email.contains":i[`user-email-contains`],"user.email.startsWith":i[`user-email-starts-with`],"user.email.endsWith":i[`user-email-ends-with`],page_token:i[`page-token`],page_size:i[`page-size`]};if(i.dryRun){n({command:`cf organization member list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/members`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.member.list({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},M={command:`member`,describe:`Operations for member`,builder:e=>e.command(T).command(D).command(k).command(j).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <organization-id>`,describe:`Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:N,handler:async i=>{if(i.dryRun){n({command:`cf organization profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/profile`,pathParams:{"organization-id":String(i[`organization-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.organization.profile.get({organization_id:i[`organization-id`]})),{successLabel:`Loaded`})}};function F(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <organization-id>`,describe:`Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:F,handler:async c=>{if(c.dryRun){n({command:`cf organization profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${c[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(c[`organization-id`]))}/profile`,pathParams:{"organization-id":String(c[`organization-id`]??``)},bodyKind:`json`,body:c.body===void 0?a({business_address:o(c[`business-address`],`business-address`,`text`),business_email:o(c[`business-email`],`business-email`,`text`),business_name:o(c[`business-name`],`business-name`,`text`),business_phone:o(c[`business-phone`],`business-phone`,`text`),external_metadata:o(c[`external-metadata`],`external-metadata`,`text`)}):i(c.body)});return}let l=await e(c);if(c.body){let e=i(c.body);t(await r(`Updating`,async()=>l.organization.profile.update({body:e,organization_id:c[`organization-id`]})),{successLabel:`Updated`});return}c[`business-address`]===void 0&&(c[`business-address`]=await s(`business-address`,`The business_address field`)),c[`business-email`]===void 0&&(c[`business-email`]=await s(`business-email`,`The business_email field`)),c[`business-name`]===void 0&&(c[`business-name`]=await s(`business-name`,`The business_name field`)),c[`business-phone`]===void 0&&(c[`business-phone`]=await s(`business-phone`,`The business_phone field`)),c[`external-metadata`]===void 0&&(c[`external-metadata`]=await s(`external-metadata`,`The external_metadata field`));let u=a({business_address:o(c[`business-address`],`business-address`,`text`),business_email:o(c[`business-email`],`business-email`,`text`),business_name:o(c[`business-name`],`business-name`,`text`),business_phone:o(c[`business-phone`],`business-phone`,`text`),external_metadata:o(c[`external-metadata`],`external-metadata`,`text`)});t(await r(`Updating`,async()=>l.organization.profile.update({body:u,organization_id:c[`organization-id`]})),{successLabel:`Updated`})}},L={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Lists all organization shares.`,builder:l(R),handler:async i=>{let a={status:i.status,kind:i.kind,target_type:i[`target-type`],resource_types:i[`resource-types`],order:i.order,direction:i.direction,page:i.page,per_page:i[`per-page`]};if(i.dryRun){n({command:`cf organization share list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/shares`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.share.list({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},B={command:`share`,describe:`Operations for share`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const H={command:`update <organization-id>`,describe:`Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:V,handler:async c=>{if(c.dryRun){n({command:`cf organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${c[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(c[`organization-id`]))}`,pathParams:{"organization-id":String(c[`organization-id`]??``)},bodyKind:`json`,body:c.body===void 0?a({name:o(c.name,`name`,`text`),parent:{id:o(c[`parent-id`],`parent-id`,`text`)},profile:{business_address:o(c[`profile-business-address`],`profile-business-address`,`text`),business_email:o(c[`profile-business-email`],`profile-business-email`,`text`),business_name:o(c[`profile-business-name`],`profile-business-name`,`text`),business_phone:o(c[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:o(c[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):i(c.body)});return}let l=await e(c);if(c.body){let e=i(c.body);t(await r(`Updating`,async()=>l.organization.update({body:e,organization_id:c[`organization-id`]})),{successLabel:`Updated`});return}c.name===void 0&&(c.name=await s(`name`,`The name field`));let u=a({name:o(c.name,`name`,`text`),parent:{id:o(c[`parent-id`],`parent-id`,`text`)},profile:{business_address:o(c[`profile-business-address`],`profile-business-address`,`text`),business_email:o(c[`profile-business-email`],`profile-business-email`,`text`),business_name:o(c[`profile-business-name`],`profile-business-name`,`text`),business_phone:o(c[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:o(c[`profile-external-metadata`],`profile-external-metadata`,`text`)}});t(await r(`Updating`,async()=>l.organization.update({body:u,organization_id:c[`organization-id`]})),{successLabel:`Updated`})}},U={command:`organization`,describe:`organization`,builder:e=>e.command(m).command(g).command(v).command(b).command(H).command(f).command(M).command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
41
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List memberships for an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:u(j),handler:async i=>{let a={status:i.status,"user.email":i[`user-email`],"user.email.contains":i[`user-email-contains`],"user.email.startsWith":i[`user-email-starts-with`],"user.email.endsWith":i[`user-email-ends-with`],page_token:i[`page-token`],page_size:i[`page-size`]};if(i.dryRun){n({command:`cf organization member list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/members`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.member.list({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},N={command:`member`,describe:`Operations for member`,builder:e=>e.command(E).command(O).command(A).command(M).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <organization-id>`,describe:`Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:P,handler:async i=>{if(i.dryRun){n({command:`cf organization profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/profile`,pathParams:{"organization-id":String(i[`organization-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.organization.profile.get({organization_id:i[`organization-id`]})),{successLabel:`Loaded`})}};function I(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`update <organization-id>`,describe:`Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:I,handler:async a=>{if(a.dryRun){n({command:`cf organization profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/profile`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`json`,body:a.body===void 0?o({business_address:s(a[`business-address`],`business-address`,`text`),business_email:s(a[`business-email`],`business-email`,`text`),business_name:s(a[`business-name`],`business-name`,`text`),business_phone:s(a[`business-phone`],`business-phone`,`text`),external_metadata:s(a[`external-metadata`],`external-metadata`,`text`)}):i(a.body)});return}let l=await e(a);if(a.body){let e=i(a.body);t(await r(`Updating`,async()=>l.organization.profile.update({body:e,organization_id:a[`organization-id`]})),{successLabel:`Updated`});return}a[`business-address`]===void 0&&(a[`business-address`]=await c(`business-address`,`The business_address field`)),a[`business-email`]===void 0&&(a[`business-email`]=await c(`business-email`,`The business_email field`)),a[`business-name`]===void 0&&(a[`business-name`]=await c(`business-name`,`The business_name field`)),a[`business-phone`]===void 0&&(a[`business-phone`]=await c(`business-phone`,`The business_phone field`)),a[`external-metadata`]===void 0&&(a[`external-metadata`]=await c(`external-metadata`,`The external_metadata field`));let u=o({business_address:s(a[`business-address`],`business-address`,`text`),business_email:s(a[`business-email`],`business-email`,`text`),business_name:s(a[`business-name`],`business-name`,`text`),business_phone:s(a[`business-phone`],`business-phone`,`text`),external_metadata:s(a[`external-metadata`],`external-metadata`,`text`)});t(await r(`Updating`,async()=>l.organization.profile.update({body:u,organization_id:a[`organization-id`]})),{successLabel:`Updated`})}},R={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`Lists all organization shares.`,builder:u(z),handler:async i=>{let a={status:i.status,kind:i.kind,target_type:i[`target-type`],resource_types:i[`resource-types`],order:i.order,direction:i.direction,page:i.page,per_page:i[`per-page`]};if(i.dryRun){n({command:`cf organization share list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/shares`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organization.share.list({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},V={command:`share`,describe:`Operations for share`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const U={command:`update <organization-id>`,describe:`Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:H,handler:async a=>{if(a.dryRun){n({command:`cf organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`json`,body:a.body===void 0?o({name:s(a.name,`name`,`text`),parent:{id:s(a[`parent-id`],`parent-id`,`text`)},profile:{business_address:s(a[`profile-business-address`],`profile-business-address`,`text`),business_email:s(a[`profile-business-email`],`profile-business-email`,`text`),business_name:s(a[`profile-business-name`],`profile-business-name`,`text`),business_phone:s(a[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:s(a[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):i(a.body)});return}let l=await e(a);if(a.body){let e=i(a.body);t(await r(`Updating`,async()=>l.organization.update({body:e,organization_id:a[`organization-id`]})),{successLabel:`Updated`});return}a.name===void 0&&(a.name=await c(`name`,`The name field`));let u=o({name:s(a.name,`name`,`text`),parent:{id:s(a[`parent-id`],`parent-id`,`text`)},profile:{business_address:s(a[`profile-business-address`],`profile-business-address`,`text`),business_email:s(a[`profile-business-email`],`profile-business-email`,`text`),business_name:s(a[`profile-business-name`],`profile-business-name`,`text`),business_phone:s(a[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:s(a[`profile-external-metadata`],`profile-external-metadata`,`text`)}});t(await r(`Updating`,async()=>l.organization.update({body:u,organization_id:a[`organization-id`]})),{successLabel:`Updated`})}},W={command:`organization`,describe:`organization`,builder:e=>e.command(h).command(_).command(y).command(x).command(U).command(p).command(N).command(R).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{r as e}from"./auth-D3X9HYhD.mjs";import{t}from"./output-Ccqw2WOb.mjs";import{t as n}from"./dry-run-DL2V6yFm.mjs";import{t as r}from"./progress-BqQcF5QH.mjs";import{t as i}from"./cli-types-DAYeL_Mj.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.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).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.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).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`})}};function d(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The unique ID that identifies the organization.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).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 f={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given organization-scoped audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.",builder:i(d),handler:async i=>{let a={action_time:i[`action-time`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit/${i.id==null?`<id>`:encodeURIComponent(String(i.id))}/history`,pathParams:{"organization-id":String(i[`organization-id`]??``),id:String(i.id??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.history({organization_id:i[`organization-id`],id:i.id,...a})),{successLabel:`Loaded`})}},p={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(c).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{r as e}from"./auth-D3X9HYhD.mjs";import{t}from"./output-Ccqw2WOb.mjs";import{t as n}from"./dry-run-DL2V6yFm.mjs";import{t as r}from"./progress-BqQcF5QH.mjs";import{n as i,t as a}from"./body-parser-BshbixEq.mjs";import{n as o}from"./input-validation-QDIYu7Vb.mjs";import{a as s,i as c,n as l}from"./prompt-B0sWIs9c.mjs";import{t as u}from"./cli-types-DAYeL_Mj.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 s(`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 c(`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
+ `);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:`origin-ca-certificates`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";import{n as a,t as o}from"./body-parser-BshbixEq.mjs";import{n as s}from"./input-validation-QDIYu7Vb.mjs";import{i as c}from"./prompt-B0sWIs9c.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:`origin-post-quantum-encryption`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";import{n as a,r as o,t as s}from"./body-parser-BshbixEq.mjs";import{n as c}from"./input-validation-QDIYu7Vb.mjs";import{a as l,n as u}from"./prompt-B0sWIs9c.mjs";import{t as d}from"./cli-types-DAYeL_Mj.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 a=>{let o={page:a.page,per_page:a[`per-page`],status:a.status};if(a.dryRun){r({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.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 o=>{if(o.dryRun){r({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({certificate:c(o.certificate,`certificate`,`text`),private_key:c(o[`private-key`],`private-key`,`text`)}):a(o.body)});return}let u=await t(o),d=await e({zone:o.zone},u,{quiet:o.quiet});if(o.zoneId=d,o.body){let e=a(o.body);n(await i(`Creating`,async()=>u.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}o.certificate===void 0&&(o.certificate=await l(`certificate`,`The hostname certificate.`)),o[`private-key`]===void 0&&(o[`private-key`]=await l(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=s({certificate:c(o.certificate,`certificate`,`text`),private_key:c(o[`private-key`],`private-key`,`text`)});n(await i(`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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"certificate-id":String(a[`certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await u({force:!!a.force})){process.stderr.write(`Aborted.
3
+ `);return}n(await i(`Deleting`,async()=>o.originTlsClientAuth.hostnameCertificates.delete({zone_id:s,certificate_id:a[`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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"certificate-id":String(a[`certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.get({zone_id:s,certificate_id:a[`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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,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.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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${a.hostname==null?`<hostname>`:encodeURIComponent(String(a.hostname))}`,pathParams:{hostname:String(a.hostname??``),"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.originTlsClientAuth.hostnames.get({zone_id:s,hostname:a.hostname})),{successLabel:`Loaded`})}};function E(e){return e.option(`config`,{type:`string`,description:`The config field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const 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 c=>{if(c.dryRun){r({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({config:o(c.config,`config`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.originTlsClientAuth.hostnames.update({...e,zone_id:u})),{successLabel:`Updated`});return}if(c.config===void 0)throw Error(`--config is required (or pass --body with this field set).`);let d=s({config:o(c.config,`config`)});n(await i(`Updating`,async()=>l.originTlsClientAuth.hostnames.update({...d,zone_id:u})),{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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.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 o=>{if(o.dryRun){r({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({enabled:o.enabled}):a(o.body)});return}let c=await t(o),l=await e({zone:o.zone},c,{quiet:o.quiet});if(o.zoneId=l,o.body){let e=a(o.body);n(await i(`Updating`,async()=>c.originTlsClientAuth.settings.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(o.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=s({enabled:o.enabled});n(await i(`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 o=>{if(o.dryRun){r({command:`cf origin-tls-client-auth zone-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({certificate:c(o.certificate,`certificate`,`text`),private_key:c(o[`private-key`],`private-key`,`text`)}):a(o.body)});return}let u=await t(o),d=await e({zone:o.zone},u,{quiet:o.quiet});if(o.zoneId=d,o.body){let e=a(o.body);n(await i(`Creating`,async()=>u.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}o.certificate===void 0&&(o.certificate=await l(`certificate`,`The zone's leaf certificate.`)),o[`private-key`]===void 0&&(o[`private-key`]=await l(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=s({certificate:c(o.certificate,`certificate`,`text`),private_key:c(o[`private-key`],`private-key`,`text`)});n(await i(`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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"certificate-id":String(a[`certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await u({force:!!a.force})){process.stderr.write(`Aborted.
4
+ `);return}n(await i(`Deleting`,async()=>o.originTlsClientAuth.zoneCertificates.delete({zone_id:s,certificate_id:a[`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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"certificate-id":String(a[`certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.get({zone_id:s,certificate_id:a[`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 a=>{if(a.dryRun){r({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/origin_tls_client_auth`,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.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:`origin-tls-client-auth`,builder:e=>e.command(m).command(C).command(O).command(N).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./Page-C-JHZnIy.mjs";import{n as t,r as n,t as r}from"./theme-BePJemMn.mjs";function i(t){return t instanceof e?t.data:typeof t==`object`&&t&&`result`in t&&Array.isArray(t.result)&&`result_info`in t?t.result:t}function a(e,n={}){if(!n.quiet){if(e=i(e),e==null){if(n.successLabel&&process.stderr.isTTY){let e=t();process.stderr.write(`${e.hex(r.success)(`✓`)} ${n.successLabel}\n`)}return}console.log(o(e))}}function o(e){let r=JSON.stringify(e,null,2);if(!n()||r.length>5e4)return r;let i=t();return r.replace(/"([^"]+)":/g,(e,t)=>`${i.cyan(`"${t}"`)}:`).replace(/: "([^"]*)"/g,(e,t)=>`: ${i.green(`"${t}"`)}`).replace(/: (-?\d+\.?\d*)/g,(e,t)=>`: ${i.yellow(t)}`).replace(/: (true|false)/g,(e,t)=>`: ${i.magenta(t)}`).replace(/: (null)/g,(e,t)=>`: ${i.dim(t)}`)}export{a as t};
2
+ import{t as e}from"./Page-9ry_XAVC.mjs";import{n as t,r as n,t as r}from"./theme-CrIBazAF.mjs";function i(t){return t instanceof e?t.data:typeof t==`object`&&t&&`result`in t&&Array.isArray(t.result)&&`result_info`in t?t.result:t}function a(e,n={}){if(!n.quiet){if(e=i(e),e==null){if(n.successLabel&&process.stderr.isTTY){let e=t();process.stderr.write(`${e.hex(r.success)(`✓`)} ${n.successLabel}\n`)}return}console.log(o(e))}}function o(e){let r=JSON.stringify(e,null,2);if(!n()||r.length>5e4)return r;let i=t();return r.replace(/"([^"]+)":/g,(e,t)=>`${i.cyan(`"${t}"`)}:`).replace(/: "([^"]*)"/g,(e,t)=>`: ${i.green(`"${t}"`)}`).replace(/: (-?\d+\.?\d*)/g,(e,t)=>`: ${i.yellow(t)}`).replace(/: (true|false)/g,(e,t)=>`: ${i.magenta(t)}`).replace(/: (null)/g,(e,t)=>`: ${i.dim(t)}`)}export{a as t};
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";import{n as a,r as o,t as s}from"./body-parser-BshbixEq.mjs";import{n as c}from"./input-validation-QDIYu7Vb.mjs";import{n as l}from"./prompt-B0sWIs9c.mjs";import{t as u}from"./cli-types-DAYeL_Mj.mjs";function d(e){return e.option(`actions`,{type:`string`,description:`The set of actions to perform if the targets of this rule match the
3
+ request. Actions can redirect to another URL or override settings, but
4
+ not both.
5
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
6
+ over another. A higher number indicates a higher priority. For example,
7
+ if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
8
+ specific Page Rule to take precedence (rule B: \`/images/special/*\`),
9
+ specify a higher priority for rule B so it overrides rule A.
10
+ `,default:1}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`],default:`disabled`}).option(`targets`,{type:`string`,description:`The rule targets to evaluate on each request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Creates a new Page Rule.`,builder:d,handler:async l=>{if(l.dryRun){r({command:`cf page-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/pagerules`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({actions:o(l.actions,`actions`),priority:l.priority,status:c(l.status,`status`,`text`),targets:o(l.targets,`targets`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.pageRules.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.actions===void 0)throw Error(`--actions is required (or pass --body with this field set).`);if(l.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let f=s({actions:o(l.actions,`actions`),priority:l.priority,status:c(l.status,`status`,`text`),targets:o(l.targets,`targets`)});n(await i(`Creating`,async()=>u.pageRules.create({...f,zone_id:d})),{successLabel:`Created`})}};function p(e){return e.positional(`pagerule-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 <pagerule-id>`,describe:`Deletes an existing Page Rule.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf page-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules/${a[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(a[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(a[`pagerule-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
11
+ `);return}n(await i(`Deleting`,async()=>o.pageRules.delete({zone_id:s,pagerule_id:a[`pagerule-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`actions`,{type:`string`,description:`The set of actions to perform if the targets of this rule match the
12
+ request. Actions can redirect to another URL or override settings, but
13
+ not both.
14
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
15
+ over another. A higher number indicates a higher priority. For example,
16
+ if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
17
+ specific Page Rule to take precedence (rule B: \`/images/special/*\`),
18
+ specify a higher priority for rule B so it overrides rule A.
19
+ `}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`targets`,{type:`string`,description:`The rule targets to evaluate on each request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`edit <pagerule-id>`,describe:`Updates one or more fields of an existing Page Rule.`,builder:h,handler:async l=>{if(l.dryRun){r({command:`cf page-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/pagerules/${l[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(l[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(l[`pagerule-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({actions:o(l.actions,`actions`),priority:l.priority,status:c(l.status,`status`,`text`),targets:o(l.targets,`targets`)}):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.pageRules.edit({...e,zone_id:d,pagerule_id:l[`pagerule-id`]})),{successLabel:`Updated`});return}let f=s({actions:o(l.actions,`actions`),priority:l.priority,status:c(l.status,`status`,`text`),targets:o(l.targets,`targets`)});n(await i(`Updating`,async()=>u.pageRules.edit({...f,zone_id:d,pagerule_id:l[`pagerule-id`]})),{successLabel:`Updated`})}};function _(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <pagerule-id>`,describe:`Fetches the details of a Page Rule.`,builder:_,handler:async a=>{if(a.dryRun){r({command:`cf page-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules/${a[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(a[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(a[`pagerule-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageRules.get({zone_id:s,pagerule_id:a[`pagerule-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`order`,{type:`string`,description:`The field used to sort returned Page Rules.`,choices:[`status`,`priority`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned Page Rules.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:"When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches Page Rules in a zone.`,builder:u(y),handler:async a=>{let o={order:a.order,direction:a.direction,match:a.match,status:a.status};if(a.dryRun){r({command:`cf page-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.pageRules.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function x(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`actions`,{type:`string`,description:`The set of actions to perform if the targets of this rule match the
20
+ request. Actions can redirect to another URL or override settings, but
21
+ not both.
22
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
23
+ over another. A higher number indicates a higher priority. For example,
24
+ if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
25
+ specific Page Rule to take precedence (rule B: \`/images/special/*\`),
26
+ specify a higher priority for rule B so it overrides rule A.
27
+ `}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`targets`,{type:`string`,description:`The rule targets to evaluate on each request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <pagerule-id>`,describe:`Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.`,builder:x,handler:async l=>{if(l.dryRun){r({command:`cf page-rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/pagerules/${l[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(l[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(l[`pagerule-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({actions:o(l.actions,`actions`),priority:l.priority,status:c(l.status,`status`,`text`),targets:o(l.targets,`targets`)}):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.pageRules.update({...e,zone_id:d,pagerule_id:l[`pagerule-id`]})),{successLabel:`Updated`});return}if(l.actions===void 0)throw Error(`--actions is required (or pass --body with this field set).`);if(l.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let f=s({actions:o(l.actions,`actions`),priority:l.priority,status:c(l.status,`status`,`text`),targets:o(l.targets,`targets`)});n(await i(`Updating`,async()=>u.pageRules.update({...f,zone_id:d,pagerule_id:l[`pagerule-id`]})),{successLabel:`Updated`})}},C={command:`page-rules`,describe:`page-rules`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{C as default};
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{a as r,r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{n as c,r as l,t as u}from"./body-parser-BshbixEq.mjs";import{n as d,t as f}from"./input-validation-QDIYu7Vb.mjs";import{a as p,i as m,n as h}from"./prompt-B0sWIs9c.mjs";import{t as ee}from"./cli-types-DAYeL_Mj.mjs";function g(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
3
+ When disabled, no deployments (production or preview) will be triggered automatically.
4
+ `}).option(`config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`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(`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(`config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`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(`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(`config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`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:`Configs for the project source control.`})}const _={command:`connect-source <project-name>`,describe:`Connect a Git repository source to an existing Pages project.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf pages projects connect-source`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/source`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?u({config:{deployments_enabled:r[`config-deployments-enabled`],owner:d(r[`config-owner`],`config-owner`,`text`),owner_id:d(r[`config-owner-id`],`config-owner-id`,`text`),path_excludes:r[`config-path-excludes`],path_includes:r[`config-path-includes`],pr_comments_enabled:r[`config-pr-comments-enabled`],preview_branch_excludes:r[`config-preview-branch-excludes`],preview_branch_includes:r[`config-preview-branch-includes`],preview_deployment_setting:d(r[`config-preview-deployment-setting`],`config-preview-deployment-setting`,`text`),production_branch:d(r[`config-production-branch`],`config-production-branch`,`text`),production_deployments_enabled:r[`config-production-deployments-enabled`],repo_id:d(r[`config-repo-id`],`config-repo-id`,`text`),repo_name:d(r[`config-repo-name`],`config-repo-name`,`text`)},type:d(r.type,`type`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.pages.projects.connectSource({body:e,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`});return}if(r[`config-deployments-enabled`]===void 0)throw Error(`--config-deployments-enabled is required (or pass --body with this field set).`);if(r[`config-owner`]===void 0&&(r[`config-owner`]=await p(`config-owner`,`The owner of the repository.`)),r[`config-owner-id`]===void 0&&(r[`config-owner-id`]=await p(`config-owner-id`,`The owner ID of the repository.`)),r[`config-path-excludes`]===void 0)throw Error(`--config-path-excludes is required (or pass --body with this field set).`);if(r[`config-path-includes`]===void 0)throw Error(`--config-path-includes is required (or pass --body with this field set).`);if(r[`config-pr-comments-enabled`]===void 0)throw Error(`--config-pr-comments-enabled is required (or pass --body with this field set).`);if(r[`config-preview-branch-excludes`]===void 0)throw Error(`--config-preview-branch-excludes is required (or pass --body with this field set).`);if(r[`config-preview-branch-includes`]===void 0)throw Error(`--config-preview-branch-includes is required (or pass --body with this field set).`);if(r[`config-preview-deployment-setting`]===void 0&&(r[`config-preview-deployment-setting`]=await m(`config-preview-deployment-setting`,`Controls whether commits to preview branches trigger a preview deployment.`,[`all`,`none`,`custom`])),r[`config-production-branch`]===void 0&&(r[`config-production-branch`]=await p(`config-production-branch`,`The production branch of the repository.`)),r[`config-production-deployments-enabled`]===void 0)throw Error(`--config-production-deployments-enabled is required (or pass --body with this field set).`);r[`config-repo-id`]===void 0&&(r[`config-repo-id`]=await p(`config-repo-id`,`The ID of the repository.`)),r[`config-repo-name`]===void 0&&(r[`config-repo-name`]=await p(`config-repo-name`,`The name of the repository.`)),r.type===void 0&&(r.type=await m(`type`,`The source control management provider.`,[`github`,`gitlab`]));let h=u({config:{deployments_enabled:r[`config-deployments-enabled`],owner:d(r[`config-owner`],`config-owner`,`text`),owner_id:d(r[`config-owner-id`],`config-owner-id`,`text`),path_excludes:r[`config-path-excludes`],path_includes:r[`config-path-includes`],pr_comments_enabled:r[`config-pr-comments-enabled`],preview_branch_excludes:r[`config-preview-branch-excludes`],preview_branch_includes:r[`config-preview-branch-includes`],preview_deployment_setting:d(r[`config-preview-deployment-setting`],`config-preview-deployment-setting`,`text`),production_branch:d(r[`config-production-branch`],`config-production-branch`,`text`),production_deployments_enabled:r[`config-production-deployments-enabled`],repo_id:d(r[`config-repo-id`],`config-repo-id`,`text`),repo_name:d(r[`config-repo-name`],`config-repo-name`,`text`)},type:d(r.type,`type`,`text`)});a(await s(`Creating`,async()=>l.pages.projects.connectSource({body:h,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`})}};function v(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.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).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.`}).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`]}).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.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).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.`}).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`]}).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.
5
+ When disabled, no deployments (production or preview) will be triggered automatically.
6
+ `}).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-always-use-latest-compatibility-date`,`deployment-configs-preview-build-image-major-version`,`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-fail-open`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-usage-model`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-always-use-latest-compatibility-date`,`deployment-configs-production-build-image-major-version`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-fail-open`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-usage-model`,`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 y={command:`create`,describe:`Create a new project.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.pages.projects.create({...e,account_id:f})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await p(`name`,`Name of the project.`)),r[`production-branch`]===void 0&&(r[`production-branch`]=await p(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=u({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}});a(await s(`Creating`,async()=>l.pages.projects.create({...m,account_id:f})),{successLabel:`Created`})}};function b(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 x={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
7
+ `);return}a(await s(`Deleting`,async()=>c.pages.projects.delete({account_id:l,project_name:r[`project-name`]})),{successLabel:`Deleted`})}};function S(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 C={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:S,handler:async c=>{if(c.dryRun){o({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),u=c.local?e:await t();if(c.accountId=u,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=f(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(d(c.branch,`branch`,`text`)??``)),c[`commit-dirty`]!==void 0&&e.append(`commit_dirty`,String(d(c[`commit-dirty`],`commit-dirty`,`text`)??``)),c[`commit-hash`]!==void 0&&e.append(`commit_hash`,String(d(c[`commit-hash`],`commit-hash`,`text`)??``)),c[`commit-message`]!==void 0&&e.append(`commit_message`,String(d(c[`commit-message`],`commit-message`,`text`)??``)),c.manifest!==void 0&&e.append(`manifest`,String(d(c.manifest,`manifest`,`text`)??``)),c[`pages-build-output-dir`]!==void 0&&e.append(`pages_build_output_dir`,String(d(c[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),c[`wrangler-config-hash`]!==void 0&&e.append(`wrangler_config_hash`,String(d(c[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${u}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=d(c.body,`body`,`binary`);a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${u}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>l.pages.projects.deployments.create({account_id:u,project_name:c[`project-name`]})),{successLabel:`Created`})}};function w(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 T={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:w,handler:async r=>{let c={force:r.force};if(r.dryRun){o({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await h({force:!!r.force})){process.stderr.write(`Aborted.
8
+ `);return}a(await s(`Deleting`,async()=>l.pages.projects.deployments.delete({account_id:u,project_name:r[`project-name`],deployment_id:r[`deployment-id`],...c})),{successLabel:`Deleted`})}};function E(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <deployment-id>`,describe:`Fetch information about a deployment.`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.deployments.get({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Loaded`})}};function O(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <deployment-id>`,describe:`Fetch deployment logs for a project.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.deployments.history.logs.get({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Loaded`})}},A={command:`logs`,describe:`Operations for projects.deployments.history.logs`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`env`,{type:`string`,description:`What type of deployments to fetch.`,choices:[`production`,`preview`]}).option(`page`,{type:`number`,description:`Which page of deployments to fetch.`}).option(`per-page`,{type:`number`,description:`How many deployments to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Fetch a list of project deployments.`,builder:ee(M),handler:async r=>{let c={env:r.env,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments`,pathParams:{"project-name":String(r[`project-name`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.pages.projects.deployments.list({account_id:u,project_name:r[`project-name`],...c})),{successLabel:`Loaded`})}};function P(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`retry <deployment-id>`,describe:`Retry a previous deployment.`,builder:P,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.pages.projects.deployments.retry({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`})}};function I(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`rollback <deployment-id>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.pages.projects.deployments.rollback({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`})}};function R(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(`filters`,{type:`string`,description:`Filters to apply to the tail session. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`create <deployment-id>`,describe:`Start a tail that receives logs and exception data.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments tails create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/tails`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.pages.projects.deployments.tails.create({...e,account_id:f,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`});return}let p=u({filters:l(r.filters,`filters`)});a(await s(`Creating`,async()=>d.pages.projects.deployments.tails.create({...p,account_id:f,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`})}};function te(e){return e.positional(`tail-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`deployment-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 B={command:`delete <tail-id>`,describe:`Deletes a tail from a Pages deployment.`,builder:te,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments tails delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/tails/${r[`tail-id`]==null?`<tail-id>`:encodeURIComponent(String(r[`tail-id`]))}`,pathParams:{"tail-id":String(r[`tail-id`]??``),"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
9
+ `);return}a(await s(`Deleting`,async()=>c.pages.projects.deployments.tails.delete({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`],tail_id:r[`tail-id`]})),{successLabel:`Deleted`})}},V={command:`tails`,describe:`Operations for projects.deployments.tails`,builder:e=>e.command(z).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`deployments`,describe:`Operations for projects.deployments`,builder:e=>e.command(C).command(T).command(D).command(N).command(F).command(L).command(j).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(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 W={command:`disconnect-source <project-name>`,describe:`Disconnect the Git repository source from an existing Pages project.`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf pages projects disconnect-source`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/source`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
10
+ `);return}a(await s(`Deleting`,async()=>c.pages.projects.disconnectSource({account_id:l,project_name:r[`project-name`]})),{successLabel:`Deleted`})}};function G(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`name`,{type:`string`,description:`The domain name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create <project-name>`,describe:`Add a new domain for the Pages project.`,builder:G,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?u({name:d(r.name,`name`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.pages.projects.domains.create({...e,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await p(`name`,`The domain name.`));let m=u({name:d(r.name,`name`,`text`)});a(await s(`Creating`,async()=>l.pages.projects.domains.create({...m,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`})}};function q(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`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 J={command:`delete <domain-name>`,describe:`Delete a Pages project's domain.`,builder:q,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
11
+ `);return}a(await s(`Deleting`,async()=>c.pages.projects.domains.delete({account_id:l,project_name:r[`project-name`],domain_name:r[`domain-name`]})),{successLabel:`Deleted`})}};function Y(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`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})}const X={command:`edit <domain-name>`,describe:`Retry the validation status of a single domain.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.pages.projects.domains.edit({account_id:l,project_name:r[`project-name`],domain_name:r[`domain-name`]})),{successLabel:`Updated`})}};function Z(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`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})}const Q={command:`get <domain-name>`,describe:`Fetch a single domain.`,builder:Z,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.domains.get({account_id:l,project_name:r[`project-name`],domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function ne(e){return e.option(`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})}const re={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.domains.list({account_id:l,project_name:r[`project-name`]})),{successLabel:`Loaded`})}},ie={command:`domains`,describe:`Operations for projects.domains`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).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.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).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.`}).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`]}).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.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).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.`}).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`]}).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.
12
+ When disabled, no deployments (production or preview) will be triggered automatically.
13
+ `}).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-always-use-latest-compatibility-date`,`deployment-configs-preview-build-image-major-version`,`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-fail-open`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-usage-model`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-always-use-latest-compatibility-date`,`deployment-configs-production-build-image-major-version`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-fail-open`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-usage-model`,`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 oe={command:`edit <project-name>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:ae,handler:async r=>{if(r.dryRun){o({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?u({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.pages.projects.edit({...e,account_id:f,project_name:r[`project-name`]})),{successLabel:`Updated`});return}let p=u({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}});a(await s(`Updating`,async()=>l.pages.projects.edit({...p,account_id:f,project_name:r[`project-name`]})),{successLabel:`Updated`})}};function $(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})}const se={command:`get-upload-token <project-name>`,describe:`Get a short-lived JWT for Pages Direct Upload asset operations.`,builder:$,handler:async r=>{if(r.dryRun){o({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/upload-token`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.getUploadToken({account_id:l,project_name:r[`project-name`]})),{successLabel:`Loaded`})}};function ce(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})}const le={command:`get <project-name>`,describe:`Fetch a project by name.`,builder:ce,handler:async r=>{if(r.dryRun){o({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.get({account_id:l,project_name:r[`project-name`]})),{successLabel:`Loaded`})}};function ue(e){return e.option(`page`,{type:`number`,description:`Which page of projects to fetch.`}).option(`per-page`,{type:`number`,description:`How many projects to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`Fetch a list of all user projects.`,builder:ue,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.pages.projects.list({account_id:u,...c})),{successLabel:`Loaded`})}};function fe(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 pe={command:`purge-build-cache <project-name>`,describe:`Purge all cached build artifacts for a Pages project`,builder:fe,handler:async r=>{if(r.dryRun){o({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
14
+ `);return}a(await s(`Deleting`,async()=>c.pages.projects.purgeBuildCache({account_id:l,project_name:r[`project-name`]})),{successLabel:`Deleted`})}},me={command:`projects`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(_).command(y).command(x).command(W).command(oe).command(le).command(se).command(de).command(pe).command(H).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{he as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n,h as r}from"./oauth-DuEONNgC.mjs";import{r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{n as c,r as l,t as u}from"./body-parser-BshbixEq.mjs";import{n as d}from"./prompt-B0sWIs9c.mjs";import{t as f}from"./cli-types-DAYeL_Mj.mjs";function p(e){return e.option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`price-usd-microcents`,{type:`number`,description:`Price in microcents 1 USD = 100,000,000 microcents. Must be 0 or a multiple of 100,000 $0.001. Range: $0.001–$9,999.999.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Data for setting flag on zones`})}const m={command:`create`,describe:`Creates the pay-per-crawl config for a zone.`,builder:p,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.payPerCrawl.config.create({body:r,zone_id:n})),{successLabel:`Created`});return}let l=u({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]});a(await s(`Creating`,async()=>t.payPerCrawl.config.create({body:l,zone_id:n})),{successLabel:`Created`})}};function h(e){return e.option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`price-usd-microcents`,{type:`number`,description:`Price in microcents 1 USD = 100,000,000 microcents. Must be 0 or a multiple of 100,000 $0.001. Range: $0.001–$9,999.999.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Data for setting flag on zones`})}const g={command:`edit`,describe:`Changes the pay-per-crawl config for a zone.`,builder:h,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl config edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.payPerCrawl.config.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let l=u({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]});a(await s(`Updating`,async()=>t.payPerCrawl.config.edit({body:l,zone_id:n})),{successLabel:`Updated`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Gets the pay-per-crawl config for a zone including the bot configuration.`,builder:_,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.payPerCrawl.config.get({zone_id:n})),{successLabel:`Loaded`})}},y={command:`config`,describe:`Operations for config`,builder:e=>e.command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`create`,describe:`Creates the stripe config for a crawler.`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawler stripe create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawler/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.payPerCrawl.crawler.stripe.create({account_id:l})),{successLabel:`Created`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete`,describe:`Deletes the stripe config for a crawler.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawler stripe delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawler/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await d({force:!!r.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>c.payPerCrawl.crawler.stripe.delete({account_id:l})),{successLabel:`Deleted`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Gets the stripe config for a crawler.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawler stripe get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawler/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.crawler.stripe.get({account_id:l})),{successLabel:`Loaded`})}},E={command:`stripe`,describe:`Operations for crawler.stripe`,builder:e=>e.command(x).command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`crawler`,describe:`Operations for crawler`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists the crawlers known to pay-per-crawl.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawlers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawlers`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.crawlers.list({account_id:l})),{successLabel:`Loaded`})}},A={command:`crawlers`,describe:`Operations for crawlers`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`create`,describe:`Creates the stripe config for a publisher.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl publisher stripe create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/publisher/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.payPerCrawl.publisher.stripe.create({account_id:l})),{successLabel:`Created`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete`,describe:`Deletes the stripe config for a publisher.`,builder:N,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl publisher stripe delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/publisher/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await d({force:!!r.force})){process.stderr.write(`Aborted.
4
+ `);return}a(await s(`Deleting`,async()=>c.payPerCrawl.publisher.stripe.delete({account_id:l})),{successLabel:`Deleted`})}};function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Gets the stripe config for a publisher.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl publisher stripe get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/publisher/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.publisher.stripe.get({account_id:l})),{successLabel:`Loaded`})}},I={command:`stripe`,describe:`Operations for publisher.stripe`,builder:e=>e.command(M).command(P).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`publisher`,describe:`Operations for publisher`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get-signature-link`,describe:`Gets a download link for the account's signed pay-per-crawl terms.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl terms get-signature-link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/signature_link`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.terms.getSignatureLink({account_id:l})),{successLabel:`Loaded`})}};function B(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 V={command:`get-signature`,describe:`Gets the account's pay-per-crawl terms signature status.`,builder:B,handler:async r=>{let c={remote:r.remote};if(r.dryRun){o({command:`cf pay-per-crawl terms get-signature`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.payPerCrawl.terms.getSignature({account_id:u,...c})),{successLabel:`Loaded`})}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Gets the pay-per-crawl terms and conditions contract.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl terms get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/terms`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.terms.get({account_id:l})),{successLabel:`Loaded`})}};function W(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 G={command:`send-signature-event`,describe:`Records that an account displayed or agreed to the pay-per-crawl terms.`,builder:f(W),handler:async r=>{let c={event_type:r[`event-type`],vid:r.vid};if(r.dryRun){o({command:`cf pay-per-crawl terms send-signature-event`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Creating`,async()=>l.payPerCrawl.terms.sendSignatureEvent({account_id:u,...c})),{successLabel:`Created`})}},K={command:`terms`,describe:`Operations for terms`,builder:e=>e.command(U).command(V).command(z).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get-can-be-enabled`,describe:`Gets whether pay-per-crawl can be enabled for a zone.`,builder:q,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl zones get-can-be-enabled`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/can_be_enabled`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.payPerCrawl.zones.getCanBeEnabled({zone_id:n})),{successLabel:`Loaded`})}};function Y(e){return e.option(`zones`,{type:`string`,array:!0,description:`The zones field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zone IDs to check for pay-per-crawl eligibility`})}const X={command:`query-can-be-enabled`,describe:`Provided a list of pay-per-crawl configured zones this method will return whether they can enable PPC or not.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl zones query-can-be-enabled`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/zones_can_be_enabled/query`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({zones:r.zones}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.payPerCrawl.zones.queryCanBeEnabled({...e,account_id:d})),{successLabel:`Created`});return}let f=u({zones:r.zones});a(await s(`Creating`,async()=>l.payPerCrawl.zones.queryCanBeEnabled({...f,account_id:d})),{successLabel:`Created`})}};function Z(e){return e.option(`zones`,{type:`string`,description:`The zones field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Data for setting flag on zones`})}const Q={command:`set-can-be-enabled`,describe:`Allows an account admin to set the can_be_enabled setting on a list of zones.`,builder:Z,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl zones set-can-be-enabled`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/zones_can_be_enabled`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({zones:l(r.zones,`zones`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.payPerCrawl.zones.setCanBeEnabled({body:e,account_id:f})),{successLabel:`Updated`});return}let p=u({zones:l(r.zones,`zones`)});a(await s(`Updating`,async()=>d.payPerCrawl.zones.setCanBeEnabled({body:p,account_id:f})),{successLabel:`Updated`})}},$={command:`zones`,describe:`Operations for zones`,builder:e=>e.command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`pay-per-crawl`,describe:`pay-per-crawl`,builder:e=>e.command(y).command(D).command(A).command(L).command(K).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};