cf 0.12.0 → 0.13.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 (416) hide show
  1. package/dist/_meta/agent-context.json +55 -55
  2. package/dist/_meta/commands.json +24282 -24542
  3. package/dist/_meta/hand-written-commands.json +53 -12
  4. package/dist/_meta/schemas.json +27680 -28212
  5. package/dist/abuse-reports-BbaHw4ST.mjs +8 -0
  6. package/dist/access-D6Xz892p.mjs +11 -0
  7. package/dist/account-DvxcqeaK.mjs +2 -0
  8. package/dist/account-tags-CeqfEWpz.mjs +9 -0
  9. package/dist/accounts-Bx-8BMH9.mjs +30 -0
  10. package/dist/acm--0opdSGE.mjs +3 -0
  11. package/dist/addressing-BS1ynzLA.mjs +13 -0
  12. package/dist/agent-context-BPhyrSns.mjs +8 -0
  13. package/dist/agent-memory-DczzpEw5.mjs +6 -0
  14. package/dist/ai-CDdCTcQl.mjs +5 -0
  15. package/dist/ai-audit-Bx9KMQYh.mjs +2 -0
  16. package/dist/ai-gateway-BSXJEaYS.mjs +13 -0
  17. package/dist/ai-search-DRQj1aMu.mjs +7 -0
  18. package/dist/ai-security-C_Rb0lGT.mjs +4 -0
  19. package/dist/alerting-BAR9eFs2.mjs +6 -0
  20. package/dist/analytics-BaUZwNc5.mjs +4 -0
  21. package/dist/analytics_engine-DkEzlhfT.mjs +2 -0
  22. package/dist/api-security-jA0lOk6a.mjs +50 -0
  23. package/dist/argo-Cz4pDagx.mjs +2 -0
  24. package/dist/artifacts-BcLTGfAv.mjs +5 -0
  25. package/dist/audit-logs-DbIv4n6u.mjs +2 -0
  26. package/dist/auth-rW5d3jtr.mjs +5 -0
  27. package/dist/auth-tvDdC1J-.mjs +8 -0
  28. package/dist/billing-Md87QjqW.mjs +3 -0
  29. package/dist/bot-management-VHMo4hpU.mjs +5 -0
  30. package/dist/botnet-feed-BHqfo3sa.mjs +3 -0
  31. package/dist/brand-protection-HUeR6Pof.mjs +3 -0
  32. package/dist/browser-extension-199oZg3X.mjs +3 -0
  33. package/dist/browser-run-DDasyux-.mjs +4 -0
  34. package/dist/build-0QlYUfFS.mjs +2 -0
  35. package/dist/builds-B-lXn6JR.mjs +9 -0
  36. package/dist/cache-CevKpiTM.mjs +9 -0
  37. package/dist/certificate-authorities-DAg-aO1B.mjs +2 -0
  38. package/dist/{cf-yPz_IqW6.mjs → cf-C11NGkjx.mjs} +1 -1
  39. package/dist/{chunk-LQW53VED-9MACsvSG.mjs → chunk-LQW53VED-CoECHA3R.mjs} +1 -1
  40. package/dist/{chunk-QBZBEHZB-yeyhVUeD.mjs → chunk-QBZBEHZB-BuiXJn8j.mjs} +1 -1
  41. package/dist/client-certificates-Bay7oPLE.mjs +3 -0
  42. package/dist/client-side-security-CbU9xn0k.mjs +37 -0
  43. package/dist/cloud-connector-AH2ClcSL.mjs +2 -0
  44. package/dist/cloudforce-one-DwOfS75V.mjs +32 -0
  45. package/dist/{command-BV87D4tR.mjs → command-CMzMsll4.mjs} +1 -1
  46. package/dist/{completions-BnD46cXe.mjs → completions-nPO9PdSu.mjs} +1 -1
  47. package/dist/config-B8lwPpVl.mjs +2 -0
  48. package/dist/config.mjs +1 -1
  49. package/dist/connector-interrupts-DcLrqM2V.mjs +2 -0
  50. package/dist/connector-telemetry-events-PrJWgNs9.mjs +2 -0
  51. package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +2 -0
  52. package/dist/connectors-CEAy30E-.mjs +3 -0
  53. package/dist/containers-BsbDqbSn.mjs +58 -0
  54. package/dist/content-scan-BdK936iO.mjs +4 -0
  55. package/dist/cps-oP97-qkm.mjs +2 -0
  56. package/dist/csamScanner-DUNN4INg.mjs +6 -0
  57. package/dist/ct-alerting-dV_gsV2w.mjs +3 -0
  58. package/dist/custom-certificates-DYspvjo4.mjs +5 -0
  59. package/dist/custom-csrs-DjSWLQRu.mjs +3 -0
  60. package/dist/custom-hostnames-df1lH6IY.mjs +5 -0
  61. package/dist/custom-nameservers-CLTbN-9R.mjs +3 -0
  62. package/dist/custom-pages-DzKnSgL3.mjs +3 -0
  63. package/dist/d1-JBEqjJoj.mjs +20 -0
  64. package/dist/data-security-CIktWnXt.mjs +7 -0
  65. package/dist/dcv-delegation-_r6Vc6VL.mjs +2 -0
  66. package/dist/{deploy-BUSz35vq.mjs → deploy-QTGENpOM.mjs} +1 -1
  67. package/dist/{deploy-input-BvD9aRP1.mjs → deploy-input-C7W1Bsji.mjs} +1 -1
  68. package/dist/{dev-DY_DquQx.mjs → dev-CAubuxCc.mjs} +1 -1
  69. package/dist/diagnostics-B0DRh714.mjs +3 -0
  70. package/dist/{dist-DV7LR38l.mjs → dist-12KzRsBM.mjs} +36 -36
  71. package/dist/{dist-BBx1io2f.mjs → dist-BCVqQpg2.mjs} +1 -1
  72. package/dist/dist-Cp3uJN1x.mjs +48 -0
  73. package/dist/dist-DW5BPGFs.mjs +57 -0
  74. package/dist/{dist-Cb9TJ2VV.mjs → dist-S9K_8gq9.mjs} +1 -1
  75. package/dist/dls-CFzTHcZM.mjs +3 -0
  76. package/dist/dns-Dw6u-NV1.mjs +29 -0
  77. package/dist/dns-firewall-CIPptslp.mjs +57 -0
  78. package/dist/{dot-prop-6SRZBKHT-wwGHcwAa.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
  79. package/dist/dry-run-DiVy1lVo.mjs +2 -0
  80. package/dist/durable-objects-CCkeqqBq.mjs +2 -0
  81. package/dist/email-auth-kdxO51Oz.mjs +2 -0
  82. package/dist/email-routing-BLggZdQq.mjs +6 -0
  83. package/dist/email-security-DjADlgdM.mjs +18 -0
  84. package/dist/email-sending-Cz7E7GoP.mjs +7 -0
  85. package/dist/error-sanitization-DfLijlBJ.mjs +2 -0
  86. package/dist/fieldExtractors-BWaMi6lD.mjs +3 -0
  87. package/dist/firewall-5t6OBIOl.mjs +8 -0
  88. package/dist/flagship-CzG_VoNR.mjs +4 -0
  89. package/dist/fraud-UOg_69Ob.mjs +20 -0
  90. package/dist/google-tag-gateway-DirkD-Q2.mjs +2 -0
  91. package/dist/healthchecks-BkHZGTp1.mjs +4 -0
  92. package/dist/hostnames-EUYOZm21.mjs +3 -0
  93. package/dist/hyperdrive-ZoLJlJCL.mjs +21 -0
  94. package/dist/iam-BQ2xSgYN.mjs +6 -0
  95. package/dist/images-CkEq6ScP.mjs +8 -0
  96. package/dist/index.mjs +1 -1
  97. package/dist/intel-DDWEdGyl.mjs +8 -0
  98. package/dist/interactive-B2E03Fs-.mjs +11 -0
  99. package/dist/interactive-_B-EqD0Y.mjs +23 -0
  100. package/dist/ips-54Qmy-Uw.mjs +2 -0
  101. package/dist/keyless-certificates-CXHLc3Qz.mjs +3 -0
  102. package/dist/keys-rvI4TC3Z.mjs +2 -0
  103. package/dist/kv-CAeN1zBy.mjs +5 -0
  104. package/dist/leaked-credential-checks-CbbwtG-p.mjs +4 -0
  105. package/dist/lifecycle-XswDq0ZB.mjs +2 -0
  106. package/dist/load-balancers-BFwdwAIU.mjs +6 -0
  107. package/dist/{local-DGiIS1uM.mjs → local-C6XsFD_W.mjs} +1 -1
  108. package/dist/{local-runtime--IQr44qq.mjs → local-runtime-BUGCbx8r.mjs} +1 -1
  109. package/dist/logexplorer-D8rOPB5I.mjs +17 -0
  110. package/dist/logo-matches-Y3PxVn7t.mjs +2 -0
  111. package/dist/logos-BN8SvJhS.mjs +3 -0
  112. package/dist/logpush-BnLA4WVm.mjs +4 -0
  113. package/dist/logs-CDo7Y5sA.mjs +3 -0
  114. package/dist/magic-cloud-networking-wPuLwu-F.mjs +5 -0
  115. package/dist/magic-network-monitoring-BNERUpxS.mjs +4 -0
  116. package/dist/magic-transit-6tvVOECW.mjs +111 -0
  117. package/dist/managed-defense-AYwBOYIH.mjs +2 -0
  118. package/dist/managed-transforms-HZZNrkC7.mjs +3 -0
  119. package/dist/matches-Dp91L3dL.mjs +2 -0
  120. package/dist/mcp-P7pcieiT.mjs +4 -0
  121. package/dist/mesh-DjFrk6PL.mjs +4 -0
  122. package/dist/mtls-certificates-DZMoef2H.mjs +3 -0
  123. package/dist/network-7cd1U6-I.mjs +6 -0
  124. package/dist/network-interconnects-CQ7cPZjK.mjs +41 -0
  125. package/dist/oauth-DH3kMXSs.mjs +14 -0
  126. package/dist/oauth-clients-P9t-eMnx.mjs +4 -0
  127. package/dist/oauth-scopes-C3r9Qh_y.mjs +2 -0
  128. package/dist/observability-M1DnLhMR.mjs +10 -0
  129. package/dist/{open-PBXRGS4R-DIiYQyU9.mjs → open-PBXRGS4R-DARSUDEI.mjs} +1 -1
  130. package/dist/organization-cUE7GDCt.mjs +45 -0
  131. package/dist/organizations-C-Hcpd0w.mjs +2 -0
  132. package/dist/origin-ca-certificates-C8cJMyQH.mjs +3 -0
  133. package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +2 -0
  134. package/dist/origin-tls-client-auth-BsjR5EAV.mjs +4 -0
  135. package/dist/{output-BqDR9h74.mjs → output-COcSQsfn.mjs} +1 -1
  136. package/dist/page-rules-B-zq1EUb.mjs +27 -0
  137. package/dist/pages-B6YpkPos.mjs +14 -0
  138. package/dist/pay-per-crawl-B4wx0lUb.mjs +4 -0
  139. package/dist/pipelines-BJc_RylD.mjs +6 -0
  140. package/dist/precursor-CLQu7suY.mjs +4 -0
  141. package/dist/progress-V6SZV3Ux.mjs +2 -0
  142. package/dist/prompt-DjRTpML4.mjs +3 -0
  143. package/dist/queries-DSrrket-.mjs +3 -0
  144. package/dist/queues-Tf7kPBpn.mjs +7 -0
  145. package/dist/r2-DmKNnxtC.mjs +25 -0
  146. package/dist/r2-data-catalog-DBxoifOq.mjs +16 -0
  147. package/dist/radar-Csk7Ab-b.mjs +2 -0
  148. package/dist/rate-limits-cdChIg_S.mjs +2 -0
  149. package/dist/raw-fetch-BVYQR6C5.mjs +2 -0
  150. package/dist/realtime-CDehZVhV.mjs +20 -0
  151. package/dist/registrar-sandbox-BxVdfnam.mjs +56 -0
  152. package/dist/registrar-vflzeNQ9.mjs +43 -0
  153. package/dist/{registry-5-I2XLwF.mjs → registry-CWUfXloz.mjs} +1 -1
  154. package/dist/reporting-BaPZ1PHN.mjs +2 -0
  155. package/dist/request-headers-CC4eHmI2.mjs +3 -0
  156. package/dist/request-tracers-C_UVBexV.mjs +2 -0
  157. package/dist/resource-sharing-CoB4S9j1.mjs +6 -0
  158. package/dist/resource-tagging-CUiUC5g4.mjs +2 -0
  159. package/dist/rules-4O8076_s.mjs +4 -0
  160. package/dist/rulesets-C84MxTYo.mjs +5 -0
  161. package/dist/rum-Bvwkrntx.mjs +4 -0
  162. package/dist/run-CRfinkSe.mjs +2 -0
  163. package/dist/schema-C8hU6G9R.mjs +2 -0
  164. package/dist/{schema-flags-CTfQVGCs.mjs → schema-flags-DC4c6dka.mjs} +1 -1
  165. package/dist/scim-BvxQmde6.mjs +4 -0
  166. package/dist/{sdk-ZctLa5jW.mjs → sdk-C12y5qCN.mjs} +2 -2
  167. package/dist/secrets-store-DOKWiC-j.mjs +7 -0
  168. package/dist/security-center-Bhy_aC-w.mjs +2 -0
  169. package/dist/security-txt-L7HJ9tq5.mjs +3 -0
  170. package/dist/{shared-DlKGNPiT.mjs → shared-YJtB5KZB.mjs} +17 -17
  171. package/dist/smart-shield-COMXuQ1S.mjs +4 -0
  172. package/dist/snippets-DffQhlKt.mjs +4 -0
  173. package/dist/{spawn-C3_tJ3RB.mjs → spawn-C1AISA2V.mjs} +3 -3
  174. package/dist/spectrum-Cmf7SqQE.mjs +63 -0
  175. package/dist/speed-m8cdhLFS.mjs +4 -0
  176. package/dist/src-C8phrg-8.mjs +109 -0
  177. package/dist/ssl-D4ffsdSw.mjs +15 -0
  178. package/dist/{startup-profile-Dpxg-MjV.mjs → startup-profile-Dx95Y5cl.mjs} +1 -1
  179. package/dist/state-CHif8Y5I.mjs +2 -0
  180. package/dist/stream-DPF5fojV.mjs +16 -0
  181. package/dist/submit-Br8hfP0_.mjs +2 -0
  182. package/dist/tags-Bnt4JuxQ.mjs +2 -0
  183. package/dist/telemetry-Ch1vCICm.mjs +2 -0
  184. package/dist/telemetry-DjGNSlkU.mjs +5 -0
  185. package/dist/tenant-D8u0CxoC.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +3 -0
  187. package/dist/{tools-j8UGEtP1.mjs → tools-D9RZkZRc.mjs} +1 -1
  188. package/dist/tunnels-BkNPpTHa.mjs +5 -0
  189. package/dist/turnstile-MgwRECJv.mjs +23 -0
  190. package/dist/ui-DQSZeaG5.mjs +5 -0
  191. package/dist/url-info-Ddp7MgcI.mjs +2 -0
  192. package/dist/url-normalization-3ptK9ntV.mjs +3 -0
  193. package/dist/url-scanner-Psb9ollR.mjs +2 -0
  194. package/dist/user-DWdshcIu.mjs +12 -0
  195. package/dist/values-CDKQL1z2.mjs +2 -0
  196. package/dist/vectorize-CTYYUyQj.mjs +4 -0
  197. package/dist/waiting-rooms-BUdmwXDY.mjs +11 -0
  198. package/dist/web-assets-CpDwDEx8.mjs +8 -0
  199. package/dist/web3-YsjDyAzH.mjs +4 -0
  200. package/dist/workers-BKKxaZcz.mjs +6 -0
  201. package/dist/workers-builds-BWo5vUA9.mjs +2 -0
  202. package/dist/workers-for-platforms-ASJsxYdM.mjs +5 -0
  203. package/dist/workers-vpc-RkTnRvA2.mjs +3 -0
  204. package/dist/workflows-KrIFI9ns.mjs +5 -0
  205. package/dist/zaraz-DglXbVzZ.mjs +2 -0
  206. package/dist/zero-trust-RilTdSjX.mjs +91 -0
  207. package/dist/zone-DsBtVkvT.mjs +2 -0
  208. package/dist/zones-BFxvWFQW.mjs +44 -0
  209. package/package.json +1 -1
  210. package/dist/abuse-reports-D40QFl-y.mjs +0 -8
  211. package/dist/access-Dl2IU1ID.mjs +0 -11
  212. package/dist/account-CPbieCZ4.mjs +0 -2
  213. package/dist/account-tags-skfP7H8k.mjs +0 -9
  214. package/dist/accounts-CSgR6909.mjs +0 -28
  215. package/dist/acm-CVvCTaNk.mjs +0 -3
  216. package/dist/addressing-Uq5hEDDP.mjs +0 -13
  217. package/dist/agent-context-BvuDdaJb.mjs +0 -8
  218. package/dist/agent-memory-BrHMIU0E.mjs +0 -6
  219. package/dist/ai-audit-BoZuL84i.mjs +0 -2
  220. package/dist/ai-gateway-DE50Jem1.mjs +0 -13
  221. package/dist/ai-search-Fx7NHCHB.mjs +0 -7
  222. package/dist/ai-security-DyLbY9kv.mjs +0 -4
  223. package/dist/ai-v2fP1r0s.mjs +0 -5
  224. package/dist/alerting-5mFZjTcD.mjs +0 -6
  225. package/dist/analytics-BygTfozw.mjs +0 -3
  226. package/dist/analytics_engine-4L-q362P.mjs +0 -2
  227. package/dist/api-security-DjFsRYWx.mjs +0 -50
  228. package/dist/argo-TzXPN7tz.mjs +0 -2
  229. package/dist/args-CDgWUP4J.mjs +0 -2
  230. package/dist/artifacts-dEw2UUBV.mjs +0 -4
  231. package/dist/audit-logs-CqY7zzwv.mjs +0 -2
  232. package/dist/auth-CPLdkOC7.mjs +0 -5
  233. package/dist/auth-DY_Y2bXC.mjs +0 -9
  234. package/dist/billing-DHQuRT8S.mjs +0 -3
  235. package/dist/bot-management-CfqG79hF.mjs +0 -5
  236. package/dist/botnet-feed-BOeNnDoH.mjs +0 -3
  237. package/dist/brand-protection-DYttrKIM.mjs +0 -3
  238. package/dist/browser-extension-CTUCdgfn.mjs +0 -3
  239. package/dist/browser-run-373D4e1i.mjs +0 -4
  240. package/dist/build-D0ir_S70.mjs +0 -2
  241. package/dist/cache-DJXBmc3w.mjs +0 -7
  242. package/dist/calls-COO0Eoz1.mjs +0 -4
  243. package/dist/certificate-authorities-DbHLmKbd.mjs +0 -2
  244. package/dist/client-certificates-RBRqYP3f.mjs +0 -3
  245. package/dist/client-side-security-HOmA37et.mjs +0 -37
  246. package/dist/cloud-connector-C7hw1c1f.mjs +0 -2
  247. package/dist/cloudforce-one-DLOj76q4.mjs +0 -36
  248. package/dist/connector-interrupts-DY-z_LrH.mjs +0 -2
  249. package/dist/connector-telemetry-events-DCXmcAc9.mjs +0 -2
  250. package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +0 -2
  251. package/dist/connectors-fEOn-J_i.mjs +0 -3
  252. package/dist/containers-BDBsEs7-.mjs +0 -58
  253. package/dist/content-scan-Cmj9--XY.mjs +0 -4
  254. package/dist/csamScanner-BRXyMCyH.mjs +0 -6
  255. package/dist/ct-alerting-9AvYys-f.mjs +0 -3
  256. package/dist/custom-certificates-C5qrlyhb.mjs +0 -5
  257. package/dist/custom-csrs-BgOnTbBW.mjs +0 -3
  258. package/dist/custom-hostnames-CbQD9aYo.mjs +0 -5
  259. package/dist/custom-nameservers-2ZajBkRC.mjs +0 -3
  260. package/dist/custom-pages-Buki_Cb8.mjs +0 -3
  261. package/dist/d1-n2in0cSF.mjs +0 -20
  262. package/dist/data-security-DzOQMkv3.mjs +0 -7
  263. package/dist/dcv-delegation-BTP9LCOm.mjs +0 -2
  264. package/dist/diagnostics-BvHV8kQb.mjs +0 -3
  265. package/dist/directory-BeiSyg8A.mjs +0 -3
  266. package/dist/dispatch-namespaces-Dp8Jjpwy.mjs +0 -7
  267. package/dist/dist-DvizctjW.mjs +0 -48
  268. package/dist/dls-BwoU29mS.mjs +0 -3
  269. package/dist/dns-DISAfuzj.mjs +0 -29
  270. package/dist/dns-firewall-wBcCx_ua.mjs +0 -57
  271. package/dist/dry-run-ILZRVpnp.mjs +0 -2
  272. package/dist/durable-objects-DhDL3San.mjs +0 -2
  273. package/dist/email-auth-BROqK6-C.mjs +0 -2
  274. package/dist/email-routing-BZXHDAOO.mjs +0 -6
  275. package/dist/email-security-DVumybrk.mjs +0 -18
  276. package/dist/email-sending-CDQ3_wyz.mjs +0 -7
  277. package/dist/fieldExtractors-Cy1rxHEF.mjs +0 -3
  278. package/dist/firewall-C0g5X7Zd.mjs +0 -11
  279. package/dist/flagship-fFBiZUz-.mjs +0 -4
  280. package/dist/fraud-CjIETOaM.mjs +0 -20
  281. package/dist/google-tag-gateway-hPa5IHUx.mjs +0 -2
  282. package/dist/healthchecks-CoycpTf9.mjs +0 -4
  283. package/dist/hostnames-x_Yezxpr.mjs +0 -3
  284. package/dist/hyperdrive-BlfrTwSq.mjs +0 -21
  285. package/dist/iam-Bk7K_PPO.mjs +0 -6
  286. package/dist/images-BAEFb9q1.mjs +0 -8
  287. package/dist/intel-DDkyJVaP.mjs +0 -8
  288. package/dist/interactive-CRnq-B5I.mjs +0 -11
  289. package/dist/interactive-cytQzL94.mjs +0 -78
  290. package/dist/ips-DU0ti0i0.mjs +0 -2
  291. package/dist/keyless-certificates-E1P9jBTb.mjs +0 -3
  292. package/dist/keys-DqldTZqH.mjs +0 -2
  293. package/dist/kv-CcfCfnwq.mjs +0 -5
  294. package/dist/leaked-credential-checks-CqmKaEbd.mjs +0 -4
  295. package/dist/load-balancers-Dg4pDad1.mjs +0 -6
  296. package/dist/logexplorer-Bu2mG5rh.mjs +0 -17
  297. package/dist/logo-matches-CWUzxY7G.mjs +0 -2
  298. package/dist/logos-BTfdkDPi.mjs +0 -3
  299. package/dist/logpush-BZyay3h2.mjs +0 -4
  300. package/dist/logs-BqF7jjQO.mjs +0 -3
  301. package/dist/magic-cloud-networking-Dhd8pTyM.mjs +0 -5
  302. package/dist/magic-network-monitoring-D0FnkjuN.mjs +0 -4
  303. package/dist/magic-transit-B5skt0G7.mjs +0 -111
  304. package/dist/managed-transforms-B6X_crcJ.mjs +0 -3
  305. package/dist/matches-DeYaB4I0.mjs +0 -2
  306. package/dist/mcp-ChjBiMx2.mjs +0 -4
  307. package/dist/mesh-DRVAFLBX.mjs +0 -4
  308. package/dist/moq-DE7VDEFS.mjs +0 -13
  309. package/dist/mtls-certificates-Cbc3uAkN.mjs +0 -3
  310. package/dist/network-CDPZNFbn.mjs +0 -6
  311. package/dist/network-interconnects-CMRs_chR.mjs +0 -41
  312. package/dist/oauth-DAa7SwkM.mjs +0 -14
  313. package/dist/oauth-clients-DAI_gcuL.mjs +0 -4
  314. package/dist/oauth-scopes-BE6xF4_h.mjs +0 -2
  315. package/dist/observability-DnyI8rPJ.mjs +0 -4
  316. package/dist/organization-yh0mSUdI.mjs +0 -41
  317. package/dist/organizations-B3aU-RCG.mjs +0 -2
  318. package/dist/origin-ca-certificates-BaNWfVqf.mjs +0 -3
  319. package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +0 -2
  320. package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +0 -4
  321. package/dist/page-rules-CzbyXbt6.mjs +0 -27
  322. package/dist/pages-CX8yefTI.mjs +0 -14
  323. package/dist/pay-per-crawl-v4vBOMWD.mjs +0 -4
  324. package/dist/pipelines-BZ1KGupx.mjs +0 -6
  325. package/dist/precursor-D42A9ay5.mjs +0 -4
  326. package/dist/progress-jYW64HY7.mjs +0 -2
  327. package/dist/project-settings-BN7tL0c7.mjs +0 -3
  328. package/dist/prompt-CyATfGUu.mjs +0 -3
  329. package/dist/queries-xvETUjUE.mjs +0 -3
  330. package/dist/queues-CpqHDtxF.mjs +0 -6
  331. package/dist/r2-data-catalog-DgKmlTKR.mjs +0 -16
  332. package/dist/r2-jhmLvD1z.mjs +0 -24
  333. package/dist/radar-C2J16wpX.mjs +0 -2
  334. package/dist/rate-limits-CoH9Xma0.mjs +0 -5
  335. package/dist/raw-fetch-CNKIypJ7.mjs +0 -2
  336. package/dist/realtimekit-CDs0Z5WW.mjs +0 -7
  337. package/dist/registrar-BI5ewTAk.mjs +0 -23
  338. package/dist/registrar-sandbox-al1znWMc.mjs +0 -61
  339. package/dist/reporting-CxsdHAH3.mjs +0 -2
  340. package/dist/request-tracers-DJJCncft.mjs +0 -2
  341. package/dist/resource-sharing-qQGn8AEn.mjs +0 -3
  342. package/dist/resource-tagging-aTtpX5e5.mjs +0 -2
  343. package/dist/rules-PpsDU89Q.mjs +0 -4
  344. package/dist/rulesets-DP12Aqik.mjs +0 -5
  345. package/dist/rum-DxvpzJYc.mjs +0 -4
  346. package/dist/schema-DlLbiOJj.mjs +0 -2
  347. package/dist/scim-DJ4AVU20.mjs +0 -4
  348. package/dist/secrets-store-D6KDNo_s.mjs +0 -7
  349. package/dist/security-center-008FMs_z.mjs +0 -2
  350. package/dist/security-txt-CqcfrhlN.mjs +0 -3
  351. package/dist/share-D5fzsVAJ.mjs +0 -5
  352. package/dist/smart-shield-DpFscIk8.mjs +0 -4
  353. package/dist/snippets-CCKgI2ZX.mjs +0 -4
  354. package/dist/spectrum-LmdqY3ki.mjs +0 -7
  355. package/dist/speed-CEK36h3A.mjs +0 -4
  356. package/dist/src-CEb2fgtT.mjs +0 -108
  357. package/dist/ssl-ChHUyaQm.mjs +0 -15
  358. package/dist/state-DeX23Kmg.mjs +0 -2
  359. package/dist/stream-DfUSELMX.mjs +0 -14
  360. package/dist/submit-DF2G5CIz.mjs +0 -2
  361. package/dist/tags-nFJJHlLJ.mjs +0 -2
  362. package/dist/tenant-CRLw1oRU.mjs +0 -2
  363. package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +0 -3
  364. package/dist/tunnel-CMQeBgmb.mjs +0 -5
  365. package/dist/tunnels-iVA3MrdS.mjs +0 -2
  366. package/dist/turnstile-DQHP6-_b.mjs +0 -23
  367. package/dist/ui-DJFcf61J.mjs +0 -5
  368. package/dist/url-info-BVgdb_pf.mjs +0 -2
  369. package/dist/url-normalization-BTcxLxIQ.mjs +0 -3
  370. package/dist/url-scanner-DwuDZLPk.mjs +0 -2
  371. package/dist/user-I_MbB_KX.mjs +0 -12
  372. package/dist/values-S-Q7-5o8.mjs +0 -2
  373. package/dist/vectorize-CNZdF_0A.mjs +0 -4
  374. package/dist/waiting-rooms-Bo-OSsxu.mjs +0 -11
  375. package/dist/web-assets-tlFzKdNL.mjs +0 -8
  376. package/dist/web3-CdbfoZ2x.mjs +0 -4
  377. package/dist/workers-DQ9Q7czn.mjs +0 -28
  378. package/dist/workers-builds-CGRhYx-x.mjs +0 -9
  379. package/dist/workflows-BhEy-crm.mjs +0 -5
  380. package/dist/zaraz-DbKvA_8C.mjs +0 -2
  381. package/dist/zero-trust-DrHCPVOc.mjs +0 -93
  382. package/dist/zone-D2zrbJI2.mjs +0 -2
  383. package/dist/zones-DrpxQ_-A.mjs +0 -21
  384. /package/dist/{Page-9ry_XAVC.mjs → Page-C-JHZnIy.mjs} +0 -0
  385. /package/dist/{alerts-9PR5sQ_z.mjs → alerts-B2SJO4nd.mjs} +0 -0
  386. /package/dist/{autorag-Bevo1kIH.mjs → autorag-iNjZXw1n.mjs} +0 -0
  387. /package/dist/{body-parser-BGVbwPeM.mjs → body-parser-DIlfApuJ.mjs} +0 -0
  388. /package/dist/{brands-C4M04Man.mjs → brands-BrVnNrT3.mjs} +0 -0
  389. /package/dist/{chunk-6EUZQHAF-C3w62dek.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
  390. /package/dist/{chunk-Q72B4Q5Z-DVMMVVEs.mjs → chunk-Q72B4Q5Z-CPy_WJKU.mjs} +0 -0
  391. /package/dist/{clear-DS0eRXOc.mjs → clear-an9o3dJ3.mjs} +0 -0
  392. /package/dist/{cli-types-C3nVfpSG.mjs → cli-types-CrSoSMPF.mjs} +0 -0
  393. /package/dist/{connector-telemetry-events-latest-CKKG6_pD.mjs → connector-telemetry-events-latest-BqWfopFc.mjs} +0 -0
  394. /package/dist/{connector-telemetry-snapshots-latest-Bv5OddJr.mjs → connector-telemetry-snapshots-latest-C1m9U1En.mjs} +0 -0
  395. /package/dist/{domain-info-BUiaGCEq.mjs → domain-info-B0Ykqv5l.mjs} +0 -0
  396. /package/dist/{health-vX6Ml2Na.mjs → health-CIUg1C5o.mjs} +0 -0
  397. /package/dist/{input-validation-1esLElok.mjs → input-validation-BxchZ9jE.mjs} +0 -0
  398. /package/dist/{internal-ROz7anul.mjs → internal-DmpATljO.mjs} +0 -0
  399. /package/dist/{live-CSxvigCS.mjs → live-B66u3_0g.mjs} +0 -0
  400. /package/dist/{metadata-DEqBUaSv.mjs → metadata-D062SVyy.mjs} +0 -0
  401. /package/dist/{public-BMg6-Hxh-DgIH5obr.mjs → public-BMg6-Hxh-BfUOZTDP.mjs} +0 -0
  402. /package/dist/{rate-limit-analytics-CgHgKjmV.mjs → rate-limit-analytics-BknoecoM.mjs} +0 -0
  403. /package/dist/{ready-6G9zVGPJ.mjs → ready-C-H2cwp_.mjs} +0 -0
  404. /package/dist/{recent-submissions-B3Smh-QM.mjs → recent-submissions-DyuH_n5u.mjs} +0 -0
  405. /package/dist/{refute-DjkmLSNe.mjs → refute-uSlzkQKq.mjs} +0 -0
  406. /package/dist/{resolve-DEvdeprv.mjs → resolve-B8CyM1mi.mjs} +0 -0
  407. /package/dist/{scan-logo-545qLcGs.mjs → scan-logo-DMk--WT7.mjs} +0 -0
  408. /package/dist/{scan-page-DRQiVufl.mjs → scan-page-DEHnAOJo.mjs} +0 -0
  409. /package/dist/{schemas-BFCBlp_W.mjs → schemas-O_ZNaF8R.mjs} +0 -0
  410. /package/dist/{search-CXbqFoqe.mjs → search-BlKeSfVD.mjs} +0 -0
  411. /package/dist/{signed-url-rU_nvgFA.mjs → signed-url-CiGmGkLQ.mjs} +0 -0
  412. /package/dist/{submission-info-D6PgXNQP.mjs → submission-info-DHlTHDrs.mjs} +0 -0
  413. /package/dist/{theme-CrIBazAF.mjs → theme-CeVf-5qG.mjs} +0 -0
  414. /package/dist/{total-queries-XkFyu8H5.mjs → total-queries-D5WvVfYi.mjs} +0 -0
  415. /package/dist/{tracked-domains-CmcRXHj_.mjs → tracked-domains-9deBK9bp.mjs} +0 -0
  416. /package/dist/{verify-CM1NakP0.mjs → verify-S-TmhUDr.mjs} +0 -0
@@ -0,0 +1,9 @@
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,t as c}from"./body-parser-DIlfApuJ.mjs";import{n as l}from"./input-validation-BxchZ9jE.mjs";import{a as u,i as d,n as f}from"./prompt-DjRTpML4.mjs";function p(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`bulk-delete`,describe:"Removes up to 100 IP-to-cloud-region mappings in a single request. Each IP is validated independently — successfully deleted items are returned in the `succeeded` array and IPs that could not be found or are invalid are returned in the `failed` array.",builder:p,handler:async c=>o({command:`cache origin-cloud-regions bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){i({command:`cf cache origin-cloud-regions bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/origin/cloud_regions/batch`,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}),!await f({force:!!c.force,message:`Are you sure you want to delete these Origin Cloud Region configurations?`})){process.stderr.write(`Aborted.
3
+ `);return}if(c.body){let e=s(c.body);if(Array.isArray(e)&&e.length>100){let n=Math.ceil(e.length/100),i=null;for(let r=0;r<e.length;r+=100){let s=e.slice(r,r+100);i=await a(`Deleting: batch ${Math.floor(r/100)+1}/${n}`,async()=>t(o,`DELETE`,`/zones/${c.zoneId}/origin/cloud_regions/batch`,{body:s}))}r(i,{successLabel:`Deleted`});return}r(await a(`Deleting`,async()=>t(o,`DELETE`,`/zones/${c.zoneId}/origin/cloud_regions/batch`,{body:e})),{successLabel:`Deleted`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function m(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 h={command:`bulk-update`,describe:"Upserts up to 100 IP-to-cloud-region mappings in a single request. Items in the request body are created or replaced; mappings not included in the request body are preserved unchanged (this is a merge operation, not a full collection replacement). Each item is validated independently — valid items are applied and invalid items are returned in the `failed` array. The vendor and region for every item are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.",builder:m,handler:async c=>o({command:`cache origin-cloud-regions bulk-update`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){i({command:`cf cache origin-cloud-regions bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/origin/cloud_regions/batch`,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>100){let n=Math.ceil(e.length/100),i=null;for(let r=0;r<e.length;r+=100){let s=e.slice(r,r+100);i=await a(`Updating: batch ${Math.floor(r/100)+1}/${n}`,async()=>t(o,`PUT`,`/zones/${c.zoneId}/origin/cloud_regions/batch`,{body:s}))}r(i,{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(o,`PUT`,`/zones/${c.zoneId}/origin/cloud_regions/batch`,{body:e})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function g(e){return e.positional(`origin-ip`,{type:`string`,description:`Origin IP address whose mapping should be deleted.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <origin-ip>`,describe:`Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted IP on success. Returns 404 if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.`,builder:g,handler:async t=>o({command:`cache origin-cloud-regions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){i({command:`cf cache origin-cloud-regions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin/cloud_regions/${t[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(t[`origin-ip`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"origin-ip":String(t[`origin-ip`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await f({force:!!t.force,message:`Are you sure you want to delete this Origin Cloud Region configuration?`})){process.stderr.write(`Aborted.
4
+ `);return}r(await a(`Deleting`,async()=>o.cache.originCloudRegions.delete({zone_id:s,origin_ip:t[`origin-ip`]})),{successLabel:`Deleted`})})};function v(e){return e.positional(`origin-ip`,{type:`string`,description:`Origin IP address to look up. IPv4 and IPv6 are supported.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <origin-ip>`,describe:`Returns the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 if the zone has no mappings or if the specified IP has no mapping.`,builder:v,handler:async t=>o({command:`cache origin-cloud-regions get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache origin-cloud-regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin/cloud_regions/${t[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(t[`origin-ip`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"origin-ip":String(t[`origin-ip`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.originCloudRegions.get({zone_id:s,origin_ip:t[`origin-ip`]})),{successLabel:`Loaded`})})};function b(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 x={command:`list`,describe:`Returns all IP-to-cloud-region mappings configured for the zone with pagination support. Each mapping tells Cloudflare which cloud vendor and region hosts the origin at that IP, enabling the edge to route via the nearest Tiered Cache upper-tier co-located with that cloud provider. Returns an empty array when no mappings exist.`,builder:b,handler:async t=>o({command:`cache origin-cloud-regions list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let o={page:t.page,per_page:t[`per-page`]};if(t.dryRun){i({command:`cf cache origin-cloud-regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin/cloud_regions`,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.cache.originCloudRegions.list({zone_id:c,...o})),{successLabel:`Loaded`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`supported-regions`,describe:`Returns the cloud vendors and regions that are valid values for origin cloud region mappings. Each region includes the Tiered Cache upper-tier colocation codes that will be used for cache routing when a mapping targeting that region is active. Requires the zone to have Tiered Cache enabled.`,builder:S,handler:async t=>o({command:`cache origin-cloud-regions supported-regions`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache origin-cloud-regions supported-regions`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin/cloud_regions/supported_regions`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.originCloudRegions.supportedRegions({zone_id:s})),{successLabel:`Loaded`})})};function w(e){return e.positional(`origin-ip`,{type:`string`,description:`Origin IP address to create or replace.`,demandOption:!0}).option(`region`,{type:`string`,description:`Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported_regions endpoint.`}).option(`vendor`,{type:`string`,description:`Cloud vendor hosting the origin. Must be one of the supported vendors.`,choices:[`aws`,`azure`,`gcp`,`oci`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or replacing an origin cloud region mapping.`})}const T={command:`update <origin-ip>`,describe:"Creates a new IP-to-cloud-region mapping or replaces the existing mapping for the specified IP. PUT is idempotent — calling it repeatedly with the same body produces the same result. The IP path parameter is normalized to canonical form (RFC 5952 for IPv6) before storage. The vendor and region are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`. Returns 400 if the `origin_ip` in the body does not match the URL path parameter. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings.",builder:w,handler:async t=>o({command:`cache origin-cloud-regions update`,classification:{safeFlags:[`vendor`,`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache origin-cloud-regions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin/cloud_regions/${t[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(t[`origin-ip`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"origin-ip":String(t[`origin-ip`]??``)},bodyKind:`json`,body:t.body===void 0?c({region:l(t.region,`region`,`text`),vendor:l(t.vendor,`vendor`,`text`)}):s(t.body)});return}let o=await n(t),f=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=f,t.body){let e=s(t.body);r(await a(`Updating`,async()=>o.cache.originCloudRegions.update({body:e,zone_id:f,origin_ip:t[`origin-ip`]})),{successLabel:`Updated`});return}t.region===void 0&&(t.region=await u(`region`,`Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported_regions endpoint.`)),t.vendor===void 0&&(t.vendor=await d(`vendor`,`Cloud vendor hosting the origin. Must be one of the supported vendors.`,[`aws`,`azure`,`gcp`,`oci`]));let p=c({region:l(t.region,`region`,`text`),vendor:l(t.vendor,`vendor`,`text`)});r(await a(`Updating`,async()=>o.cache.originCloudRegions.update({body:p,zone_id:f,origin_ip:t[`origin-ip`]})),{successLabel:`Updated`})})},E={command:`origin-cloud-regions`,describe:`Manage Origin Cloud Regions routing and failover configurations`,builder:e=>e.command(ee).command(h).command(_).command(y).command(x).command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`environment-id`,{type:`string`,description:`Environment ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`purge-environment <environment-id>`,describe:`Purge cached content scoped to a specific environment. Supports the same purge types as the zone-level endpoint (purge everything, by URL, by tag, host, or prefix). ### Availability and limits Please refer to [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).`,builder:D,handler:async c=>o({command:`cache purge-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){i({command:`cf cache purge-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/environments/${c[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(c[`environment-id`]))}/purge_cache`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"environment-id":String(c[`environment-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let o=await n(c),l=await e({zone:c.zone},o,{quiet:c.quiet});if(c.zoneId=l,!await f({force:!!c.force,message:`Are you sure you want to purge cache for this environment?`})){process.stderr.write(`Aborted.
5
+ `);return}if(c.body){let e=s(c.body);r(await a(`Deleting`,async()=>o.cache.purgeEnvironment({body:e,zone_id:l,environment_id:c[`environment-id`]})),{successLabel:`Deleted`});return}r(await a(`Deleting`,async()=>t(o,`POST`,`/zones/${c.zoneId}/environments/${encodeURIComponent(String(c[`environment-id`]))}/purge_cache`)),{successLabel:`Deleted`})})};function k(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`purge`,describe:'### Purge All Cached Content Removes ALL files from Cloudflare\'s cache. All tiers can purge everything. ``` {"purge_everything": true} ``` ### Purge Cached Content by URL Granularly removes one or more files from Cloudflare\'s cache by specifying URLs. All tiers can purge by URL. To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header. **NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise. Single file purge example with files: ``` {"files": ["http://www.example.com/css/styles.css", "http://www.example.com/js/index.js"]} ``` Single file purge example with url and header pairs: ``` {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]} ``` ### Purge Cached Content by Tag, Host or Prefix Granularly removes one or more files from Cloudflare\'s cache either by specifying the host, the associated Cache-Tag, or a Prefix. Flex purge with tags: ``` {"tags": ["a-cache-tag", "another-cache-tag"]} ``` Flex purge with hosts: ``` {"hosts": ["www.example.com", "images.example.com"]} ``` Flex purge with prefixes: ``` {"prefixes": ["www.example.com/foo", "images.example.com/bar/baz"]} ``` ### Availability and limits Please refer to [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).',builder:k,handler:async c=>o({command:`cache purge`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){i({command:`cf cache purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/purge_cache`,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),l=await e({zone:c.zone},o,{quiet:c.quiet});if(c.zoneId=l,!await f({force:!!c.force,message:`This operation will delete cached content for the zone.`})){process.stderr.write(`Aborted.
6
+ `);return}if(c.body){let e=s(c.body);r(await a(`Deleting`,async()=>o.cache.purge({body:e,zone_id:l})),{successLabel:`Deleted`});return}r(await a(`Deleting`,async()=>t(o,`POST`,`/zones/${c.zoneId}/purge_cache`)),{successLabel:`Deleted`})})};function j(e){return e.option(`value`,{type:`string`,description:`Value of the Regional Tiered Cache zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`edit`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:j,handler:async t=>o({command:`cache settings regional-tiered-cache edit`,classification:{safeFlags:[`value`,`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings regional-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({value:l(t.value,`value`,`text`)}):s(t.body)});return}let o=await n(t),u=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=s(t.body);r(await a(`Updating`,async()=>o.cache.settings.regionalTieredCache.edit({...e,zone_id:u})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await d(`value`,`Value of the Regional Tiered Cache zone setting.`,[`on`,`off`]));let f=c({value:l(t.value,`value`,`text`)});r(await a(`Updating`,async()=>o.cache.settings.regionalTieredCache.edit({...f,zone_id:u})),{successLabel:`Updated`})})};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:N,handler:async t=>o({command:`cache settings regional-tiered-cache get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings regional-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.settings.regionalTieredCache.get({zone_id:s})),{successLabel:`Loaded`})})},F={command:`regional-tiered-cache`,describe:`Restrict tiered cache topology to data centers within a specific geographic region`,builder:e=>e.command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 L={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:I,handler:async t=>o({command:`cache settings reserve clear`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){i({command:`cf cache settings reserve clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await f({force:!!t.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`})){process.stderr.write(`Aborted.
7
+ `);return}r(await a(`Deleting`,async()=>o.cache.settings.reserve.clear({zone_id:s})),{successLabel:`Deleted`})})};function te(e){return e.option(`value`,{type:`string`,description:`Value of the Cache Reserve zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`edit`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:te,handler:async t=>o({command:`cache settings reserve edit`,classification:{safeFlags:[`value`,`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings reserve edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({value:l(t.value,`value`,`text`)}):s(t.body)});return}let o=await n(t),u=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=s(t.body);r(await a(`Updating`,async()=>o.cache.settings.reserve.edit({...e,zone_id:u})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await d(`value`,`Value of the Cache Reserve zone setting.`,[`on`,`off`]));let f=c({value:l(t.value,`value`,`text`)});r(await a(`Updating`,async()=>o.cache.settings.reserve.edit({...f,zone_id:u})),{successLabel:`Updated`})})};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:z,handler:async t=>o({command:`cache settings reserve get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings reserve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.settings.reserve.get({zone_id:s})),{successLabel:`Loaded`})})};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:V,handler:async t=>o({command:`cache settings reserve status`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings reserve status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.settings.reserve.status({zone_id:s})),{successLabel:`Loaded`})})},U={command:`reserve`,describe:`Persistent storage tier that keeps cached assets even after eviction from edge caches`,builder:e=>e.command(L).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const G={command:`create`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website's origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:W,handler:async t=>o({command:`cache settings smart-tiered-cache create`,classification:{safeFlags:[`value`,`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings smart-tiered-cache create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({value:l(t.value,`value`,`text`)}):s(t.body)});return}let o=await n(t),u=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=s(t.body);r(await a(`Creating`,async()=>o.cache.settings.smartTieredCache.create({body:e,zone_id:u})),{successLabel:`Created`});return}t.value===void 0&&(t.value=await d(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let f=c({value:l(t.value,`value`,`text`)});r(await a(`Creating`,async()=>o.cache.settings.smartTieredCache.create({body:f,zone_id:u})),{successLabel:`Created`})})};function K(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 q={command:`delete`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:K,handler:async t=>o({command:`cache settings smart-tiered-cache delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){i({command:`cf cache settings smart-tiered-cache delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await f({force:!!t.force})){process.stderr.write(`Aborted.
8
+ `);return}r(await a(`Deleting`,async()=>o.cache.settings.smartTieredCache.delete({zone_id:s})),{successLabel:`Deleted`})})};function J(e){return e.option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const Y={command:`edit`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:J,handler:async t=>o({command:`cache settings smart-tiered-cache edit`,classification:{safeFlags:[`value`,`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings smart-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({value:l(t.value,`value`,`text`)}):s(t.body)});return}let o=await n(t),u=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=s(t.body);r(await a(`Updating`,async()=>o.cache.settings.smartTieredCache.edit({body:e,zone_id:u})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await d(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let f=c({value:l(t.value,`value`,`text`)});r(await a(`Updating`,async()=>o.cache.settings.smartTieredCache.edit({body:f,zone_id:u})),{successLabel:`Updated`})})};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:X,handler:async t=>o({command:`cache settings smart-tiered-cache get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings smart-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.settings.smartTieredCache.get({zone_id:s})),{successLabel:`Loaded`})})},Q={command:`smart-tiered-cache`,describe:`Automatically determine the best upper-tier data centers for tiered cache topology`,builder:e=>e.command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(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 re={command:`delete`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:ne,handler:async t=>o({command:`cache settings variants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){i({command:`cf cache settings variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await f({force:!!t.force})){process.stderr.write(`Aborted.
9
+ `);return}r(await a(`Deleting`,async()=>o.cache.settings.variants.delete({zone_id:s})),{successLabel:`Deleted`})})};function ie(e){return e.option(`value-avif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for avif.`}).option(`value-bmp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for bmp.`}).option(`value-gif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for gif.`}).option(`value-jp2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jp2.`}).option(`value-jpeg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpeg.`}).option(`value-jpg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg.`}).option(`value-jpg2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg2.`}).option(`value-png`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for png.`}).option(`value-tif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tif.`}).option(`value-tiff`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tiff.`}).option(`value-webp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for webp.`}).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 ae={command:`edit`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:ie,handler:async t=>o({command:`cache settings variants edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({value:{avif:t[`value-avif`],bmp:t[`value-bmp`],gif:t[`value-gif`],jp2:t[`value-jp2`],jpeg:t[`value-jpeg`],jpg:t[`value-jpg`],jpg2:t[`value-jpg2`],png:t[`value-png`],tif:t[`value-tif`],tiff:t[`value-tiff`],webp:t[`value-webp`]}}):s(t.body)});return}let o=await n(t),l=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=s(t.body);r(await a(`Updating`,async()=>o.cache.settings.variants.edit({...e,zone_id:l})),{successLabel:`Updated`});return}let u=c({value:{avif:t[`value-avif`],bmp:t[`value-bmp`],gif:t[`value-gif`],jp2:t[`value-jp2`],jpeg:t[`value-jpeg`],jpg:t[`value-jpg`],jpg2:t[`value-jpg2`],png:t[`value-png`],tif:t[`value-tif`],tiff:t[`value-tiff`],webp:t[`value-webp`]}});r(await a(`Updating`,async()=>o.cache.settings.variants.edit({...u,zone_id:l})),{successLabel:`Updated`})})};function oe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:oe,handler:async t=>o({command:`cache settings variants get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf cache settings variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.cache.settings.variants.get({zone_id:s})),{successLabel:`Loaded`})})},se={command:`variants`,describe:`Serve different cached versions of an image based on the Accept header (WebP, AVIF, etc.)`,builder:e=>e.command(re).command(ae).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`settings`,describe:`Configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(F).command(U).command(Q).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`cache`,describe:`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(A).command(O).command(E).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
@@ -0,0 +1,2 @@
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";function l(e){return e.option(`mtls-certificate-id`,{type:`string`,description:`The UUID to match against for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the results will be the hostnames associated to your active Cloudflare Managed CA.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`List Hostname Associations.`,builder:l,handler:async o=>a({command:`certificate-authorities hostname-associations get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{let a={mtls_certificate_id:o[`mtls-certificate-id`]};if(o.dryRun){r({command:`cf certificate-authorities hostname-associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/certificate_authorities/hostname_associations`,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.certificateAuthorities.hostnameAssociations.get({zone_id:c,...a})),{successLabel:`Loaded`})})};function d(e){return e.option(`hostnames`,{type:`string`,array:!0,description:`The hostnames field`}).option(`mtls-certificate-id`,{type:`string`,description:`The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the hostnames will be associated to your active Cloudflare Managed CA.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`update`,describe:`Replace Hostname Associations.`,builder:d,handler:async l=>a({command:`certificate-authorities hostname-associations update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf certificate-authorities hostname-associations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/certificate_authorities/hostname_associations`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({hostnames:l.hostnames,mtls_certificate_id:c(l[`mtls-certificate-id`],`mtls-certificate-id`,`text`)}):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(`Updating`,async()=>a.certificateAuthorities.hostnameAssociations.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({hostnames:l.hostnames,mtls_certificate_id:c(l[`mtls-certificate-id`],`mtls-certificate-id`,`text`)});n(await i(`Updating`,async()=>a.certificateAuthorities.hostnameAssociations.update({...d,zone_id:u})),{successLabel:`Updated`})})},p={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`certificate-authorities`,describe:`certificate-authorities`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{$ as e,Ct as t,D as n,Dt as r,P as i,T as a,U as o,W as s,Y as c,j as l,l as u,p as d,w as f}from"./dist-DV7LR38l.mjs";import{a as p,c as m,d as h,f as g,h as _,i as v,l as y,m as b,n as ee,o as te,p as ne,r as x,s as re,t as ie,u as S}from"./chunk-LQW53VED-9MACsvSG.mjs";import{chmodSync as C,existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,writeFileSync as k}from"node:fs";import A from"node:path";import{URLSearchParams as ae}from"node:url";function j(e){function t(){return A.resolve(e(),`preferences.json`)}_(t,`getUserPreferencesPath`);function n(){try{let e=E(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}_(n,`readUserPreferences`);function r(e){let r={...n(),...e},i=t();T(A.dirname(i),{recursive:!0}),k(i,JSON.stringify(r,null,` `),{encoding:`utf-8`})}return _(r,`updateUserPreferences`),{readUserPreferences:n,updateUserPreferences:r}}_(j,`createPreferences`);var M=6e4,N=525600,P=43200,F=1440,I=Symbol.for(`constructDateFrom`);function L(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&I in e?e[I](t):e instanceof Date?new e.constructor(t):new Date(t)}_(L,`constructFrom`);function R(e,t){return L(t||e,e)}_(R,`toDate`);var z={};function B(){return z}_(B,`getDefaultOptions`);function V(e){let t=R(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}_(V,`getTimezoneOffsetInMilliseconds`);function H(e,...t){let n=L.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}_(H,`normalizeDates`);function U(e,t){let n=R(e)-+R(t);return n<0?-1:n>0?1:n}_(U,`compareAsc`);function oe(e){return L(e,Date.now())}_(oe,`constructNow`);function se(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}_(se,`getRoundingMethod`);var ce={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},le=_((e,t,n)=>{let r,i=ce[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function W(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}_(W,`buildFormatLongFn`);var ue={date:W({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:W({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:W({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},de={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},fe=_((e,t,n,r)=>de[e],`formatRelative`);function G(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}_(G,`buildLocalizeFn`);var pe={ordinalNumber:_((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:G({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:G({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:_(e=>e-1,`argumentCallback`)}),month:G({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:G({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:G({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function K(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?me(s,e=>e.test(o)):q(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}_(K,`buildMatchFn`);function q(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}_(q,`findKey`);function me(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}_(me,`findIndex`);function he(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}_(he,`buildMatchPatternFn`);var ge={code:`en-US`,formatDistance:le,formatLong:ue,formatRelative:fe,localize:pe,match:{ordinalNumber:he({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:_(e=>parseInt(e,10),`valueCallback`)}),era:K({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:K({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:_(e=>e+1,`valueCallback`)}),month:K({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:K({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:K({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function _e(e,t,n){let r=B(),i=n?.locale??r.locale??ge,a=U(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=H(n?.in,...a>0?[t,e]:[e,t]),l=se(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/M,f=(u-(V(c)-V(s)))/M,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<F?`hour`:f<P?`day`:f<N?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}else if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}else if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}else if(m===`day`){let e=l(f/F);return i.formatDistance(`xDays`,e,o)}else if(m===`month`){let e=l(f/P);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}else{let e=l(f/N);return i.formatDistance(`xYears`,e,o)}}_(_e,`formatDistanceStrict`);function ve(e,t){return _e(e,oe(e),t)}_(ve,`formatDistanceToNowStrict`);function J(e,n){return{read:_(()=>{let r=n();if(!w(r))return;let i=t(r);try{return S(e,i)}catch{return}},`read`),write(t){let r=n();T(A.dirname(r),{recursive:!0}),k(r,g(e,t),{encoding:`utf-8`,mode:384}),C(r,384)},clear(){let e=n(),t=w(e);return O(e,{force:!0}),t},path:n}}_(J,`createFileStorage`);function ye(e){let{logger:t,prompt:r}=e;return _(async function(e,i){if(n())return t.log(i),!0;let a=await r(e);return typeof a==`string`&&a.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}_(ye,`createTemporaryTermsPrompt`);var be=[9106,1e4];function Y(e){return e?.code}_(Y,`getErrorCode`);function xe(e){let t=Y(e);return t!==void 0&&be.includes(t)}_(xe,`isMembershipsInaccessible`);function Se(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`}}_(Se,`notLoggedInErrorBodies`);function Ce(e,t,n){let r=new Date(t.claim.expiresAt);e.log(v`
2
+ import{$ as e,Ct as t,D as n,Dt as r,P as i,T as a,U as o,W as s,Y as c,j as l,l as u,p as d,w as f}from"./dist-12KzRsBM.mjs";import{a as p,c as m,d as h,f as g,h as _,i as v,l as y,m as b,n as ee,o as te,p as ne,r as x,s as re,t as ie,u as S}from"./chunk-LQW53VED-CoECHA3R.mjs";import{chmodSync as C,existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,writeFileSync as k}from"node:fs";import A from"node:path";import{URLSearchParams as ae}from"node:url";function j(e){function t(){return A.resolve(e(),`preferences.json`)}_(t,`getUserPreferencesPath`);function n(){try{let e=E(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}_(n,`readUserPreferences`);function r(e){let r={...n(),...e},i=t();T(A.dirname(i),{recursive:!0}),k(i,JSON.stringify(r,null,` `),{encoding:`utf-8`})}return _(r,`updateUserPreferences`),{readUserPreferences:n,updateUserPreferences:r}}_(j,`createPreferences`);var M=6e4,N=525600,P=43200,F=1440,I=Symbol.for(`constructDateFrom`);function L(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&I in e?e[I](t):e instanceof Date?new e.constructor(t):new Date(t)}_(L,`constructFrom`);function R(e,t){return L(t||e,e)}_(R,`toDate`);var z={};function B(){return z}_(B,`getDefaultOptions`);function V(e){let t=R(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}_(V,`getTimezoneOffsetInMilliseconds`);function H(e,...t){let n=L.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}_(H,`normalizeDates`);function U(e,t){let n=R(e)-+R(t);return n<0?-1:n>0?1:n}_(U,`compareAsc`);function oe(e){return L(e,Date.now())}_(oe,`constructNow`);function se(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}_(se,`getRoundingMethod`);var ce={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},le=_((e,t,n)=>{let r,i=ce[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function W(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}_(W,`buildFormatLongFn`);var ue={date:W({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:W({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:W({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},de={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},fe=_((e,t,n,r)=>de[e],`formatRelative`);function G(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}_(G,`buildLocalizeFn`);var pe={ordinalNumber:_((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:G({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:G({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:_(e=>e-1,`argumentCallback`)}),month:G({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:G({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:G({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function K(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?me(s,e=>e.test(o)):q(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}_(K,`buildMatchFn`);function q(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}_(q,`findKey`);function me(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}_(me,`findIndex`);function he(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}_(he,`buildMatchPatternFn`);var ge={code:`en-US`,formatDistance:le,formatLong:ue,formatRelative:fe,localize:pe,match:{ordinalNumber:he({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:_(e=>parseInt(e,10),`valueCallback`)}),era:K({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:K({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:_(e=>e+1,`valueCallback`)}),month:K({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:K({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:K({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function _e(e,t,n){let r=B(),i=n?.locale??r.locale??ge,a=U(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=H(n?.in,...a>0?[t,e]:[e,t]),l=se(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/M,f=(u-(V(c)-V(s)))/M,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<F?`hour`:f<P?`day`:f<N?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}else if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}else if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}else if(m===`day`){let e=l(f/F);return i.formatDistance(`xDays`,e,o)}else if(m===`month`){let e=l(f/P);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}else{let e=l(f/N);return i.formatDistance(`xYears`,e,o)}}_(_e,`formatDistanceStrict`);function ve(e,t){return _e(e,oe(e),t)}_(ve,`formatDistanceToNowStrict`);function J(e,n){return{read:_(()=>{let r=n();if(!w(r))return;let i=t(r);try{return S(e,i)}catch{return}},`read`),write(t){let r=n();T(A.dirname(r),{recursive:!0}),k(r,g(e,t),{encoding:`utf-8`,mode:384}),C(r,384)},clear(){let e=n(),t=w(e);return O(e,{force:!0}),t},path:n}}_(J,`createFileStorage`);function ye(e){let{logger:t,prompt:r}=e;return _(async function(e,i){if(n())return t.log(i),!0;let a=await r(e);return typeof a==`string`&&a.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}_(ye,`createTemporaryTermsPrompt`);var be=[9106,1e4];function Y(e){return e?.code}_(Y,`getErrorCode`);function xe(e){let t=Y(e);return t!==void 0&&be.includes(t)}_(xe,`isMembershipsInaccessible`);function Se(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`}}_(Se,`notLoggedInErrorBodies`);function Ce(e,t,n){let r=new Date(t.claim.expiresAt);e.log(v`
3
3
  Temporary account ready:
4
4
  Account: ${t.account.name} (${n?`reused`:`created`})
5
5
  Claim within: ${ve(r)}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{$ as e,Ct as t,D as n,Dt as r,Et as i,H as a,I as o,R as s,U as c,W as l,Z as u,xt as d}from"./dist-DV7LR38l.mjs";import{createRequire as f}from"node:module";import{chmodSync as p,existsSync as m,mkdirSync as h,rmSync as g,writeFileSync as _}from"node:fs";import v from"node:assert";import{TextEncoder as ee}from"node:util";import y from"node:path";import te from"node:url";import ne from"node:http";import{createCipheriv as re,createDecipheriv as ie,createHash as b,randomBytes as x,webcrypto as S}from"node:crypto";import{spawn as ae,spawnSync as C}from"node:child_process";var oe=Object.defineProperty,w=(e,t)=>oe(e,`name`,{value:t,configurable:!0}),T=o(),se=!1;function E(e){let{configOverride:t,warningLogger:n,storage:r}=e,{oauth_token:i,refresh_token:a,expiration_time:o,scopes:s,api_token:c}=t??r.read()??{};return i?{accessToken:{value:i,expiry:o??`2000-01-01:00:00:00+00:00`},refreshToken:{value:a??``},scopes:s}:c?(!se&&n&&(se=!0,n.warn(`It looks like you have used Wrangler v1's \`config\` command to login with an API token
2
+ import{$ as e,Ct as t,D as n,Dt as r,Et as i,H as a,I as o,R as s,U as c,W as l,Z as u,xt as d}from"./dist-12KzRsBM.mjs";import{createRequire as f}from"node:module";import{chmodSync as p,existsSync as m,mkdirSync as h,rmSync as g,writeFileSync as _}from"node:fs";import v from"node:assert";import{TextEncoder as ee}from"node:util";import y from"node:path";import te from"node:url";import ne from"node:http";import{createCipheriv as re,createDecipheriv as ie,createHash as b,randomBytes as x,webcrypto as S}from"node:crypto";import{spawn as ae,spawnSync as C}from"node:child_process";var oe=Object.defineProperty,w=(e,t)=>oe(e,`name`,{value:t,configurable:!0}),T=o(),se=!1;function E(e){let{configOverride:t,warningLogger:n,storage:r}=e,{oauth_token:i,refresh_token:a,expiration_time:o,scopes:s,api_token:c}=t??r.read()??{};return i?{accessToken:{value:i,expiry:o??`2000-01-01:00:00:00+00:00`},refreshToken:{value:a??``},scopes:s}:c?(!se&&n&&(se=!0,n.warn(`It looks like you have used Wrangler v1's \`config\` command to login with an API token
3
3
  from ${t===void 0?r.path():`in-memory config`}.
4
4
  This is no longer supported in the current version of Wrangler.
5
5
  If you wish to authenticate via an API token then please set the \`CLOUDFLARE_API_TOKEN\` environment variable.`)),{deprecatedApiToken:c}):{}}w(E,`readStoredAuthState`);var ce=e({variableName:`CLOUDFLARE_API_TOKEN`,deprecatedName:`CF_API_TOKEN`}),le=e({variableName:`CLOUDFLARE_API_KEY`,deprecatedName:`CF_API_KEY`}),ue=e({variableName:`CLOUDFLARE_EMAIL`,deprecatedName:`CF_EMAIL`});function de(e){if(e?.allowGlobalAuthKey??!0){let e=le(),t=ue();if(e&&t)return{authKey:e,authEmail:t}}let t=ce();if(t)return{apiToken:t}}w(de,`getAuthFromEnv`);function fe(e){let t=de(e);if(t)return t;let n=E({storage:e.storage,warningLogger:e.warningLogger});if(n.deprecatedApiToken)return{apiToken:n.deprecatedApiToken};if(n.accessToken?.value)return{apiToken:n.accessToken.value}}w(fe,`getAPIToken`);function pe(e){let t=fe(e);if(!t)throw new r(`No API token found.`,{telemetryMessage:`user auth missing api token`});return t}w(pe,`requireApiToken`);var me=/^[A-Za-z0-9_-]+$/;function he(e,t){if(!me.test(e))throw new r(`Invalid account ID "${e}" ${t}. Account IDs may only contain alphanumeric characters, hyphens, and underscores.`,{telemetryMessage:`user account id invalid characters`});return e}w(he,`validateAccountId`);var D=e({variableName:`WRANGLER_AUTH_DOMAIN`,defaultValue:w(()=>c()===`staging`?`dash.staging.cloudflare.com`:`dash.cloudflare.com`,`defaultValue`)}),ge=e({variableName:`WRANGLER_AUTH_URL`,defaultValue:w(()=>`https://${D()}/oauth2/auth`,`defaultValue`)}),_e=e({variableName:`WRANGLER_TOKEN_URL`,defaultValue:w(()=>`https://${D()}/oauth2/token`,`defaultValue`)}),ve=e({variableName:`WRANGLER_REVOKE_URL`,defaultValue:w(()=>`https://${D()}/oauth2/revoke`,`defaultValue`)}),ye=e({variableName:`CLOUDFLARE_ACCOUNT_ID`,deprecatedName:`CF_ACCOUNT_ID`});function be(){let e=ye();if(e)return he(e,"set in the `CLOUDFLARE_ACCOUNT_ID` environment variable")}w(be,`getCloudflareAccountIdFromEnv`);var xe=`/oauth2/device/auth`;function Se(){return`https://${D()}${xe}`}w(Se,`getDeviceAuthUrl`);var Ce=e({variableName:`CLOUDFLARE_ACCESS_CLIENT_ID`}),we=e({variableName:`CLOUDFLARE_ACCESS_CLIENT_SECRET`}),Te=e({variableName:`WRANGLER_CF_AUTHORIZATION_TOKEN`}),Ee=u({variableName:`CLOUDFLARE_AUTH_USE_KEYRING`}),O={},k=new Map;function De(){for(let e of Object.keys(O))delete O[e];k.clear()}w(De,`clearAccessCaches`);async function Oe(e,t){if(t.debug(`Checking if domain has Access enabled:`,e),k.has(e))return t.debug(`Using cached Access switch for:`,e,k.get(e)),k.get(e)??!1;t.debug(`Access switch not cached for:`,e);try{let n=new AbortController,r=setTimeout(()=>{n.abort()},1e3),i=await(0,T.fetch)(`https://${e}`,{redirect:`manual`,signal:n.signal});clearTimeout(r);let a=!!(i.status===302&&i.headers.get(`location`)?.includes(`cloudflareaccess.com`));return t.debug(`Caching access switch for:`,e),k.set(e,a),a}catch{return k.set(e,!1),!1}}w(Oe,`domainUsesAccess`);async function ke(e,t){let i=t.logger,a=Ce(),o=we();if(a&&o)return i.debug(`Using Access Service Token headers for domain:`,e),{"CF-Access-Client-Id":a,"CF-Access-Client-Secret":o};if((a!==void 0||o!==void 0)&&i.warn(`Both CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET must be set to use Access Service Token authentication. Only ${a===void 0?`CLOUDFLARE_ACCESS_CLIENT_SECRET`:`CLOUDFLARE_ACCESS_CLIENT_ID`} was found.`),!await Oe(e,i))return{};if(i.debug(`Getting Access headers for domain:`,e),O[e])return i.debug(`Using cached Access headers for domain:`,e),O[e];if((t.isNonInteractiveOrCI??n)())throw new r(`The domain "${e}" is behind Cloudflare Access, but no Access Service Token credentials were found and the current environment is non-interactive.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{r as e,t}from"./chunk-vbHwaUoU.mjs";import{Dt as n,I as r,at as i,f as a,k as o}from"./dist-DV7LR38l.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l from"node:assert";import u,{resolve as d}from"node:path";import{spawnSync as f}from"node:child_process";var p=Object.create,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,y=(e,t)=>m(e,`name`,{value:t,configurable:!0}),b=e===void 0?s(import.meta.url):e,x=(e,t)=>function(){return t||(0,e[g(e)[0]])((t={exports:{}}).exports,t),t.exports},S=(e,t)=>{for(var n in t)m(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of g(t))!v.call(e,i)&&i!==n&&m(e,i,{get:()=>t[i],enumerable:!(r=h(t,i))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:p(_(e)),C(t||!e||!e.__esModule?m(n,`default`,{value:e,enumerable:!0}):n,e)),T=t(((t,n)=>{var r=e(`child_process`).exec,i=e(`child_process`).execSync,a=e(`fs`),o=e(`path`),s=a.access,c=a.accessSync,l=a.constants||a,u=process.platform==`win32`,d=function(e,t){s(e,l.F_OK,function(e){t(!e)})},f=function(e){try{return c(e,l.F_OK),!1}catch{return!0}},p=function(e,t){s(e,l.F_OK|l.X_OK,function(e){t(null,!e)})},m=function(e){try{return c(e,l.F_OK|l.X_OK),!0}catch{return!1}},h=function(e,t,n){d(e,function(i){if(!i){r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)});return}p(e,n)})},g=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)){n(null,!1);return}r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)})},_=function(e,t){if(f(e))try{return!!i(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`)}catch{return!1}return m(e)},v=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!i(`where `+t,{stdio:[]})}catch{return!1}},y=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=`'`+e.replace(/'/g,`'\\''`)+`'`,e=e.replace(/^(?:'')+/g,``).replace(/\\'''/g,`\\'`)),e};u&&(y=function(e){if(/[\\]/.test(e)){var t=`"`+o.dirname(e)+`"`,n=`"`+o.basename(e)+`"`;return t+`:`+n}return`"`+e+`"`}),n.exports=function e(t,n){var r=y(t);if(!n&&typeof Promise<`u`)return new Promise(function(n,r){e(t,function(e,i){i?n(t):r(e)})});u?g(t,r,n):h(t,r,n)},n.exports.sync=function(e){var t=y(e);return u?v(e,t):_(e,t)}})),E=t(((e,t)=>{t.exports=T()})),ee=r(),D=E();function O(e){if(e.compiled_schema)return c(d(e.compiled_schema));let{base_path:t,source_schemas:r}=e,i=(r??[]).map(e=>d(t,e));if(!(0,D.sync)(`capnp`))throw new n(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let a=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${d(t??`.`)}`,...i],{maxBuffer:3*1024*1024});if(a.error)throw a.error;if(a.stderr.length)throw Error(a.stderr.toString());return a.stdout}y(O,`handleUnsafeCapnp`);var k={esm:`application/javascript+module`,commonjs:`application/javascript`,"compiled-wasm":`application/wasm`,buffer:`application/octet-stream`,text:`text/plain`,python:`text/x-python`,"python-requirement":`text/x-python-requirement`};function A(e){let t=k[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}y(A,`toMimeType`);function j(e){let t=Object.keys(k).find(t=>k[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}y(j,`fromMimeType`);function M(e,t,r){let s=new ee.FormData,{main:d,sourceMaps:f,migrations:p,exports:m,compatibility_date:h,compatibility_flags:g,keepVars:_,keepSecrets:v,keepBindings:y,logpush:b,placement:x,tail_consumers:S,streaming_tail_consumers:C,limits:w,annotations:T,keep_assets:E,assets:D,observability:k,cache:j,package_dependencies:M}=e,N={html_handling:D?.assetConfig?.html_handling,not_found_handling:D?.assetConfig?.not_found_handling,run_worker_first:D?.run_worker_first,_redirects:D?._redirects,_headers:D?._headers};if(D&&!D.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:D.jwt,config:N},...T&&{annotations:T},...h&&{compatibility_date:h},...g&&{compatibility_flags:g}})),s;let{modules:P}=e,F=[],te=a(`plain_text`,t),ne=a(`json`,t),re=a(`secret_text`,t),ie=a(`kv_namespace`,t),I=a(`send_email`,t),ae=a(`durable_object_namespace`,t),oe=a(`workflow`,t),se=a(`queue`,t),ce=a(`r2_bucket`,t),le=a(`d1`,t),ue=a(`vectorize`,t),de=a(`ai_search_namespace`,t),L=a(`ai_search`,t),R=a(`agent_memory`,t),z=a(`hyperdrive`,t),B=a(`secrets_store_secret`,t),V=a(`artifacts`,t),fe=a(`unsafe_hello_world`,t),pe=a(`flagship`,t),me=a(`ratelimit`,t),he=a(`vpc_service`,t),ge=a(`vpc_network`,t),_e=a(`service`,t),H=a(`analytics_engine`,t),ve=a(`dispatch_namespace`,t),ye=a(`mtls_certificate`,t),be=a(`pipeline`,t),xe=a(`worker_loader`,t),Se=a(`logfwdr`,t),Ce=a(`wasm_module`,t),U=a(`browser`,t)[0],W=a(`ai`,t)[0],G=a(`images`,t)[0],K=a(`stream`,t)[0],q=a(`media`,t)[0],J=a(`version_metadata`,t)[0],Y=a(`assets`,t)[0],we=a(`text_blob`,t),Te=a(`data_blob`,t);a(`inherit`,t).forEach(({binding:e})=>{F.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{F.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{F.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{F.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:a})=>{if(r?.dryRun&&(e??=i),e===void 0)throw new n(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===i?F.push({name:t,type:`inherit`}):F.push({name:t,type:`kv_namespace`,namespace_id:e,raw:a})}),I.forEach(e=>{let t={name:e.name,type:`send_email`,allowed_sender_addresses:e.allowed_sender_addresses};e.destination_address===void 0?e.allowed_destination_addresses===void 0?F.push(t):F.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):F.push({...t,destination_address:e.destination_address})}),ae.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{F.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),oe.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{F.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),se.forEach(({binding:e,queue_name:t,delivery_delay:a,raw:o})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "queue" field. Add a "queue" field to the producer in your Worker configuration specifying the name of the Queue to bind to.`,{telemetryMessage:`queue binding missing name`});t===i?F.push({name:e,type:`inherit`}):F.push({type:`queue`,name:e,queue_name:t,delivery_delay:a,raw:o})}),ce.forEach(({binding:e,bucket_name:t,jurisdiction:a,raw:o})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "bucket_name" field. Add a "bucket_name" field to the binding in your Worker configuration specifying the name of the R2 bucket to bind to.`,{telemetryMessage:`r2 bucket binding missing bucket_name`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:a,raw:o})}),le.forEach(({binding:e,database_id:t,database_internal_env:a,raw:o})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "database_id" field. Add a "database_id" field to the binding in your Worker configuration specifying the ID of the D1 database to bind to.`,{telemetryMessage:`d1 database binding missing database_id`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`d1`,id:t,internalEnv:a,raw:o})}),ue.forEach(({binding:e,index_name:t,raw:n})=>{F.push({name:e,type:`vectorize`,index_name:t,raw:n})}),de.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the AI Search namespace to bind to.`,{telemetryMessage:`ai search namespace binding missing namespace`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`ai_search_namespace`,namespace:t})}),L.forEach(({binding:e,instance_name:t})=>{F.push({name:e,type:`ai_search`,instance_name:t})}),R.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`,{telemetryMessage:!1});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`agent_memory`,namespace:t})}),z.forEach(({binding:e,id:t})=>{F.push({name:e,type:`hyperdrive`,id:t})}),B.forEach(({binding:e,store_id:t,secret_name:n})=>{F.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),V.forEach(({binding:e,namespace:t})=>{F.push({name:e,type:`artifacts`,namespace:t})}),fe.forEach(({binding:e,enable_timer:t})=>{F.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),pe.forEach(({binding:e,app_id:t})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have an "app_id" field. Add an "app_id" field to the binding in your Worker configuration specifying the Flagship app to bind to.`,{telemetryMessage:`flagship binding missing app id`});F.push(t===i?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),me.forEach(({name:e,namespace_id:t,simple:n})=>{F.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),he.forEach(({binding:e,service_id:t})=>{F.push({name:e,type:`vpc_service`,service_id:t})}),ge.forEach(({binding:e,tunnel_id:t,network_id:n})=>{F.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),_e.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{F.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),H.forEach(({binding:e,dataset:t})=>{F.push({name:e,type:`analytics_engine`,dataset:t})}),ve.forEach(({binding:e,namespace:t,outbound:a})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the dispatch namespace to bind to.`,{telemetryMessage:`dispatch namespace binding missing namespace`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`dispatch_namespace`,namespace:t,...a&&{outbound:{worker:{service:a.service,environment:a.environment},params:a.parameters?.map(e=>({name:e}))}}})}),ye.forEach(({binding:e,certificate_id:t})=>{F.push({name:e,type:`mtls_certificate`,certificate_id:t})}),be.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)F.push({name:e,type:`pipelines`,stream:t});else if(n)F.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),xe.forEach(({binding:e})=>{F.push({name:e,type:`worker_loader`})}),Se.forEach(({name:e,destination:t})=>{F.push({name:e,type:`logfwdr`,destination:t})}),Ce.forEach(({binding:e,source:t})=>{F.push({name:e,type:`wasm_module`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),U!==void 0&&F.push({name:U.binding,type:`browser`,raw:U.raw}),W!==void 0&&F.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&F.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&F.push({name:K.binding,type:`stream`}),q!==void 0&&F.push({name:q.binding,type:`media`}),J!==void 0&&F.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&F.push({name:Y.binding,type:`assets`}),we.forEach(({binding:e,source:t})=>{F.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?s.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):s.set(e,new File([c(t.path)],t.path,{type:`text/plain`})))}),Te.forEach(({binding:e,source:t})=>{F.push({name:e,type:`data_blob`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,n]of Object.entries(t??{}))if(o(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;F.push({name:e,type:t.slice(7),...r})}let X=`__STATIC_CONTENT_MANIFEST`;if(P?.some(({name:e})=>e===X)&&d.type===`esm`){l(P!==void 0);let e=new Set(P.map(e=>u.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=u.posix.relative(t,X),n=u.posix.join(t,X);P.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(d.type===`commonjs`){for(let e of Object.values([...P||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),P=P?.filter(t=>t!==e);else if(e.type===`compiled-wasm`||e.type===`text`||e.type===`buffer`){let t=e.name.replace(/[^a-zA-Z0-9_$]/g,`_`);F.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),s.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),P=P?.filter(t=>t!==e)}}let Z;if(r?.unsafe?.capnp){let e=O(r.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;_&&(Q??=[],Q.push(`plain_text`,`json`)),v&&(Q??=[],Q.push(`secret_text`,`secret_key`)),y&&(Q??=[],Q.push(...y));let $={...d.type===`commonjs`?{body_part:d.name}:{main_module:d.name},bindings:F,containers:e.containers===void 0?void 0:e.containers.map(e=>({...e.name!==void 0&&{name:e.name},...e.class_name!==void 0&&{class_name:e.class_name},...e.images!==void 0&&{images:e.images}})),...h&&{compatibility_date:h},...g&&{compatibility_flags:g},...p&&{migrations:p},...m&&Object.keys(m).length>0&&{exports:m},capnp_schema:Z,...Q&&{keep_bindings:Q},...b!==void 0&&{logpush:b},...x&&{placement:x},...S&&{tail_consumers:S},...C&&{streaming_tail_consumers:C},...w&&{limits:w},...T&&{annotations:T},...E!==void 0&&{keep_assets:E},...D&&{assets:{jwt:D.jwt,config:N}},...k&&{observability:k},...j&&{cache_options:j},...M?.length&&{package_dependencies:M}};if(r?.unsafe?.metadata!==void 0)for(let e of Object.keys(r.unsafe.metadata))$[e]=r.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),d.type===`commonjs`&&P&&P.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[d].concat(P||[]))s.set(e.name,new File([e.content],e.name,{type:A(e.type??d.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}y(M,`createWorkerUploadForm`);export{S as a,w as c,x as i,j as n,y as o,k as r,b as s,M as t};
2
+ import{r as e,t}from"./chunk-vbHwaUoU.mjs";import{Dt as n,I as r,at as i,f as a,k as o}from"./dist-12KzRsBM.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l from"node:assert";import u,{resolve as d}from"node:path";import{spawnSync as f}from"node:child_process";var p=Object.create,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,y=(e,t)=>m(e,`name`,{value:t,configurable:!0}),b=e===void 0?s(import.meta.url):e,x=(e,t)=>function(){return t||(0,e[g(e)[0]])((t={exports:{}}).exports,t),t.exports},S=(e,t)=>{for(var n in t)m(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of g(t))!v.call(e,i)&&i!==n&&m(e,i,{get:()=>t[i],enumerable:!(r=h(t,i))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:p(_(e)),C(t||!e||!e.__esModule?m(n,`default`,{value:e,enumerable:!0}):n,e)),T=t(((t,n)=>{var r=e(`child_process`).exec,i=e(`child_process`).execSync,a=e(`fs`),o=e(`path`),s=a.access,c=a.accessSync,l=a.constants||a,u=process.platform==`win32`,d=function(e,t){s(e,l.F_OK,function(e){t(!e)})},f=function(e){try{return c(e,l.F_OK),!1}catch{return!0}},p=function(e,t){s(e,l.F_OK|l.X_OK,function(e){t(null,!e)})},m=function(e){try{return c(e,l.F_OK|l.X_OK),!0}catch{return!1}},h=function(e,t,n){d(e,function(i){if(!i){r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)});return}p(e,n)})},g=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)){n(null,!1);return}r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)})},_=function(e,t){if(f(e))try{return!!i(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`)}catch{return!1}return m(e)},v=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!i(`where `+t,{stdio:[]})}catch{return!1}},y=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=`'`+e.replace(/'/g,`'\\''`)+`'`,e=e.replace(/^(?:'')+/g,``).replace(/\\'''/g,`\\'`)),e};u&&(y=function(e){if(/[\\]/.test(e)){var t=`"`+o.dirname(e)+`"`,n=`"`+o.basename(e)+`"`;return t+`:`+n}return`"`+e+`"`}),n.exports=function e(t,n){var r=y(t);if(!n&&typeof Promise<`u`)return new Promise(function(n,r){e(t,function(e,i){i?n(t):r(e)})});u?g(t,r,n):h(t,r,n)},n.exports.sync=function(e){var t=y(e);return u?v(e,t):_(e,t)}})),E=t(((e,t)=>{t.exports=T()})),ee=r(),D=E();function O(e){if(e.compiled_schema)return c(d(e.compiled_schema));let{base_path:t,source_schemas:r}=e,i=(r??[]).map(e=>d(t,e));if(!(0,D.sync)(`capnp`))throw new n(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let a=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${d(t??`.`)}`,...i],{maxBuffer:3*1024*1024});if(a.error)throw a.error;if(a.stderr.length)throw Error(a.stderr.toString());return a.stdout}y(O,`handleUnsafeCapnp`);var k={esm:`application/javascript+module`,commonjs:`application/javascript`,"compiled-wasm":`application/wasm`,buffer:`application/octet-stream`,text:`text/plain`,python:`text/x-python`,"python-requirement":`text/x-python-requirement`};function A(e){let t=k[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}y(A,`toMimeType`);function j(e){let t=Object.keys(k).find(t=>k[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}y(j,`fromMimeType`);function M(e,t,r){let s=new ee.FormData,{main:d,sourceMaps:f,migrations:p,exports:m,compatibility_date:h,compatibility_flags:g,keepVars:_,keepSecrets:v,keepBindings:y,logpush:b,placement:x,tail_consumers:S,streaming_tail_consumers:C,limits:w,annotations:T,keep_assets:E,assets:D,observability:k,cache:j,package_dependencies:M}=e,N={html_handling:D?.assetConfig?.html_handling,not_found_handling:D?.assetConfig?.not_found_handling,run_worker_first:D?.run_worker_first,_redirects:D?._redirects,_headers:D?._headers};if(D&&!D.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:D.jwt,config:N},...T&&{annotations:T},...h&&{compatibility_date:h},...g&&{compatibility_flags:g}})),s;let{modules:P}=e,F=[],te=a(`plain_text`,t),ne=a(`json`,t),re=a(`secret_text`,t),ie=a(`kv_namespace`,t),I=a(`send_email`,t),ae=a(`durable_object_namespace`,t),oe=a(`workflow`,t),se=a(`queue`,t),ce=a(`r2_bucket`,t),le=a(`d1`,t),ue=a(`vectorize`,t),de=a(`ai_search_namespace`,t),L=a(`ai_search`,t),R=a(`agent_memory`,t),z=a(`hyperdrive`,t),B=a(`secrets_store_secret`,t),V=a(`artifacts`,t),fe=a(`unsafe_hello_world`,t),pe=a(`flagship`,t),me=a(`ratelimit`,t),he=a(`vpc_service`,t),ge=a(`vpc_network`,t),_e=a(`service`,t),H=a(`analytics_engine`,t),ve=a(`dispatch_namespace`,t),ye=a(`mtls_certificate`,t),be=a(`pipeline`,t),xe=a(`worker_loader`,t),Se=a(`logfwdr`,t),Ce=a(`wasm_module`,t),U=a(`browser`,t)[0],W=a(`ai`,t)[0],G=a(`images`,t)[0],K=a(`stream`,t)[0],q=a(`media`,t)[0],J=a(`version_metadata`,t)[0],Y=a(`assets`,t)[0],we=a(`text_blob`,t),Te=a(`data_blob`,t);a(`inherit`,t).forEach(({binding:e})=>{F.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{F.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{F.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{F.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:a})=>{if(r?.dryRun&&(e??=i),e===void 0)throw new n(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===i?F.push({name:t,type:`inherit`}):F.push({name:t,type:`kv_namespace`,namespace_id:e,raw:a})}),I.forEach(e=>{let t={name:e.name,type:`send_email`,allowed_sender_addresses:e.allowed_sender_addresses};e.destination_address===void 0?e.allowed_destination_addresses===void 0?F.push(t):F.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):F.push({...t,destination_address:e.destination_address})}),ae.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{F.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),oe.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{F.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),se.forEach(({binding:e,queue_name:t,delivery_delay:a,raw:o})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "queue" field. Add a "queue" field to the producer in your Worker configuration specifying the name of the Queue to bind to.`,{telemetryMessage:`queue binding missing name`});t===i?F.push({name:e,type:`inherit`}):F.push({type:`queue`,name:e,queue_name:t,delivery_delay:a,raw:o})}),ce.forEach(({binding:e,bucket_name:t,jurisdiction:a,raw:o})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "bucket_name" field. Add a "bucket_name" field to the binding in your Worker configuration specifying the name of the R2 bucket to bind to.`,{telemetryMessage:`r2 bucket binding missing bucket_name`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:a,raw:o})}),le.forEach(({binding:e,database_id:t,database_internal_env:a,raw:o})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "database_id" field. Add a "database_id" field to the binding in your Worker configuration specifying the ID of the D1 database to bind to.`,{telemetryMessage:`d1 database binding missing database_id`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`d1`,id:t,internalEnv:a,raw:o})}),ue.forEach(({binding:e,index_name:t,raw:n})=>{F.push({name:e,type:`vectorize`,index_name:t,raw:n})}),de.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the AI Search namespace to bind to.`,{telemetryMessage:`ai search namespace binding missing namespace`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`ai_search_namespace`,namespace:t})}),L.forEach(({binding:e,instance_name:t})=>{F.push({name:e,type:`ai_search`,instance_name:t})}),R.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`,{telemetryMessage:!1});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`agent_memory`,namespace:t})}),z.forEach(({binding:e,id:t})=>{F.push({name:e,type:`hyperdrive`,id:t})}),B.forEach(({binding:e,store_id:t,secret_name:n})=>{F.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),V.forEach(({binding:e,namespace:t})=>{F.push({name:e,type:`artifacts`,namespace:t})}),fe.forEach(({binding:e,enable_timer:t})=>{F.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),pe.forEach(({binding:e,app_id:t})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have an "app_id" field. Add an "app_id" field to the binding in your Worker configuration specifying the Flagship app to bind to.`,{telemetryMessage:`flagship binding missing app id`});F.push(t===i?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),me.forEach(({name:e,namespace_id:t,simple:n})=>{F.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),he.forEach(({binding:e,service_id:t})=>{F.push({name:e,type:`vpc_service`,service_id:t})}),ge.forEach(({binding:e,tunnel_id:t,network_id:n})=>{F.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),_e.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{F.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),H.forEach(({binding:e,dataset:t})=>{F.push({name:e,type:`analytics_engine`,dataset:t})}),ve.forEach(({binding:e,namespace:t,outbound:a})=>{if(r?.dryRun&&(t??=i),t===void 0)throw new n(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the dispatch namespace to bind to.`,{telemetryMessage:`dispatch namespace binding missing namespace`});t===i?F.push({name:e,type:`inherit`}):F.push({name:e,type:`dispatch_namespace`,namespace:t,...a&&{outbound:{worker:{service:a.service,environment:a.environment},params:a.parameters?.map(e=>({name:e}))}}})}),ye.forEach(({binding:e,certificate_id:t})=>{F.push({name:e,type:`mtls_certificate`,certificate_id:t})}),be.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)F.push({name:e,type:`pipelines`,stream:t});else if(n)F.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),xe.forEach(({binding:e})=>{F.push({name:e,type:`worker_loader`})}),Se.forEach(({name:e,destination:t})=>{F.push({name:e,type:`logfwdr`,destination:t})}),Ce.forEach(({binding:e,source:t})=>{F.push({name:e,type:`wasm_module`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),U!==void 0&&F.push({name:U.binding,type:`browser`,raw:U.raw}),W!==void 0&&F.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&F.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&F.push({name:K.binding,type:`stream`}),q!==void 0&&F.push({name:q.binding,type:`media`}),J!==void 0&&F.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&F.push({name:Y.binding,type:`assets`}),we.forEach(({binding:e,source:t})=>{F.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?s.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):s.set(e,new File([c(t.path)],t.path,{type:`text/plain`})))}),Te.forEach(({binding:e,source:t})=>{F.push({name:e,type:`data_blob`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,n]of Object.entries(t??{}))if(o(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;F.push({name:e,type:t.slice(7),...r})}let X=`__STATIC_CONTENT_MANIFEST`;if(P?.some(({name:e})=>e===X)&&d.type===`esm`){l(P!==void 0);let e=new Set(P.map(e=>u.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=u.posix.relative(t,X),n=u.posix.join(t,X);P.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(d.type===`commonjs`){for(let e of Object.values([...P||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),P=P?.filter(t=>t!==e);else if(e.type===`compiled-wasm`||e.type===`text`||e.type===`buffer`){let t=e.name.replace(/[^a-zA-Z0-9_$]/g,`_`);F.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),s.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),P=P?.filter(t=>t!==e)}}let Z;if(r?.unsafe?.capnp){let e=O(r.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;_&&(Q??=[],Q.push(`plain_text`,`json`)),v&&(Q??=[],Q.push(`secret_text`,`secret_key`)),y&&(Q??=[],Q.push(...y));let $={...d.type===`commonjs`?{body_part:d.name}:{main_module:d.name},bindings:F,containers:e.containers===void 0?void 0:e.containers.map(e=>({...e.name!==void 0&&{name:e.name},...e.class_name!==void 0&&{class_name:e.class_name},...e.images!==void 0&&{images:e.images}})),...h&&{compatibility_date:h},...g&&{compatibility_flags:g},...p&&{migrations:p},...m&&Object.keys(m).length>0&&{exports:m},capnp_schema:Z,...Q&&{keep_bindings:Q},...b!==void 0&&{logpush:b},...x&&{placement:x},...S&&{tail_consumers:S},...C&&{streaming_tail_consumers:C},...w&&{limits:w},...T&&{annotations:T},...E!==void 0&&{keep_assets:E},...D&&{assets:{jwt:D.jwt,config:N}},...k&&{observability:k},...j&&{cache_options:j},...M?.length&&{package_dependencies:M}};if(r?.unsafe?.metadata!==void 0)for(let e of Object.keys(r.unsafe.metadata))$[e]=r.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),d.type===`commonjs`&&P&&P.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[d].concat(P||[]))s.set(e.name,new File([e.content],e.name,{type:A(e.type??d.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}y(M,`createWorkerUploadForm`);export{S as a,w as c,x as i,j as n,y as o,k as r,b as s,M as t};
@@ -0,0 +1,3 @@
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";import{t as d}from"./cli-types-CrSoSMPF.mjs";function f(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`validity-days`,{type:`number`,description:`The number of days the Client Certificate will be valid after the issued_on date.`}).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:`create`,describe:`Create a new API Shield mTLS Client Certificate.`,builder:f,handler:async u=>a({command:`client-certificates create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({csr:c(u.csr,`csr`,`text`),validity_days:u[`validity-days`]}):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.clientCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(u.csr===void 0&&(u.csr=await l(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),u[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=s({csr:c(u.csr,`csr`,`text`),validity_days:u[`validity-days`]});n(await i(`Creating`,async()=>a.clientCertificates.create({...f,zone_id:d})),{successLabel:`Created`})})};function m(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <client-certificate-id>`,describe:`Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`,builder:m,handler:async o=>a({command:`client-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf client-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/client_certificates/${o[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(o[`client-certificate-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"client-certificate-id":String(o[`client-certificate-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
+ `);return}n(await i(`Deleting`,async()=>a.clientCertificates.delete({zone_id:s,client_certificate_id:o[`client-certificate-id`]})),{successLabel:`Deleted`})})};function g(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`reactivate`,{type:`boolean`,description:`The reactivate 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 _={command:`edit <client-certificate-id>`,describe:`If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint.`,builder:g,handler:async c=>a({command:`client-certificates edit`,classification:{safeFlags:[`reactivate`,`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf client-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/client_certificates/${c[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(c[`client-certificate-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"client-certificate-id":String(c[`client-certificate-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({reactivate:c.reactivate}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Updating`,async()=>a.clientCertificates.edit({...e,zone_id:l,client_certificate_id:c[`client-certificate-id`]})),{successLabel:`Updated`});return}let u=s({reactivate:c.reactivate});n(await i(`Updating`,async()=>a.clientCertificates.edit({...u,zone_id:l,client_certificate_id:c[`client-certificate-id`]})),{successLabel:`Updated`})})};function v(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <client-certificate-id>`,describe:`Get Details for a single mTLS API Shield Client Certificate.`,builder:v,handler:async o=>a({command:`client-certificates get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/client_certificates/${o[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(o[`client-certificate-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"client-certificate-id":String(o[`client-certificate-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.clientCertificates.get({zone_id:s,client_certificate_id:o[`client-certificate-id`]})),{successLabel:`Loaded`})})};function b(e){return e.option(`status`,{type:`string`,description:`Client Certitifcate Status to filter results by.`,choices:[`all`,`active`,`pending_reactivation`,`pending_revocation`,`revoked`]}).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 x={command:`list`,describe:`List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination.`,builder:d(b),handler:async o=>a({command:`client-certificates list`,classification:{safeFlags:[`status`,`dry-run`]}},o,async()=>{let a={status:o.status,page:o.page,per_page:o[`per-page`],limit:o.limit,offset:o.offset};if(o.dryRun){r({command:`cf client-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/client_certificates`,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.clientCertificates.list({zone_id:c,...a})),{successLabel:`Loaded`})})},S={command:`client-certificates`,describe:`client-certificates`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{S as default};
@@ -0,0 +1,37 @@
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,i as u,n as d}from"./prompt-DjRTpML4.mjs";import{t as f}from"./cli-types-CrSoSMPF.mjs";function p(e){return e.positional(`connection-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <connection-id>`,describe:`Returns a webpage connection detected on the zone by connection ID.`,builder:p,handler:async o=>a({command:`client-side-security connections get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/connections/${o[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(o[`connection-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"connection-id":String(o[`connection-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.clientSideSecurity.connections.get({zone_id:s,connection_id:o[`connection-id`]})),{successLabel:`Loaded`})})};function h(e){return e.option(`exclude-urls`,{type:`string`,description:`Excludes connections whose URL contains one of the URL-encoded URLs separated by commas.`}).option(`urls`,{type:`string`,description:`Includes connections whose URL contain one or more URL-encoded URLs separated by commas.`}).option(`hosts`,{type:`string`,description:`Includes connections that match one or more URL-encoded hostnames separated by commas.
3
+
4
+ Wildcards are supported at the start and end of each hostname to support starts with, ends with
5
+ and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
6
+
7
+ We additionally support a special value "all". When "all" is used, the API will return all the connections
8
+ with the applied filters in a single page. This feature is best-effort and it may only work for zones with
9
+ a low number of connections`}).option(`per-page`,{type:`number`,description:`The number of results per page.`}).option(`order-by`,{type:`string`,description:`The field used to sort returned connections.`,choices:[`first_seen_at`,`last_seen_at`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned connections.`,choices:[`asc`,`desc`]}).option(`prioritize-malicious`,{type:`boolean`,description:`When true, malicious connections appear first in the returned connections.`}).option(`exclude-cdn-cgi`,{type:`boolean`,description:"When true, excludes connections seen in a `/cdn-cgi` path from the returned connections. The default value is true."}).option(`status`,{type:`string`,description:"Filters the returned connections using a comma-separated list of connection statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default value is `active`."}).option(`page-url`,{type:`string`,description:`Includes connections that match one or more page URLs (separated by commas) where they were last seen
10
+
11
+ Wildcards are supported at the start and end of each page URL to support starts with, ends with
12
+ and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of connections as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists outbound connections made by webpages in the zone.`,builder:f(h),handler:async o=>a({command:`client-side-security connections list`,classification:{safeFlags:[`order-by`,`direction`,`prioritize-malicious`,`exclude-cdn-cgi`,`export`,`dry-run`]}},o,async()=>{let a={exclude_urls:o[`exclude-urls`],urls:o.urls,hosts:o.hosts,page:o.page,per_page:o[`per-page`],order_by:o[`order-by`],direction:o.direction,prioritize_malicious:o[`prioritize-malicious`],exclude_cdn_cgi:o[`exclude-cdn-cgi`],status:o.status,page_url:o[`page-url`],export:o.export};if(o.dryRun){r({command:`cf client-side-security connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/connections`,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.clientSideSecurity.connections.list({zone_id:c,...a})),{successLabel:`Loaded`})})},_={command:`connections`,describe:`Third-party connections made by scripts on your pages — track data exfiltration risks`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`cookie-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <cookie-id>`,describe:`Returns a cookie detected on the zone by cookie ID.`,builder:v,handler:async o=>a({command:`client-side-security cookies get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security cookies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/cookies/${o[`cookie-id`]==null?`<cookie-id>`:encodeURIComponent(String(o[`cookie-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"cookie-id":String(o[`cookie-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.clientSideSecurity.cookies.get({zone_id:s,cookie_id:o[`cookie-id`]})),{successLabel:`Loaded`})})};function b(e){return e.option(`hosts`,{type:`string`,description:`Includes cookies that match one or more URL-encoded hostnames separated by commas.
13
+
14
+ Wildcards are supported at the start and end of each hostname to support starts with, ends with
15
+ and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
16
+
17
+ We additionally support a special value "all". When "all" is used, the API will return all the cookies
18
+ with the applied filters in a single page. This feature is best-effort and it may only work for zones with
19
+ a low number of cookies`}).option(`per-page`,{type:`number`,description:`The number of results per page.`}).option(`order-by`,{type:`string`,description:`The field used to sort returned cookies.`,choices:[`first_seen_at`,`last_seen_at`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned cookies.'`,choices:[`asc`,`desc`]}).option(`page-url`,{type:`string`,description:`Includes connections that match one or more page URLs (separated by commas) where they were last seen
20
+
21
+ Wildcards are supported at the start and end of each page URL to support starts with, ends with
22
+ and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of cookies as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`name`,{type:`string`,description:`Filters the returned cookies that match the specified name.
23
+ Wildcards are supported at the start and end to support starts with, ends with
24
+ and contains. e.g. session*`}).option(`secure`,{type:`boolean`,description:`Filters the returned cookies that are set with Secure`}).option(`http-only`,{type:`boolean`,description:`Filters the returned cookies that are set with HttpOnly`}).option(`same-site`,{type:`string`,description:`Filters the returned cookies that match the specified same_site attribute`,choices:[`lax`,`strict`,`none`]}).option(`type`,{type:`string`,description:`Filters the returned cookies that match the specified type attribute`,choices:[`first_party`,`unknown`]}).option(`path`,{type:`string`,description:`Filters the returned cookies that match the specified path attribute`}).option(`domain`,{type:`string`,description:`Filters the returned cookies that match the specified domain attribute`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists cookies detected on the zone.`,builder:f(b),handler:async o=>a({command:`client-side-security cookies list`,classification:{safeFlags:[`order-by`,`direction`,`export`,`secure`,`http-only`,`same-site`,`type`,`dry-run`]}},o,async()=>{let a={hosts:o.hosts,page:o.page,per_page:o[`per-page`],order_by:o[`order-by`],direction:o.direction,page_url:o[`page-url`],export:o.export,name:o.name,secure:o.secure,http_only:o[`http-only`],same_site:o[`same-site`],type:o.type,path:o.path,domain:o.domain};if(o.dryRun){r({command:`cf client-side-security cookies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/cookies`,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.clientSideSecurity.cookies.list({zone_id:c,...a})),{successLabel:`Loaded`})})},S={command:`cookies`,describe:`Cookies set by your pages with classification and same-site attribute tracking`,builder:e=>e.command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`action`,{type:`string`,description:`The action to take if the expression matches`,choices:[`allow`,`log`,`add_reporting_directives`]}).option(`description`,{type:`string`,description:`A description for the policy`}).option(`enabled`,{type:`boolean`,description:`Whether the policy is enabled`}).option(`expression`,{type:`string`,description:`The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax`}).option(`value`,{type:`string`,description:`The policy which will be applied`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Creates a rule that applies a client-side security action when its filter expression matches.`,builder:C,handler:async d=>a({command:`client-side-security policies create`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},d,async()=>{if(d.dryRun){r({command:`cf client-side-security policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${d.zone??d.zoneId??`<zone>`}/page_shield/policies`,pathParams:{"zone-id":String(d.zone??d[`zone-id`]??``)},bodyKind:`json`,body:d.body===void 0?s({action:c(d.action,`action`,`text`),description:c(d.description,`description`,`text`),enabled:d.enabled,expression:c(d.expression,`expression`,`text`),value:c(d.value,`value`,`text`)}):o(d.body)});return}let a=await t(d),f=await e({zone:d.zone},a,{quiet:d.quiet});if(d.zoneId=f,d.body){let e=o(d.body);n(await i(`Creating`,async()=>a.clientSideSecurity.policies.create({...e,zone_id:f})),{successLabel:`Created`});return}if(d.action===void 0&&(d.action=await u(`action`,`The action to take if the expression matches`,[`allow`,`log`,`add_reporting_directives`])),d.description===void 0&&(d.description=await l(`description`,`A description for the policy`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d.expression===void 0&&(d.expression=await l(`expression`,`The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax`)),d.value===void 0&&(d.value=await l(`value`,`The policy which will be applied`));let p=s({action:c(d.action,`action`,`text`),description:c(d.description,`description`,`text`),enabled:d.enabled,expression:c(d.expression,`expression`,`text`),value:c(d.value,`value`,`text`)});n(await i(`Creating`,async()=>a.clientSideSecurity.policies.create({...p,zone_id:f})),{successLabel:`Created`})})};function T(e){return e.positional(`policy-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 E={command:`delete <policy-id>`,describe:`Permanently deletes a content security rule by ID.`,builder:T,handler:async o=>a({command:`client-side-security policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/policies/${o[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(o[`policy-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"policy-id":String(o[`policy-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await d({force:!!o.force,message:`This operation permanently deletes the content security rule from the zone.`})){process.stderr.write(`Aborted.
25
+ `);return}n(await i(`Deleting`,async()=>a.clientSideSecurity.policies.delete({zone_id:s,policy_id:o[`policy-id`]})),{successLabel:`Deleted`})})};function D(e){return e.positional(`policy-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <policy-id>`,describe:`Returns a content security rule by ID.`,builder:D,handler:async o=>a({command:`client-side-security policies get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/policies/${o[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(o[`policy-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"policy-id":String(o[`policy-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.clientSideSecurity.policies.get({zone_id:s,policy_id:o[`policy-id`]})),{successLabel:`Loaded`})})};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists content security rules configured for the zone.`,builder:k,handler:async o=>a({command:`client-side-security policies list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/policies`,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.clientSideSecurity.policies.list({zone_id:s})),{successLabel:`Loaded`})})};function j(e){return e.positional(`policy-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`action`,{type:`string`,description:`The action to take if the expression matches`,choices:[`allow`,`log`,`add_reporting_directives`]}).option(`description`,{type:`string`,description:`A description for the policy`}).option(`enabled`,{type:`boolean`,description:`Whether the policy is enabled`}).option(`expression`,{type:`string`,description:`The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax`}).option(`value`,{type:`string`,description:`The policy which will be applied`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update <policy-id>`,describe:`Updates the description, action, expression, enabled state, and policy value for a content security rule.`,builder:j,handler:async l=>a({command:`client-side-security policies update`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf client-side-security policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/page_shield/policies/${l[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(l[`policy-id`]))}`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``),"policy-id":String(l[`policy-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({action:c(l.action,`action`,`text`),description:c(l.description,`description`,`text`),enabled:l.enabled,expression:c(l.expression,`expression`,`text`),value:c(l.value,`value`,`text`)}):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(`Updating`,async()=>a.clientSideSecurity.policies.update({...e,zone_id:u,policy_id:l[`policy-id`]})),{successLabel:`Updated`});return}let d=s({action:c(l.action,`action`,`text`),description:c(l.description,`description`,`text`),enabled:l.enabled,expression:c(l.expression,`expression`,`text`),value:c(l.value,`value`,`text`)});n(await i(`Updating`,async()=>a.clientSideSecurity.policies.update({...d,zone_id:u,policy_id:l[`policy-id`]})),{successLabel:`Updated`})})},N={command:`policies`,describe:`Content Security Policies that control which scripts and connections are allowed on your pages`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`script-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <script-id>`,describe:`Returns a script detected on the zone by script ID.`,builder:P,handler:async o=>a({command:`client-side-security scripts get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security scripts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/scripts/${o[`script-id`]==null?`<script-id>`:encodeURIComponent(String(o[`script-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"script-id":String(o[`script-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.clientSideSecurity.scripts.get({zone_id:s,script_id:o[`script-id`]})),{successLabel:`Loaded`})})};function I(e){return e.option(`exclude-urls`,{type:`string`,description:`Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas.`}).option(`urls`,{type:`string`,description:`Includes scripts whose URL contain one or more URL-encoded URLs separated by commas.`}).option(`hosts`,{type:`string`,description:`Includes scripts that match one or more URL-encoded hostnames separated by commas.
26
+
27
+ Wildcards are supported at the start and end of each hostname to support starts with, ends with
28
+ and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
29
+
30
+ We additionally support a special value "all". When "all" is used, the API will return all the scripts
31
+ with the applied filters in a single page. This feature is best-effort and it may only work for zones with
32
+ a low number of scripts`}).option(`per-page`,{type:`number`,description:`The number of results per page.`}).option(`order-by`,{type:`string`,description:`The field used to sort returned scripts.`,choices:[`first_seen_at`,`last_seen_at`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned scripts.`,choices:[`asc`,`desc`]}).option(`prioritize-malicious`,{type:`boolean`,description:`When true, malicious scripts appear first in the returned scripts.`}).option(`exclude-cdn-cgi`,{type:`boolean`,description:"When true, excludes scripts seen in a `/cdn-cgi` path from the returned scripts. The default value is true."}).option(`exclude-duplicates`,{type:`boolean`,description:`When true, excludes duplicate scripts. We consider a script duplicate of another if their javascript
33
+ content matches and they share the same url host and zone hostname. In such case, we return the most
34
+ recent script for the URL host and zone hostname combination.`}).option(`status`,{type:`string`,description:"Filters the returned scripts using a comma-separated list of scripts statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default value is `active`."}).option(`page-url`,{type:`string`,description:`Includes scripts that match one or more page URLs (separated by commas) where they were last seen
35
+
36
+ Wildcards are supported at the start and end of each page URL to support starts with, ends with
37
+ and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of scripts as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists scripts detected on webpages in the zone, with filtering and pagination.`,builder:f(I),handler:async o=>a({command:`client-side-security scripts list`,classification:{safeFlags:[`order-by`,`direction`,`prioritize-malicious`,`exclude-cdn-cgi`,`exclude-duplicates`,`export`,`dry-run`]}},o,async()=>{let a={exclude_urls:o[`exclude-urls`],urls:o.urls,hosts:o.hosts,page:o.page,per_page:o[`per-page`],order_by:o[`order-by`],direction:o.direction,prioritize_malicious:o[`prioritize-malicious`],exclude_cdn_cgi:o[`exclude-cdn-cgi`],exclude_duplicates:o[`exclude-duplicates`],status:o.status,page_url:o[`page-url`],export:o.export};if(o.dryRun){r({command:`cf client-side-security scripts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield/scripts`,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.clientSideSecurity.scripts.list({zone_id:c,...a})),{successLabel:`Loaded`})})},R={command:`scripts`,describe:`JavaScript files detected on your pages with change tracking and malicious code detection`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Returns the client-side security product enablement status and reporting behaviors.`,builder:z,handler:async o=>a({command:`client-side-security settings get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-side-security settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/page_shield`,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.clientSideSecurity.settings.get({zone_id:s})),{successLabel:`Loaded`})})};function V(e){return e.option(`enabled`,{type:`boolean`,description:`When true, indicates that Client-Side Security is enabled.`}).option(`use-cloudflare-reporting-endpoint`,{type:`boolean`,description:`When true, CSP reports will be sent to https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report`}).option(`use-connection-url-path`,{type:`boolean`,description:`When true, the paths associated with connections URLs will also be analyzed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`update`,describe:`Updates client-side security enablement and reporting behaviors for the zone.`,builder:V,handler:async c=>a({command:`client-side-security settings update`,classification:{safeFlags:[`enabled`,`use-cloudflare-reporting-endpoint`,`use-connection-url-path`,`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf client-side-security settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/page_shield`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({enabled:c.enabled,use_cloudflare_reporting_endpoint:c[`use-cloudflare-reporting-endpoint`],use_connection_url_path:c[`use-connection-url-path`]}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Updating`,async()=>a.clientSideSecurity.settings.update({...e,zone_id:l})),{successLabel:`Updated`});return}let u=s({enabled:c.enabled,use_cloudflare_reporting_endpoint:c[`use-cloudflare-reporting-endpoint`],use_connection_url_path:c[`use-connection-url-path`]});n(await i(`Updating`,async()=>a.clientSideSecurity.settings.update({...u,zone_id:l})),{successLabel:`Updated`})})},U={command:`settings`,describe:`Fine tune Client-Side Security behaviors`,builder:e=>e.command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`client-side-security`,describe:`Client-Side Security — monitor JavaScript, connections, and cookies on your pages for supply-chain attacks`,builder:e=>e.command(_).command(S).command(N).command(R).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
@@ -0,0 +1,2 @@
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}from"./body-parser-DIlfApuJ.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.`,builder:s,handler:async o=>a({command:`cloud-connector rules list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf cloud-connector rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/cloud_connector/rules`,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.cloudConnector.rules.list({zone_id:s})),{successLabel:`Loaded`})})};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`update`,describe:`Updates Cloud Connector rules for a zone, replacing the existing rule configuration.`,builder:l,handler:async s=>a({command:`cloud-connector rules update`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf cloud-connector rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.cloudConnector.rules.update({body:e,zone_id:c})),{successLabel:`Updated`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},d={command:`rules`,describe:`Routing rules that map request patterns to cloud provider endpoints`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`cloud-connector`,describe:`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};