cf 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/_meta/agent-context.json +189 -187
  2. package/dist/_meta/commands.json +2591 -2248
  3. package/dist/_meta/hand-written-commands.json +146 -1
  4. package/dist/_meta/schemas.json +1548 -1313
  5. package/dist/{abuse-reports-BbaHw4ST.mjs → abuse-reports-CDFjJ2e8.mjs} +1 -1
  6. package/dist/{access-D6Xz892p.mjs → access-BoT1waG4.mjs} +1 -1
  7. package/dist/{account-DvxcqeaK.mjs → account-agnMUKWj.mjs} +1 -1
  8. package/dist/{account-tags-CeqfEWpz.mjs → account-tags-BRMMHCee.mjs} +1 -1
  9. package/dist/{accounts-Bx-8BMH9.mjs → accounts-Cut77dAt.mjs} +2 -2
  10. package/dist/{acm--0opdSGE.mjs → acm-C8WgXNCl.mjs} +1 -1
  11. package/dist/{addressing-BS1ynzLA.mjs → addressing-CR8EV42x.mjs} +1 -1
  12. package/dist/{agent-context-BPhyrSns.mjs → agent-context-Wj5TRRbW.mjs} +1 -1
  13. package/dist/{agent-memory-DczzpEw5.mjs → agent-memory-CVJpKKZy.mjs} +1 -1
  14. package/dist/{ai-CDdCTcQl.mjs → ai-BbNYt-yI.mjs} +1 -1
  15. package/dist/{ai-audit-Bx9KMQYh.mjs → ai-audit-mVajM-2i.mjs} +1 -1
  16. package/dist/{ai-gateway-BSXJEaYS.mjs → ai-gateway-BsepSA_v.mjs} +2 -2
  17. package/dist/{ai-search-DRQj1aMu.mjs → ai-search-DbEJqm5-.mjs} +1 -1
  18. package/dist/{ai-security-C_Rb0lGT.mjs → ai-security-DmyB5EYk.mjs} +1 -1
  19. package/dist/{alerting-BAR9eFs2.mjs → alerting-dmy3hd8O.mjs} +3 -3
  20. package/dist/analytics-B1xBMla0.mjs +5 -0
  21. package/dist/{analytics_engine-DkEzlhfT.mjs → analytics_engine-DazCn3iC.mjs} +1 -1
  22. package/dist/{api-security-jA0lOk6a.mjs → api-security-0HXCzfHk.mjs} +1 -1
  23. package/dist/{argo-Cz4pDagx.mjs → argo-DSHsE8zv.mjs} +1 -1
  24. package/dist/{artifacts-BcLTGfAv.mjs → artifacts-CwiU9Mxu.mjs} +1 -1
  25. package/dist/{audit-logs-DbIv4n6u.mjs → audit-logs-DwFtMDwH.mjs} +1 -1
  26. package/dist/{auth-rW5d3jtr.mjs → auth-B0ZyXc3y.mjs} +1 -1
  27. package/dist/{auth-tvDdC1J-.mjs → auth-DWxtJ918.mjs} +2 -2
  28. package/dist/{billing-Md87QjqW.mjs → billing-Cbpadkgu.mjs} +1 -1
  29. package/dist/{bot-management-VHMo4hpU.mjs → bot-management-B6M2Vyyn.mjs} +1 -1
  30. package/dist/{botnet-feed-BHqfo3sa.mjs → botnet-feed-Dn8UuE4h.mjs} +1 -1
  31. package/dist/{brand-protection-HUeR6Pof.mjs → brand-protection-B5R0b3pu.mjs} +1 -1
  32. package/dist/{browser-extension-199oZg3X.mjs → browser-extension-D55pYZf_.mjs} +1 -1
  33. package/dist/{browser-run-DDasyux-.mjs → browser-run-C1b2VkGB.mjs} +1 -1
  34. package/dist/build-CP2JUfV1.mjs +2 -0
  35. package/dist/{builds-B-lXn6JR.mjs → builds-CVEXO_4a.mjs} +8 -8
  36. package/dist/{cache-CevKpiTM.mjs → cache-BU5xX82E.mjs} +1 -1
  37. package/dist/{certificate-authorities-DAg-aO1B.mjs → certificate-authorities--tZTWJWD.mjs} +1 -1
  38. package/dist/cf-BV2HLCQm.mjs +18 -0
  39. package/dist/{chunk-QBZBEHZB-BuiXJn8j.mjs → chunk-QBZBEHZB-BcCMlc8C.mjs} +1 -1
  40. package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +103 -0
  41. package/dist/{client-certificates-Bay7oPLE.mjs → client-certificates-DX84qeYG.mjs} +1 -1
  42. package/dist/{client-side-security-CbU9xn0k.mjs → client-side-security-DsSO2rZQ.mjs} +1 -1
  43. package/dist/{cloud-connector-AH2ClcSL.mjs → cloud-connector-cf8qlxap.mjs} +1 -1
  44. package/dist/{cloudforce-one-DwOfS75V.mjs → cloudforce-one-DzVXorbu.mjs} +2 -2
  45. package/dist/command-BL6weJf3.mjs +3 -0
  46. package/dist/command-DYrspBc0.mjs +2 -0
  47. package/dist/{completions-nPO9PdSu.mjs → completions-Dn621okY.mjs} +1 -1
  48. package/dist/{config-B8lwPpVl.mjs → config-BY6KpMZs.mjs} +1 -1
  49. package/dist/config.d.mts +1 -1729
  50. package/dist/config.mjs +1 -1
  51. package/dist/{connector-interrupts-DcLrqM2V.mjs → connector-interrupts-DqpqPPkp.mjs} +1 -1
  52. package/dist/{connector-telemetry-events-PrJWgNs9.mjs → connector-telemetry-events-CCD-_B-8.mjs} +1 -1
  53. package/dist/{connector-telemetry-snapshots-CIjJm5yu.mjs → connector-telemetry-snapshots-D3CeGGhk.mjs} +1 -1
  54. package/dist/{connectors-CEAy30E-.mjs → connectors-aPQspZdg.mjs} +1 -1
  55. package/dist/{containers-BsbDqbSn.mjs → containers-D0Kjl8h-.mjs} +1 -1
  56. package/dist/{content-scan-BdK936iO.mjs → content-scan-BVx18XmS.mjs} +1 -1
  57. package/dist/{cps-oP97-qkm.mjs → cps-ByazyM0x.mjs} +1 -1
  58. package/dist/{csamScanner-DUNN4INg.mjs → csamScanner-OG5lQxBC.mjs} +1 -1
  59. package/dist/{ct-alerting-dV_gsV2w.mjs → ct-alerting-BJx5n8Zf.mjs} +1 -1
  60. package/dist/{custom-certificates-DYspvjo4.mjs → custom-certificates-BuJ2e9TA.mjs} +1 -1
  61. package/dist/{custom-csrs-DjSWLQRu.mjs → custom-csrs-CR_5qbST.mjs} +1 -1
  62. package/dist/{custom-hostnames-df1lH6IY.mjs → custom-hostnames-BzDTsQXb.mjs} +1 -1
  63. package/dist/{custom-nameservers-CLTbN-9R.mjs → custom-nameservers-OfMPRGkD.mjs} +1 -1
  64. package/dist/custom-pages-BmGXoTIo.mjs +3 -0
  65. package/dist/d1-DedC8N0N.mjs +21 -0
  66. package/dist/data-security-B2UB26ry.mjs +7 -0
  67. package/dist/{dcv-delegation-_r6Vc6VL.mjs → dcv-delegation-C11vmzbG.mjs} +1 -1
  68. package/dist/{deploy-QTGENpOM.mjs → deploy-BtETDvDA.mjs} +1 -1
  69. package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-BoLTdQzS.mjs} +1 -1
  70. package/dist/{dev-CAubuxCc.mjs → dev-B5WcIpEr.mjs} +2 -2
  71. package/dist/{diagnostics-B0DRh714.mjs → diagnostics-Cf6BLpAo.mjs} +1 -1
  72. package/dist/dialog-Bud0hiYv.mjs +2 -0
  73. package/dist/{dist-DW5BPGFs.mjs → dist-BRg_z9Ut.mjs} +1 -1
  74. package/dist/{shared-YJtB5KZB.mjs → dist-CFQREIRi.mjs} +86 -86
  75. package/dist/dist-CyisSore.mjs +371 -0
  76. package/dist/dist-Dr4Hg_Up.mjs +48 -0
  77. package/dist/{dls-CFzTHcZM.mjs → dls-R6PvHbhj.mjs} +1 -1
  78. package/dist/{dns-Dw6u-NV1.mjs → dns-Cl8se64c.mjs} +1 -1
  79. package/dist/{dns-firewall-CIPptslp.mjs → dns-firewall-WtmKilDT.mjs} +1 -1
  80. package/dist/dry-run-YSQndLvt.mjs +2 -0
  81. package/dist/{durable-objects-CCkeqqBq.mjs → durable-objects-jfVU6yp_.mjs} +1 -1
  82. package/dist/{email-auth-kdxO51Oz.mjs → email-auth-DPmZ85eW.mjs} +1 -1
  83. package/dist/{email-routing-BLggZdQq.mjs → email-routing-Bf6DbNTr.mjs} +1 -1
  84. package/dist/{email-security-DjADlgdM.mjs → email-security-DTifjSxM.mjs} +1 -1
  85. package/dist/{email-sending-Cz7E7GoP.mjs → email-sending-Dm3WkFHV.mjs} +1 -1
  86. package/dist/{error-sanitization-DfLijlBJ.mjs → error-sanitization-D8zuyPj_.mjs} +1 -1
  87. package/dist/{fieldExtractors-BWaMi6lD.mjs → fieldExtractors-CeXZL0-I.mjs} +1 -1
  88. package/dist/{firewall-5t6OBIOl.mjs → firewall-D5N2APXO.mjs} +1 -1
  89. package/dist/{flagship-CzG_VoNR.mjs → flagship-sUOy9jei.mjs} +1 -1
  90. package/dist/{fraud-UOg_69Ob.mjs → fraud-WLW2Ep1Z.mjs} +1 -1
  91. package/dist/{google-tag-gateway-DirkD-Q2.mjs → google-tag-gateway-lbww1FaJ.mjs} +1 -1
  92. package/dist/{healthchecks-BkHZGTp1.mjs → healthchecks-0ih8Qjiw.mjs} +1 -1
  93. package/dist/{hostnames-EUYOZm21.mjs → hostnames-Ba6FuL8K.mjs} +1 -1
  94. package/dist/{hyperdrive-ZoLJlJCL.mjs → hyperdrive-DMqcU639.mjs} +1 -1
  95. package/dist/{iam-BQ2xSgYN.mjs → iam-CXlYm0uC.mjs} +1 -1
  96. package/dist/{images-CkEq6ScP.mjs → images-D_g1oli6.mjs} +1 -1
  97. package/dist/index.mjs +1 -1
  98. package/dist/{intel-DDWEdGyl.mjs → intel-B8bS0ARd.mjs} +1 -1
  99. package/dist/interactive-CGOh-aYq.mjs +32 -0
  100. package/dist/{ips-54Qmy-Uw.mjs → ips-68fzniN4.mjs} +1 -1
  101. package/dist/{keyless-certificates-CXHLc3Qz.mjs → keyless-certificates-CeLnqBvX.mjs} +1 -1
  102. package/dist/{keys-rvI4TC3Z.mjs → keys-DkVdS2lF.mjs} +1 -1
  103. package/dist/{kv-CAeN1zBy.mjs → kv-gDAN50BQ.mjs} +1 -1
  104. package/dist/{leaked-credential-checks-CbbwtG-p.mjs → leaked-credential-checks-DfnvHpvg.mjs} +1 -1
  105. package/dist/{lifecycle-XswDq0ZB.mjs → lifecycle-CadF_i2n.mjs} +1 -1
  106. package/dist/{load-balancers-BFwdwAIU.mjs → load-balancers-m0HqyXPZ.mjs} +1 -1
  107. package/dist/{local-C6XsFD_W.mjs → local-BwL_gesw.mjs} +1 -1
  108. package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-Dj8k-p62.mjs} +1 -1
  109. package/dist/{logo-matches-Y3PxVn7t.mjs → logo-matches-DPbHlsKQ.mjs} +1 -1
  110. package/dist/{logos-BN8SvJhS.mjs → logos-DFBJFAYJ.mjs} +1 -1
  111. package/dist/{logpush-BnLA4WVm.mjs → logpush-gzmlZayc.mjs} +1 -1
  112. package/dist/logs-BuzwQgt5.mjs +18 -0
  113. package/dist/{magic-cloud-networking-wPuLwu-F.mjs → magic-cloud-networking-BbHCi1Vp.mjs} +1 -1
  114. package/dist/{magic-network-monitoring-BNERUpxS.mjs → magic-network-monitoring-kWMmnPTG.mjs} +1 -1
  115. package/dist/{magic-transit-6tvVOECW.mjs → magic-transit-ClSmJDKw.mjs} +1 -1
  116. package/dist/{managed-defense-AYwBOYIH.mjs → managed-defense-EOihg1UR.mjs} +1 -1
  117. package/dist/{managed-transforms-HZZNrkC7.mjs → managed-transforms-BZ_XdGE2.mjs} +1 -1
  118. package/dist/{matches-Dp91L3dL.mjs → matches-B6sG0_fr.mjs} +1 -1
  119. package/dist/{mcp-P7pcieiT.mjs → mcp--kK0vS5i.mjs} +1 -1
  120. package/dist/{mesh-DjFrk6PL.mjs → mesh-DfXYUHOO.mjs} +1 -1
  121. package/dist/{mtls-certificates-DZMoef2H.mjs → mtls-certificates-DZd-0X7l.mjs} +1 -1
  122. package/dist/{network-7cd1U6-I.mjs → network-U6f_5ihp.mjs} +1 -1
  123. package/dist/{network-interconnects-CQ7cPZjK.mjs → network-interconnects-DKZGTiYM.mjs} +1 -1
  124. package/dist/oauth-BdVr2hJp.mjs +14 -0
  125. package/dist/{oauth-clients-P9t-eMnx.mjs → oauth-clients-CY3OkPhC.mjs} +1 -1
  126. package/dist/{oauth-scopes-C3r9Qh_y.mjs → oauth-scopes-BTY7_5L-.mjs} +1 -1
  127. package/dist/{observability-M1DnLhMR.mjs → observability-Bsp-LdmJ.mjs} +1 -1
  128. package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-ClEt4E8F.mjs} +3 -3
  129. package/dist/{organization-cUE7GDCt.mjs → organization-BSeMdj-7.mjs} +1 -1
  130. package/dist/{organizations-C-Hcpd0w.mjs → organizations-BroR48Nv.mjs} +1 -1
  131. package/dist/{origin-ca-certificates-C8cJMyQH.mjs → origin-ca-certificates-jC-EMn6W.mjs} +1 -1
  132. package/dist/{origin-post-quantum-encryption-DjZJCk8M.mjs → origin-post-quantum-encryption-DIspLvA0.mjs} +1 -1
  133. package/dist/{origin-tls-client-auth-BsjR5EAV.mjs → origin-tls-client-auth-CZ_nUEcM.mjs} +1 -1
  134. package/dist/{page-rules-B-zq1EUb.mjs → page-rules-ZcdjPohY.mjs} +1 -1
  135. package/dist/{pages-B6YpkPos.mjs → pages-W4tKa7xk.mjs} +1 -1
  136. package/dist/pay-per-crawl-BNM1mJmP.mjs +5 -0
  137. package/dist/pay-per-use-DKxlnkH3.mjs +2 -0
  138. package/dist/{pipelines-BJc_RylD.mjs → pipelines-Dug0BR-c.mjs} +1 -1
  139. package/dist/{precursor-CLQu7suY.mjs → precursor-D-11DkRU.mjs} +1 -1
  140. package/dist/previews-D_Nv4dR6.mjs +4 -0
  141. package/dist/{progress-V6SZV3Ux.mjs → progress-a5IKeKni.mjs} +1 -1
  142. package/dist/project-settings-Bc3wYHo8.mjs +3 -0
  143. package/dist/prompt-BP8XrQSj.mjs +3 -0
  144. package/dist/{queries-DSrrket-.mjs → queries-BdA2vJoe.mjs} +1 -1
  145. package/dist/{queues-Tf7kPBpn.mjs → queues-Bu06ZqUE.mjs} +1 -1
  146. package/dist/{r2-DmKNnxtC.mjs → r2-COC9wMKb.mjs} +1 -1
  147. package/dist/{r2-data-catalog-DBxoifOq.mjs → r2-data-catalog-CX5Rl5Qx.mjs} +1 -1
  148. package/dist/{radar-Csk7Ab-b.mjs → radar-L-yoLIHF.mjs} +1 -1
  149. package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNH2V8qH.mjs} +1 -1
  150. package/dist/{realtime-CDehZVhV.mjs → realtime-JKIiXfzi.mjs} +1 -1
  151. package/dist/{registrar-vflzeNQ9.mjs → registrar-_dYUZrK0.mjs} +2 -2
  152. package/dist/{registrar-sandbox-BxVdfnam.mjs → registrar-sandbox-D1yfW_Q_.mjs} +2 -2
  153. package/dist/{registry-CWUfXloz.mjs → registry-BrtVdMrC.mjs} +1 -1
  154. package/dist/{reporting-BaPZ1PHN.mjs → reporting-3fyoMcmb.mjs} +1 -1
  155. package/dist/request-headers-BhQQAfJt.mjs +2 -0
  156. package/dist/{request-tracers-C_UVBexV.mjs → request-tracers-TisEth2p.mjs} +1 -1
  157. package/dist/{resolve-B8CyM1mi.mjs → resolve-CYUp6YgC.mjs} +1 -1
  158. package/dist/{resource-sharing-CoB4S9j1.mjs → resource-sharing-C4-dnohU.mjs} +1 -1
  159. package/dist/{resource-tagging-CUiUC5g4.mjs → resource-tagging-BRDifKqM.mjs} +1 -1
  160. package/dist/{rules-4O8076_s.mjs → rules-BCF3gIkw.mjs} +2 -2
  161. package/dist/{rulesets-C84MxTYo.mjs → rulesets-wp6rllt3.mjs} +1 -1
  162. package/dist/{rum-Bvwkrntx.mjs → rum-B77awgoB.mjs} +1 -1
  163. package/dist/run-BS8otL3u.mjs +2 -0
  164. package/dist/{schema-C8hU6G9R.mjs → schema-DmuJtMN5.mjs} +1 -1
  165. package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CUGxFeZe.mjs} +4 -4
  166. package/dist/{scim-BvxQmde6.mjs → scim-C9BmUYil.mjs} +1 -1
  167. package/dist/{sdk-C12y5qCN.mjs → sdk-Bvqx-_3z.mjs} +1 -1
  168. package/dist/{secrets-store-DOKWiC-j.mjs → secrets-store-ckkZR2dM.mjs} +1 -1
  169. package/dist/{security-center-Bhy_aC-w.mjs → security-center-BCahKT57.mjs} +1 -1
  170. package/dist/{security-txt-L7HJ9tq5.mjs → security-txt-0SI5du7I.mjs} +1 -1
  171. package/dist/shared-D0B-7q-D.mjs +2 -0
  172. package/dist/{smart-shield-COMXuQ1S.mjs → smart-shield-BDPbrZa4.mjs} +1 -1
  173. package/dist/{snippets-DffQhlKt.mjs → snippets-CVRR_h0i.mjs} +1 -1
  174. package/dist/spawn-DP4T92ss.mjs +519 -0
  175. package/dist/{spectrum-Cmf7SqQE.mjs → spectrum-CjNXQIQE.mjs} +3 -3
  176. package/dist/{speed-m8cdhLFS.mjs → speed-CrXCHk3h.mjs} +1 -1
  177. package/dist/src-BbnV77C4.mjs +108 -0
  178. package/dist/{ssl-D4ffsdSw.mjs → ssl-DKORhHkh.mjs} +1 -1
  179. package/dist/{startup-profile-Dx95Y5cl.mjs → startup-profile-CBIH6yZy.mjs} +3 -3
  180. package/dist/{state-CHif8Y5I.mjs → state-QUu6HfxC.mjs} +1 -1
  181. package/dist/{stream-DPF5fojV.mjs → stream-wY3zi3FK.mjs} +1 -1
  182. package/dist/{submit-Br8hfP0_.mjs → submit-B-4oCBSk.mjs} +1 -1
  183. package/dist/{tags-Bnt4JuxQ.mjs → tags-5uJEkYJZ.mjs} +1 -1
  184. package/dist/{telemetry-DjGNSlkU.mjs → telemetry-2s9Y3FaN.mjs} +1 -1
  185. package/dist/{telemetry-Ch1vCICm.mjs → telemetry-n3NJourL.mjs} +1 -1
  186. package/dist/{tenant-D8u0CxoC.mjs → tenant-BkFvv2o3.mjs} +1 -1
  187. package/dist/{tenant-custom-nameservers-BrWMyslZ.mjs → tenant-custom-nameservers-DcjC1q0r.mjs} +1 -1
  188. package/dist/{tools-D9RZkZRc.mjs → tools-Dz1JCrHd.mjs} +1 -1
  189. package/dist/tunnel-Cd4ipbvJ.mjs +2 -0
  190. package/dist/{tunnels-BkNPpTHa.mjs → tunnels-9Zg3ePwD.mjs} +1 -1
  191. package/dist/{turnstile-MgwRECJv.mjs → turnstile-BTwKYpzD.mjs} +1 -1
  192. package/dist/{url-info-Ddp7MgcI.mjs → url-info-D7Y61BFd.mjs} +1 -1
  193. package/dist/{url-normalization-3ptK9ntV.mjs → url-normalization-B4n8HiNQ.mjs} +1 -1
  194. package/dist/{url-scanner-Psb9ollR.mjs → url-scanner-CiCIltSQ.mjs} +1 -1
  195. package/dist/{user-DWdshcIu.mjs → user-DDFDGJ0Y.mjs} +1 -1
  196. package/dist/{values-CDKQL1z2.mjs → values-DRznB_Cl.mjs} +1 -1
  197. package/dist/{vectorize-CTYYUyQj.mjs → vectorize-CbznPhzq.mjs} +1 -1
  198. package/dist/waiting-rooms-CKP5hYBK.mjs +11 -0
  199. package/dist/{web-assets-CpDwDEx8.mjs → web-assets-C-ZoSkkh.mjs} +1 -1
  200. package/dist/{web3-YsjDyAzH.mjs → web3-DwlN4dOw.mjs} +1 -1
  201. package/dist/{workers-builds-BWo5vUA9.mjs → workers-builds-ECw_x_kp.mjs} +1 -1
  202. package/dist/{workers-for-platforms-ASJsxYdM.mjs → workers-for-platforms-BYGy46R6.mjs} +2 -2
  203. package/dist/{workers-vpc-RkTnRvA2.mjs → workers-vpc-CCosFcxz.mjs} +1 -1
  204. package/dist/workers-zFMrbUkg.mjs +6 -0
  205. package/dist/{workflows-KrIFI9ns.mjs → workflows-C8GXGDRW.mjs} +1 -1
  206. package/dist/{zaraz-DglXbVzZ.mjs → zaraz-B5UIREaz.mjs} +1 -1
  207. package/dist/{zero-trust-RilTdSjX.mjs → zero-trust-DUp0XoIo.mjs} +50 -50
  208. package/dist/{zone-DsBtVkvT.mjs → zone-BGLkk-mL.mjs} +1 -1
  209. package/dist/{zones-BFxvWFQW.mjs → zones-CwYjNXMH.mjs} +1 -1
  210. package/package.json +11 -11
  211. package/dist/analytics-BaUZwNc5.mjs +0 -4
  212. package/dist/build-0QlYUfFS.mjs +0 -2
  213. package/dist/cf-C11NGkjx.mjs +0 -18
  214. package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
  215. package/dist/command-CMzMsll4.mjs +0 -2
  216. package/dist/custom-pages-DzKnSgL3.mjs +0 -3
  217. package/dist/d1-JBEqjJoj.mjs +0 -20
  218. package/dist/data-security-CIktWnXt.mjs +0 -7
  219. package/dist/dist-12KzRsBM.mjs +0 -387
  220. package/dist/dist-BCVqQpg2.mjs +0 -2
  221. package/dist/dist-Cp3uJN1x.mjs +0 -48
  222. package/dist/dist-S9K_8gq9.mjs +0 -9
  223. package/dist/dry-run-DiVy1lVo.mjs +0 -2
  224. package/dist/interactive-B2E03Fs-.mjs +0 -11
  225. package/dist/interactive-_B-EqD0Y.mjs +0 -23
  226. package/dist/logexplorer-D8rOPB5I.mjs +0 -17
  227. package/dist/logs-CDo7Y5sA.mjs +0 -3
  228. package/dist/oauth-DH3kMXSs.mjs +0 -14
  229. package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
  230. package/dist/prompt-DjRTpML4.mjs +0 -3
  231. package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
  232. package/dist/request-headers-CC4eHmI2.mjs +0 -3
  233. package/dist/run-CRfinkSe.mjs +0 -2
  234. package/dist/schemas-O_ZNaF8R.mjs +0 -65
  235. package/dist/spawn-C1AISA2V.mjs +0 -526
  236. package/dist/src-C8phrg-8.mjs +0 -109
  237. package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
  238. package/dist/workers-BKKxaZcz.mjs +0 -6
  239. /package/dist/{alerts-B2SJO4nd.mjs → alerts-CarPLL8k.mjs} +0 -0
  240. /package/dist/{autorag-iNjZXw1n.mjs → autorag-zK-3harf.mjs} +0 -0
  241. /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-Cmw7PZ7a.mjs} +0 -0
  242. /package/dist/{brands-BrVnNrT3.mjs → brands-CpgTsX8h.mjs} +0 -0
  243. /package/dist/{clear-an9o3dJ3.mjs → clear-C5gzBA8G.mjs} +0 -0
  244. /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-abvWQN3T.mjs} +0 -0
  245. /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-BY-dbhQZ.mjs} +0 -0
  246. /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-DoMvHvCO.mjs} +0 -0
  247. /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-Cw3G4nap.mjs} +0 -0
  248. /package/dist/{health-CIUg1C5o.mjs → health-DkEXPkS6.mjs} +0 -0
  249. /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-nF-0Ze2h.mjs} +0 -0
  250. /package/dist/{internal-DmpATljO.mjs → internal-4fU2r5en.mjs} +0 -0
  251. /package/dist/{live-B66u3_0g.mjs → live-B4iGrwY2.mjs} +0 -0
  252. /package/dist/{metadata-D062SVyy.mjs → metadata-C5fJJr-k.mjs} +0 -0
  253. /package/dist/{output-COcSQsfn.mjs → output-Z2lQmPUW.mjs} +0 -0
  254. /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-DNsAFIeM.mjs} +0 -0
  255. /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-CsOim7bm.mjs} +0 -0
  256. /package/dist/{ready-C-H2cwp_.mjs → ready-tTe-zcIw.mjs} +0 -0
  257. /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-B3eTV5yC.mjs} +0 -0
  258. /package/dist/{refute-uSlzkQKq.mjs → refute-BY76YVrT.mjs} +0 -0
  259. /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-DdoF_a5y.mjs} +0 -0
  260. /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-sSgLwwZN.mjs} +0 -0
  261. /package/dist/{search-BlKeSfVD.mjs → search-BFvQr-sl.mjs} +0 -0
  262. /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-Cr8hiZPJ.mjs} +0 -0
  263. /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-DT2mLnu1.mjs} +0 -0
  264. /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-6gs5iy9T.mjs} +0 -0
  265. /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-D6XKO2EV.mjs} +0 -0
  266. /package/dist/{verify-S-TmhUDr.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,i as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`eligibility <report-id>`,describe:`Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse.`,builder:h,handler:async c=>s({command:`abuse-reports appeals eligibility`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.appeals.eligibility({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})},_={command:`appeals`,describe:`Operations for appeals`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`act`,{type:`string`,description:`The act field`,choices:[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`]}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,i as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`eligibility <report-id>`,describe:`Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse.`,builder:h,handler:async c=>s({command:`abuse-reports appeals eligibility`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.appeals.eligibility({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})},_={command:`appeals`,describe:`Operations for appeals`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`act`,{type:`string`,description:`The act field`,choices:[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`]}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
3
3
  `}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
4
4
  `,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
5
5
  `}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,n as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.option(`target-ids`,{type:`string`,array:!0,description:`List of target IDs to bulk delete`}).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:`delete`,describe:`Removes one or more targets.`,builder:h,handler:async l=>s({command:`access targets bulk delete`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_delete`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({target_ids:l[`target-ids`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.access.targets.bulk.delete({...e,account_id:d})),{successLabel:`Created`});return}if(l[`target-ids`]===void 0)throw Error(`--target-ids is required (or pass --body with this field set).`);let f=u({target_ids:l[`target-ids`]});i(await o(`Creating`,async()=>s.access.targets.bulk.delete({...f,account_id:d})),{successLabel:`Created`})})};function _(e){return e.option(`items`,{type:`string`,description:`The items 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 v={command:`replace-tags`,describe:`Replaces tags for one or more existing infrastructure access targets.`,builder:_,handler:async d=>s({command:`access targets bulk replace-tags`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf access targets bulk replace-tags`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_tags`,pathParams:{},bodyKind:`json`,body:d.body===void 0?u({items:l(d.items,`items`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.access.targets.bulk.replaceTags({...e,account_id:f})),{successLabel:`Created`});return}if(d.items===void 0)throw Error(`--items is required (or pass --body with this field set).`);let p=u({items:l(d.items,`items`)});i(await o(`Creating`,async()=>s.access.targets.bulk.replaceTags({...p,account_id:f})),{successLabel:`Created`})})};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update`,describe:`Adds one or more targets.`,builder:y,handler:async l=>s({command:`access targets bulk update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.access.targets.bulk.update({body:e,account_id:u})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},x={command:`bulk`,describe:`Operations for targets.bulk`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,n as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.option(`target-ids`,{type:`string`,array:!0,description:`List of target IDs to bulk delete`}).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:`delete`,describe:`Removes one or more targets.`,builder:h,handler:async l=>s({command:`access targets bulk delete`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_delete`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({target_ids:l[`target-ids`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.access.targets.bulk.delete({...e,account_id:d})),{successLabel:`Created`});return}if(l[`target-ids`]===void 0)throw Error(`--target-ids is required (or pass --body with this field set).`);let f=u({target_ids:l[`target-ids`]});i(await o(`Creating`,async()=>s.access.targets.bulk.delete({...f,account_id:d})),{successLabel:`Created`})})};function _(e){return e.option(`items`,{type:`string`,description:`The items 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 v={command:`replace-tags`,describe:`Replaces tags for one or more existing infrastructure access targets.`,builder:_,handler:async d=>s({command:`access targets bulk replace-tags`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf access targets bulk replace-tags`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_tags`,pathParams:{},bodyKind:`json`,body:d.body===void 0?u({items:l(d.items,`items`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.access.targets.bulk.replaceTags({...e,account_id:f})),{successLabel:`Created`});return}if(d.items===void 0)throw Error(`--items is required (or pass --body with this field set).`);let p=u({items:l(d.items,`items`)});i(await o(`Creating`,async()=>s.access.targets.bulk.replaceTags({...p,account_id:f})),{successLabel:`Created`})})};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update`,describe:`Adds one or more targets.`,builder:y,handler:async l=>s({command:`access targets bulk update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.access.targets.bulk.update({body:e,account_id:u})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},x={command:`bulk`,describe:`Operations for targets.bulk`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
3
3
  length of 255 characters, supports the use of special characters dash
4
4
  and period, does not support spaces, and must start and end with an
5
5
  alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).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`,describe:`Creates a new infrastructure access target in the account.`,builder:S,handler:async l=>s({command:`access targets create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({hostname:d(l.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:d(l[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:d(l[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.access.targets.create({...e,account_id:p})),{successLabel:`Created`});return}l.hostname===void 0&&(l.hostname=await f(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let m=u({hostname:d(l.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:d(l[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:d(l[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}});i(await o(`Creating`,async()=>s.access.targets.create({...m,account_id:p})),{successLabel:`Created`})})};function w(e){return e.positional(`target-id`,{type:`string`,description:`Target 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 T={command:`delete <target-id>`,describe:`Removes a single infrastructure access target by its ID.`,builder:w,handler:async c=>s({command:`access targets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf access targets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/${c[`target-id`]==null?`<target-id>`:encodeURIComponent(String(c[`target-id`]))}`,pathParams:{"target-id":String(c[`target-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force})){process.stderr.write(`Aborted.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,t as l}from"./body-parser-DIlfApuJ.mjs";import{n as u}from"./input-validation-BxchZ9jE.mjs";import{a as d}from"./prompt-DjRTpML4.mjs";function f(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:f,handler:async e=>s({command:`account batch move`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)}):c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await d(`destination-organization-id`,`Move accounts to this organization ID.`));let n=l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`})})},m={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const g={command:`move`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:h,handler:async f=>s({command:`account move`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.account.move({...e,account_id:p})),{successLabel:`Created`});return}f[`destination-organization-id`]===void 0&&(f[`destination-organization-id`]=await d(`destination-organization-id`,`The destination_organization_id field`));let m=l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>s.account.move({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:_,handler:async c=>s({command:`account organization list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.account.organization.list({account_id:l})),{successLabel:`Loaded`})})},y={command:`organization`,describe:`Operations for organization`,builder:e=>e.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:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:b,handler:async c=>s({command:`account profile get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.account.profile.get({account_id:l})),{successLabel:`Loaded`})})};function S(e){return e.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 C={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:S,handler:async f=>s({command:`account profile update`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Updating`,async()=>s.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}f[`business-address`]===void 0&&(f[`business-address`]=await d(`business-address`,`The business_address field`)),f[`business-email`]===void 0&&(f[`business-email`]=await d(`business-email`,`The business_email field`)),f[`business-name`]===void 0&&(f[`business-name`]=await d(`business-name`,`The business_name field`)),f[`business-phone`]===void 0&&(f[`business-phone`]=await d(`business-phone`,`The business_phone field`)),f[`external-metadata`]===void 0&&(f[`external-metadata`]=await d(`external-metadata`,`The external_metadata field`));let m=l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)});i(await o(`Updating`,async()=>s.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})})},w={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`account`,describe:`account`,builder:e=>e.command(g).command(m).command(y).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d}from"./prompt-BP8XrQSj.mjs";function f(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:f,handler:async e=>s({command:`account batch move`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)}):c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await d(`destination-organization-id`,`Move accounts to this organization ID.`));let n=l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`})})},m={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const g={command:`move`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:h,handler:async f=>s({command:`account move`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.account.move({...e,account_id:p})),{successLabel:`Created`});return}f[`destination-organization-id`]===void 0&&(f[`destination-organization-id`]=await d(`destination-organization-id`,`The destination_organization_id field`));let m=l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>s.account.move({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:_,handler:async c=>s({command:`account organization list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.account.organization.list({account_id:l})),{successLabel:`Loaded`})})},y={command:`organization`,describe:`Operations for organization`,builder:e=>e.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:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:b,handler:async c=>s({command:`account profile get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.account.profile.get({account_id:l})),{successLabel:`Loaded`})})};function S(e){return e.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 C={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:S,handler:async f=>s({command:`account profile update`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Updating`,async()=>s.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}f[`business-address`]===void 0&&(f[`business-address`]=await d(`business-address`,`The business_address field`)),f[`business-email`]===void 0&&(f[`business-email`]=await d(`business-email`,`The business_email field`)),f[`business-name`]===void 0&&(f[`business-name`]=await d(`business-name`,`The business_name field`)),f[`business-phone`]===void 0&&(f[`business-phone`]=await d(`business-phone`,`The business_phone field`)),f[`external-metadata`]===void 0&&(f[`external-metadata`]=await d(`external-metadata`,`The external_metadata field`));let m=l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)});i(await o(`Updating`,async()=>s.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})})},w={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`account`,describe:`account`,builder:e=>e.command(g).command(m).command(y).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{a as i,r as a}from"./auth-tvDdC1J-.mjs";import{t as o}from"./output-COcSQsfn.mjs";import{t as s}from"./dry-run-DiVy1lVo.mjs";import{t as c}from"./progress-V6SZV3Ux.mjs";import{t as l}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as u,n as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p}from"./input-validation-BxchZ9jE.mjs";import{a as m,i as h,n as g}from"./prompt-DjRTpML4.mjs";import{t as _}from"./cli-types-CrSoSMPF.mjs";function v(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{a as i,r as a}from"./auth-DWxtJ918.mjs";import{t as o}from"./output-Z2lQmPUW.mjs";import{t as s}from"./dry-run-YSQndLvt.mjs";import{t as c}from"./progress-a5IKeKni.mjs";import{t as l}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as u,n as d,t as f}from"./body-parser-Cmw7PZ7a.mjs";import{n as p}from"./input-validation-nF-0Ze2h.mjs";import{a as m,i as h,n as g}from"./prompt-BP8XrQSj.mjs";import{t as _}from"./cli-types-abvWQN3T.mjs";function v(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
3
3
  verify the current resource ETag matches before applying the write. Returns
4
4
  412 Precondition Failed if the resource has been modified since the ETag was
5
5
  obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`)}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).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:`Request body schema for deleting tags from account-level resources. Use /zones/{zone_id}/tags for zone-level resources.`})}const y={command:`delete`,describe:`Removes all tags from a specific account or zone-level resource.`,builder:v,handler:async _=>l({command:`account-tags delete`,classification:{safeFlags:[`resource-type`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},_,async()=>{let l={};if(_[`if-match`]!==void 0&&(l[`If-Match`]=String(_[`if-match`])),_.dryRun){let e=_.zone===void 0?await n():void 0,t=_.zone===void 0?`accounts`:`zones`,r=_.zone??e??`<account-id>`;s({command:`cf account-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:_.body===void 0?f({resource_id:p(_[`resource-id`],`resource-id`,`text`),resource_type:p(_[`resource-type`],`resource-type`,`text`),worker_id:p(_[`worker-id`],`worker-id`,`text`)}):d(_.body)});return}let v=await a(_),y=_.zone===void 0?`accounts`:`zones`,b=y===`zones`?await r({zone:_.zone},v,{quiet:_.quiet}):_.local?e:await t();if(y===`zones`?_.zoneId=b:_.accountId=b,!await g({force:!!_.force})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{a as i,r as a}from"./auth-tvDdC1J-.mjs";import{t as o}from"./output-COcSQsfn.mjs";import{t as s}from"./dry-run-DiVy1lVo.mjs";import{t as c}from"./progress-V6SZV3Ux.mjs";import{t as l}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DIlfApuJ.mjs";import{n as m}from"./input-validation-BxchZ9jE.mjs";import{a as h,i as g,n as _}from"./prompt-DjRTpML4.mjs";import{t as v}from"./cli-types-CrSoSMPF.mjs";import{n as ee,t as te}from"./raw-fetch-BVYQR6C5.mjs";function y(e){return e.option(`category-id`,{type:`number`,description:`Returns the category ID.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Returns the human readable ID.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`name`,{type:`string`,description:`Returns the application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Create a custom application for an account.`,builder:y,handler:async r=>l({command:`accounts applications create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({category_id:r[`category-id`],hostnames:r.hostnames,human_id:m(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:m(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.applications.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);r[`human-id`]===void 0&&(r[`human-id`]=await h(`human-id`,`Returns the human readable ID.`)),r.name===void 0&&(r.name=await h(`name`,`Returns the application name.`));let u=p({category_id:r[`category-id`],hostnames:r.hostnames,human_id:m(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:m(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Creating`,async()=>i.accounts.applications.create({...u,account_id:l})),{successLabel:`Created`})})};function x(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <id>`,describe:`Delete a custom application and all of its versions. Deletion is rejected when other resources reference the application.`,builder:x,handler:async r=>l({command:`accounts applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{a as i,r as a}from"./auth-DWxtJ918.mjs";import{t as o}from"./output-Z2lQmPUW.mjs";import{t as s}from"./dry-run-YSQndLvt.mjs";import{t as c}from"./progress-a5IKeKni.mjs";import{t as l}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-Cmw7PZ7a.mjs";import{n as m}from"./input-validation-nF-0Ze2h.mjs";import{a as h,i as g,n as _}from"./prompt-BP8XrQSj.mjs";import{t as v}from"./cli-types-abvWQN3T.mjs";import{n as ee,t as te}from"./raw-fetch-DNH2V8qH.mjs";function y(e){return e.option(`category-id`,{type:`number`,description:`Returns the category ID.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Returns the human readable ID.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets for this application. Custom application create and update requests accept IPv4 prefix lengths /8 through /32 and IPv6 prefix lengths /32 through /128.`}).option(`name`,{type:`string`,description:`Returns the application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom application. At least one hostname or IP subnet is required. Support domains and port/protocol pairs do not satisfy this requirement. `})}const b={command:`create`,describe:`Create a custom application for an account.`,builder:y,handler:async r=>l({command:`accounts applications create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({category_id:r[`category-id`],hostnames:r.hostnames,human_id:m(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:m(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.applications.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);r[`human-id`]===void 0&&(r[`human-id`]=await h(`human-id`,`Returns the human readable ID.`)),r.name===void 0&&(r.name=await h(`name`,`Returns the application name.`));let u=p({category_id:r[`category-id`],hostnames:r.hostnames,human_id:m(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:m(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Creating`,async()=>i.accounts.applications.create({body:u,account_id:l})),{successLabel:`Created`})})};function x(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <id>`,describe:`Delete a custom application and all of its versions. Deletion is rejected when other resources reference the application.`,builder:x,handler:async r=>l({command:`accounts applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}o(await c(`Deleting`,async()=>i.accounts.applications.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})})};function C(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
4
4
  - name: Filter by application name (e.g., name:HR)
5
5
  - id: Filter by application ID (e.g., id:498)
@@ -14,7 +14,7 @@ import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oaut
14
14
  .`}).option(`limit`,{type:`number`,description:`Limit of number of results to return (max 250).`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`order-by`,{type:`string`,description:`Order results using field:direction format. Supported fields are name, id, human_id,
15
15
  category_id, application_type, application_confidence_score, and gen_ai_score.
16
16
  Supported directions are asc and desc. Ignored when search is provided; results are
17
- ranked by relevance instead.`}).option(`search`,{type:`string`,description:`Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters.`}).option(`fields`,{type:`string`,description:"Return only the listed properties on each application, as a comma-separated list.\nUse this to keep responses small when you only need part of each application — for\nexample populating a picker with `fields=id,name` instead of downloading every\nhostname and IP subnet.\n\nOmit this parameter to receive the full application object.\n\n`id` is always returned.\n\nSelectable properties: `id`, `name`, `human_id`, `version`, `hostnames`,\n`support_domains`, `ip_subnets`, `port_protocols`, `supported`, `gen_ai_score`,\n`application_confidence_score`, `created_at`, `updated_at`, `review_status`.\n\nUnknown or empty property names return `400`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`applications`,describe:"List the applications available to an account, both the applications Cloudflare curates and the custom applications the account has defined. Results are paginated. Use `filter` and `search` to narrow the list, `order_by` to sort it, and `fields` to reduce each result to only the properties you need. The authenticated principal must have access to the account identified by `account_id`.",builder:C,handler:async r=>l({command:`accounts applications get applications`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={filter:r.filter,limit:r.limit,offset:r.offset,order_by:r[`order-by`],search:r.search,fields:r.fields};if(r.dryRun){s({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.applications.get.applications({account_id:u,...i})),{successLabel:`Loaded`})})};function T(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`id <id>`,describe:`Get application by ID.`,builder:T,handler:async r=>l({command:`accounts applications get by id`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.applications.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})})},D={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates the network matchers for the application. Omitted matcher lists are left unchanged; send an empty array to clear a list.`})}const A={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:k,handler:async r=>l({command:`accounts applications update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?p({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.applications.update({...e,account_id:l,id:r.id})),{successLabel:`Updated`});return}let u=p({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Updating`,async()=>i.accounts.applications.update({...u,account_id:l,id:r.id})),{successLabel:`Updated`})})},j={command:`applications`,describe:`Applications operations`,builder:e=>e.command(b).command(S).command(A).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`createSetupIntent`,describe:`Creates a Stripe setup intent for adding a payment method to an account. Returns a client secret for frontend payment method collection.`,builder:M,handler:async r=>l({command:`accounts billing createSetupIntent`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing createSetupIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/client-secret`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.createSetupIntent({account_id:l})),{successLabel:`Created`})})};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:P,handler:async r=>l({command:`accounts billing getBadDebt`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing getBadDebt`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/bad-debt`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getBadDebt({account_id:l})),{successLabel:`Loaded`})})};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:I,handler:async r=>l({command:`accounts billing getCredits`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing getCredits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/credits`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getCredits({account_id:l})),{successLabel:`Loaded`})})};function R(e){return e.positional(`receipt-id`,{type:`string`,description:`Receipt identifier.`,demandOption:!0}).option(`doctype`,{type:`string`,description:`The document type to generate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const z={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:R,handler:async r=>l({command:`accounts billing getReceiptPdf`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{let i={doctype:r.doctype};if(r.dryRun){s({command:`cf accounts billing getReceiptPdf`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/receipts/${r[`receipt-id`]==null?`<receipt-id>`:encodeURIComponent(String(r[`receipt-id`]))}/pdf`,pathParams:{"receipt-id":String(r[`receipt-id`]??``)},query:i,bodyKind:`none`});return}await a(r);let o=r.local?e:await t();r.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await c(`Loading`,async()=>te(`/accounts/${o}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?u.toString(`utf-8`):u)})};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:B,handler:async r=>l({command:`accounts billing getUnpaidInvoices`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing getUnpaidInvoices`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/unpaid-invoice`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getUnpaidInvoices({account_id:l})),{successLabel:`Loaded`})})};function H(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`status`,{type:`string`,description:`Filter billing history by status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Gets the billing history for an account.`,builder:H,handler:async r=>l({command:`accounts billing history list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){s({command:`cf accounts billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/history`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.history.list({account_id:u,...i})),{successLabel:`Loaded`})})},W={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).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:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:G,handler:async r=>l({command:`accounts billing payBadDebt`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payBadDebt`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-bad-debt`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...e,account_id:l})),{successLabel:`Created`});return}let u=p({payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...u,account_id:l})),{successLabel:`Created`})})};function q(e){return e.option(`invoice-id`,{type:`string`,description:`The identifier of the invoice to pay.`}).option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`validate-payment-method`,{type:`boolean`,description:`Whether to validate the payment method before processing.`}).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 J={command:`payInvoice`,describe:`Pays an outstanding invoice for an account. Returns a Stripe client secret when Strong Customer Authentication (SCA) is required to complete the payment.`,builder:q,handler:async r=>l({command:`accounts billing payInvoice`,classification:{safeFlags:[`validate-payment-method`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payInvoice`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-invoice`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({invoice_id:m(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...e,account_id:l})),{successLabel:`Created`});return}let u=p({invoice_id:m(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...u,account_id:l})),{successLabel:`Created`})})};function Y(e){return e.option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new payment method for an account.`,builder:Y,handler:async r=>l({command:`accounts billing payment-methods create`,classification:{safeFlags:[`default`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:e,account_id:l})),{successLabel:`Created`});return}let u=p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:u,account_id:l})),{successLabel:`Created`})})};function Z(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method 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 Q={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:Z,handler:async r=>l({command:`accounts billing payment-methods delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
17
+ ranked by relevance instead.`}).option(`search`,{type:`string`,description:`Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters.`}).option(`fields`,{type:`string`,description:"Return only the listed properties on each application, as a comma-separated list.\nUse this to keep responses small when you only need part of each application — for\nexample populating a picker with `fields=id,name` instead of downloading every\nhostname and IP subnet.\n\nOmit this parameter to receive the full application object.\n\n`id` is always returned.\n\nSelectable properties: `id`, `name`, `human_id`, `version`, `hostnames`,\n`support_domains`, `ip_subnets`, `port_protocols`, `supported`, `gen_ai_score`,\n`application_confidence_score`, `created_at`, `updated_at`, `review_status`.\n\nUnknown or empty property names return `400`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`applications`,describe:"List the applications available to an account, both the applications Cloudflare curates and the custom applications the account has defined. Results are paginated. Use `filter` and `search` to narrow the list, `order_by` to sort it, and `fields` to reduce each result to only the properties you need. The authenticated principal must have access to the account identified by `account_id`.",builder:C,handler:async r=>l({command:`accounts applications get applications`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={filter:r.filter,limit:r.limit,offset:r.offset,order_by:r[`order-by`],search:r.search,fields:r.fields};if(r.dryRun){s({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.applications.get.applications({account_id:u,...i})),{successLabel:`Loaded`})})};function T(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`id <id>`,describe:`Get application by ID.`,builder:T,handler:async r=>l({command:`accounts applications get by id`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.applications.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})})},D={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets for this application. Custom application create and update requests accept IPv4 prefix lengths /8 through /32 and IPv6 prefix lengths /32 through /128.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update the network matchers for the application. The service preserves omitted matcher lists; send an empty array to clear a list. The resulting application must contain at least one hostname or IP subnet. Support domains and port/protocol pairs do not satisfy this requirement. `})}const A={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:k,handler:async r=>l({command:`accounts applications update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts applications update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?p({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.applications.update({...e,account_id:l,id:r.id})),{successLabel:`Updated`});return}let u=p({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Updating`,async()=>i.accounts.applications.update({...u,account_id:l,id:r.id})),{successLabel:`Updated`})})},j={command:`applications`,describe:`Applications operations`,builder:e=>e.command(b).command(S).command(A).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`createSetupIntent`,describe:`Creates a Stripe setup intent for adding a payment method to an account. Returns a client secret for frontend payment method collection.`,builder:M,handler:async r=>l({command:`accounts billing createSetupIntent`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing createSetupIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/client-secret`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.createSetupIntent({account_id:l})),{successLabel:`Created`})})};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:P,handler:async r=>l({command:`accounts billing getBadDebt`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing getBadDebt`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/bad-debt`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getBadDebt({account_id:l})),{successLabel:`Loaded`})})};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:I,handler:async r=>l({command:`accounts billing getCredits`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing getCredits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/credits`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getCredits({account_id:l})),{successLabel:`Loaded`})})};function R(e){return e.positional(`receipt-id`,{type:`string`,description:`Receipt identifier.`,demandOption:!0}).option(`doctype`,{type:`string`,description:`The document type to generate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const z={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:R,handler:async r=>l({command:`accounts billing getReceiptPdf`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{let i={doctype:r.doctype};if(r.dryRun){s({command:`cf accounts billing getReceiptPdf`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/receipts/${r[`receipt-id`]==null?`<receipt-id>`:encodeURIComponent(String(r[`receipt-id`]))}/pdf`,pathParams:{"receipt-id":String(r[`receipt-id`]??``)},query:i,bodyKind:`none`});return}await a(r);let o=r.local?e:await t();r.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await c(`Loading`,async()=>te(`/accounts/${o}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?u.toString(`utf-8`):u)})};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:B,handler:async r=>l({command:`accounts billing getUnpaidInvoices`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing getUnpaidInvoices`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/unpaid-invoice`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getUnpaidInvoices({account_id:l})),{successLabel:`Loaded`})})};function H(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`status`,{type:`string`,description:`Filter billing history by status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Gets the billing history for an account.`,builder:H,handler:async r=>l({command:`accounts billing history list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){s({command:`cf accounts billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/history`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.history.list({account_id:u,...i})),{successLabel:`Loaded`})})},W={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).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:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:G,handler:async r=>l({command:`accounts billing payBadDebt`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payBadDebt`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-bad-debt`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...e,account_id:l})),{successLabel:`Created`});return}let u=p({payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...u,account_id:l})),{successLabel:`Created`})})};function q(e){return e.option(`invoice-id`,{type:`string`,description:`The identifier of the invoice to pay.`}).option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`validate-payment-method`,{type:`boolean`,description:`Whether to validate the payment method before processing.`}).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 J={command:`payInvoice`,describe:`Pays an outstanding invoice for an account. Returns a Stripe client secret when Strong Customer Authentication (SCA) is required to complete the payment.`,builder:q,handler:async r=>l({command:`accounts billing payInvoice`,classification:{safeFlags:[`validate-payment-method`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payInvoice`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-invoice`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({invoice_id:m(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...e,account_id:l})),{successLabel:`Created`});return}let u=p({invoice_id:m(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...u,account_id:l})),{successLabel:`Created`})})};function Y(e){return e.option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new payment method for an account.`,builder:Y,handler:async r=>l({command:`accounts billing payment-methods create`,classification:{safeFlags:[`default`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:e,account_id:l})),{successLabel:`Created`});return}let u=p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:u,account_id:l})),{successLabel:`Created`})})};function Z(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method 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 Q={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:Z,handler:async r=>l({command:`accounts billing payment-methods delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
18
18
  `);return}o(await c(`Deleting`,async()=>i.accounts.billing.paymentMethods.delete({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Deleted`})})};function ne(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <payment-method-id>`,describe:`Gets a specific payment method for an account.`,builder:ne,handler:async r=>l({command:`accounts billing payment-methods get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.paymentMethods.get({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Loaded`})})};function ie(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Lists all payment methods for an account.`,builder:ie,handler:async r=>l({command:`accounts billing payment-methods list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf accounts billing payment-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.paymentMethods.list({account_id:u,...i})),{successLabel:`Loaded`})})};function oe(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`setDefault <payment-method-id>`,describe:`Sets a payment method as the default for an account.`,builder:oe,handler:async r=>l({command:`accounts billing payment-methods setDefault`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods setDefault`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}/set-as-default`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.setDefault({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Created`})})};function ce(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).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 le={command:`update <payment-method-id>`,describe:`Updates a payment method for an account.`,builder:ce,handler:async r=>l({command:`accounts billing payment-methods update`,classification:{safeFlags:[`default`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing payment-methods update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:e,account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`});return}let u=p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)});o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:u,account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`})})},ue={command:`payment-methods`,describe:`Operations for billing.payment-methods`,builder:e=>e.command(X).command(Q).command(re).command(ae).command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.option(`toggle`,{type:`boolean`,description:`Whether to enable or disable PDF invoice generation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`togglePdfInvoices`,describe:`Toggles PDF invoice generation for an account.`,builder:de,handler:async r=>l({command:`accounts billing togglePdfInvoices`,classification:{safeFlags:[`toggle`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts billing togglePdfInvoices`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/invoices`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({toggle:r.toggle}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({toggle:r.toggle});o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...u,account_id:l})),{successLabel:`Updated`})})},pe={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(N).command(F).command(L).command(z).command(V).command(K).command(J).command(fe).command(W).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`id <id>`,describe:`Get application category by ID.`,builder:me,handler:async r=>l({command:`accounts categories get by id`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.categories.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})})},ge={command:`by`,describe:`Operations for categories.get.by`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`categories`,describe:`List application categories.`,builder:_e,handler:async r=>l({command:`accounts categories get categories`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={limit:r.limit,offset:r.offset};if(r.dryRun){s({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.categories.get.categories({account_id:u,...i})),{successLabel:`Loaded`})})},ye={command:`get`,describe:`Operations for categories.get`,builder:e=>e.command(ve).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},be={command:`categories`,describe:`Categories operations`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`idempotency-key`,{type:`string`,description:`Optional key that identifies an Account-creation request. Free Account creation can require exactly one valid key, so API clients should send a key with every Account-creation request. Reuse the same key when retrying the same request.`}).option(`name`,{type:`string`,description:`Account name`}).option(`standalone`,{type:`boolean`,description:"Set to `true` and omit `unit` to create a standalone Free Account. If provided, this field must be `true`."}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const Se={command:`create`,describe:"Create an Account. To create the Account within an Organization, provide `unit.id` and omit `standalone`. To create a standalone Free Account, provide `standalone: true` and omit `unit`. Providing both fields is invalid. If you omit both fields, Cloudflare can determine the destination only when the User is an administrator of exactly one Organization. Cloudflare creates the Account in that Organization; otherwise, the request returns an error.",builder:xe,handler:async e=>l({command:`accounts create`,classification:{safeFlags:[`standalone`,`dry-run`]}},e,async()=>{let t={};if(e[`idempotency-key`]!==void 0&&(t[`Idempotency-Key`]=String(e[`idempotency-key`])),e.dryRun){s({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`),standalone:e.standalone,unit:{id:m(e[`unit-id`],`unit-id`,`text`)}}):d(e.body)});return}let n=await a(e);if(e.body){let r=d(e.body);o(await c(`Creating`,async()=>i(n,`POST`,`/accounts`,{body:r,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`Account name`));let r={};e.name!==void 0&&u(r,[`name`],m(e.name,`name`,`text`)),e.standalone!==void 0&&u(r,[`standalone`],e.standalone),e[`unit-id`]!==void 0&&u(r,[`unit`,`id`],m(e[`unit-id`],`unit-id`,`text`)),o(await c(`Creating`,async()=>i(n,`POST`,`/accounts`,{body:Object.keys(r).length>0?r:void 0,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Created`})})};function Ce(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 we={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:Ce,handler:async r=>l({command:`accounts delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
19
19
  `);return}o(await c(`Deleting`,async()=>i.accounts.delete({account_id:l})),{successLabel:`Deleted`})})};function Te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:Te,handler:async r=>l({command:`accounts get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.get({account_id:l})),{successLabel:`Loaded`})})};function De(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:v(De),handler:async e=>l({command:`accounts list`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){s({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})})};function ke(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,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 Ae={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given 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:v(ke),handler:async r=>l({command:`accounts logs audit history`,classification:{safeFlags:[`direction`,`dry-run`]}},r,async()=>{let i={action_time:r[`action-time`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){s({command:`cf accounts logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/history`,pathParams:{id:String(r.id??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.logs.audit.history({account_id:u,id:r.id,...i})),{successLabel:`Loaded`})})};function je(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).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 ID. This can be either the Account ID or 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(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).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 user, an account, a zone, or a membership.`}).option(`product-category`,{type:`string`,description:`Filters audit logs by one or more predefined product categories. Each product category expands into a curated set of resource_product values and is unioned with any explicit resource_product filter. Matched case-insensitively; unknown product categories return 400. Repeatable. Use the audit log product categories endpoint to discover the available values.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).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 ID. This can be either the Account ID or 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(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).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 user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).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 Me={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:v(je),handler:async r=>l({command:`accounts logs audit list`,classification:{safeFlags:[`direction`,`dry-run`]}},r,async()=>{let i={account_name:r[`account-name`],action_result:r[`action-result`],action_type:r[`action-type`],actor_context:r[`actor-context`],actor_email:r[`actor-email`],actor_id:r[`actor-id`],actor_ip_address:r[`actor-ip-address`],actor_token_id:r[`actor-token-id`],actor_token_name:r[`actor-token-name`],actor_type:r[`actor-type`],audit_log_id:r[`audit-log-id`],id:r.id,raw_cf_ray_id:r[`raw-cf-ray-id`],raw_method:r[`raw-method`],raw_status_code:r[`raw-status-code`],raw_uri:r[`raw-uri`],resource_id:r[`resource-id`],resource_product:r[`resource-product`],resource_type:r[`resource-type`],resource_scope:r[`resource-scope`],product_category:r[`product-category`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],"account_name.not":r[`account-name-not`],"action_result.not":r[`action-result-not`],"action_type.not":r[`action-type-not`],"actor_context.not":r[`actor-context-not`],"actor_email.not":r[`actor-email-not`],"actor_id.not":r[`actor-id-not`],"actor_ip_address.not":r[`actor-ip-address-not`],"actor_token_id.not":r[`actor-token-id-not`],"actor_token_name.not":r[`actor-token-name-not`],"actor_type.not":r[`actor-type-not`],"audit_log_id.not":r[`audit-log-id-not`],"id.not":r[`id-not`],"raw_cf_ray_id.not":r[`raw-cf-ray-id-not`],"raw_method.not":r[`raw-method-not`],"raw_status_code.not":r[`raw-status-code-not`],"raw_uri.not":r[`raw-uri-not`],"resource_id.not":r[`resource-id-not`],"resource_product.not":r[`resource-product-not`],"resource_type.not":r[`resource-type-not`],"resource_scope.not":r[`resource-scope-not`],"zone_id.not":r[`zone-id-not`],"zone_name.not":r[`zone-name-not`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){s({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.logs.audit.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`product-categories`,describe:`Lists the available audit log product categories and the resource products each one expands to. Use these values with the product_category filter on the account audit logs endpoint.`,builder:Ne,handler:async r=>l({command:`accounts logs audit product-categories`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts logs audit product-categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/product_categories`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.logs.audit.productCategories({account_id:l})),{successLabel:`Loaded`})})},Fe={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
20
20
  Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-DH3kMXSs.mjs";import{r as t}from"./auth-tvDdC1J-.mjs";import{t as n}from"./output-COcSQsfn.mjs";import{t as r}from"./dry-run-DiVy1lVo.mjs";import{t as i}from"./progress-V6SZV3Ux.mjs";import{t as a}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as o,t as s}from"./body-parser-DIlfApuJ.mjs";import{n as c}from"./input-validation-BxchZ9jE.mjs";import{a as l,n as u}from"./prompt-DjRTpML4.mjs";function d(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).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 a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:d,handler:async u=>a({command:`acm custom-trust-store create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({certificate:c(u.certificate,`certificate`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Creating`,async()=>a.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}u.certificate===void 0&&(u.certificate=await l(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=s({certificate:c(u.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>a.acm.customTrustStore.create({...f,zone_id:d})),{successLabel:`Created`})})};function p(e){return e.positional(`custom-origin-trust-store-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 <custom-origin-trust-store-id>`,describe:`Removes a root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:p,handler:async o=>a({command:`acm custom-trust-store delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store/${o[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(o[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(o[`custom-origin-trust-store-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await u({force:!!o.force})){process.stderr.write(`Aborted.
2
+ import{h as e}from"./oauth-BdVr2hJp.mjs";import{r as t}from"./auth-DWxtJ918.mjs";import{t as n}from"./output-Z2lQmPUW.mjs";import{t as r}from"./dry-run-YSQndLvt.mjs";import{t as i}from"./progress-a5IKeKni.mjs";import{t as a}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as o,t as s}from"./body-parser-Cmw7PZ7a.mjs";import{n as c}from"./input-validation-nF-0Ze2h.mjs";import{a as l,n as u}from"./prompt-BP8XrQSj.mjs";function d(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).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 a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:d,handler:async u=>a({command:`acm custom-trust-store create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({certificate:c(u.certificate,`certificate`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Creating`,async()=>a.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}u.certificate===void 0&&(u.certificate=await l(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=s({certificate:c(u.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>a.acm.customTrustStore.create({...f,zone_id:d})),{successLabel:`Created`})})};function p(e){return e.positional(`custom-origin-trust-store-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 <custom-origin-trust-store-id>`,describe:`Removes a root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:p,handler:async o=>a({command:`acm custom-trust-store delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store/${o[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(o[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(o[`custom-origin-trust-store-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await u({force:!!o.force})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>a.acm.customTrustStore.delete({zone_id:s,custom_origin_trust_store_id:o[`custom-origin-trust-store-id`]})),{successLabel:`Deleted`})})};function h(e){return e.positional(`custom-origin-trust-store-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 <custom-origin-trust-store-id>`,describe:`Retrieves details about a specific root CA certificate in the custom origin trust store, including expiration and subject information.`,builder:h,handler:async o=>a({command:`acm custom-trust-store get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store/${o[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(o[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(o[`custom-origin-trust-store-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.acm.customTrustStore.get({zone_id:s,custom_origin_trust_store_id:o[`custom-origin-trust-store-id`]})),{successLabel:`Loaded`})})};function _(e){return e.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:`Get Custom Origin Trust Store for a Zone.`,builder:_,handler:async o=>a({command:`acm custom-trust-store list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`],limit:o.limit,offset:o.offset};if(o.dryRun){r({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.acm.customTrustStore.list({zone_id:c,...a})),{successLabel:`Loaded`})})},y={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:b,handler:async l=>a({command:`acm total-tls edit`,classification:{safeFlags:[`certificate-authority`,`enabled`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({certificate_authority:c(l[`certificate-authority`],`certificate-authority`,`text`),enabled:l.enabled}):o(l.body)});return}let a=await t(l),u=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body);n(await i(`Creating`,async()=>a.acm.totalTls.edit({...e,zone_id:u})),{successLabel:`Created`});return}if(l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=s({certificate_authority:c(l[`certificate-authority`],`certificate-authority`,`text`),enabled:l.enabled});n(await i(`Creating`,async()=>a.acm.totalTls.edit({...d,zone_id:u})),{successLabel:`Created`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:S,handler:async o=>a({command:`acm total-tls get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.acm.totalTls.get({zone_id:s})),{successLabel:`Loaded`})})},w={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`acm`,describe:`acm`,builder:e=>e.command(y).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{a as i,r as a}from"./auth-tvDdC1J-.mjs";import{t as o}from"./output-COcSQsfn.mjs";import{t as s}from"./dry-run-DiVy1lVo.mjs";import{t as c}from"./progress-V6SZV3Ux.mjs";import{t as l}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as u,r as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p,t as m}from"./input-validation-BxchZ9jE.mjs";import{a as h,n as g}from"./prompt-DjRTpML4.mjs";import{n as ee,t as te}from"./raw-fetch-BVYQR6C5.mjs";function _(e){return e.positional(`member-account-id`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 <member-account-id>`,describe:`Remove an account as a member of a particular address map.`,builder:_,handler:async r=>l({command:`addressing address-maps accounts delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/accounts/${r[`member-account-id`]==null?`<member-account-id>`:encodeURIComponent(String(r[`member-account-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``),"member-account-id":String(r[`member-account-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{a as i,r as a}from"./auth-DWxtJ918.mjs";import{t as o}from"./output-Z2lQmPUW.mjs";import{t as s}from"./dry-run-YSQndLvt.mjs";import{t as c}from"./progress-a5IKeKni.mjs";import{t as l}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as u,r as d,t as f}from"./body-parser-Cmw7PZ7a.mjs";import{n as p,t as m}from"./input-validation-nF-0Ze2h.mjs";import{a as h,n as g}from"./prompt-BP8XrQSj.mjs";import{n as ee,t as te}from"./raw-fetch-DNH2V8qH.mjs";function _(e){return e.positional(`member-account-id`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 <member-account-id>`,describe:`Remove an account as a member of a particular address map.`,builder:_,handler:async r=>l({command:`addressing address-maps accounts delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/accounts/${r[`member-account-id`]==null?`<member-account-id>`:encodeURIComponent(String(r[`member-account-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``),"member-account-id":String(r[`member-account-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}o(await c(`Deleting`,async()=>i.addressing.addressMaps.accounts.delete({account_id:l,address_map_id:r[`address-map-id`],member_account_id:r[`member-account-id`]})),{successLabel:`Deleted`})})};function y(e){return e.positional(`member-account-id`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`update <member-account-id>`,describe:`Add an account as a member of a particular address map.`,builder:y,handler:async r=>l({command:`addressing address-maps accounts update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/accounts/${r[`member-account-id`]==null?`<member-account-id>`:encodeURIComponent(String(r[`member-account-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``),"member-account-id":String(r[`member-account-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.addressing.addressMaps.accounts.update({account_id:l,address_map_id:r[`address-map-id`],member_account_id:r[`member-account-id`]})),{successLabel:`Updated`})})},x={command:`accounts`,describe:`Operations for address-maps.accounts`,builder:e=>e.command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`,default:!1}).option(`ips`,{type:`string`,array:!0,description:`The ips field`}).option(`memberships`,{type:`string`,description:`Zones and Accounts which will be assigned IPs on this Address Map. A zone membership will take priority over an account membership. 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`,describe:`Create a new address map under the account.`,builder:S,handler:async r=>l({command:`addressing address-maps create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),enabled:r.enabled,ips:r.ips,memberships:d(r.memberships,`memberships`)}):u(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);o(await c(`Creating`,async()=>i.addressing.addressMaps.create({...e,account_id:l})),{successLabel:`Created`});return}let m=f({description:p(r.description,`description`,`text`),enabled:r.enabled,ips:r.ips,memberships:d(r.memberships,`memberships`)});o(await c(`Creating`,async()=>i.addressing.addressMaps.create({...m,account_id:l})),{successLabel:`Created`})})};function w(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 T={command:`delete <address-map-id>`,describe:`Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.`,builder:w,handler:async r=>l({command:`addressing address-maps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}o(await c(`Deleting`,async()=>i.addressing.addressMaps.delete({account_id:l,address_map_id:r[`address-map-id`]})),{successLabel:`Deleted`})})};function E(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`default-sni`,{type:`string`,description:`If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account.`}).option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map 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 D={command:`edit <address-map-id>`,describe:`Modify properties of an address map owned by the account.`,builder:E,handler:async r=>l({command:`addressing address-maps edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({default_sni:p(r[`default-sni`],`default-sni`,`text`),description:p(r.description,`description`,`text`),enabled:r.enabled}):u(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);o(await c(`Updating`,async()=>i.addressing.addressMaps.edit({...e,account_id:l,address_map_id:r[`address-map-id`]})),{successLabel:`Updated`});return}let d=f({default_sni:p(r[`default-sni`],`default-sni`,`text`),description:p(r.description,`description`,`text`),enabled:r.enabled});o(await c(`Updating`,async()=>i.addressing.addressMaps.edit({...d,account_id:l,address_map_id:r[`address-map-id`]})),{successLabel:`Updated`})})};function O(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <address-map-id>`,describe:`Show a particular address map owned by the account.`,builder:O,handler:async r=>l({command:`addressing address-maps get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.addressMaps.get({account_id:l,address_map_id:r[`address-map-id`]})),{successLabel:`Loaded`})})};function A(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 <ip-address>`,describe:`Remove an IP from a particular address map.`,builder:A,handler:async r=>l({command:`addressing address-maps ips delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps ips delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/ips/${r[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(r[`ip-address`]))}`,pathParams:{"ip-address":String(r[`ip-address`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
5
5
  `);return}o(await c(`Deleting`,async()=>i.addressing.addressMaps.ips.delete({account_id:l,address_map_id:r[`address-map-id`],ip_address:r[`ip-address`]})),{successLabel:`Deleted`})})};function M(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`update <ip-address>`,describe:`Add an IP from a prefix owned by the account to a particular address map.`,builder:M,handler:async r=>l({command:`addressing address-maps ips update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps ips update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/ips/${r[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(r[`ip-address`]))}`,pathParams:{"ip-address":String(r[`ip-address`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.addressing.addressMaps.ips.update({account_id:l,address_map_id:r[`address-map-id`],ip_address:r[`ip-address`]})),{successLabel:`Updated`})})},P={command:`ips`,describe:`Operations for address-maps.ips`,builder:e=>e.command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List all address maps owned by the account.`,builder:F,handler:async r=>l({command:`addressing address-maps list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf addressing address-maps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.addressMaps.list({account_id:l})),{successLabel:`Loaded`})})};function L(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 R={command:`delete`,describe:`Remove a zone as a member of a particular address map.`,builder:L,handler:async i=>l({command:`addressing address-maps zones delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){s({command:`cf addressing address-maps zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${i[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(i[`address-map-id`]))}/zones/${i.zone??i.zoneId??`<zone>`}`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``),"address-map-id":String(i[`address-map-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});if(i.zoneId=d,!await g({force:!!i.force})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./src-C8phrg-8.mjs";import{t}from"./output-COcSQsfn.mjs";import{n}from"./metadata-D062SVyy.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`products`in e&&`universal`in e&&typeof e.version==`string`&&typeof e.universal==`string`&&typeof e.products==`object`}const i={command:`agent-context [product]`,describe:`Output agent context and skill files`,builder:e=>e.positional(`product`,{describe:`Product name (e.g., d1, dns, zones)`,type:`string`}).option(`list`,{type:`boolean`,describe:`List available products`,default:!1}),handler:async i=>{let a=n(import.meta.url,`agent-context.json`,r);if(!a)throw console.error("Error: Could not load agent context. Run `pnpm generate` first."),new e(1);if(i.list){t(Object.keys(a.products));return}if(i.product){let t=a.products[i.product];if(!t){let t=Object.keys(a.products).join(`, `);throw console.error(`Product "${i.product}" not found. Available: ${t}`),new e(1)}console.log(a.universal+`
2
+ import{t as e}from"./src-BbnV77C4.mjs";import{t}from"./output-Z2lQmPUW.mjs";import{n}from"./metadata-C5fJJr-k.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`products`in e&&`universal`in e&&typeof e.version==`string`&&typeof e.universal==`string`&&typeof e.products==`object`}const i={command:`agent-context [product]`,describe:`Output agent context and skill files`,builder:e=>e.positional(`product`,{describe:`Product name (e.g., d1, dns, zones)`,type:`string`}).option(`list`,{type:`boolean`,describe:`List available products`,default:!1}),handler:async i=>{let a=n(import.meta.url,`agent-context.json`,r);if(!a)throw console.error("Error: Could not load agent context. Run `pnpm generate` first."),new e(1);if(i.list){t(Object.keys(a.products));return}if(i.product){let t=a.products[i.product];if(!t){let t=Object.keys(a.products).join(`, `);throw console.error(`Product "${i.product}" not found. Available: ${t}`),new e(1)}console.log(a.universal+`
3
3
 
4
4
  `+t);return}console.log(a.universal+`
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,n as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.option(`name`,{type:`string`,description:`Namespace 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 g={command:`create-namespace`,describe:`Creates a new memory namespace owned by the account.`,builder:h,handler:async l=>s({command:`agent-memory create-namespace`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf agent-memory create-namespace`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.agentMemory.createNamespace({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Namespace name.`));let m=u({name:d(l.name,`name`,`text`)});i(await o(`Creating`,async()=>s.agentMemory.createNamespace({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.positional(`memory-id`,{type:`string`,description:`Memory Identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,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-memory <memory-id>`,describe:`Deletes a memory by ID. Removes the memory and any source messages linked to it. Returns the deleted memory.`,builder:_,handler:async c=>s({command:`agent-memory delete-memory`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf agent-memory delete-memory`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}/memories/${c[`memory-id`]==null?`<memory-id>`:encodeURIComponent(String(c[`memory-id`]))}`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``),"memory-id":String(c[`memory-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes the memory and any source messages linked to it.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,n as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.option(`name`,{type:`string`,description:`Namespace 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 g={command:`create-namespace`,describe:`Creates a new memory namespace owned by the account.`,builder:h,handler:async l=>s({command:`agent-memory create-namespace`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf agent-memory create-namespace`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.agentMemory.createNamespace({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Namespace name.`));let m=u({name:d(l.name,`name`,`text`)});i(await o(`Creating`,async()=>s.agentMemory.createNamespace({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.positional(`memory-id`,{type:`string`,description:`Memory Identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,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-memory <memory-id>`,describe:`Deletes a memory by ID. Removes the memory and any source messages linked to it. Returns the deleted memory.`,builder:_,handler:async c=>s({command:`agent-memory delete-memory`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf agent-memory delete-memory`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}/memories/${c[`memory-id`]==null?`<memory-id>`:encodeURIComponent(String(c[`memory-id`]))}`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``),"memory-id":String(c[`memory-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes the memory and any source messages linked to it.`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>s.agentMemory.deleteMemory({account_id:l,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`],memory_id:c[`memory-id`]})),{successLabel:`Deleted`})})};function y(e){return e.positional(`namespace-name`,{type:`string`,description:`Namespace name.`,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-namespace <namespace-name>`,describe:`Deletes a namespace.`,builder:y,handler:async c=>s({command:`agent-memory delete-namespace`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf agent-memory delete-namespace`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}`,pathParams:{"namespace-name":String(c[`namespace-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes the namespace along with all memory profiles, memories, and sessions it contains.`})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>s.agentMemory.deleteNamespace({account_id:l,namespace_name:c[`namespace-name`]})),{successLabel:`Deleted`})})};function x(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete-profile <profile-name>`,describe:`Marks a profile for deletion.`,builder:x,handler:async c=>s({command:`agent-memory delete-profile`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf agent-memory delete-profile`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes the profile along with all of its memories and messages.`})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>s.agentMemory.deleteProfile({account_id:l,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Deleted`})})};function C(e){return e.positional(`session-id`,{type:`string`,description:`Session identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete-session <session-id>`,describe:`Marks all memories and messages in a profile that are tagged with the given session ID for deletion.`,builder:C,handler:async c=>s({command:`agent-memory delete-session`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf agent-memory delete-session`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}/sessions/${c[`session-id`]==null?`<session-id>`:encodeURIComponent(String(c[`session-id`]))}`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``),"session-id":String(c[`session-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes all memories and messages tagged with this session ID.`})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as e}from"./theme-CeVf-5qG.mjs";import{n as t,t as n}from"./local-C6XsFD_W.mjs";import{f as r,g as i}from"./oauth-DH3kMXSs.mjs";import{a,o,r as s}from"./auth-tvDdC1J-.mjs";import{t as c}from"./output-COcSQsfn.mjs";import{t as l}from"./dry-run-DiVy1lVo.mjs";import{t as u}from"./progress-V6SZV3Ux.mjs";import{r as d,t as f}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as p,t as m}from"./body-parser-DIlfApuJ.mjs";import{n as h,t as g}from"./input-validation-BxchZ9jE.mjs";import{a as _,i as v,n as y}from"./prompt-DjRTpML4.mjs";import{t as b}from"./cli-types-CrSoSMPF.mjs";import{n as x}from"./raw-fetch-BVYQR6C5.mjs";import{_ as S,c as C,d as w,f as T,g as ee,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F}from"./schema-flags-DC4c6dka.mjs";const I=`ai-model-schema`;async function L(e,t,n,r){let i=ee(I,[t,e]);if(i)return{ok:!0,schema:i};let a;try{let i=await n();if(r===void 0)a=await i.ai.getModelSchema({account_id:t,model:e});else{let n=r-Date.now();if(n<=0)return{ok:!1,reason:`the request timed out`};a=await i.ai.getModelSchema({account_id:t,model:e},{timeoutInSeconds:n/1e3,maxRetries:0})}}catch(e){return{ok:!1,reason:k(e)}}let o=E(a,`input`);return o?(S(I,[t,e],o),{ok:!0,schema:o}):{ok:!1,reason:`the API returned no input schema`}}const R="Run `cf ai models list` to see the models you can run.",z=[`model-name`,`modelName`];let B;function V(e){return B=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${R}`)}async function H(n){n.local&&console.log(`${t}\n`),B?.showHelp(`log`);let r=n[`model-name`];if(!r||n.local)return;let i=Date.now()+M,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the input flags for ${r}.`)}`);return}let c=await L(r,a,()=>s(n),i);console.log(c.ok?`\n${j(C(c.schema),`Input flags for ${r}`)}`:`\n${e.muted(`Could not load the input flags for ${r}: ${c.reason}.`)}`)}var U=d({command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:V,handler:async e=>{if(e.help){await H(e);return}if(e.local)throw Error(t);let n=e[`model-name`];if(!n)throw Error(`A model is required: cf ai run <model>. ${R}`);let o=e.dryRun?await i()??`<account-id>`:await r(),d=n.split(`/`).map(encodeURIComponent).join(`/`),f;if(e.body!==void 0){if(O(e,z).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);f=p(e.body)}else{let t=await L(n,o,()=>s(e));if(!t.ok)throw Error(`Could not load the input schema for ${n}: ${t.reason}.\nPass the request body directly instead: cf ai run ${n} --body '{…}'`);let r=C(t.schema),i=O(e,[...z,...A(r)]);if(i.length>0)throw Error(`${i.map(e=>`Unknown flag --${e}`).join(`
2
+ import{a as e}from"./theme-CeVf-5qG.mjs";import{n as t,t as n}from"./local-BwL_gesw.mjs";import{f as r,g as i}from"./oauth-BdVr2hJp.mjs";import{a,o,r as s}from"./auth-DWxtJ918.mjs";import{t as c}from"./output-Z2lQmPUW.mjs";import{t as l}from"./dry-run-YSQndLvt.mjs";import{t as u}from"./progress-a5IKeKni.mjs";import{r as d,t as f}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as p,t as m}from"./body-parser-Cmw7PZ7a.mjs";import{n as h,t as g}from"./input-validation-nF-0Ze2h.mjs";import{a as _,i as v,n as y}from"./prompt-BP8XrQSj.mjs";import{t as b}from"./cli-types-abvWQN3T.mjs";import{n as x}from"./raw-fetch-DNH2V8qH.mjs";import{_ as S,c as C,d as w,f as T,g as ee,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F}from"./schema-flags-CUGxFeZe.mjs";const I=`ai-model-schema`;async function L(e,t,n,r){let i=ee(I,[t,e]);if(i)return{ok:!0,schema:i};let a;try{let i=await n();if(r===void 0)a=await i.ai.getModelSchema({account_id:t,model:e});else{let n=r-Date.now();if(n<=0)return{ok:!1,reason:`the request timed out`};a=await i.ai.getModelSchema({account_id:t,model:e},{timeoutInSeconds:n/1e3,maxRetries:0})}}catch(e){return{ok:!1,reason:k(e)}}let o=E(a,`input`);return o?(S(I,[t,e],o),{ok:!0,schema:o}):{ok:!1,reason:`the API returned no input schema`}}const R="Run `cf ai models list` to see the models you can run.",z=[`model-name`,`modelName`];let B;function V(e){return B=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${R}`)}async function H(n){n.local&&console.log(`${t}\n`),B?.showHelp(`log`);let r=n[`model-name`];if(!r||n.local)return;let i=Date.now()+M,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the input flags for ${r}.`)}`);return}let c=await L(r,a,()=>s(n),i);console.log(c.ok?`\n${j(C(c.schema),`Input flags for ${r}`)}`:`\n${e.muted(`Could not load the input flags for ${r}: ${c.reason}.`)}`)}var U=d({command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:V,handler:async e=>{if(e.help){await H(e);return}if(e.local)throw Error(t);let n=e[`model-name`];if(!n)throw Error(`A model is required: cf ai run <model>. ${R}`);let o=e.dryRun?await i()??`<account-id>`:await r(),d=n.split(`/`).map(encodeURIComponent).join(`/`),f;if(e.body!==void 0){if(O(e,z).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);f=p(e.body)}else{let t=await L(n,o,()=>s(e));if(!t.ok)throw Error(`Could not load the input schema for ${n}: ${t.reason}.\nPass the request body directly instead: cf ai run ${n} --body '{…}'`);let r=C(t.schema),i=O(e,[...z,...A(r)]);if(i.length>0)throw Error(`${i.map(e=>`Unknown flag --${e}`).join(`
3
3
  `)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);let a=new Set;for(;;){let t=D(r,e).find(e=>!a.has(e.name)&&(e.choices!==void 0||e.type===`string`));if(!t)break;a.add(t.name),t.choices?e[t.name]=await v(t.name,P(t),t.choices,t.choiceLabels):e[t.name]=await _(t.name,P(t))}let c=N(t.schema),l=F(r,e,{reserved:z}),u=l.errors.length===0?c?w(t.schema,l.body):T(t.schema,l.body):l.errors;if(u.length>0)throw Error(`${u.join(`
4
4
  `)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);f=l.body}if(e.dryRun){l({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${o}/ai/run/${d}`,pathParams:{"model-name":n},bodyKind:`json`,body:f});return}let m=await s(e);e.accountId=o;let h=await u(`Running`,async()=>a(m,`POST`,`/accounts/${o}/ai/run/${d}`,{body:f,preserveNonJsonBytes:!0}));if(Buffer.isBuffer(h)){x(h);return}c(h,{successLabel:`Ran`})}},{command:`ai run`,recordArgs:!1});function W(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Searches Workers AI models by author or organization name.`,builder:W,handler:async e=>f({command:`ai authors list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.authors.list({account_id:a})),{successLabel:`Loaded`})})},K={command:`authors`,describe:`Operations for authors`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Finetune asset file upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`file-name`,{type:`string`,description:`Name of the file (adapter_config.json or adapter_model.safetensors).`})}const J={command:`create <finetune-id>`,describe:`Uploads training data assets for a Workers AI fine-tuning job.`,builder:q,handler:async e=>f({command:`ai finetunes assets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai finetunes assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,"file-name":e[`file-name`]}});return}let t=await s(e),o=e.local?n:await r();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e[`file-name`]!==void 0){let n=new FormData;if(e.file){let t=g(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e[`file-name`]!==void 0&&n.append(`file_name`,String(h(e[`file-name`],`file-name`,`text`)??``)),c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=h(e.body,`body`,`binary`);c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Y(e){return e.positional(`file-name`,{type:`string`,description:`File name`,demandOption:!0}).option(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`download <file-name>`,describe:`Returns a pre-signed R2 URL for downloading a finetune asset file.`,builder:Y,handler:async e=>f({command:`ai finetunes assets download`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai finetunes assets download`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets/${e[`file-name`]==null?`<file-name>`:encodeURIComponent(String(e[`file-name`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``),"file-name":String(e[`file-name`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.finetunes.assets.download({account_id:a,finetune_id:e[`finetune-id`],file_name:e[`file-name`]})),{successLabel:`Loaded`})})},X={command:`assets`,describe:`Operations for finetunes.assets`,builder:e=>e.command(J).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`model`,{type:`string`,description:`The model field`}).option(`name`,{type:`string`,description:`The name field`}).option(`public`,{type:`boolean`,description:`The public field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`create`,describe:`Creates a new fine-tuning job for a Workers AI model using custom training data.`,builder:Z,handler:async e=>f({command:`ai finetunes create`,classification:{safeFlags:[`public`,`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai finetunes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),model:h(e.model,`model`,`text`),name:h(e.name,`name`,`text`),public:e.public}):p(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=p(e.body);c(await u(`Creating`,async()=>t.ai.finetunes.create({...n,account_id:a})),{successLabel:`Created`});return}e.model===void 0&&(e.model=await _(`model`,`The model field`)),e.name===void 0&&(e.name=await _(`name`,`The name field`));let o=m({description:h(e.description,`description`,`text`),model:h(e.model,`model`,`text`),name:h(e.name,`name`,`text`),public:e.public});c(await u(`Creating`,async()=>t.ai.finetunes.create({...o,account_id:a})),{successLabel:`Created`})})};function ne(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`delete <finetune-id>`,describe:`Delete a finetune. Any in-flight requests referencing the lora will fail after the files are deleted.`,builder:ne,handler:async e=>f({command:`ai finetunes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){l({command:`cf ai finetunes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
5
5
  `);return}c(await u(`Deleting`,async()=>t.ai.finetunes.delete({account_id:a,finetune_id:e[`finetune-id`]})),{successLabel:`Deleted`})})};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Lists all fine-tuning jobs created by the account, including status and metrics.`,builder:ie,handler:async e=>f({command:`ai finetunes list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai finetunes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.finetunes.list({account_id:a})),{successLabel:`Loaded`})})};function oe(e){return e.option(`limit`,{type:`number`,description:`Pagination Limit.`}).option(`offset`,{type:`number`,description:`Pagination Offset.`}).option(`order-by`,{type:`string`,description:`Order By Column Name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`Lists publicly available fine-tuned models that can be used with Workers AI.`,builder:oe,handler:async e=>f({command:`ai finetunes public list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={limit:e.limit,offset:e.offset,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf ai finetunes public list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/public`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.ai.finetunes.public.list({account_id:o,...t})),{successLabel:`Loaded`})})},ce={command:`public`,describe:`Operations for finetunes.public`,builder:e=>e.command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`finetunes`,describe:`Operations for finetunes`,builder:e=>e.command(Q).command(re).command(ae).command(X).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`model`,{type:`string`,description:`Model Name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get-model-schema`,describe:`Retrieves the input and output JSON schema definition for a Workers AI model.`,builder:ue,handler:async e=>f({command:`ai get-model-schema`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={model:e.model};if(e.dryRun){l({command:`cf ai get-model-schema`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/models/schema`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.ai.getModelSchema({account_id:o,...t})),{successLabel:`Loaded`})})};function fe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`listMarkdownSupportedFormats`,describe:`Lists all file formats supported for conversion to Markdown.`,builder:fe,handler:async e=>f({command:`ai listMarkdownSupportedFormats`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai listMarkdownSupportedFormats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.listMarkdownSupportedFormats({account_id:a})),{successLabel:`Loaded`})})};function $(e){return e.option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name.`}).option(`author`,{type:`string`,description:`Filter by Author.`}).option(`source`,{type:`number`,description:`Filter by Source Id.`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models.`}).option(`search`,{type:`string`,description:`Search.`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models for up to three months after their deprecation date. Defaults to false.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Searches Workers AI models by name or description.`,builder:b($),handler:async e=>f({command:`ai models list`,classification:{safeFlags:[`hide-experimental`,`include-deprecated`,`format`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page:e.page,task:e.task,author:e.author,source:e.source,hide_experimental:e[`hide-experimental`],search:e.search,include_deprecated:e[`include-deprecated`],format:e.format};if(e.dryRun){l({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/models/search`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.ai.models.list({account_id:o,...t})),{successLabel:`Loaded`})})},he={command:`models`,describe:`Operations for models`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`model-name`,{type:`string`,description:`Model name`,demandOption:!0}).option(`text`,{type:`string`,description:`The text that you want to classify`}).option(`guidance`,{type:`number`,description:`Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt`}).option(`height`,{type:`number`,description:`The height of the generated image in pixels`}).option(`image`,{type:`string`,array:!0,description:`For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values`}).option(`image-b64`,{type:`string`,description:`For use with img2img tasks. A base64-encoded string of the input image`}).option(`mask`,{type:`string`,array:!0,description:`An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values`}).option(`negative-prompt`,{type:`string`,description:`Text describing elements to avoid in the generated image`}).option(`num-steps`,{type:`number`,description:`The number of diffusion steps; higher values can improve quality but take longer`}).option(`prompt`,{type:`string`,description:`A text description of the image you want to generate`}).option(`seed`,{type:`number`,description:`Random seed for reproducibility of the image generation`}).option(`strength`,{type:`number`,description:`A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image`}).option(`width`,{type:`number`,description:`The width of the generated image in pixels`}).option(`lang`,{type:`string`,description:`The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified`}).option(`source-lang`,{type:`string`,description:`The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified`}).option(`target-lang`,{type:`string`,description:`The language code to translate the text into (e.g., 'es' for Spanish)`}).option(`input-text`,{type:`string`,description:`The text that you want the model to summarize`}).option(`max-length`,{type:`number`,description:`The maximum length of the generated summary in tokens`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`text`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`guidance`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`height`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`image`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`,`prompt`]).conflicts(`image-b64`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`mask`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`negative-prompt`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`num-steps`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`prompt`,[`text`,`source-lang`,`target-lang`,`input-text`,`max-length`,`image`]).conflicts(`seed`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`strength`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`width`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`lang`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`seed`,`strength`,`width`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`source-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`target-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).implies(`target-lang`,[`text`]).conflicts(`input-text`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`]).conflicts(`max-length`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`])}const _e={command:`run-model <model-name>`,describe:`This endpoint provides users with the capability to run specific AI models on-demand. By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases. Model specific inputs available in [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).`,builder:ge,handler:async e=>f({command:`ai run-model`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai run-model`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/run/${e[`model-name`]==null?`<model-name>`:encodeURIComponent(String(e[`model-name`]))}`,pathParams:{"model-name":String(e[`model-name`]??``)},bodyKind:`json`,body:e.body===void 0?m({text:h(e.text,`text`,`text`),guidance:e.guidance,height:e.height,image:e.image,image_b64:h(e[`image-b64`],`image-b64`,`text`),mask:e.mask,negative_prompt:h(e[`negative-prompt`],`negative-prompt`,`text`),num_steps:e[`num-steps`],prompt:h(e.prompt,`prompt`,`text`),seed:e.seed,strength:e.strength,width:e.width,lang:h(e.lang,`lang`,`text`),source_lang:h(e[`source-lang`],`source-lang`,`text`),target_lang:h(e[`target-lang`],`target-lang`,`text`),input_text:h(e[`input-text`],`input-text`,`text`),max_length:e[`max-length`]}):p(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=p(e.body);c(await u(`Creating`,async()=>t.ai.runModel({body:n,account_id:a,model_name:e[`model-name`]})),{successLabel:`Created`});return}let o=m({text:h(e.text,`text`,`text`),guidance:e.guidance,height:e.height,image:e.image,image_b64:h(e[`image-b64`],`image-b64`,`text`),mask:e.mask,negative_prompt:h(e[`negative-prompt`],`negative-prompt`,`text`),num_steps:e[`num-steps`],prompt:h(e.prompt,`prompt`,`text`),seed:e.seed,strength:e.strength,width:e.width,lang:h(e.lang,`lang`,`text`),source_lang:h(e[`source-lang`],`source-lang`,`text`),target_lang:h(e[`target-lang`],`target-lang`,`text`),input_text:h(e[`input-text`],`input-text`,`text`),max_length:e[`max-length`]});c(await u(`Creating`,async()=>t.ai.runModel({body:o,account_id:a,model_name:e[`model-name`]})),{successLabel:`Created`})})};function ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`list`,describe:`Searches Workers AI models by task type (e.g., text-generation, embeddings).`,builder:ve,handler:async e=>f({command:`ai tasks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.tasks.list({account_id:a})),{successLabel:`Loaded`})})},be={command:`tasks`,describe:`Operations for tasks`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:`The files`})}const Se={command:`to-markdown`,describe:`Converts uploaded files into Markdown format using Workers AI.`,builder:xe,handler:async e=>f({command:`ai to-markdown`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai to-markdown`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files}});return}let t=await s(e),o=e.local?n:await r();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e.files!==void 0){let n=new FormData;if(e.file){let t=g(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.files!==void 0){let t=typeof e.files==`string`?h(e.files,`files`,`text`):e.files;n.append(`files`,typeof t==`string`?t:JSON.stringify(t))}c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=h(e.body,`body`,`binary`);c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ce={command:`ai`,describe:`ai`,builder:e=>e.command(de).command(pe).command(U).command(_e).command(Se).command(K).command(le).command(he).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ce as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-DH3kMXSs.mjs";import{a as t,r as n}from"./auth-tvDdC1J-.mjs";import{t as r}from"./output-COcSQsfn.mjs";import{t as i}from"./dry-run-DiVy1lVo.mjs";import{t as a}from"./progress-V6SZV3Ux.mjs";import{t as o}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as s}from"./body-parser-DIlfApuJ.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const l={command:`bulk-get`,describe:`Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`,builder:c,handler:async c=>o({command:`ai-audit robots bulk-get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let o=await n(c);if(c.zoneId=await e({zone:c.zone},o,{quiet:c.quiet}),c.body){let e=s(c.body);if(Array.isArray(e)&&e.length>25){let n=Math.ceil(e.length/25),i=null;for(let r=0;r<e.length;r+=25){let s=e.slice(r,r+25);i=await a(`Loading: batch ${Math.floor(r/25)+1}/${n}`,async()=>t(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:s}))}r(i,{successLabel:`Loaded`});return}r(await a(`Loading`,async()=>t(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:e})),{successLabel:`Loaded`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function u(e){return e.option(`subdomain`,{type:`string`,description:`Optional subdomain to fetch robots.txt for. If omitted, fetches robots.txt for the zone apex domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps.`,builder:u,handler:async t=>o({command:`ai-audit robots get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let o={subdomain:t.subdomain};if(t.dryRun){i({command:`cf ai-audit robots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/ai-audit/robots`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.aiAudit.robots.get({zone_id:c,...o})),{successLabel:`Loaded`})})},f={command:`robots`,describe:`Operations for robots`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`ai-audit`,describe:`ai-audit`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
2
+ import{h as e}from"./oauth-BdVr2hJp.mjs";import{a as t,r as n}from"./auth-DWxtJ918.mjs";import{t as r}from"./output-Z2lQmPUW.mjs";import{t as i}from"./dry-run-YSQndLvt.mjs";import{t as a}from"./progress-a5IKeKni.mjs";import{t as o}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as s}from"./body-parser-Cmw7PZ7a.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const l={command:`bulk-get`,describe:`Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`,builder:c,handler:async c=>o({command:`ai-audit robots bulk-get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let o=await n(c);if(c.zoneId=await e({zone:c.zone},o,{quiet:c.quiet}),c.body){let e=s(c.body);if(Array.isArray(e)&&e.length>25){let n=Math.ceil(e.length/25),i=null;for(let r=0;r<e.length;r+=25){let s=e.slice(r,r+25);i=await a(`Loading: batch ${Math.floor(r/25)+1}/${n}`,async()=>t(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:s}))}r(i,{successLabel:`Loaded`});return}r(await a(`Loading`,async()=>t(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:e})),{successLabel:`Loaded`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function u(e){return e.option(`subdomain`,{type:`string`,description:`Optional subdomain to fetch robots.txt for. If omitted, fetches robots.txt for the zone apex domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps.`,builder:u,handler:async t=>o({command:`ai-audit robots get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let o={subdomain:t.subdomain};if(t.dryRun){i({command:`cf ai-audit robots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/ai-audit/robots`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.aiAudit.robots.get({zone_id:c,...o})),{successLabel:`Loaded`})})},f={command:`robots`,describe:`Operations for robots`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`ai-audit`,describe:`ai-audit`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};