cf 1.0.0-beta.13 → 1.0.0-beta.15

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 (443) hide show
  1. package/README.md +10 -0
  2. package/dist/_meta/commands.json +5039 -2465
  3. package/dist/_meta/hand-written-commands.json +375 -22
  4. package/dist/_meta/schemas.json +2607 -1038
  5. package/dist/abuse-reports-CnQBtN1G.mjs +24 -0
  6. package/dist/access-BzmXSwzj.mjs +2 -0
  7. package/dist/account-tags-2qPWbW17.mjs +15 -0
  8. package/dist/accounts-B0Byg-AV.mjs +132 -0
  9. package/dist/acm-DgAu0cnk.mjs +15 -0
  10. package/dist/addressing-J1oa0ML2.mjs +105 -0
  11. package/dist/agent-memory-4KGou-tm.mjs +34 -0
  12. package/dist/ai-WY7wVQfA.mjs +31 -0
  13. package/dist/ai-audit-D38HaEoZ.mjs +6 -0
  14. package/dist/ai-gateway-C0gIipT8.mjs +80 -0
  15. package/dist/ai-search-ClwnPU-9.mjs +79 -0
  16. package/dist/ai-security-BIsvFPYV.mjs +10 -0
  17. package/dist/alerting-MHhv28oO.mjs +56 -0
  18. package/dist/analytics-BfBz7bqB.mjs +17 -0
  19. package/dist/analytics_engine-CXVdBF1n.mjs +4 -0
  20. package/dist/api-eMuS5GI1.mjs +3 -0
  21. package/dist/api-security-DUCfcdC1.mjs +154 -0
  22. package/dist/argo-CUlzI4v3.mjs +14 -0
  23. package/dist/artifacts-BLfWGzBg.mjs +43 -0
  24. package/dist/audit-logs-CsfIm2QS.mjs +4 -0
  25. package/dist/auth-8Sm4uLGM.mjs +2 -0
  26. package/dist/auth-C6u9qIGO.mjs +2 -0
  27. package/dist/auth-CGRemu5W.mjs +2 -0
  28. package/dist/{auth-token-pNQrX_9O.mjs → auth-token-DkkYg4DP.mjs} +1 -1
  29. package/dist/{autoconfig-sD7Frryg.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
  30. package/dist/basin-catalog-CrKRYJ0b.mjs +46 -0
  31. package/dist/billing-NxehgXrR.mjs +23 -0
  32. package/dist/blocks-Bat9A8V_.mjs +5 -0
  33. package/dist/bot-management-C993iQKL.mjs +9 -0
  34. package/dist/botnet-feed-CZ4vYk5y.mjs +11 -0
  35. package/dist/brand-protection-ADVgIi0l.mjs +27 -0
  36. package/dist/browser-run-CEptKZYl.mjs +42 -0
  37. package/dist/build-Bm6kGyzo.mjs +2 -0
  38. package/dist/{build-HmSXqjGn.mjs → build-sBpqm9ga.mjs} +1 -1
  39. package/dist/builds-DqtiTH7p.mjs +71 -0
  40. package/dist/cache-hX5QxmI0.mjs +45 -0
  41. package/dist/certificate-authorities-BOcybjc1.mjs +6 -0
  42. package/dist/cf-Bq4pA4n6.mjs +18 -0
  43. package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
  44. package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
  45. package/dist/{chunk-DSGVRFIS-C1_SEtRK.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
  46. package/dist/{cli-DeJc9U8z.mjs → cli-R8h3OKZI.mjs} +1 -1
  47. package/dist/client-certificates-Bez_ArKE.mjs +13 -0
  48. package/dist/client-side-security-CSmA50Bv.mjs +63 -0
  49. package/dist/cloud-connector-0Wivqi7S.mjs +6 -0
  50. package/dist/{cloudflared--1Ws1RJy.mjs → cloudflared-By8BzYXc.mjs} +1 -1
  51. package/dist/cloudforce-one-J-rU6k1U.mjs +405 -0
  52. package/dist/{command-Dh7RmjFu.mjs → command-0BOb1pgV.mjs} +1 -1
  53. package/dist/{command-DUhX8Dcr.mjs → command-BCJN-ZM2.mjs} +1 -1
  54. package/dist/{command-BvfKhMl7.mjs → command-BG-kLOnS.mjs} +1 -1
  55. package/dist/{command-Cu7dcaHT.mjs → command-BIsI-mMX.mjs} +1 -1
  56. package/dist/{command-83uVfXh9.mjs → command-BKDbbA-L.mjs} +1 -1
  57. package/dist/command-BWQIKu6I.mjs +2 -0
  58. package/dist/{command-D3fyhdy-.mjs → command-Bdy69UFU.mjs} +1 -1
  59. package/dist/{command-BDe67N_n.mjs → command-Bgb-3yPg.mjs} +1 -1
  60. package/dist/{command-_rqD0hXF.mjs → command-C6w1OdoC.mjs} +1 -1
  61. package/dist/{command-oNVwyjGB.mjs → command-CKW6UhTh.mjs} +1 -1
  62. package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
  63. package/dist/{command-CcuLC6CJ.mjs → command-DIs-Nqtl.mjs} +1 -1
  64. package/dist/command-DPn5ANHs.mjs +2 -0
  65. package/dist/{command-CG6RvZs0.mjs → command-DZfKHiru.mjs} +1 -1
  66. package/dist/{command-BlIb6RR2.mjs → command-DppVezAB.mjs} +1 -1
  67. package/dist/{completions-D06AO7A8.mjs → completions-CpNGTlUX.mjs} +1 -1
  68. package/dist/config.mjs +0 -0
  69. package/dist/connector-interrupts-CH-DaLuo.mjs +6 -0
  70. package/dist/connector-telemetry-events-X3Fod9nl.mjs +6 -0
  71. package/dist/connector-telemetry-snapshots-D-WR4npQ.mjs +6 -0
  72. package/dist/connectors-CORKD31m.mjs +15 -0
  73. package/dist/containers-BboUbx3k.mjs +78 -0
  74. package/dist/containers-Di3_Vopq.mjs +376 -0
  75. package/dist/content-scan-DXGREAXa.mjs +14 -0
  76. package/dist/{context-q7UaYK69.mjs → context-A6T-NKPI.mjs} +2 -2
  77. package/dist/cps-1BoOLtTq.mjs +6 -0
  78. package/dist/create-OXylMu6m.mjs +2 -0
  79. package/dist/csamScanner-CHfbfeup.mjs +10 -0
  80. package/dist/ct-alerting-DlH4ILQo.mjs +5 -0
  81. package/dist/custom-certificates-zJqJZ2Th.mjs +17 -0
  82. package/dist/custom-csrs-DoLIGqYL.mjs +11 -0
  83. package/dist/custom-hostnames-YfV-aoAK.mjs +27 -0
  84. package/dist/custom-nameservers-BV43gmgt.mjs +9 -0
  85. package/dist/custom-pages-CoOU1Cdx.mjs +21 -0
  86. package/dist/d1-DujBmzLa.mjs +94 -0
  87. package/dist/dcv-delegation-CPLsVYOl.mjs +4 -0
  88. package/dist/delegate.mjs +0 -0
  89. package/dist/deploy-context-tEhwEXnA.mjs +56 -0
  90. package/dist/{deploy-input-Cc0_2QlW.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
  91. package/dist/{deploy-CWNm1-5v.mjs → deploy-wNujfGUJ.mjs} +1 -1
  92. package/dist/{dev-ZA8itQE7.mjs → dev-EtnMYA7K.mjs} +1 -1
  93. package/dist/diagnostics-B3TYPVRi.mjs +15 -0
  94. package/dist/dist-DZRTPMMA.mjs +449 -0
  95. package/dist/dls-CWm1HRF0.mjs +17 -0
  96. package/dist/dns-CjAFU7Z9.mjs +144 -0
  97. package/dist/dns-firewall-BooBP9ap.mjs +71 -0
  98. package/dist/docs-C5XB7HdG.mjs +3 -0
  99. package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
  100. package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
  101. package/dist/durable-objects-CSrMQDCE.mjs +6 -0
  102. package/dist/email-auth-Bp1Mui-n.mjs +6 -0
  103. package/dist/email-routing-CVF6SwQt.mjs +45 -0
  104. package/dist/email-security-mYZtazae.mjs +158 -0
  105. package/dist/email-sending-BqaKU_Xu.mjs +47 -0
  106. package/dist/error-sanitization-CIQOep3I.mjs +2 -0
  107. package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
  108. package/dist/fieldExtractors-CAGZVmYg.mjs +9 -0
  109. package/dist/firewall-DgTDsYOt.mjs +36 -0
  110. package/dist/flagship-Db3PxxyZ.mjs +28 -0
  111. package/dist/fraud-BEOQczy8.mjs +22 -0
  112. package/dist/get-By1q8YlI.mjs +2 -0
  113. package/dist/get-CRKvqCu6.mjs +2 -0
  114. package/dist/get-iPUHxD1r.mjs +2 -0
  115. package/dist/google-tag-gateway-DjLQ9wo0.mjs +6 -0
  116. package/dist/hand-written-dry-run-B82fRl2N.mjs +2 -0
  117. package/dist/healthchecks-C3ScnKss.mjs +22 -0
  118. package/dist/{hostnames-sF999-6H.mjs → hostnames-DU0k-xO9.mjs} +6 -6
  119. package/dist/hyperdrive-IpCCLCRd.mjs +37 -0
  120. package/dist/iam-96CYM8Vw.mjs +52 -0
  121. package/dist/images-AB9EgZgT.mjs +71 -0
  122. package/dist/index.mjs +1 -1
  123. package/dist/{init-1w_mcgk3.mjs → init-D2nPoW4f.mjs} +2 -2
  124. package/dist/intel-BKb4RLvS.mjs +76 -0
  125. package/dist/ips-z9APCV_b.mjs +4 -0
  126. package/dist/k2-Bv-HiJ29.mjs +11 -0
  127. package/dist/keyless-certificates-ChgSGHq4.mjs +13 -0
  128. package/dist/keys-BhngDsDa.mjs +4 -0
  129. package/dist/kv-CB5MQVGP.mjs +15 -0
  130. package/dist/{lazy-command-BDiIwpss.mjs → lazy-command-CaZ1kdlW.mjs} +1 -1
  131. package/dist/leaked-credential-checks-Bsi2WpSU.mjs +18 -0
  132. package/dist/load-balancers-0gXZNCeI.mjs +76 -0
  133. package/dist/{local-DlT72Xpn.mjs → local-Dil4fTWX.mjs} +1 -1
  134. package/dist/local-DxWDQDnG.mjs +2 -0
  135. package/dist/{local-runtime-CokO6qaX.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
  136. package/dist/login-CiQGR8ha.mjs +5 -0
  137. package/dist/login-Ik98G4K6.mjs +2 -0
  138. package/dist/logo-matches-DmoF5Otu.mjs +6 -0
  139. package/dist/logos-BL6ohIMH.mjs +7 -0
  140. package/dist/logpush-UVopW68t.mjs +46 -0
  141. package/dist/logs-BVfxiEiM.mjs +36 -0
  142. package/dist/magic-cloud-networking-B5S3aM6f.mjs +71 -0
  143. package/dist/magic-network-monitoring-CDSJPP47.mjs +36 -0
  144. package/dist/magic-transit-TcDTKM43.mjs +386 -0
  145. package/dist/managed-defense-C88HL0pg.mjs +18 -0
  146. package/dist/managed-transforms-Ja41Tahl.mjs +9 -0
  147. package/dist/matches-BL_Y-9Yq.mjs +6 -0
  148. package/dist/mcp-BWp5Q09R.mjs +32 -0
  149. package/dist/mesh-lFPLRWhV.mjs +26 -0
  150. package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
  151. package/dist/monetization-BIc4Bwo2.mjs +20 -0
  152. package/dist/mtls-certificates-CVBw-Jli.mjs +13 -0
  153. package/dist/network-Wig0qbaC.mjs +50 -0
  154. package/dist/network-interconnects-C16z1HuQ.mjs +72 -0
  155. package/dist/o11y-Bhy4qDRm.mjs +93 -0
  156. package/dist/oauth-CfEedDZi.mjs +4 -0
  157. package/dist/oauth-clients-eXjmK5yf.mjs +16 -0
  158. package/dist/{oauth-mspHHU5U.mjs → oauth-oWaW7ICv.mjs} +1 -1
  159. package/dist/oauth-scopes-DZWn50EA.mjs +4 -0
  160. package/dist/organization-QdAQTrKa.mjs +71 -0
  161. package/dist/organizations-CgAQYdK5.mjs +4 -0
  162. package/dist/origin-ca-certificates-BklXqp8X.mjs +11 -0
  163. package/dist/origin-post-quantum-encryption-Dg16ueT4.mjs +6 -0
  164. package/dist/origin-tls-client-auth-d8bDU5zU.mjs +30 -0
  165. package/dist/output-Co4xdFf6.mjs +2 -0
  166. package/dist/page-rules-CgMkC6YR.mjs +39 -0
  167. package/dist/pages-CkBtOOf8.mjs +54 -0
  168. package/dist/path-DRw6Y-nd.mjs +2 -0
  169. package/dist/pay-per-crawl-CnGXOWyz.mjs +38 -0
  170. package/dist/pay-per-use-HbfxpATr.mjs +33 -0
  171. package/dist/pipelines-CnO9CCs0.mjs +44 -0
  172. package/dist/precursor-Bc55XJdQ.mjs +4 -0
  173. package/dist/previews-C7vZrajd.mjs +7 -0
  174. package/dist/progress-D5po7ScB.mjs +2 -0
  175. package/dist/prompt-BAJpE3jV.mjs +4 -0
  176. package/dist/queries-BJAH4B74.mjs +9 -0
  177. package/dist/queues-D4G8vvwi.mjs +57 -0
  178. package/dist/r2-CJ8rD6Jb.mjs +128 -0
  179. package/dist/{radar-DrQLcbkq.mjs → radar-DgaxOdcd.mjs} +150 -150
  180. package/dist/raw-fetch-yY-wX5Xx.mjs +2 -0
  181. package/dist/realtime-DU09m7L7.mjs +172 -0
  182. package/dist/registrar-Cj7OfvGs.mjs +43 -0
  183. package/dist/registrar-sandbox-CA0Mua-j.mjs +56 -0
  184. package/dist/{registry-CHowrQsZ.mjs → registry-CRnk93ur.mjs} +1 -1
  185. package/dist/reporting-3kDVF5c8.mjs +14 -0
  186. package/dist/{request-headers-DiJeDAn1.mjs → request-headers-D_eQn93b.mjs} +1 -1
  187. package/dist/request-tracers-VBD4R3s3.mjs +4 -0
  188. package/dist/resolve-BpgXeklt.mjs +2 -0
  189. package/dist/resolve-C3FmNlSO.mjs +2 -0
  190. package/dist/resource-sharing-BtUF3psS.mjs +40 -0
  191. package/dist/resource-tagging--90INP8_.mjs +4 -0
  192. package/dist/rules-CcwPngVo.mjs +18 -0
  193. package/dist/rulesets-CfdruY82.mjs +37 -0
  194. package/dist/rum-RLkdfSL7.mjs +30 -0
  195. package/dist/run-CUNhH5CQ.mjs +2 -0
  196. package/dist/{run-BvHwWWUX.mjs → run-DASYqJsY.mjs} +1 -1
  197. package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
  198. package/dist/{schema-flags-BzoBGPWk.mjs → schema-flags-CShtn7ya.mjs} +1 -1
  199. package/dist/scim-BZYsTPIL.mjs +18 -0
  200. package/dist/secrets-store-C_-FkSH_.mjs +24 -0
  201. package/dist/security-insights-BVBEaZmD.mjs +40 -0
  202. package/dist/security-txt--IoHrHee.mjs +9 -0
  203. package/dist/session-Cq3YNLoI.mjs +2 -0
  204. package/dist/shared-zNQNv1im.mjs +2 -0
  205. package/dist/smart-shield-CByC4_60.mjs +24 -0
  206. package/dist/snippets-DB-jiZAV.mjs +20 -0
  207. package/dist/{spawn-IysxuTNW.mjs → spawn-DQttFH05.mjs} +1 -1
  208. package/dist/spectrum-Bs2g1BmK.mjs +83 -0
  209. package/dist/speed-Bq4evEnJ.mjs +24 -0
  210. package/dist/sql-XGci7hZC.mjs +4 -0
  211. package/dist/src-GiuwAT55.mjs +125 -0
  212. package/dist/ssl-KJTLW1NR.mjs +45 -0
  213. package/dist/{startup-profile-CdJWgNjd.mjs → startup-profile-BOaseXnO.mjs} +1 -1
  214. package/dist/startup-profile-BwEZFVGS.mjs +2 -0
  215. package/dist/{state-BDSvdSdP.mjs → state-Boubf1X6.mjs} +1 -1
  216. package/dist/state-CODDG9Nx.mjs +2 -0
  217. package/dist/stream-BotgYspF.mjs +102 -0
  218. package/dist/submit-C5VytaHP.mjs +4 -0
  219. package/dist/{tags-CA1xMM96.mjs → tags-3Hq-B9qp.mjs} +2 -2
  220. package/dist/{telemetry-Cm39QJ-M.mjs → telemetry-3FJOXl_C.mjs} +1 -1
  221. package/dist/telemetry-BhKfwxyh.mjs +2 -0
  222. package/dist/tenant-BgX5onPc.mjs +10 -0
  223. package/dist/tenant-custom-nameservers-BVG8v1Xo.mjs +9 -0
  224. package/dist/theme-BGHWSKCw.mjs +6 -0
  225. package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
  226. package/dist/tunnels-CThOI3qH.mjs +29 -0
  227. package/dist/turnstile-BgZaUx-g.mjs +33 -0
  228. package/dist/ui-BtIBQeaG.mjs +2 -0
  229. package/dist/update-check-Yy7Ivq2V.mjs +2 -0
  230. package/dist/{update-check-CMXSdres.mjs → update-check-jb89ih_g.mjs} +1 -1
  231. package/dist/update-check-worker.mjs +1 -1
  232. package/dist/url-info-DQERN0Xq.mjs +4 -0
  233. package/dist/url-normalization-Cb1hofqv.mjs +9 -0
  234. package/dist/url-scanner-gHgx1bW7.mjs +16 -0
  235. package/dist/user-CdKzIuSi.mjs +112 -0
  236. package/dist/values-EwA8Sx0w.mjs +4 -0
  237. package/dist/vectorize-DejgIJIv.mjs +32 -0
  238. package/dist/version-B6MnUIqV.mjs +2 -0
  239. package/dist/waiting-rooms-BNR1HvAP.mjs +53 -0
  240. package/dist/web-assets-iglnzkTV.mjs +64 -0
  241. package/dist/web3-JBUU6IVt.mjs +28 -0
  242. package/dist/workers-CDp4kLTJ.mjs +40 -0
  243. package/dist/workers-builds-CSb9Dglt.mjs +14 -0
  244. package/dist/workers-for-platforms-D4srNZvt.mjs +40 -0
  245. package/dist/workers-vpc-LPC8TadH.mjs +13 -0
  246. package/dist/workflows-DN_VqWJC.mjs +52 -0
  247. package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
  248. package/dist/zaraz-DDErl5yc.mjs +22 -0
  249. package/dist/zero-trust-M88XX3uD.mjs +957 -0
  250. package/dist/zone-BsGvedmN.mjs +4 -0
  251. package/dist/zones-l_sRKrVl.mjs +124 -0
  252. package/package.json +17 -20
  253. package/dist/Page-BShsqCXr.mjs +0 -2
  254. package/dist/abuse-reports-BjU1s8cf.mjs +0 -24
  255. package/dist/access-C_G2MZnA.mjs +0 -2
  256. package/dist/account-tags-CaXDDeZ4.mjs +0 -15
  257. package/dist/accounts-BALwxDQY.mjs +0 -131
  258. package/dist/acm-CP9EaXQN.mjs +0 -15
  259. package/dist/addressing-DRlaxqrI.mjs +0 -93
  260. package/dist/agent-memory-vGhlfZBx.mjs +0 -34
  261. package/dist/ai-CJtbWfB9.mjs +0 -31
  262. package/dist/ai-audit-C0BJNqZZ.mjs +0 -6
  263. package/dist/ai-gateway-BQtv3U3x.mjs +0 -80
  264. package/dist/ai-search-DGU1Y5By.mjs +0 -79
  265. package/dist/ai-security-CFTaYk_X.mjs +0 -10
  266. package/dist/alerting-1hun27JC.mjs +0 -56
  267. package/dist/analytics-DXUSjvzT.mjs +0 -17
  268. package/dist/analytics_engine-CQsnL09C.mjs +0 -4
  269. package/dist/api-security-BXhrfR6-.mjs +0 -154
  270. package/dist/argo-LPUCTnee.mjs +0 -14
  271. package/dist/args-CfbYkeXd.mjs +0 -2
  272. package/dist/artifacts-Dt6easua.mjs +0 -43
  273. package/dist/audit-logs-CVznAM2Z.mjs +0 -4
  274. package/dist/auth-CGLsxbc6.mjs +0 -2
  275. package/dist/auth-CrmVwfpJ.mjs +0 -2
  276. package/dist/auth-eQr-kQCH.mjs +0 -2
  277. package/dist/banner-D03JEqRs.mjs +0 -2
  278. package/dist/basin-catalog-ZQICw-zF.mjs +0 -46
  279. package/dist/billing-Dy1-dV_B.mjs +0 -23
  280. package/dist/bot-management-DTgPwL7O.mjs +0 -9
  281. package/dist/botnet-feed-xb98Cj3Y.mjs +0 -11
  282. package/dist/brand-protection-Ck3okE2k.mjs +0 -27
  283. package/dist/browser-run-DJGJSzFX.mjs +0 -42
  284. package/dist/build-B1L6xrgC.mjs +0 -2
  285. package/dist/builds-CYxcZtkG.mjs +0 -71
  286. package/dist/cache-D9tSfovH.mjs +0 -45
  287. package/dist/certificate-authorities-CpiveTFC.mjs +0 -6
  288. package/dist/cf-BxsXrVeh.mjs +0 -18
  289. package/dist/chunk-NDZDTP46-Bjx_wtJe.mjs +0 -361
  290. package/dist/cli-types-9oYmRTHJ.mjs +0 -2
  291. package/dist/client-certificates-CF6YZyvP.mjs +0 -13
  292. package/dist/client-side-security-BLoe9kS5.mjs +0 -63
  293. package/dist/cloud-connector-DXRUHsjt.mjs +0 -6
  294. package/dist/cloudforce-one-CBLxXi6v.mjs +0 -447
  295. package/dist/command-DwXiDOeH.mjs +0 -2
  296. package/dist/command-UiHLJ8Ji.mjs +0 -2
  297. package/dist/connector-interrupts-DelTmNyw.mjs +0 -6
  298. package/dist/connector-telemetry-events-BwxR3G8d.mjs +0 -6
  299. package/dist/connector-telemetry-snapshots-Bqq-hrpJ.mjs +0 -6
  300. package/dist/connectors-D-m3rEpk.mjs +0 -15
  301. package/dist/containers-CVNfEjJs.mjs +0 -78
  302. package/dist/containers-DeoZyeQe.mjs +0 -375
  303. package/dist/content-scan-W0BNzbQp.mjs +0 -14
  304. package/dist/cps-BZ6hqRb5.mjs +0 -6
  305. package/dist/csamScanner-Bo1t3CLh.mjs +0 -10
  306. package/dist/ct-alerting-E03faC7p.mjs +0 -5
  307. package/dist/custom-certificates-CUySSPzi.mjs +0 -17
  308. package/dist/custom-csrs-gNpWkJPQ.mjs +0 -11
  309. package/dist/custom-hostnames-abGBAbx7.mjs +0 -27
  310. package/dist/custom-nameservers-BgNXol1P.mjs +0 -9
  311. package/dist/custom-pages-DMKX3aoD.mjs +0 -21
  312. package/dist/d1-CE08YqYk.mjs +0 -93
  313. package/dist/dcv-delegation-B5YUEWu0.mjs +0 -4
  314. package/dist/deploy-context-Dr6bxNcB.mjs +0 -56
  315. package/dist/diagnostics-UMbG6m4n.mjs +0 -15
  316. package/dist/dist-BHEmAAHr.mjs +0 -487
  317. package/dist/dls-DIl16mLp.mjs +0 -17
  318. package/dist/dns-QUpgljRG.mjs +0 -144
  319. package/dist/dns-firewall-BZwJXHLj.mjs +0 -71
  320. package/dist/durable-objects-BCj4ykpU.mjs +0 -6
  321. package/dist/email-auth-DlHIYhCk.mjs +0 -6
  322. package/dist/email-routing-UKVS4DYy.mjs +0 -45
  323. package/dist/email-security-CZjfRIg0.mjs +0 -158
  324. package/dist/email-sending-Dquc880C.mjs +0 -47
  325. package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
  326. package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
  327. package/dist/errors-_sob7Ihu.mjs +0 -3
  328. package/dist/fieldExtractors-BbwDRquU.mjs +0 -9
  329. package/dist/firewall--mTfDnCJ.mjs +0 -36
  330. package/dist/flagship-cfoSwwM9.mjs +0 -28
  331. package/dist/fraud-Dcsq3EYK.mjs +0 -22
  332. package/dist/google-tag-gateway-DPKSkZQi.mjs +0 -6
  333. package/dist/healthchecks-D78hIIBC.mjs +0 -22
  334. package/dist/hyperdrive-qWACKfA4.mjs +0 -37
  335. package/dist/iam-Bvg_PayW.mjs +0 -52
  336. package/dist/images-DI_lEZ4L.mjs +0 -71
  337. package/dist/intel-BxElBUMP.mjs +0 -76
  338. package/dist/ips-DWoaKxi7.mjs +0 -4
  339. package/dist/k2-tFjaftl-.mjs +0 -11
  340. package/dist/keyless-certificates-BrvxHU4J.mjs +0 -13
  341. package/dist/keys-DcwTYKRf.mjs +0 -4
  342. package/dist/kv-htXS-7uP.mjs +0 -15
  343. package/dist/leaked-credential-checks-bvGrLOmQ.mjs +0 -18
  344. package/dist/load-balancers-BNTUt4yG.mjs +0 -76
  345. package/dist/local-DlDumOSC.mjs +0 -2
  346. package/dist/login-BGF_I_LT.mjs +0 -5
  347. package/dist/login-Ccw-mYwT.mjs +0 -2
  348. package/dist/logo-matches-tE8LTKgg.mjs +0 -6
  349. package/dist/logos-Bj845Mcw.mjs +0 -7
  350. package/dist/logpush-Cs8JdvKi.mjs +0 -46
  351. package/dist/logs-C92XZvNu.mjs +0 -36
  352. package/dist/magic-cloud-networking-hNp5MMw-.mjs +0 -71
  353. package/dist/magic-network-monitoring-68GuWAnv.mjs +0 -36
  354. package/dist/magic-transit-DNd7gu4j.mjs +0 -383
  355. package/dist/managed-defense-B_wCAuFD.mjs +0 -18
  356. package/dist/managed-transforms-DZdxHPOh.mjs +0 -9
  357. package/dist/matches-B65CkflD.mjs +0 -6
  358. package/dist/mcp-DrJW5ayK.mjs +0 -32
  359. package/dist/mesh-DfVzYTn1.mjs +0 -26
  360. package/dist/monetization-BGaI8CMO.mjs +0 -20
  361. package/dist/mtls-certificates-BsU2emDD.mjs +0 -13
  362. package/dist/network-BEMD8P0U.mjs +0 -50
  363. package/dist/network-interconnects-DMu_fcbo.mjs +0 -68
  364. package/dist/o11y-C1a4gDGF.mjs +0 -93
  365. package/dist/oauth-Bj5Ne1o8.mjs +0 -9
  366. package/dist/oauth-clients-p4Etdqy_.mjs +0 -16
  367. package/dist/oauth-scopes-B2IabFza.mjs +0 -4
  368. package/dist/organization-CdXt7AVZ.mjs +0 -75
  369. package/dist/organizations-5S6xEp7T.mjs +0 -4
  370. package/dist/origin-ca-certificates-_VJAoK1D.mjs +0 -11
  371. package/dist/origin-post-quantum-encryption-GcldDsT2.mjs +0 -6
  372. package/dist/origin-tls-client-auth-DZHld9fA.mjs +0 -30
  373. package/dist/output-BOe-3AQG.mjs +0 -2
  374. package/dist/page-rules-o1tAMMsD.mjs +0 -39
  375. package/dist/pages-CmiOhjSl.mjs +0 -54
  376. package/dist/pay-per-crawl-BsnOxGYU.mjs +0 -38
  377. package/dist/pay-per-use-BXWMCSyE.mjs +0 -33
  378. package/dist/pipelines-DWLQC0F6.mjs +0 -44
  379. package/dist/precursor-B6DjBib6.mjs +0 -4
  380. package/dist/previews-dUKEBGSM.mjs +0 -4
  381. package/dist/progress-BtkTVcHI.mjs +0 -2
  382. package/dist/prompt-RlgRrmbm.mjs +0 -3
  383. package/dist/queries-yLwoJRHV.mjs +0 -9
  384. package/dist/queues-CnJRaE1o.mjs +0 -57
  385. package/dist/r2-CuC6-zQX.mjs +0 -128
  386. package/dist/raw-fetch-B4NvWuZD.mjs +0 -2
  387. package/dist/realtime-CjsnzHxD.mjs +0 -172
  388. package/dist/registrar-BgOsxTnX.mjs +0 -43
  389. package/dist/registrar-sandbox-3ikBD9fB.mjs +0 -56
  390. package/dist/reporting-hE127s5r.mjs +0 -14
  391. package/dist/request-tracers-BCwLxmPN.mjs +0 -4
  392. package/dist/resolve-CaTBV-c6.mjs +0 -2
  393. package/dist/resolve-DCGSzUDQ.mjs +0 -2
  394. package/dist/resource-sharing-2qvWUuMa.mjs +0 -40
  395. package/dist/resource-tagging-Dwx7iL3v.mjs +0 -4
  396. package/dist/rules-DxVQ6jIg.mjs +0 -18
  397. package/dist/rulesets-Cdh8YjI9.mjs +0 -37
  398. package/dist/rum-a4CMq4Qu.mjs +0 -30
  399. package/dist/run-CkbrPJPx.mjs +0 -2
  400. package/dist/scim-B8XlXl8v.mjs +0 -18
  401. package/dist/secrets-store-Cqhedh_i.mjs +0 -24
  402. package/dist/security-insights-le2-DteL.mjs +0 -40
  403. package/dist/security-txt-cCArWXur.mjs +0 -9
  404. package/dist/session-C1BhT1ZJ.mjs +0 -2
  405. package/dist/shared-BPjcpXuA.mjs +0 -2
  406. package/dist/smart-shield-Csyh8hwB.mjs +0 -24
  407. package/dist/snippets-DUWx25q6.mjs +0 -20
  408. package/dist/spectrum-Da3UYSOR.mjs +0 -83
  409. package/dist/speed-NxlMnB2e.mjs +0 -24
  410. package/dist/sql-CNdHAlQ8.mjs +0 -4
  411. package/dist/src-JfLDUxFr.mjs +0 -125
  412. package/dist/ssl-BtaX2WEJ.mjs +0 -45
  413. package/dist/startup-profile-B2l0ChVu.mjs +0 -2
  414. package/dist/state-JB4_BU1o.mjs +0 -2
  415. package/dist/stream-C1Ijjzn4.mjs +0 -102
  416. package/dist/submit-MdkuU_Pt.mjs +0 -4
  417. package/dist/telemetry-BsYO3nxG.mjs +0 -2
  418. package/dist/tenant-BB6Oszcl.mjs +0 -10
  419. package/dist/tenant-custom-nameservers-BsbgYAEo.mjs +0 -9
  420. package/dist/theme-CQ_TYifs.mjs +0 -6
  421. package/dist/tunnels-CRFtyHWz.mjs +0 -29
  422. package/dist/turnstile-DBXWo_Xe.mjs +0 -33
  423. package/dist/ui-YmjF66Ct.mjs +0 -5
  424. package/dist/update-check-C2oVEbXx.mjs +0 -2
  425. package/dist/url-info-t-XAs0Mk.mjs +0 -4
  426. package/dist/url-normalization-Cs4F8e0a.mjs +0 -9
  427. package/dist/url-scanner-CBIoDbTx.mjs +0 -16
  428. package/dist/user-CevdOMoa.mjs +0 -112
  429. package/dist/values-CjNlkbIh.mjs +0 -4
  430. package/dist/vectorize-9d9tPmg5.mjs +0 -32
  431. package/dist/version-BdVUXLnK.mjs +0 -2
  432. package/dist/waiting-rooms--5WmrWb3.mjs +0 -53
  433. package/dist/web-assets-BHot_MU8.mjs +0 -64
  434. package/dist/web3-CYfWAF6b.mjs +0 -28
  435. package/dist/workers-S17M0n3h.mjs +0 -40
  436. package/dist/workers-builds-Dw7ho3So.mjs +0 -14
  437. package/dist/workers-for-platforms-A3yjyLh3.mjs +0 -40
  438. package/dist/workers-vpc-BZ2xXtC3.mjs +0 -13
  439. package/dist/workflows-BgGrVpSR.mjs +0 -43
  440. package/dist/zaraz-BsD2dMI3.mjs +0 -22
  441. package/dist/zero-trust-CA3iGQbG.mjs +0 -837
  442. package/dist/zone-D2M4EZD0.mjs +0 -4
  443. package/dist/zones-BoOC_JzC.mjs +0 -124
@@ -0,0 +1,363 @@
1
+ #!/usr/bin/env node
2
+ import{H as e,J as t,K as n,V as r,it as i,k as a,nt as o,q as s}from"./dist-DZRTPMMA.mjs";import{E as c,M as l,N as u,O as d}from"./chunk-2HLTAS5V-D7COzUOd.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:path";import ee from"node:url";import y from"node:assert";import{TextEncoder as te}from"node:util";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";f(import.meta.url||(typeof __filename==`string`?__filename:`/`));var oe=Object.defineProperty,w=(e,t)=>oe(e,`name`,{value:t,configurable:!0}),T=r();f(import.meta.url||(typeof __filename==`string`?__filename:`/`));var 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
+ from ${t===void 0?r.path():`in-memory config`}.
4
+ This is no longer supported in the current version of Wrangler.
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=i({variableName:`CLOUDFLARE_API_TOKEN`,deprecatedName:`CF_API_TOKEN`}),le=i({variableName:`CLOUDFLARE_API_KEY`,deprecatedName:`CF_API_KEY`}),ue=i({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 u(`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 u(`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=i({variableName:`WRANGLER_AUTH_DOMAIN`,defaultValue:/* @__PURE__ */ w(()=>s()===`staging`?`dash.staging.cloudflare.com`:`dash.cloudflare.com`,`defaultValue`)}),ge=i({variableName:`WRANGLER_AUTH_URL`,defaultValue:/* @__PURE__ */ w(()=>`https://${D()}/oauth2/auth`,`defaultValue`)}),_e=i({variableName:`WRANGLER_TOKEN_URL`,defaultValue:/* @__PURE__ */ w(()=>`https://${D()}/oauth2/token`,`defaultValue`)}),ve=i({variableName:`WRANGLER_REVOKE_URL`,defaultValue:/* @__PURE__ */ w(()=>`https://${D()}/oauth2/revoke`,`defaultValue`)}),ye=i({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=i({variableName:`CLOUDFLARE_ACCESS_CLIENT_ID`}),we=i({variableName:`CLOUDFLARE_ACCESS_CLIENT_SECRET`}),Te=i({variableName:`WRANGLER_CF_AUTHORIZATION_TOKEN`}),Ee=o({variableName:`CLOUDFLARE_AUTH_USE_KEYRING`}),O={},k=/* @__PURE__ */ new Map;function De(e,t){let n=new URL(`https://${e}`);return t&&n.searchParams.set(`cf_workers_preview_token`,t),n.toString()}w(De,`buildProbeUrl`);function Oe(){for(let e of Object.keys(O))delete O[e];k.clear()}w(Oe,`clearAccessCaches`);async function ke(e,t,n){t.debug(`Checking if domain has Access enabled:`,e);let r=JSON.stringify([e,!!n]);if(k.has(r))return t.debug(`Using cached Access switch for:`,e,k.get(r)),k.get(r)??!1;t.debug(`Access switch not cached for:`,e);try{let i=new AbortController,a=setTimeout(()=>{i.abort()},1e3),o=await(0,T.fetch)(De(e,n),{redirect:`manual`,signal:i.signal});clearTimeout(a);let s=!!(o.status===302&&o.headers.get(`location`)?.includes(`cloudflareaccess.com`));return(s||!n)&&(t.debug(`Caching access switch for:`,e),k.set(r,s)),s}catch{return t.debug(`Access probe failed for:`,e),!1}}w(ke,`domainUsesAccess`);async function Ae(e,t){let n=t.logger,r=Ce(),i=we();if(r&&i)return n.debug(`Using Access Service Token headers for domain:`,e),{"CF-Access-Client-Id":r,"CF-Access-Client-Secret":i};if((r!==void 0||i!==void 0)&&n.warn(`Both CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET must be set to use Access Service Token authentication. Only ${r===void 0?`CLOUDFLARE_ACCESS_CLIENT_SECRET`:`CLOUDFLARE_ACCESS_CLIENT_ID`} was found.`),!await ke(e,n,t.previewToken))return{};if(n.debug(`Getting Access headers for domain:`,e),O[e])return n.debug(`Using cached Access headers for domain:`,e),O[e];if((t.isNonInteractiveOrCI??a)())throw new u(`The domain "${e}" is behind Cloudflare Access, but no Access Service Token credentials were found and the current environment is non-interactive.
6
+ Set the CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET environment variables to authenticate with an Access Service Token.
7
+ See https://developers.cloudflare.com/cloudflare-one/access-controls/service-credentials/service-tokens/`,{telemetryMessage:`user access missing service token non interactive`});n.debug(`Spawning cloudflared to get Access token for domain:`);let o=await je(De(e,t.previewToken),t.signal);if(o.error)throw new u(`To use ${t.cliDisplayName} with Cloudflare Access, please install \`cloudflared\` from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation`,{telemetryMessage:`user access missing cloudflared`});let s=o.stdout;n.debug(`cloudflared output:`,s);let c=s.match(/fetched your token:\n\n(.*)/m);if(c&&c.length>=2){let t={Cookie:`CF_Authorization=${c[1]}`};return O[e]=t,n.debug(`Caching Access headers for domain:`,e),t}throw Error(`Failed to authenticate with Cloudflare Access`)}w(Ae,`getAccessHeaders`);function je(e,t){return new Promise((n,r)=>{let i=ae(`cloudflared`,[`access`,`login`,e],{signal:t}),a=[];i.stdout.on(`data`,e=>a.push(e)),i.stderr.resume();let o=/* @__PURE__ */ w(()=>i.kill(),`killChild`);process.once(`exit`,o),i.on(`error`,e=>{if(process.removeListener(`exit`,o),t?.aborted){r(e);return}n({error:e,stdout:``})}),i.on(`close`,()=>{if(process.removeListener(`exit`,o),t?.aborted){r(t.reason??/* @__PURE__ */ Error(`The operation was aborted`));return}n({stdout:Buffer.concat(a).toString()})})})}w(je,`spawnCloudflaredAccessLogin`);async function Me(e){let t=Te();return t===void 0?Ae(D(),e):(e.logger.debug(`Using WRANGLER_CF_AUTHORIZATION_TOKEN from environment`),{Cookie:`CF_Authorization=${t}`})}w(Me,`getCloudflareAccessHeaders`);var Ne=96,Pe=32,Fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`;function Ie(e){let t=btoa(e);return t=t.replace(/\+/g,`-`),t=t.replace(/\//g,`_`),t=t.replace(/=/g,``),t}w(Ie,`base64urlEncode`);async function Le(){let e=new Uint32Array(Ne);S.getRandomValues(e);let t=Ie(Array.from(e).map(e=>Fe[e%Fe.length]).join(``)),n=await S.subtle.digest(`SHA-256`,new te().encode(t)),r=new Uint8Array(n),i=``,a=r.byteLength;for(let e=0;e<a;e++)i+=String.fromCharCode(r[e]);return{codeChallenge:Ie(i),codeVerifier:t}}w(Le,`generatePKCECodes`);var Re=/* @__PURE__ */ w(({verificationUri:e,userCode:t})=>{let n=new URL(e);return n.searchParams.set(`user_code`,t),n.toString()},`generateVerificationUrl`);function ze(e){try{return new URL(e)}catch{return}}w(ze,`parseUrl`);function Be(e,t){let n=ze(e),r=ze(`https://${t.authDomain}`);if(n===void 0||r===void 0||n.protocol!==`https:`||n.username!==``||n.password!==``||n.host!==r.host)throw new u(`The authorization server returned an untrusted \`${t.field}\`: ${e}
8
+ Expected an \`https\` URL on \`${t.authDomain}\`. Refusing to display or open it.`,{telemetryMessage:`user device-flow untrusted verification url`})}w(Be,`assertTrustedVerificationUrl`);var Ve=/* @__PURE__ */ w(({authUrl:e,clientId:t,scopes:n,stateQueryParam:r,codeChallenge:i,redirectUri:a})=>e+`?response_type=code&client_id=${encodeURIComponent(t)}&redirect_uri=${encodeURIComponent(a)}&scope=${encodeURIComponent([...n,`offline_access`].join(` `))}&state=${r}&code_challenge=${encodeURIComponent(i)}&code_challenge_method=S256`,`generateAuthUrl`);function He(e){let t=new Uint32Array(e);return S.getRandomValues(t),Array.from(t).map(e=>Fe[e%Fe.length]).join(``)}w(He,`generateRandomState`);var Ue=64e6;function We(e,t,n){let r=Array(t+1),i=b(`sha256`).update(e).digest();r[0]=i;for(let e=0;e<t;e++){for(let e=0;e<n;e++)i=b(`sha256`).update(i).digest();r[e+1]=i}return r}w(We,`solvePow`);function Ge(e){return Buffer.concat(e).toString(`base64`)}w(Ge,`encodeCheckpoints`);function Ke(e){let t=We(Buffer.from(e.seed,`base64url`),e.k,e.g);return{challengeToken:e.challengeToken,solution:{checkpoints:Ge(t)}}}w(Ke,`solveChallenge`);var A={termsOfService:`https://www.cloudflare.com/terms/`,privacyPolicy:`https://www.cloudflare.com/privacypolicy/`},qe=`You must accept Cloudflare's Terms of Service (${A.termsOfService}) and Privacy Policy (${A.privacyPolicy}) in order to continue. By typing "yes", you agree to these terms. Type "yes" to continue.`,Je=`Continuing means you accept Cloudflare's Terms of Service (${A.termsOfService}) and Privacy Policy (${A.privacyPolicy}).`,Ye=`You must accept Cloudflare's Terms of Service (${A.termsOfService}) and Privacy Policy (${A.privacyPolicy}) to use --temporary.`,Xe=/* @__PURE__ */ new Map([[1035,{message:`The event code is malformed. Check it and try again.`,telemetryMessage:`deploy temporary event code invalid`}],[1036,{message:`The event code was not found. Check it and try again.`,telemetryMessage:`deploy temporary event not found`}],[1037,{message:`This event has not started yet.`,telemetryMessage:`deploy temporary event not started`}],[1038,{message:`This event has ended.`,telemetryMessage:`deploy temporary event expired`}],[1039,{message:`This event is disabled. Contact the event organizer.`,telemetryMessage:`deploy temporary event disabled`}],[1040,{message:`This event has no temporary accounts remaining.`,telemetryMessage:`deploy temporary event exhausted`}],[1041,{message:`The event account could not be prepared. Try again later or contact the event organizer.`,telemetryMessage:`deploy temporary event provisioning unavailable`,fatal:!0}]]);function Ze(e){if(typeof e!=`object`||!e||!(`errors`in e))return;let{errors:t}=e;if(!Array.isArray(t)||t.length===0)return;let[n]=t;if(typeof n==`object`&&n&&`code`in n)return typeof n.code==`number`?n.code:void 0}w(Ze,`getResponseErrorCode`);async function Qe(e){let t;try{t=await e.json()}catch{return}let n=Ze(t);if(n===void 0)return;let r=Xe.get(n);if(!r)return;let i={telemetryMessage:r.telemetryMessage};return r.fatal?new l(r.message,i):new u(r.message,i)}w(Qe,`getEventAccountError`);function $e(){return`${n(e)}/provisioning/previews`}w($e,`getTemporaryPreviewUrl`);function et(){return`${$e()}/challenge`}w(et,`getTemporaryPreviewChallengeUrl`);function tt(e){let t=Date.parse(e);return!Number.isNaN(t)&&t>Date.now()}w(tt,`isFutureTimestamp`);function nt(e){let t=e.read();if(t&&t.account?.id&&t.account?.apiToken&&t.account?.name&&t.claim?.url&&tt(t.account?.expiresAt??``)&&tt(t.claim?.expiresAt??``))return t}w(nt,`getCachedTemporaryPreviewAccount`);async function rt(e,t){let n=await(0,T.fetch)(et(),{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!n.ok)throw new l(`Failed to request a proof-of-work challenge (${n.status} ${n.statusText}).`,{telemetryMessage:`deploy temporary account challenge failed`});let r;try{r=await n.json()}catch{throw new l(`Failed to request a proof-of-work challenge. Received an invalid response (${n.status} ${n.statusText}).`,{telemetryMessage:`deploy temporary account challenge invalid response`})}let{challengeToken:i,seed:a,k:o,g:s}=r.result??{};if(i===void 0||a===void 0||o===void 0||s===void 0)throw new l(`Failed to request a proof-of-work challenge because the response was missing required fields.`,{telemetryMessage:`deploy temporary account challenge incomplete`});if(!Number.isInteger(o)||!Number.isInteger(s)||o<=0||s<=0||o*s>Ue||Buffer.from(a,`base64url`).length!==32)throw new l(`The proof-of-work challenge is not supported by this version of ${t}.`,{telemetryMessage:`deploy temporary account challenge difficulty unsupported`});return e.log(`Solving proof-of-work challenge…`),Ke({challengeToken:i,seed:a,k:o,g:s})}w(rt,`requestPowSolution`);async function it(e,t,n=`Wrangler`){let r=await rt(e,n),i=await(0,T.fetch)($e(),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({termsOfService:A.termsOfService,privacyPolicy:A.privacyPolicy,acceptTermsOfService:`yes`,challengeToken:r.challengeToken,solution:r.solution,...t?.eventCode?{eventCode:t.eventCode}:{}})});if(!i.ok){if(t?.eventCode){let e=await Qe(i);if(e)throw e}throw new l(`Failed to create a temporary preview account (${i.status} ${i.statusText}).`,{telemetryMessage:`deploy temporary account create failed`})}let a;try{a=await i.json()}catch{throw new l(`Failed to create a temporary preview account. Received an invalid response (${i.status} ${i.statusText}).`,{telemetryMessage:`deploy temporary account invalid response`})}let o=a.result,s=o?.account?.id,c=o?.account?.name,u=o?.account?.apiToken,d=o?.account?.expiresAt,f=o?.claim?.url,p=o?.claim?.expiresAt,m=o?.eventCodeAccepted;if(s===void 0||c===void 0||u===void 0||d===void 0||f===void 0||p===void 0)throw new l(`Failed to create a temporary preview account because the response was missing required fields.`,{telemetryMessage:`deploy temporary account response incomplete`});if(t?.eventCode&&m!==!0)throw new l(`Failed to create a temporary preview account because the response did not acknowledge the event code.`,{telemetryMessage:`deploy temporary event acknowledgement missing`});return{account:{id:s,name:c,apiToken:u,expiresAt:d},claim:{url:f,expiresAt:p}}}w(it,`createTemporaryPreviewAccount`);async function at(e){let t=nt(e.storage);if(t){if(e.request?.eventCode)throw new u(`A temporary account is already cached. Rerun without --event-code to reuse it, or run \`${e.logoutCommand??`wrangler logout`}\` and retry to create an account for this event.`,{telemetryMessage:`deploy temporary event cache conflict`});return{account:t,cached:!0}}if(!await e.prompt(qe,Je))throw new u(Ye,{telemetryMessage:`user temporary terms not accepted`});let n=await it(e.temporaryAccountLogger,e.request,e.cliDisplayName);return e.storage.write(n),{account:n,cached:!1}}w(at,`getOrCreateTemporaryPreviewAccount`);function ot(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
9
+ [ ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
10
+ `)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
11
+ `)&&(o=String(e).split(`
12
+ `).map(function(e,t){return t===0?e:``+i+e}).join(`
13
+ `)),a+=o+n[t+1]}),a}w(ot,`dedent`);var st=ot,j=class extends u{static{w(this,`ErrorOAuth2`)}code;description;uri;toString(){return`ErrorOAuth2`}},ct=class extends j{static{w(this,`ErrorUnknown`)}toString(){return`ErrorUnknown`}},lt=class extends j{static{w(this,`ErrorAuthServerUnreachable`)}toString(){return`ErrorAuthServerUnreachable`}},ut=class extends j{static{w(this,`ErrorNoAuthCode`)}toString(){return`ErrorNoAuthCode`}},dt=class extends j{static{w(this,`ErrorInvalidReturnedStateParam`)}toString(){return`ErrorInvalidReturnedStateParam`}},ft=class extends j{static{w(this,`ErrorInvalidJson`)}toString(){return`ErrorInvalidJson`}},pt=class extends j{static{w(this,`ErrorInvalidScope`)}toString(){return`ErrorInvalidScope`}},mt=class extends j{static{w(this,`ErrorInvalidRequest`)}toString(){return`ErrorInvalidRequest`}},ht=class extends j{static{w(this,`ErrorInvalidToken`)}toString(){return`ErrorInvalidToken`}},M=class extends j{static{w(this,`ErrorAuthenticationGrant`)}toString(){return`ErrorAuthenticationGrant`}},gt=class extends M{static{w(this,`ErrorUnauthorizedClient`)}toString(){return`ErrorUnauthorizedClient`}},_t=class extends M{static{w(this,`ErrorAccessDenied`)}toString(){return`ErrorAccessDenied`}},vt=class extends M{static{w(this,`ErrorUnsupportedResponseType`)}toString(){return`ErrorUnsupportedResponseType`}},yt=class extends M{static{w(this,`ErrorServerError`)}toString(){return`ErrorServerError`}},bt=class extends M{static{w(this,`ErrorTemporarilyUnavailable`)}toString(){return`ErrorTemporarilyUnavailable`}},xt=class extends j{static{w(this,`ErrorAccessTokenResponse`)}toString(){return`ErrorAccessTokenResponse`}},St=class extends xt{static{w(this,`ErrorInvalidClient`)}toString(){return`ErrorInvalidClient`}},Ct=class extends xt{static{w(this,`ErrorInvalidGrant`)}toString(){return`ErrorInvalidGrant`}},wt=class extends xt{static{w(this,`ErrorUnsupportedGrantType`)}toString(){return`ErrorUnsupportedGrantType`}};function Tt(e,t,n){let r=`OAuth error: ${e}`;return t&&(r+=`
14
+ ${t}`),n&&(r+=`
15
+ See: ${n}`),r}w(Tt,`formatOAuthErrorMessage`);function N(e,t,n){let r=Tt(e,t,n),i;switch(e){case`invalid_request`:i=new mt(r,{telemetryMessage:`user oauth invalid request`});break;case`invalid_grant`:i=new Ct(r,{telemetryMessage:`user oauth invalid grant`});break;case`unauthorized_client`:i=new gt(r,{telemetryMessage:`user oauth unauthorized client`});break;case`access_denied`:i=new _t(r,{telemetryMessage:`user oauth access denied`});break;case`unsupported_response_type`:i=new vt(r,{telemetryMessage:`user oauth unsupported response type`});break;case`invalid_scope`:i=new pt(r,{telemetryMessage:`user oauth invalid scope`});break;case`server_error`:i=new yt(r,{telemetryMessage:`user oauth server error`});break;case`temporarily_unavailable`:i=new bt(r,{telemetryMessage:`user oauth temporarily unavailable`});break;case`invalid_client`:i=new St(r,{telemetryMessage:`user oauth invalid client`});break;case`unsupported_grant_type`:i=new wt(r,{telemetryMessage:`user oauth unsupported grant type`});break;case`invalid_json`:i=new ft(r,{telemetryMessage:`user oauth invalid json`});break;case`invalid_token`:i=new ht(r,{telemetryMessage:`user oauth invalid token`});break;default:i=new ct(r,{telemetryMessage:`user oauth unknown error`})}return i.code=e,i.description=t,i.uri=n,i}w(N,`toErrorClass`);var Et=3e4;function Dt(e,t,n){if(e.error)throw N(Array.isArray(e.error)?e.error[0]:e.error,Array.isArray(e.error_description)?e.error_description[0]:e.error_description,Array.isArray(e.error_uri)?e.error_uri[0]:e.error_uri);let r=e.code;if(!r)return!1;if(e.state!==t.stateQueryParam)throw n.warn(`Received query string parameter doesn't match the one sent! Possible malicious activity somewhere.`),new dt(``,{telemetryMessage:`user oauth invalid returned state`});return y(!Array.isArray(r)),t.authorizationCode=r,t.hasAuthCodeBeenExchangedForAccessToken=!1,!0}w(Dt,`isReturningFromAuthServer`);async function Ot(e,t,n,r,i){let{codeChallenge:a,codeVerifier:o}=await Le(),s=i.generateRandomState(Pe);return Object.assign(r,{codeChallenge:a,codeVerifier:o,stateQueryParam:s}),i.generateAuthUrl({authUrl:ge(),clientId:t,scopes:e,stateQueryParam:s,codeChallenge:a,redirectUri:n})}w(Ot,`getAuthURL`);async function kt(e,t,n,r,i){let a=E({warningLogger:e,storage:r}).refreshToken;a||e.warn(`No refresh token is present.`);let o=await P(new URLSearchParams({grant_type:`refresh_token`,refresh_token:a?.value??``,client_id:n}),e,t,i);if(o.status>=400){let t;try{t=await F(o,e)}catch(t){e.error(t)}throw t===void 0?new ct(`Failed to parse Error from exchangeRefreshTokenForAccessToken`,{telemetryMessage:`user oauth refresh token exchange parse error`}):typeof t==`string`?Error(t):t}try{let t=await F(o,e);if(`error`in t)throw t.error;let{access_token:n,expires_in:r,refresh_token:i,scope:s}=t;return{token:{value:n,expiry:new Date(Date.now()+r*1e3).toISOString()},scopes:s?s.split(` `):[],refreshToken:i?{value:i}:a}}catch(e){throw typeof e==`string`?N(e):e}}w(kt,`exchangeRefreshTokenForAccessToken`);async function At(e,t,n,r,i,a){let{authorizationCode:o,codeVerifier:s=``}=e;s?o||t.warn(`No authorization grant code is being passed.`):t.warn(`No code verifier is being sent.`);let c=await P(new URLSearchParams({grant_type:`authorization_code`,code:o??``,redirect_uri:i,client_id:r,code_verifier:s}),t,n,a);if(!c.ok){let{error:e}=await F(c,t);throw e===`invalid_grant`&&t.log(`Expired! Auth code or refresh token needs to be renewed.`),N(e)}let l=await F(c,t);if(`error`in l)throw N(l.error);let{access_token:u,expires_in:d,refresh_token:f,scope:p}=l;return e.hasAuthCodeBeenExchangedForAccessToken=!0,{token:{value:u,expiry:new Date(Date.now()+d*1e3).toISOString()},scopes:p?p.split(` `):[],refreshToken:f?{value:f}:void 0}}w(At,`exchangeAuthCodeForAccessToken`);async function P(e,t,n,r){let i={"Content-Type":`application/x-www-form-urlencoded`};if(t.debug(`fetching auth token`,`grant_type=${e.get(`grant_type`)??`<unknown>`}`),await ke(D(),t)){t.debug(`Using Cloudflare Access to get an access token for the auth request`);let e=await Me({logger:t,isNonInteractiveOrCI:n,cliDisplayName:r});Object.assign(i,e)}t.debug(`Fetching auth token from`,_e());try{let n=await(0,T.fetch)(_e(),{method:`POST`,body:e.toString(),headers:i,signal:AbortSignal.timeout(Et)});return n.ok||t.debug(`Failed to fetch auth token:`,n.status,n.statusText),n}catch(e){t.debug(`Failed to fetch auth token:`,e);let n=e?.cause,r=e?.name===`TimeoutError`?` (timed out after ${Et/1e3} seconds)`:typeof n?.code==`string`?` (${n.code})`:``;throw new lt(`Could not reach the Cloudflare auth server at ${_e()}${r}.`,{cause:e,telemetryMessage:`user oauth token endpoint unreachable`})}}w(P,`fetchAuthToken`);async function F(e,t){let n=await e.text();try{return JSON.parse(n)}catch(r){throw n.match(/<!DOCTYPE html>/)&&(t.error(`The body of the response was HTML rather than JSON. Check the debug logs to see the full body of the response.`),n.match(/challenge-platform/)&&t.error(`It looks like you might have hit a bot challenge page. This may be transient but if not, please contact Cloudflare to find out what can be done. When you contact Cloudflare, please provide your Ray ID: ${e.headers.get(`cf-ray`)}`)),t.debug(`Full body of response
16
+
17
+ `,n),Error(`Invalid JSON in response: status: ${e.status} ${e.statusText}`,{cause:r})}}w(F,`getJSONFromResponse`);function jt(e,t){let n=/* @__PURE__ */ w(e=>e.replace(/[&<>"']/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`})[e]),`escape`),r=t.code?`<p>Code: <code>${n(t.code)}</code></p>`:``,i=t.description?`<p class="detail">${n(t.description)}</p>`:``,a=n(e);return st`
18
+ <!doctype html>
19
+ <html lang="en">
20
+ <head>
21
+ <meta charset="utf-8" />
22
+ <title>${a} login failed</title>
23
+ <style>
24
+ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 720px; margin: 4rem auto; padding: 0 1rem; color: #1f2933; line-height: 1.5; }
25
+ h1 { color: #c12d3f; }
26
+ code { background: #f5f7fa; padding: 0.15em 0.3em; border-radius: 3px; }
27
+ p.detail { background: #f5f7fa; padding: 1rem; border-radius: 4px; white-space: pre-wrap; }
28
+ </style>
29
+ </head>
30
+ <body>
31
+ <h1>${a} login failed</h1>
32
+ <p>The Cloudflare OAuth provider returned an error.</p>
33
+ ${r}
34
+ ${i}
35
+ <p>You can close this tab and return to your terminal for more details.</p>
36
+ </body>
37
+ </html>
38
+ `}w(jt,`renderOauthErrorPage`);async function Mt(e,t,n,r){let i=await Ot(e.scopes,e.clientId,e.redirectUri,t,r),a=new URL(e.redirectUri).pathname,o,s,c=new Promise((e,t)=>{s=setTimeout(()=>{o.close(),clearTimeout(s),t(new u(`Timed out waiting for authorization code, please try again.`,{telemetryMessage:`user oauth authorization timeout`}))},12e4)}),l=new Promise((r,i)=>{o=ne.createServer(async(c,l)=>{function d(e,t){clearTimeout(s),l.writableEnded||l.end(),o.close(n=>{t||n?i(t||n):(y(e),r(e))})}w(d,`finish`);function f(e){l.writeHead(400,{"Content-Type":`text/html; charset=utf-8`}),l.end(jt(n.cliDisplayName,e))}w(f,`renderErrorPage`),y(c.url,`This request doesn't have a URL`);let{pathname:p,query:m}=ee.parse(c.url,!0);if(c.method!==`GET`)return l.end(`OK`);switch(p){case a:{let r=!1;try{r=Dt(m,t,n.logger)}catch(t){if(t instanceof _t){l.writeHead(307,{Location:e.denied.url}),l.end(()=>{d(null,new u(e.denied.error,{telemetryMessage:`user oauth consent denied`}))});return}let n=t;f({code:n.code,description:n.description??n.message}),d(null,n);return}if(!r){let e=`The Cloudflare OAuth provider did not return an authorisation code.`;f({description:e}),d(null,new ut(e,{telemetryMessage:`user oauth missing auth code`}));return}try{let r=await At(t,n.logger,n.isNonInteractiveOrCI,e.clientId,e.redirectUri,n.cliDisplayName);l.writeHead(307,{Location:e.granted.url}),l.end(()=>{d(r)})}catch(e){let t=e,n=t instanceof j;f({code:n?t.code:void 0,description:(n?t.description:void 0)??t.message??`Failed to exchange the authorisation code for an access token.`}),d(null,t)}return}}});let c=new URL(e.redirectUri),l=Number(c.port||(c.protocol===`https:`?443:80));(c.hostname!==e.callbackHost||l!==e.callbackPort)&&(n.logger.log(`Temporary login server listening on ${e.callbackHost}:${e.callbackPort}`),n.logger.log(`Note that the OAuth login page will always redirect to \`${e.redirectUri}\`.
39
+ If you have changed the callback host or port because you are running in a container, then ensure that you have port forwarding set up correctly.`)),o.once(`error`,t=>{clearTimeout(s),t.code===`EADDRINUSE`?i(new u(`The OAuth callback server could not bind to ${e.callbackHost}:${e.callbackPort} because the port is already in use. Stop the process using that port or pass a different \`--callback-port\`.`,{telemetryMessage:`user oauth callback port in use`})):i(t)}),o.listen(e.callbackPort,e.callbackHost)});return e.browser?(n.logger.log(`Opening a link in your default browser: ${i}`),await n.openInBrowser(i)):n.logger.log(`Visit this link to authenticate: ${i}`),Promise.race([c,l])}w(Mt,`getOauthToken`);var Nt=300,Pt=1;function I(e,t){if(typeof e!=`object`||!e)return;let n=e[t];return typeof n==`string`&&n!==``?n:void 0}w(I,`getStringMember`);function L(e,t){if(typeof e!=`object`||!e)return;let n=e[t];return typeof n==`number`&&Number.isFinite(n)&&n>0?n:void 0}w(L,`getPositiveNumberMember`);function Ft(e,t){let n=`HTTP ${e.status} ${e.statusText}`.trim(),r=I(t,`error_description`);return r?`${n}: ${r}`:n}w(Ft,`describeUnusableResponse`);function It(e){return e>=500||e===429}w(It,`isRetryableStatus`);function Lt(e){let t=I(e,`device_code`),n=I(e,`user_code`),r=I(e,`verification_uri`),i=L(e,`expires_in`);if(t&&n&&r&&i!==void 0)return{device_code:t,user_code:n,verification_uri:r,verification_uri_complete:I(e,`verification_uri_complete`),expires_in:i,interval:L(e,`interval`)}}w(Lt,`asDeviceAuthorizationResponse`);async function R(e,t){let n=await e.text();try{return JSON.parse(n)}catch(r){throw n.match(/<!DOCTYPE html>/)&&(t.debug(`The body of the response was HTML rather than JSON. Check the debug logs to see the full body of the response.`),n.match(/challenge-platform/)&&t.debug(`It looks like you might have hit a bot challenge page. This may be transient but if not, please contact Cloudflare to find out what can be done. When you contact Cloudflare, please provide your Ray ID: ${e.headers.get(`cf-ray`)}`)),t.debug(`Full body of response
40
+
41
+ `,n),Error(`Invalid JSON in response: status: ${e.status} ${e.statusText}`,{cause:r})}}w(R,`readJson`);async function Rt(e,t,n){let r={"Content-Type":`application/x-www-form-urlencoded`};return await ke(D(),e)&&(e.debug(`Using Cloudflare Access to get an access token for the device authorization request`),Object.assign(r,await Me({logger:e,isNonInteractiveOrCI:t,cliDisplayName:n}))),r}w(Rt,`buildDeviceAuthHeaders`);async function zt(e,t,n,r,i){let a=new URLSearchParams({client_id:t,scope:[...e,`offline_access`].join(` `)}),o=await Rt(n,r,i),s=Se();n.debug(`Fetching device authorization from`,s);let c=await(0,T.fetch)(s,{method:`POST`,body:a.toString(),headers:o});if(!c.ok){let e=await R(c,n).catch(()=>void 0);throw N(e&&typeof e==`object`&&`error`in e?String(e.error):`HTTP ${c.status} ${c.statusText}`)}let l=await R(c,n),d=Lt(l);if(d===void 0)throw n.debug(`Unusable device authorization response body:`,l),new u(`The device authorization endpoint returned a response that could not be interpreted (${Ft(c,l)}).
42
+ Enable debug logging to see the full response.`,{telemetryMessage:`user device-flow unusable device authorization response`});return d}w(zt,`requestDeviceAuthorization`);async function Bt(e,t,n,r,i){let a=await P(new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:device_code`,device_code:e,client_id:t}),n,r,i),o=await R(a,n),s=I(o,`error`);if(s!==void 0)return{kind:`oauth-error`,error:s};let c=I(o,`access_token`),l=L(o,`expires_in`);return!a.ok||c===void 0||l===void 0?(n.debug(`Unusable token response body:`,o),{kind:`unexpected`,detail:Ft(a,o),retryable:!a.ok&&It(a.status)}):{kind:`token`,grant:{access_token:c,expires_in:l,refresh_token:I(o,`refresh_token`),scope:I(o,`scope`)}}}w(Bt,`pollDeviceToken`);function Vt(e){return new Promise(t=>setTimeout(t,e*1e3))}w(Vt,`sleep`);async function Ht(e,t){let{logger:n,openInBrowser:r,isNonInteractiveOrCI:i}=t,a=await zt(e.scopes,e.clientId,n,i,t.cliDisplayName),o=D();Be(a.verification_uri,{field:`verification_uri`,authDomain:o}),a.verification_uri_complete!==void 0&&Be(a.verification_uri_complete,{field:`verification_uri_complete`,authDomain:o});let s=a.verification_uri_complete??Re({verificationUri:a.verification_uri,userCode:a.user_code}),c=Math.min(a.expires_in,Nt);n.log(st`
43
+ To authorize ${t.cliDisplayName}, please visit:
44
+
45
+ ${a.verification_uri}
46
+
47
+ and enter the code:
48
+
49
+ ${a.user_code}
50
+
51
+ You have ${Ut(c)} to approve this request.
52
+ `),e.browser&&(n.log(`
53
+ Opening a link in your default browser: ${s}`),await r(s));let l=Date.now()+c*1e3,d=Math.max(a.interval??Pt,Pt),f=!0,p;for(;Date.now()<l;){f||await Vt(d),f=!1;let r;try{r=await Bt(a.device_code,e.clientId,n,i,t.cliDisplayName)}catch(e){n.debug(`Ignoring transient error while polling for token:`,e),p=e instanceof Error?e.message:String(e);continue}if(r.kind===`unexpected`){if(!r.retryable)throw new u(`The token endpoint returned a response that could not be interpreted (${r.detail}).
54
+ Enable debug logging to see the full response.`,{telemetryMessage:`user device-flow unusable token response`});n.debug(`Ignoring transient response while polling for token:`,r.detail),p=r.detail;continue}if(p=void 0,r.kind===`oauth-error`)switch(r.error){case`authorization_pending`:continue;case`slow_down`:d+=5;continue;case`access_denied`:throw new u(`Consent denied. You must grant consent to ${t.cliDisplayName} in order to login.
55
+ If you don't want to do this consider passing an API token via the \`CLOUDFLARE_API_TOKEN\` environment variable.`,{telemetryMessage:`user device-flow consent denied`});case`expired_token`:throw new u(`Device code expired before the request was approved. Please run \`${t.deviceLoginCommand}\` again to obtain a new code.`,{telemetryMessage:`user device-flow code expired`});default:throw N(r.error)}let{grant:o}=r;return{token:{value:o.access_token,expiry:new Date(Date.now()+o.expires_in*1e3).toISOString()},scopes:o.scope?o.scope.split(` `):[],refreshToken:o.refresh_token?{value:o.refresh_token}:void 0}}throw p===void 0?new u(`Device authorization timed out after ${Ut(c)}. Please run \`${t.deviceLoginCommand}\` again to obtain a new code.`,{telemetryMessage:`user device-flow authorization timeout`}):new u(`Gave up waiting for device authorization: the token endpoint kept returning responses that could not be interpreted (last: ${p}).
56
+ Enable debug logging to see the full response, then run \`${t.deviceLoginCommand}\` to try again.`,{telemetryMessage:`user device-flow poll failed`})}w(Ht,`getOauthTokenViaDeviceFlow`);function Ut(e){if(e<60)return`${e} seconds`;let t=Math.floor(e/60),n=t===1?`minute`:`minutes`,r=e%60;return r===0?`${t} ${n}`:r==59?`${t+1} ${n}`:`${t} ${n} and ${r} ${r===1?`second`:`seconds`}`}w(Ut,`toHumanPeriod`);function Wt(e){let n={},r={generateAuthUrl:e.generateAuthUrl??Ve,generateRandomState:e.generateRandomState??He},i=`default`;function a(t){return e.storageFactory(t??i)}w(a,`getStorage`);let o=/* @__PURE__ */ w(()=>typeof e.clientId==`function`?e.clientId():e.clientId,`getClientId`),s=e.consent,c,l,d=new URL(e.redirectUri),f=d.hostname,p=Number(d.port);async function m(i){if(e.hasEnvCredentials())return e.logger.error(`You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log in via OAuth.`),!1;let c=t(i.complianceConfig);if(c===`fedramp_high`){let e=i.complianceConfig?.compliance_region?"`compliance_region` configuration property":"`CLOUDFLARE_API_ENVIRONMENT` environment variable";throw new u(st`
57
+ OAuth login is not supported in the \`${c}\` compliance region.
58
+ Please use a Cloudflare API token (\`CLOUDFLARE_API_TOKEN\` environment variable) or remove the ${e}.
59
+ `,{telemetryMessage:`user login unsupported compliance region`})}let l;return i.device?(e.logger.log(`Attempting to login via OAuth Device Authorization Grant...`),l=await Ht({browser:i.browser??!0,scopes:i.scopes,clientId:o()},e)):(e.logger.log(`Attempting to login via OAuth...`),l=await Mt({browser:i.browser??!0,scopes:i.scopes,clientId:o(),redirectUri:e.redirectUri,denied:s.denied,granted:s.granted,callbackHost:i.callbackHost??f,callbackPort:i.callbackPort??p},n,e,r)),a(i.profile).write({oauth_token:l.token?.value??``,expiration_time:l.token?.expiry,refresh_token:l.refreshToken?.value,scopes:l.scopes}),e.logger.log(`Successfully logged in.`),x(),e.purgeOnLoginOrLogout?.(),!0}w(m,`login`);function h(t){if(e.hasEnvCredentials())return!1;let{accessToken:n}=E({warningLogger:e.logger,storage:a(t)});return!!(n&&/* @__PURE__ */ new Date>=new Date(n.expiry))}w(h,`isRefreshNeeded`);async function g(t){let n=a(t);try{let{token:{value:t,expiry:r}={value:``,expiry:``},refreshToken:{value:i}={},scopes:a}=await kt(e.logger,e.isNonInteractiveOrCI,o(),n,e.cliDisplayName);return n.write({oauth_token:t,expiration_time:r,refresh_token:i,scopes:a}),`refreshed`}catch(t){return e.logger.debug(`Token refresh failed: ${t instanceof Error?t.message:String(t)}`),t instanceof lt||t instanceof Error&&t.name===`TimeoutError`?`unreachable`:`rejected`}}w(g,`refreshToken`);async function _(t){if(e.hasEnvCredentials())return{loggedIn:!0};let n=E({warningLogger:e.logger,storage:a(t.profile)});if(!n.accessToken&&!n.deprecatedApiToken)return e.isNonInteractiveOrCI()?{loggedIn:!1,reason:`no-credentials-non-interactive`}:await m(t)?{loggedIn:!0}:{loggedIn:!1,reason:`no-credentials-login-failed`};if(h(t.profile)){let n=await g(t.profile);return n===`refreshed`?{loggedIn:!0}:n===`unreachable`?{loggedIn:!1,reason:`token-refresh-unreachable`}:e.isNonInteractiveOrCI()?{loggedIn:!1,reason:`token-expired-non-interactive`}:await m(t)?{loggedIn:!0}:{loggedIn:!1,reason:`token-expired-login-failed`}}return{loggedIn:!0}}w(_,`loginOrRefreshIfRequired`);async function v(t){let n=x();if(e.hasEnvCredentials()){e.logger.log(`You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log out.`);return}let r=E({warningLogger:e.logger,storage:a(t)}).refreshToken;if(!r){e.logger.log(n?`Cleared temporary preview account.`:`Not logged in, exiting...`);return}let i=`client_id=${encodeURIComponent(o())}&token_type_hint=refresh_token&token=${encodeURIComponent(r.value||``)}`;await(await(0,T.fetch)(ve(),{method:`POST`,body:i,headers:{"Content-Type":`application/x-www-form-urlencoded`}})).text(),a(t).clear(),e.logger.log(`Successfully logged out.`),e.purgeOnLoginOrLogout?.()}w(v,`logout`);async function ee(){let t=E({warningLogger:e.logger,storage:a()});if(t.accessToken){if(t.accessToken&&/* @__PURE__ */ new Date>=new Date(t.accessToken.expiry)){if(await g()!==`refreshed`)return;t=E({warningLogger:e.logger,storage:a()})}return t.accessToken?.value}}w(ee,`getOAuthTokenFromLocalState`);function y(){return l?{apiToken:l.account.apiToken}:fe({storage:a(),warningLogger:e.logger,allowGlobalAuthKey:e.allowGlobalAuthKey})}w(y,`getAPITokenInternal`);function te(){return l?{apiToken:l.account.apiToken}:pe({storage:a(),warningLogger:e.logger,allowGlobalAuthKey:e.allowGlobalAuthKey})}w(te,`requireApiTokenInternal`);function ne(t,n){c=t&&e.temporary!==void 0?n??{}:void 0,l=void 0}w(ne,`setTemporaryAllowed`);function re(){return c!==void 0}w(re,`isTemporaryAllowed`);function ie(){return l}w(ie,`getActiveTemporaryAccount`);async function b(){if(!e.temporary)throw new u(`Temporary preview accounts are not supported by ${e.cliDisplayName}.`,{telemetryMessage:`user temporary account unsupported`});let t=await at({...e.temporary,...c?{request:c}:{}});return l=t.account,t}w(b,`activateTemporaryAccount`);function x(){return l=void 0,e.temporary?.storage.clear()??!1}w(x,`clearTemporaryAccount`);function S(e){i=e}w(S,`setProfile`);function ae(){return i}w(ae,`getActiveProfile`);function C(){return E({warningLogger:e.logger,storage:a()}).scopes}return w(C,`getScopes`),{setProfile:S,getActiveProfile:ae,login:m,logout:v,loginOrRefreshIfRequired:_,getOAuthTokenFromLocalState:ee,getAPIToken:y,requireApiToken:te,getScopes:C,setTemporaryAllowed:ne,isTemporaryAllowed:re,getActiveTemporaryAccount:ie,activateTemporaryAccount:b}}w(Wt,`createOAuthFlow`);var Gt=[`default`,`staging`];function Kt(e){let t={read(){return e.bindings.read()},write(t){e.bindings.write(t)},activate(t,n){let r=v.resolve(n),i=e.bindings.read();i[r]=t,e.bindings.write(i)},deactivate(t){let n=v.resolve(t),r=e.bindings.read(),i=r[n];if(i===void 0){let e=Jt(n,r);throw e?new u(`No profile is directly bound to "${qt(n)}". The active profile "${e.profile}" is bound at "${qt(e.dir)}". Run the deactivate command from that directory instead.`,{telemetryMessage:`auth deactivate wrong directory`}):new u(`No profile is bound to "${qt(n)}". Nothing to deactivate.`,{telemetryMessage:`auth deactivate no binding`})}delete r[n],e.bindings.write(r);let a=Jt(n,r);return a?{removedProfile:i,newResolution:{profile:a.profile,source:`inherited from ${a.dir}`}}:e.configs.exists(`default`)?{removedProfile:i,newResolution:{profile:`default`,source:`default profile`}}:{removedProfile:i,newResolution:{profile:void 0,source:`no profile`}}},getProfileForDirectory(t){return Jt(t,e.bindings.read())?.profile},getBindingsForProfile(t){return Object.entries(e.bindings.read()).filter(([,e])=>e===t).map(([e])=>e)},removeAllBindingsForProfile(t){let n=e.bindings.read(),r=[];for(let[e,i]of Object.entries(n))i===t&&(r.push(e),delete n[e]);return r.length>0&&e.bindings.write(n),r}};return{configs:e.configs,bindings:t,resolve(e){return e.profile?e.profile==="default"?`default`:(z(e.profile),e.profile):t.getProfileForDirectory(e.cwd)||`default`}}}w(Kt,`createProfileStore`);function z(e){if(Gt.includes(e.toLowerCase()))throw new u(`"${e}" is a reserved profile name. Use the login and logout commands to manage the default profile, which applies as a global fallback.`,{telemetryMessage:`auth profile reserved name`});if(!/^[a-zA-Z0-9_-]+$/.test(e))throw new u(`Invalid profile name "${e}". Profile names may only contain alphanumeric characters, hyphens, and underscores.`,{telemetryMessage:`auth profile invalid name`})}w(z,`validateProfileName`);function qt(e){return v.relative(process.cwd(),e)||`.`}w(qt,`formatDirectoryForUserError`);function Jt(e,t){let n=v.resolve(e),r=Object.entries(t).sort(([e],[t])=>t.length-e.length);for(let[e,t]of r)if(n===e||n.startsWith(e)&&n[e.length]===v.sep)return{profile:t,dir:e}}w(Jt,`getProfileForDirectoryFromBindings`);var Yt=/^[a-z0-9-_]+$/i,Xt=!!``.isWellFormed;function B(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(typeof e.getUTCDate==`function`&&e instanceof Date)return`date`;if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return`temporal/tz+uc`;if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return`temporal/uc`;if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return`temporal`;if(e instanceof Temporal.PlainYearMonth)return`temporal/x`}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return`temporal/x`}}return t}w(B,`extendedTypeOf`);function Zt(e){for(let t=0;t<e.length;t++)if(B(e[t])!==`object`)return!1;return e.length!=0}w(Zt,`isArrayOfTables`);function Qt(e){return JSON.stringify(e).replaceAll(``,`\\u007f`)}w(Qt,`formatWellFormedStringUnchecked`);function $t(e){return Qt(Xt?e.toWellFormed():e)}w($t,`formatString`);function en(e){if(Yt.test(e))return e;if(Xt&&!e.isWellFormed())throw RangeError(`key contains illegal lone surrogates`);return Qt(e)}w(en,`formatKey`);function V(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);switch(t){case`number`:if(isNaN(e))return`nan`;if(e===1/0)return`inf`;if(e===-1/0)return`-inf`;if(Number.isInteger(e)&&(r||!Number.isSafeInteger(e)))return e.toFixed(1);case`bigint`:case`boolean`:case`temporal`:return e.toString();case`string`:return $t(e);case`date`:if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString();case`object`:return tn(e,n,r,i);case`array`:return nn(e,n,r,i);case`temporal/tz+uc`:if(i){let t=e.timeZoneId,n=t.charCodeAt(0);if(n!==43&&n!==45&&(n!==85&&n!==71&&n!==90&&n!==69||t!==`UTC`&&t!==`UCT`&&t!==`Universal`&&t!==`Zulu`&&!t.startsWith(`GMT`)&&t!==`Greenwich`&&!t.startsWith(`Etc/`)))throw TypeError(`Temporal objects with an IANA timezone are not allowed in Temporal strict mode`)}case`temporal/uc`:if(i&&e.calendarId!==`iso8601`)throw TypeError(`Temporal objects with a non-default calendar are not allowed in Temporal strict mode`);return e.toString({calendarName:`never`,timeZoneName:`never`});case`temporal/x`:throw TypeError(`Unsupported `+e[Symbol.toStringTag])}}w(V,`stringifyValue`);function tn(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `;for(let o=0;o<i.length;o++){let s=i[o];o&&(a+=`, `),a+=en(s)+` = `+V(e[s],B(e[s]),t-1,n,r)}return a+` }`}w(tn,`stringifyInlineTable`);function nn(e,t,n,r){if(e.length===0)return`[]`;let i=`[ `;for(let a=0;a<e.length;a++){if(a&&(i+=`, `),e[a]===null||e[a]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);i+=V(e[a],B(e[a]),t-1,n,r)}return i+` ]`}w(nn,`stringifyArray`);function rn(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``;for(let o=0;o<e.length;o++)a+=`${a&&`
60
+ `}[[${t}]]
61
+ `,a+=H(0,e[o],t,n,r,i);return a}w(rn,`stringifyArrayTable`);function H(e,t,n,r,i,a){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let o=``,s=``,c=Object.keys(t);for(let e=0;e<c.length;e++){let l=c[e];if(t[l]!==null&&t[l]!==void 0){let e=B(t[l]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let c=en(l);if(e===`array`&&Zt(t[l]))s+=(s&&`
62
+ `)+rn(t[l],n?`${n}.${c}`:c,r-1,i,a);else if(e===`object`){let e=n?`${n}.${c}`:c;s+=(s&&`
63
+ `)+H(e,t[l],e,r-1,i,a)}else o+=c,o+=` = `,o+=V(t[l],e,r,i,a),o+=`
64
+ `}}return e&&(o||!s)&&(o=o?`[${e}]
65
+ ${o}`:`[${e}]`),o&&s?`${o}
66
+ ${s}`:o||s}w(H,`stringifyTable`);function an(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:r=!1}={}){if(B(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let i=H(0,e,``,t,n,r);return i[i.length-1]===`
67
+ `?i:i+`
68
+ `}w(an,`stringify`);var on={toml:{parse:/* @__PURE__ */ w(e=>c(e),`parse`),stringify:/* @__PURE__ */ w(e=>an(e),`stringify`)},json:{parse:/* @__PURE__ */ w(e=>JSON.parse(e),`parse`),stringify:/* @__PURE__ */ w(e=>JSON.stringify(e,null,` `),`stringify`)}};function U(e,t){return on[e].parse(t)}w(U,`parseFile`);function W(e,t){return on[e].stringify(t)}w(W,`stringifyFile`);var sn=`config`;function G(e){if(e===void 0||e==="default"){let e=s();return e===`production`?`default`:e}return z(e),e}w(G,`resolveAuthProfileBaseName`);function K(e,t,n=`toml`){return v.join(e,sn,`${G(t)}.${n}`)}w(K,`getAuthConfigFilePath`);var q=class{constructor(e,t,n=`toml`){this.configPath=e,this.profile=t,this.format=n}static{w(this,`FileCredentialStore`)}kind=`file`;filePath(){return K(this.configPath,this.profile,this.format)}read(){let e=this.filePath();if(m(e))return U(this.format,d(e))}write(e){let t=this.filePath();h(v.dirname(t),{recursive:!0}),_(t,W(this.format,e),{encoding:`utf-8`,mode:384}),p(t,384)}clear(){let e=this.filePath(),t=m(e);return t&&g(e),t}path(){return this.filePath()}describe(){return this.filePath()}},J=32,cn=12,ln=16,un=`AES-256-GCM`,dn=`aes-256-gcm`;function fn(){return new Uint8Array(x(J))}w(fn,`generateKey`);function pn(e,t){if(t.length!==J)throw Error(`AES-256-GCM requires a ${J}-byte key (got ${t.length} bytes).`);let n=x(cn),r=re(dn,t,n),i=Buffer.concat([r.update(e,`utf-8`),r.final()]),a=r.getAuthTag();return{v:1,alg:un,iv:n.toString(`base64`),tag:a.toString(`base64`),ciphertext:i.toString(`base64`)}}w(pn,`encryptString`);function mn(e,t){if(t.length!==J)throw Error(`AES-256-GCM requires a ${J}-byte key (got ${t.length} bytes).`);if(e.v!==1)throw Error(`Unsupported encrypted envelope version: ${e.v}.`);let n=Buffer.from(e.iv,`base64`),r=Buffer.from(e.tag,`base64`),i=Buffer.from(e.ciphertext,`base64`);if(n.length!==cn)throw Error(`Expected ${cn}-byte IV in envelope (got ${n.length} bytes).`);if(r.length!==ln)throw Error(`Expected ${ln}-byte auth tag in envelope (got ${r.length} bytes).`);let a=ie(dn,t,n);return a.setAuthTag(r),Buffer.concat([a.update(i),a.final()]).toString(`utf-8`)}w(mn,`decryptString`);function hn(e){if(typeof e!=`object`||!e)return;let t=e;if(t.v===1&&t.alg===un&&typeof t.iv==`string`&&typeof t.tag==`string`&&typeof t.ciphertext==`string`)return t}w(hn,`parseEncryptedEnvelope`);function Y(e,t){return v.join(e,`config`,`${G(t)}.enc`)}w(Y,`getEncryptedAuthConfigFilePath`);var gn=class{constructor(e,t,n,r,i=`toml`){this.configPath=e,this.keyProvider=t,this.onPlaintextMigration=n,this.profile=r,this.format=i}static{w(this,`EncryptedFileCredentialStore`)}kind=`encrypted-file`;plaintextPath(){return K(this.configPath,this.profile,this.format)}read(){let e=Y(this.configPath,this.profile);if(m(e))return this.readEncryptedFile(e);let t=this.plaintextPath();if(m(t))return this.migrateFromPlaintext(t,e)}write(e){let t=this.ensureKey(),n=pn(W(this.format,e),t),r=Y(this.configPath,this.profile);h(v.dirname(r),{recursive:!0}),_(r,JSON.stringify(n,null,` `),{encoding:`utf-8`,mode:384}),p(r,384);let i=this.plaintextPath();m(i)&&g(i)}clear(){let e=Y(this.configPath,this.profile),t=this.plaintextPath(),n=!1;m(e)&&(g(e),n=!0),m(t)&&(g(t),n=!0);try{this.keyProvider.deleteKey()}catch{}return n}path(){return Y(this.configPath,this.profile)}describe(){return`Encrypted file (${Y(this.configPath,this.profile)}) with key in ${this.keyProvider.describe()}`}readEncryptedFile(e){let t=this.keyProvider.getKey();if(t===void 0)return;let n=d(e),r;try{r=hn(JSON.parse(n))}catch{return}if(r===void 0)return;let i;try{i=mn(r,t)}catch{return}try{return U(this.format,i)}catch{return}}migrateFromPlaintext(e,t){let n=d(e),r;try{r=U(this.format,n)}catch{return}return this.write(r),this.onPlaintextMigration?.({plaintextPath:e,encryptedPath:t,keyProviderDescription:this.keyProvider.describe()}),r}ensureKey(){let e=this.keyProvider.getKey();if(e!==void 0)return e;let t=fn();return this.keyProvider.setKey(t),t}},X=`1.3.0`;function _n(e){return C(`npm`,e,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],shell:process.platform===`win32`})}w(_n,`defaultNpmRunner`);var vn=_n,Z=/* @__PURE__ */ new Map;function yn(e){vn=e??_n,Z.clear()}w(yn,`setNpmRunner`);function bn(e){return v.join(e,`native`,`keyring`)}w(bn,`getKeyringInstallDir`);function xn(e){return v.join(e,`node_modules`,`@napi-rs`,`keyring`)}w(xn,`getInstalledBindingPath`);function Sn(e){try{return f(e)(e),!0}catch{return!1}}w(Sn,`canLoadKeyringBinding`);function Cn(e){let t=Z.get(e);if(t!==void 0)return t;let n=xn(e);if(m(v.join(n,`index.js`))&&Sn(n))return Z.set(e,n),n;try{let t=vn([`root`,`-g`]);if(t.status===0){let n=v.join(t.stdout.trim(),`@napi-rs`,`keyring`);if(m(v.join(n,`index.js`))&&Sn(n))return Z.set(e,n),n}}catch{}return Z.set(e,null),null}w(Cn,`findKeyringBinding`);function wn(e){let t=e;h(t,{recursive:!0});let n=v.join(t,`package.json`);m(n)||_(n,JSON.stringify({private:!0,name:`cloudflare-auth-keyring-host`},null,` `),`utf-8`);let r;try{r=vn([`install`,`@napi-rs/keyring@${X}`,`--prefix`,t,`--no-save`,`--no-audit`,`--no-fund`,`--no-package-lock`,`--loglevel=error`])}catch(e){throw new u(`Failed to spawn \`npm\` to install the keyring backend: ${e instanceof Error?e.message:String(e)}
69
+
70
+ Install \`npm\` and retry, or install the binding globally:
71
+ npm install -g @napi-rs/keyring@${X}`,{telemetryMessage:`workers-auth keyring npm spawn failed`})}if(r.status!==0)throw new u(`Failed to install \`@napi-rs/keyring\` (npm exited ${r.status}):
72
+ ${r.stderr?.trim()??`(no stderr)`}
73
+
74
+ Retry once the underlying issue is fixed, or install the binding globally:
75
+ npm install -g @napi-rs/keyring@${X}`,{telemetryMessage:`workers-auth keyring npm install failed`});if(Z.delete(e),Cn(e)===null)throw new u(`\`npm\` reported success but the \`@napi-rs/keyring\` native binding still cannot be loaded.
76
+
77
+ Its platform-specific binary ships as a separate optional package, so a download that was skipped or interrupted leaves the binding unusable.
78
+
79
+ Retry once the underlying issue is fixed, or install the binding globally:
80
+ npm install -g @napi-rs/keyring@${X}`,{telemetryMessage:`workers-auth keyring install incomplete`})}w(wn,`installKeyringBindingSync`);var Tn;function En(e){Tn=e}w(En,`setKeyringEntryFactory`);function Dn(e){if(Tn!==void 0)return Tn;let t=Cn(e);if(t===null)throw new u(`The \`@napi-rs/keyring\` native binding is not available.
81
+
82
+ Retry the command, or install the binding globally:
83
+ npm install -g @napi-rs/keyring@${X}`,{telemetryMessage:`workers-auth keyring binding not loadable`});let n=f(t)(t);return(e,t)=>new n.Entry(e,t)}w(Dn,`resolveKeyringEntryFactory`);function Q(e){return G(e)}w(Q,`getKeyringAccountName`);function On(e){let t={v:1,key:Buffer.from(e).toString(`base64`),created:(/* @__PURE__ */ new Date()).toISOString()};return JSON.stringify(t)}w(On,`encodeKeyEnvelope`);function kn(e){if(e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t==`object`&&t&&t.v===1&&typeof t.key==`string`)try{let e=Buffer.from(t.key,`base64`);return e.length===32?new Uint8Array(e):void 0}catch{return}}w(kn,`decodeKeyEnvelope`);function An(e,t={}){return C(`secret-tool`,e,{encoding:`utf-8`,input:t.input})}w(An,`defaultRunner`);var $=An,jn=void 0;function Mn(e){$=e??An,jn=void 0}w(Mn,`setLinuxSecretToolRunner`);function Nn(){if(jn!==void 0)return jn;let e;try{e=$([`--version`]).error===void 0}catch{e=!1}return jn=e,e}w(Nn,`probeSecretTool`);var Pn=class{constructor(e,t){this.serviceName=e,this.profile=t}static{w(this,`LinuxSecretToolKeyProvider`)}getKey(){let e=$([`lookup`,`service`,this.serviceName,`account`,Q(this.profile)]);if(e.status!==1){if(e.status!==0)throw Error(`Failed to read key via secret-tool (exit ${e.status}): ${e.stderr?.trim()??`(no stderr)`}`);return kn(e.stdout.trim())}}setKey(e){let t=$([`store`,`--label=Cloudflare credentials key`,`service`,this.serviceName,`account`,Q(this.profile)],{input:On(e)});if(t.status!==0)throw Error(`Failed to write key via secret-tool (exit ${t.status}): ${t.stderr?.trim()??`(no stderr)`}`)}deleteKey(){let e=$([`clear`,`service`,this.serviceName,`account`,Q(this.profile)]);if(e.status!==0)throw Error(`Failed to delete key via secret-tool (exit ${e.status}): ${e.stderr?.trim()??`(no stderr)`}`)}describe(){return`Linux secret-tool (service=${this.serviceName}, account=${Q(this.profile)})`}},Fn=44;function In(e,t={}){return C(`/usr/bin/security`,e,{encoding:`utf-8`,input:t.input})}w(In,`defaultRunner`);var Ln=In;function Rn(e){Ln=e??In}w(Rn,`setMacSecurityCommandRunner`);var zn=class{constructor(e,t){this.serviceName=e,this.profile=t}static{w(this,`MacSecurityKeyProvider`)}getKey(){let e=Ln([`find-generic-password`,`-s`,this.serviceName,`-a`,Q(this.profile),`-w`]);if(e.status!==Fn){if(e.status!==0)throw Error(`Failed to read key from macOS Keychain (exit ${e.status}): ${e.stderr?.trim()??`(no stderr)`}`);return kn(e.stdout.trim())}}setKey(e){let t=Ln([`add-generic-password`,`-s`,this.serviceName,`-a`,Q(this.profile),`-w`,On(e),`-U`]);if(t.status!==0)throw Error(`Failed to write key to macOS Keychain (exit ${t.status}): ${t.stderr?.trim()??`(no stderr)`}`)}deleteKey(){let e=Ln([`delete-generic-password`,`-s`,this.serviceName,`-a`,Q(this.profile)]);if(e.status!==0&&e.status!==Fn)throw Error(`Failed to delete key from macOS Keychain (exit ${e.status}): ${e.stderr?.trim()??`(no stderr)`}`)}describe(){return`macOS Keychain (service=${this.serviceName}, account=${Q(this.profile)})`}},Bn=class{constructor(e,t,n){this.serviceName=e,this.installDir=t,this.profile=n}static{w(this,`NapiKeyringKeyProvider`)}entry(){return Dn(this.installDir)(this.serviceName,Q(this.profile))}getKey(){let e=this.entry().getPassword();if(e!==null&&e!==``)return kn(e)}setKey(e){this.entry().setPassword(On(e))}deleteKey(){try{this.entry().deletePassword()}catch{}}describe(){return`${process.platform===`win32`?`Windows Credential Manager`:`OS keyring`} via @napi-rs/keyring (service=${this.serviceName}, account=${Q(this.profile)})`}},Vn;function Hn(e){Vn=e}w(Hn,`setKeyProviderFactoryForTesting`);function Un(e,t,n){if(Vn!==void 0)return{kind:`available`,provider:Vn(e,t)};switch(process.platform){case`darwin`:return{kind:`available`,provider:new zn(e,t)};case`linux`:return Nn()?{kind:`available`,provider:new Pn(e,t)}:{kind:`unsupported`};case`win32`:{let r=bn(n);return Cn(r)===null?{kind:`needs-install`,install:/* @__PURE__ */ w(()=>wn(r),`install`),afterInstall:/* @__PURE__ */ w(()=>new Bn(e,r,t),`afterInstall`)}:{kind:`available`,provider:new Bn(e,r,t)}}default:return{kind:`unsupported`}}}w(Un,`resolveKeyProvider`);var Wn={installFailedThisSession:!1,hasWarnedAboutKeyringFallback:!1,hasWarnedAboutSecretToolMissing:!1};function Gn(){return Wn}w(Gn,`getResolverSessionFlags`);function Kn(){Wn.installFailedThisSession=!1,Wn.hasWarnedAboutKeyringFallback=!1,Wn.hasWarnedAboutSecretToolMissing=!1}w(Kn,`resetCredentialStorageState`);function qn(e){let t={...e,loginCommand:e.loginCommand??`your CLI login`,format:e.format??`toml`};function n(e){return Jn(t,e)}w(n,`getActiveStore`);function r(e){return{read:/* @__PURE__ */ w(()=>n(e).read(),`read`),write:/* @__PURE__ */ w(t=>n(e).write(t),`write`),clear:/* @__PURE__ */ w(()=>n(e).clear(),`clear`),path:/* @__PURE__ */ w(()=>n(e).path(),`path`)}}return w(r,`storageFactory`),{storageFactory:r,getActiveStore:n}}w(qn,`createCredentialStorageContext`);function Jn(e,t){let n=Ee(),r=e.getConfigPath();if(n===!1)return new q(r,t,e.format);let i=n===!0;if(!(n??e.isKeyringEnabled()??!1))return new q(r,t,e.format);let a=Un(e.serviceName,t,r);switch(a.kind){case`available`:return new gn(r,a.provider,Yn(e),t,e.format);case`needs-install`:return Xn(a,i,e,t);case`unsupported`:return Zn(i,e,t)}}w(Jn,`resolveActiveCredentialStore`);function Yn(e){return t=>{e.logger.warn(`Migrated credentials from ${t.plaintextPath} into ${t.encryptedPath} (key in ${t.keyProviderDescription}). The plaintext file has been deleted.`)}}w(Yn,`buildMigrationLogger`);function Xn(e,t,n,r){let i=Gn();if(i.installFailedThisSession){if(t)throw new u(`CLOUDFLARE_AUTH_USE_KEYRING is set but the keyring backend could not be installed earlier this session.`,{telemetryMessage:`workers-auth keyring install previously failed`});return Qn(`The keyring backend could not be installed earlier this session; using the plaintext credentials file.`,n,r)}if(n.isNonInteractiveOrCI())throw new u(er(n.loginCommand),{telemetryMessage:`workers-auth keyring binding not installed`});try{n.logger.log(`🔐 Installing keyring backend (one-time, ~2 MB)…`),e.install()}catch(e){if(i.installFailedThisSession=!0,t)throw e instanceof u?e:new u(`Failed to install the keyring backend: ${e instanceof Error?e.message:String(e)}`,{telemetryMessage:`workers-auth keyring install threw`});return Qn(`Failed to install the keyring backend (${e instanceof Error?e.message:String(e)}); falling back to the plaintext credentials file.`,n,r)}return new gn(n.getConfigPath(),e.afterInstall(),Yn(n),r,n.format)}w(Xn,`handleNeedsInstall`);function Zn(e,t,n){let r=process.platform,i=r===`linux`,a=i?$n(t.loginCommand):`OS keyring storage is not supported on \`${r}\`; falling back to the plaintext credentials file.`;if(e)throw new u(i?`CLOUDFLARE_AUTH_USE_KEYRING is set but ${a}`:`CLOUDFLARE_AUTH_USE_KEYRING is set but no keyring backend is available on \`${r}\`.`,{telemetryMessage:i?`workers-auth keyring secret tool missing`:`workers-auth keyring unsupported platform`});if(i&&t.isNonInteractiveOrCI())throw new u(a,{telemetryMessage:`workers-auth keyring secret tool missing`});let o=Gn();return i?(o.hasWarnedAboutSecretToolMissing||(o.hasWarnedAboutSecretToolMissing=!0,t.logger.warn(`${a}
84
+
85
+ Falling back to the plaintext credentials file for this session.`)),new q(t.getConfigPath(),n,t.format)):Qn(a,t,n)}w(Zn,`handleUnsupported`);function Qn(e,t,n){let r=Gn();return r.hasWarnedAboutKeyringFallback||(r.hasWarnedAboutKeyringFallback=!0,t.logger.warn(e)),new q(t.getConfigPath(),n,t.format)}w(Qn,`fallbackToFileWithWarning`);function $n(e){return`\`secret-tool\` is required for OS keyring storage on Linux but is not installed.
86
+
87
+ Install it via your package manager:
88
+ Debian/Ubuntu: sudo apt-get install libsecret-tools
89
+ Fedora/RHEL: sudo dnf install libsecret
90
+ Arch: sudo pacman -S libsecret
91
+ Alpine: apk add libsecret
92
+
93
+ Or disable keyring storage: \`${e} --no-use-keyring\`.`}w($n,`secretToolMissingMessage`);function er(e){return`\`@napi-rs/keyring\` is required for OS keyring storage on Windows but is not installed.
94
+
95
+ Run \`${e} --use-keyring\` interactively to install it automatically, or install it globally for CI:
96
+
97
+ npm install -g @napi-rs/keyring@${X}
98
+
99
+ Or disable keyring storage: \`${e} --no-use-keyring\`.`}w(er,`windowsBindingMissingMessage`);function tr(e){let t=Y(e.configPath,e.profile),n=m(t),r=Un(e.serviceName,e.profile,e.configPath);return r.kind===`available`?(new gn(e.configPath,r.provider,void 0,e.profile,e.format??`toml`).clear(),{backendAvailable:!0,encryptedFileExisted:n}):(n&&g(t),{backendAvailable:!1,encryptedFileExisted:n})}w(tr,`scrubEncryptedCredentials`);
100
+ /*! Bundled license information:
101
+
102
+ smol-toml/dist/error.js:
103
+ (*!
104
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
105
+ * SPDX-License-Identifier: BSD-3-Clause
106
+ *
107
+ * Redistribution and use in source and binary forms, with or without
108
+ * modification, are permitted provided that the following conditions are met:
109
+ *
110
+ * 1. Redistributions of source code must retain the above copyright notice, this
111
+ * list of conditions and the following disclaimer.
112
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
113
+ * this list of conditions and the following disclaimer in the
114
+ * documentation and/or other materials provided with the distribution.
115
+ * 3. Neither the name of the copyright holder nor the names of its contributors
116
+ * may be used to endorse or promote products derived from this software without
117
+ * specific prior written permission.
118
+ *
119
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
120
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
121
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
122
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
123
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
124
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
125
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
126
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
127
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
128
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
129
+ *)
130
+
131
+ smol-toml/dist/primitive.js:
132
+ (*!
133
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
134
+ * SPDX-License-Identifier: BSD-3-Clause
135
+ *
136
+ * Redistribution and use in source and binary forms, with or without
137
+ * modification, are permitted provided that the following conditions are met:
138
+ *
139
+ * 1. Redistributions of source code must retain the above copyright notice, this
140
+ * list of conditions and the following disclaimer.
141
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
142
+ * this list of conditions and the following disclaimer in the
143
+ * documentation and/or other materials provided with the distribution.
144
+ * 3. Neither the name of the copyright holder nor the names of its contributors
145
+ * may be used to endorse or promote products derived from this software without
146
+ * specific prior written permission.
147
+ *
148
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
149
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
150
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
151
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
152
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
153
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
154
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
155
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
156
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
157
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
158
+ *)
159
+
160
+ smol-toml/dist/date.js:
161
+ (*!
162
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
163
+ * SPDX-License-Identifier: BSD-3-Clause
164
+ *
165
+ * Redistribution and use in source and binary forms, with or without
166
+ * modification, are permitted provided that the following conditions are met:
167
+ *
168
+ * 1. Redistributions of source code must retain the above copyright notice, this
169
+ * list of conditions and the following disclaimer.
170
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
171
+ * this list of conditions and the following disclaimer in the
172
+ * documentation and/or other materials provided with the distribution.
173
+ * 3. Neither the name of the copyright holder nor the names of its contributors
174
+ * may be used to endorse or promote products derived from this software without
175
+ * specific prior written permission.
176
+ *
177
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
178
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
179
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
180
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
181
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
182
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
183
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
184
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
185
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
186
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
187
+ *)
188
+
189
+ smol-toml/dist/extract.js:
190
+ (*!
191
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
192
+ * SPDX-License-Identifier: BSD-3-Clause
193
+ *
194
+ * Redistribution and use in source and binary forms, with or without
195
+ * modification, are permitted provided that the following conditions are met:
196
+ *
197
+ * 1. Redistributions of source code must retain the above copyright notice, this
198
+ * list of conditions and the following disclaimer.
199
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
200
+ * this list of conditions and the following disclaimer in the
201
+ * documentation and/or other materials provided with the distribution.
202
+ * 3. Neither the name of the copyright holder nor the names of its contributors
203
+ * may be used to endorse or promote products derived from this software without
204
+ * specific prior written permission.
205
+ *
206
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
207
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
208
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
209
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
210
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
211
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
212
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
213
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
214
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
215
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
216
+ *)
217
+
218
+ smol-toml/dist/util.js:
219
+ (*!
220
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
221
+ * SPDX-License-Identifier: BSD-3-Clause
222
+ *
223
+ * Redistribution and use in source and binary forms, with or without
224
+ * modification, are permitted provided that the following conditions are met:
225
+ *
226
+ * 1. Redistributions of source code must retain the above copyright notice, this
227
+ * list of conditions and the following disclaimer.
228
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
229
+ * this list of conditions and the following disclaimer in the
230
+ * documentation and/or other materials provided with the distribution.
231
+ * 3. Neither the name of the copyright holder nor the names of its contributors
232
+ * may be used to endorse or promote products derived from this software without
233
+ * specific prior written permission.
234
+ *
235
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
236
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
237
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
238
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
239
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
240
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
241
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
242
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
243
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
244
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
245
+ *)
246
+
247
+ smol-toml/dist/struct.js:
248
+ (*!
249
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
250
+ * SPDX-License-Identifier: BSD-3-Clause
251
+ *
252
+ * Redistribution and use in source and binary forms, with or without
253
+ * modification, are permitted provided that the following conditions are met:
254
+ *
255
+ * 1. Redistributions of source code must retain the above copyright notice, this
256
+ * list of conditions and the following disclaimer.
257
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
258
+ * this list of conditions and the following disclaimer in the
259
+ * documentation and/or other materials provided with the distribution.
260
+ * 3. Neither the name of the copyright holder nor the names of its contributors
261
+ * may be used to endorse or promote products derived from this software without
262
+ * specific prior written permission.
263
+ *
264
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
265
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
266
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
267
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
268
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
269
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
270
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
271
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
272
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
273
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274
+ *)
275
+
276
+ smol-toml/dist/parse.js:
277
+ (*!
278
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
279
+ * SPDX-License-Identifier: BSD-3-Clause
280
+ *
281
+ * Redistribution and use in source and binary forms, with or without
282
+ * modification, are permitted provided that the following conditions are met:
283
+ *
284
+ * 1. Redistributions of source code must retain the above copyright notice, this
285
+ * list of conditions and the following disclaimer.
286
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
287
+ * this list of conditions and the following disclaimer in the
288
+ * documentation and/or other materials provided with the distribution.
289
+ * 3. Neither the name of the copyright holder nor the names of its contributors
290
+ * may be used to endorse or promote products derived from this software without
291
+ * specific prior written permission.
292
+ *
293
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
294
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
295
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
296
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
297
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
298
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
299
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
300
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
301
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
302
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
303
+ *)
304
+
305
+ smol-toml/dist/stringify.js:
306
+ (*!
307
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
308
+ * SPDX-License-Identifier: BSD-3-Clause
309
+ *
310
+ * Redistribution and use in source and binary forms, with or without
311
+ * modification, are permitted provided that the following conditions are met:
312
+ *
313
+ * 1. Redistributions of source code must retain the above copyright notice, this
314
+ * list of conditions and the following disclaimer.
315
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
316
+ * this list of conditions and the following disclaimer in the
317
+ * documentation and/or other materials provided with the distribution.
318
+ * 3. Neither the name of the copyright holder nor the names of its contributors
319
+ * may be used to endorse or promote products derived from this software without
320
+ * specific prior written permission.
321
+ *
322
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
323
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
324
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
325
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
326
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
327
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
328
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
329
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
330
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
331
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
332
+ *)
333
+
334
+ smol-toml/dist/index.js:
335
+ (*!
336
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
337
+ * SPDX-License-Identifier: BSD-3-Clause
338
+ *
339
+ * Redistribution and use in source and binary forms, with or without
340
+ * modification, are permitted provided that the following conditions are met:
341
+ *
342
+ * 1. Redistributions of source code must retain the above copyright notice, this
343
+ * list of conditions and the following disclaimer.
344
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
345
+ * this list of conditions and the following disclaimer in the
346
+ * documentation and/or other materials provided with the distribution.
347
+ * 3. Neither the name of the copyright holder nor the names of its contributors
348
+ * may be used to endorse or promote products derived from this software without
349
+ * specific prior written permission.
350
+ *
351
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
352
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
353
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
354
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
355
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
356
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
357
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
358
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
359
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
360
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
361
+ *)
362
+ */
363
+ export{K as a,Ee as c,tr as d,W as f,w as h,ot as i,Y as l,z as m,Wt as n,de as o,he as p,Kt as r,be as s,qn as t,U as u};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e,r as t}from"./source-mXUcrTVw.mjs";import{B as n,j as r,m as i}from"./dist-BHEmAAHr.mjs";import{N as a,r as o}from"./chunk-TAK63GWY-DdMktrgc.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l,{resolve as u}from"node:path";import d from"node:assert";import{spawnSync as f}from"node:child_process";const p=s(import.meta.url||(typeof __filename==`string`?__filename:`/`));var m=Object.create,h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>h(e,`name`,{value:t,configurable:!0}),x=/* @__PURE__ */ (e=>p===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(p===void 0?e:p)[t]}):e:p)(function(e){if(p!==void 0)return p.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),S=(e,t)=>function(){return t||(0,e[_(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of _(t))!y.call(e,i)&&i!==n&&h(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e},T=(e,t,n)=>(n=e==null?{}:m(v(e)),w(t||!e||!e.__esModule?h(n,`default`,{value:e,enumerable:!0}):n,e)),E=/* @__PURE__ */ e(((e,n)=>{var r=t(`child_process`).exec,i=t(`child_process`).execSync,a=t(`fs`),o=t(`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)}})),D=/* @__PURE__ */ e(((e,t)=>{t.exports=E()})),ee=n(),O=D();s(import.meta.url||(typeof __filename==`string`?__filename:`/`));function k(e){if(e.compiled_schema)return c(u(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>u(t,e));if(!(0,O.sync)(`capnp`))throw new a(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=u(t??`.`),o=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${i}`,...r],{maxBuffer:3145728});if(o.error)throw o.error;if(o.stderr.length)throw Error(o.stderr.toString());return o.stdout}b(k,`handleUnsafeCapnp`);var A={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 j(e){let t=A[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}b(j,`toMimeType`);function M(e){let t=Object.keys(A).find(t=>A[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}b(M,`fromMimeType`);function N(e,t,n){let s=new ee.FormData,{main:u,sourceMaps:f,migrations:p,code_update_strategy:m,exports:h,compatibility_date:g,compatibility_flags:_,keepVars:v,keepSecrets:y,keepBindings:b,logpush:x,placement:S,tail_consumers:C,streaming_tail_consumers:w,limits:T,annotations:E,keep_assets:D,assets:O,observability:A,cache:M,package_dependencies:N}=e,P={html_handling:O?.assetConfig?.html_handling,not_found_handling:O?.assetConfig?.not_found_handling,base_path:O?.assetConfig?.base_path,run_worker_first:O?.run_worker_first,_redirects:O?._redirects,_headers:O?._headers};if(O&&!O.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:O.jwt,config:P},...E&&{annotations:E},...g&&{compatibility_date:g},..._&&{compatibility_flags:_}})),s;let{modules:F}=e,I=[],te=i(`plain_text`,t),ne=i(`json`,t),re=i(`secret_text`,t),ie=i(`kv_namespace`,t),ae=i(`send_email`,t),oe=i(`durable_object_namespace`,t),se=i(`workflow`,t),ce=i(`queue`,t),le=i(`r2_bucket`,t),ue=i(`d1`,t),de=i(`vectorize`,t),fe=i(`ai_search_namespace`,t),pe=i(`ai_search`,t),L=i(`agent_memory`,t),R=i(`hyperdrive`,t),z=i(`secrets_store_secret`,t),B=i(`artifacts`,t),me=i(`unsafe_hello_world`,t),he=i(`flagship`,t),ge=i(`ratelimit`,t),_e=i(`vpc_service`,t),ve=i(`vpc_network`,t),V=i(`service`,t),ye=i(`analytics_engine`,t),be=i(`dispatch_namespace`,t),xe=i(`mtls_certificate`,t),Se=i(`pipeline`,t),Ce=i(`k2`,t),we=i(`worker_loader`,t),Te=i(`logfwdr`,t),Ee=i(`wasm_module`,t),H=i(`browser`,t)[0],U=i(`analytics`,t)[0],W=i(`ai`,t)[0],G=i(`images`,t)[0],K=i(`stream`,t)[0],q=i(`media`,t)[0],J=i(`version_metadata`,t)[0],Y=i(`assets`,t)[0],De=i(`text_blob`,t),Oe=i(`data_blob`,t);i(`inherit`,t).forEach(({binding:e})=>{I.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{I.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{I.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{I.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:r})=>{if(n?.dryRun&&(e??=o),e===void 0)throw new a(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===o?I.push({name:t,type:`inherit`}):I.push({name:t,type:`kv_namespace`,namespace_id:e,raw:r})}),ae.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?I.push(t):I.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):I.push({...t,destination_address:e.destination_address})}),oe.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{I.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),se.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{I.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ce.forEach(({binding:e,queue_name:t,delivery_delay:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({type:`queue`,name:e,queue_name:t,delivery_delay:r,raw:i})}),le.forEach(({binding:e,bucket_name:t,jurisdiction:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:r,raw:i})}),ue.forEach(({binding:e,database_id:t,database_internal_env:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`d1`,id:t,internalEnv:r,raw:i})}),de.forEach(({binding:e,index_name:t,raw:n})=>{I.push({name:e,type:`vectorize`,index_name:t,raw:n})}),fe.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`ai_search_namespace`,namespace:t})}),pe.forEach(({binding:e,instance_name:t})=>{I.push({name:e,type:`ai_search`,instance_name:t})}),L.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`agent_memory`,namespace:t})}),R.forEach(({binding:e,id:t})=>{I.push({name:e,type:`hyperdrive`,id:t})}),z.forEach(({binding:e,store_id:t,secret_name:n})=>{I.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),B.forEach(({binding:e,namespace:t})=>{I.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{I.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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`});I.push(t===o?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{I.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{I.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{I.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),V.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{I.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),ye.forEach(({binding:e,dataset:t})=>{I.push({name:e,type:`analytics_engine`,dataset:t})}),be.forEach(({binding:e,namespace:t,outbound:r})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`dispatch_namespace`,namespace:t,...r&&{outbound:{worker:{service:r.service,environment:r.environment},params:r.parameters?.map(e=>({name:e}))}}})}),xe.forEach(({binding:e,certificate_id:t})=>{I.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Se.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)I.push({name:e,type:`pipelines`,stream:t});else if(n)I.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),Ce.forEach(({binding:e,stream:t})=>{I.push({name:e,type:`k2`,stream:t})}),we.forEach(({binding:e})=>{I.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{I.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{I.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`}))}),H!==void 0&&I.push({name:H.binding,type:`browser`,raw:H.raw}),U!==void 0&&I.push({name:U.binding,type:`analytics`}),W!==void 0&&I.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&I.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&I.push({name:K.binding,type:`stream`}),q!==void 0&&I.push({name:q.binding,type:`media`}),J!==void 0&&I.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&I.push({name:Y.binding,type:`assets`}),De.forEach(({binding:e,source:t})=>{I.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`})))}),Oe.forEach(({binding:e,source:t})=>{I.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(r(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;I.push({name:e,type:t.slice(7),...r})}let X=`__STATIC_CONTENT_MANIFEST`;if(F?.some(({name:e})=>e===X)&&u.type===`esm`){d(F!==void 0);let e=new Set(F.map(e=>l.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=l.posix.relative(t,X),n=l.posix.join(t,X);F.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(u.type===`commonjs`){for(let e of Object.values([...F||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),F=F?.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,`_`);I.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`})),F=F?.filter(t=>t!==e)}}let Z;if(n?.unsafe?.capnp){let e=k(n.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;v&&(Q??=[],Q.push(`plain_text`,`json`)),y&&(Q??=[],Q.push(`secret_text`,`secret_key`)),b&&(Q??=[],Q.push(...b));let $={...u.type===`commonjs`?{body_part:u.name}:{main_module:u.name},bindings:I,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}})),...g&&{compatibility_date:g},..._&&{compatibility_flags:_},...p&&{migrations:p},...m&&{code_update_strategy:m},...h&&Object.keys(h).length>0&&{exports:h},capnp_schema:Z,...Q&&{keep_bindings:Q},...x!==void 0&&{logpush:x},...S&&{placement:S},...C&&{tail_consumers:C},...w&&{streaming_tail_consumers:w},...T&&{limits:T},...E&&{annotations:E},...D!==void 0&&{keep_assets:D},...O&&{assets:{jwt:O.jwt,config:P}},...A&&{observability:A},...M&&{cache_options:M},...N?.length&&{package_dependencies:N}};if(n?.unsafe?.metadata!==void 0)for(let e of Object.keys(n.unsafe.metadata))$[e]=n.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),u.type===`commonjs`&&F&&F.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[u].concat(F||[]))s.set(e.name,new File([e.content],e.name,{type:j(e.type??u.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}b(N,`createWorkerUploadForm`);export{C as a,T as c,S as i,M as n,b as o,A as r,x as s,N as t};
2
+ import{n as e,r as t}from"./source-mXUcrTVw.mjs";import{V as n,j as r,m as i}from"./dist-DZRTPMMA.mjs";import{N as a,r as o}from"./chunk-2HLTAS5V-D7COzUOd.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l,{resolve as u}from"node:path";import d from"node:assert";import{spawnSync as f}from"node:child_process";const p=s(import.meta.url||(typeof __filename==`string`?__filename:`/`));var m=Object.create,h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>h(e,`name`,{value:t,configurable:!0}),x=/* @__PURE__ */ (e=>p===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(p===void 0?e:p)[t]}):e:p)(function(e){if(p!==void 0)return p.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),S=(e,t)=>function(){return t||(0,e[_(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of _(t))!y.call(e,i)&&i!==n&&h(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e},T=(e,t,n)=>(n=e==null?{}:m(v(e)),w(t||!e||!e.__esModule?h(n,`default`,{value:e,enumerable:!0}):n,e)),E=/* @__PURE__ */ e(((e,n)=>{var r=t(`child_process`).exec,i=t(`child_process`).execSync,a=t(`fs`),o=t(`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)}})),D=/* @__PURE__ */ e(((e,t)=>{t.exports=E()})),ee=n(),O=D();s(import.meta.url||(typeof __filename==`string`?__filename:`/`));function k(e){if(e.compiled_schema)return c(u(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>u(t,e));if(!(0,O.sync)(`capnp`))throw new a(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=u(t??`.`),o=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${i}`,...r],{maxBuffer:3145728});if(o.error)throw o.error;if(o.stderr.length)throw Error(o.stderr.toString());return o.stdout}b(k,`handleUnsafeCapnp`);var A={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 j(e){let t=A[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}b(j,`toMimeType`);function M(e){let t=Object.keys(A).find(t=>A[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}b(M,`fromMimeType`);function N(e,t,n){let s=new ee.FormData,{main:u,sourceMaps:f,migrations:p,code_update_strategy:m,exports:h,compatibility_date:g,compatibility_flags:_,keepVars:v,keepSecrets:y,keepBindings:b,logpush:x,placement:S,tail_consumers:C,streaming_tail_consumers:w,limits:T,annotations:E,keep_assets:D,assets:O,observability:A,cache:M,package_dependencies:N}=e,P={html_handling:O?.assetConfig?.html_handling,not_found_handling:O?.assetConfig?.not_found_handling,base_path:O?.assetConfig?.base_path,run_worker_first:O?.run_worker_first,_redirects:O?._redirects,_headers:O?._headers};if(O&&!O.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:O.jwt,config:P},...E&&{annotations:E},...g&&{compatibility_date:g},..._&&{compatibility_flags:_}})),s;let{modules:F}=e,I=[],te=i(`plain_text`,t),ne=i(`json`,t),re=i(`secret_text`,t),ie=i(`kv_namespace`,t),ae=i(`send_email`,t),oe=i(`durable_object_namespace`,t),se=i(`workflow`,t),ce=i(`queue`,t),le=i(`r2_bucket`,t),ue=i(`d1`,t),de=i(`vectorize`,t),fe=i(`ai_search_namespace`,t),pe=i(`ai_search`,t),L=i(`agent_memory`,t),R=i(`hyperdrive`,t),z=i(`secrets_store_secret`,t),B=i(`artifacts`,t),me=i(`unsafe_hello_world`,t),he=i(`flagship`,t),ge=i(`ratelimit`,t),_e=i(`vpc_service`,t),ve=i(`vpc_network`,t),V=i(`service`,t),ye=i(`analytics_engine`,t),be=i(`dispatch_namespace`,t),xe=i(`mtls_certificate`,t),Se=i(`pipeline`,t),Ce=i(`k2`,t),we=i(`worker_loader`,t),Te=i(`logfwdr`,t),Ee=i(`wasm_module`,t),H=i(`browser`,t)[0],U=i(`analytics`,t)[0],W=i(`ai`,t)[0],G=i(`images`,t)[0],K=i(`stream`,t)[0],q=i(`media`,t)[0],J=i(`version_metadata`,t)[0],Y=i(`assets`,t)[0],De=i(`text_blob`,t),Oe=i(`data_blob`,t);i(`inherit`,t).forEach(({binding:e})=>{I.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{I.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{I.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{I.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:r})=>{if(n?.dryRun&&(e??=o),e===void 0)throw new a(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===o?I.push({name:t,type:`inherit`}):I.push({name:t,type:`kv_namespace`,namespace_id:e,raw:r})}),ae.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?I.push(t):I.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):I.push({...t,destination_address:e.destination_address})}),oe.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{I.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),se.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{I.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ce.forEach(({binding:e,queue_name:t,delivery_delay:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({type:`queue`,name:e,queue_name:t,delivery_delay:r,raw:i})}),le.forEach(({binding:e,bucket_name:t,jurisdiction:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:r,raw:i})}),ue.forEach(({binding:e,database_id:t,database_internal_env:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`d1`,id:t,internalEnv:r,raw:i})}),de.forEach(({binding:e,index_name:t,raw:n})=>{I.push({name:e,type:`vectorize`,index_name:t,raw:n})}),fe.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`ai_search_namespace`,namespace:t})}),pe.forEach(({binding:e,instance_name:t})=>{I.push({name:e,type:`ai_search`,instance_name:t})}),L.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`agent_memory`,namespace:t})}),R.forEach(({binding:e,id:t})=>{I.push({name:e,type:`hyperdrive`,id:t})}),z.forEach(({binding:e,store_id:t,secret_name:n})=>{I.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),B.forEach(({binding:e,namespace:t})=>{I.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{I.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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`});I.push(t===o?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{I.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{I.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{I.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),V.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{I.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),ye.forEach(({binding:e,dataset:t})=>{I.push({name:e,type:`analytics_engine`,dataset:t})}),be.forEach(({binding:e,namespace:t,outbound:r})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`dispatch_namespace`,namespace:t,...r&&{outbound:{worker:{service:r.service,environment:r.environment},params:r.parameters?.map(e=>({name:e}))}}})}),xe.forEach(({binding:e,certificate_id:t})=>{I.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Se.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)I.push({name:e,type:`pipelines`,stream:t});else if(n)I.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),Ce.forEach(({binding:e,stream:t})=>{I.push({name:e,type:`k2`,stream:t})}),we.forEach(({binding:e})=>{I.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{I.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{I.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`}))}),H!==void 0&&I.push({name:H.binding,type:`browser`,raw:H.raw}),U!==void 0&&I.push({name:U.binding,type:`analytics`}),W!==void 0&&I.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&I.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&I.push({name:K.binding,type:`stream`}),q!==void 0&&I.push({name:q.binding,type:`media`}),J!==void 0&&I.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&I.push({name:Y.binding,type:`assets`}),De.forEach(({binding:e,source:t})=>{I.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`})))}),Oe.forEach(({binding:e,source:t})=>{I.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(r(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;I.push({name:e,type:t.slice(7),...r})}let X=`__STATIC_CONTENT_MANIFEST`;if(F?.some(({name:e})=>e===X)&&u.type===`esm`){d(F!==void 0);let e=new Set(F.map(e=>l.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=l.posix.relative(t,X),n=l.posix.join(t,X);F.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(u.type===`commonjs`){for(let e of Object.values([...F||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),F=F?.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,`_`);I.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`})),F=F?.filter(t=>t!==e)}}let Z;if(n?.unsafe?.capnp){let e=k(n.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;v&&(Q??=[],Q.push(`plain_text`,`json`)),y&&(Q??=[],Q.push(`secret_text`,`secret_key`)),b&&(Q??=[],Q.push(...b));let $={...u.type===`commonjs`?{body_part:u.name}:{main_module:u.name},bindings:I,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}})),...g&&{compatibility_date:g},..._&&{compatibility_flags:_},...p&&{migrations:p},...m&&{code_update_strategy:m},...h&&Object.keys(h).length>0&&{exports:h},capnp_schema:Z,...Q&&{keep_bindings:Q},...x!==void 0&&{logpush:x},...S&&{placement:S},...C&&{tail_consumers:C},...w&&{streaming_tail_consumers:w},...T&&{limits:T},...E&&{annotations:E},...D!==void 0&&{keep_assets:D},...O&&{assets:{jwt:O.jwt,config:P}},...A&&{observability:A},...M&&{cache_options:M},...N?.length&&{package_dependencies:N}};if(n?.unsafe?.metadata!==void 0)for(let e of Object.keys(n.unsafe.metadata))$[e]=n.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),u.type===`commonjs`&&F&&F.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[u].concat(F||[]))s.set(e.name,new File([e.content],e.name,{type:j(e.type??u.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}b(N,`createWorkerUploadForm`);export{C as a,T as c,S as i,M as n,b as o,A as r,x as s,N as t};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{n as e,t}from"./metadata-Df5kCWJv.mjs";import{r as n}from"./theme-CQ_TYifs.mjs";import{t as r}from"./cli-exit-CstFZ1eJ.mjs";import"./ui-YmjF66Ct.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{a,f as o,m as s,t as c,u as l}from"./run-BvHwWWUX.mjs";import u from"minisearch";function d({enabled:e,source:t}){let r=e?n.success(`Enabled`):n.error(`Disabled`),i=l(t);return`Status: ${r}${i?` (set by ${i})`:``}\n`}const f={command:`disable`,describe:`Disable cf telemetry collection`,handler:()=>{s(!1);let{enabled:e,source:t}=o();console.log(d({enabled:e,source:t})),console.log(e?`cf is collecting usage telemetry because ${l(t)}=true overrides this setting.\n`:`cf is no longer collecting usage telemetry.
2
+ import{n as e,t}from"./metadata-Df5kCWJv.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{t as r}from"./cli-exit-CstFZ1eJ.mjs";import"./ui-BtIBQeaG.mjs";import{t as i}from"./output-Co4xdFf6.mjs";import{a,f as o,m as s,t as c,u as l}from"./run-DASYqJsY.mjs";import u from"minisearch";function d({enabled:e,source:t}){let r=e?n.success(`Enabled`):n.error(`Disabled`),i=l(t);return`Status: ${r}${i?` (set by ${i})`:``}\n`}const f={command:`disable`,describe:`Disable cf telemetry collection`,handler:()=>{s(!1);let{enabled:e,source:t}=o();console.log(d({enabled:e,source:t})),console.log(e?`cf is collecting usage telemetry because ${l(t)}=true overrides this setting.\n`:`cf is no longer collecting usage telemetry.
3
3
  `)}},p={command:`enable`,describe:`Enable cf telemetry collection`,handler:()=>{s(!0);let{enabled:e,source:t}=o();console.log(d({enabled:e,source:t})),console.log(e?`cf is now collecting anonymous usage telemetry. Thank you for helping make cf better.
4
4
  `:`cf is not collecting usage telemetry because ${l(t)}${t===`env`||t===`wrangler-env`?`=false`:``} overrides this setting.\n`)}},m={command:`status`,describe:`Check whether cf telemetry collection is enabled`,handler:()=>{console.log(d(o())),console.log(n.muted(`Configure on this machine: \`cf cli telemetry enable\` / \`cf cli telemetry disable\`.
5
5
  Override per invocation with ${a}=true/false. DO_NOT_TRACK is also honored.\nLearn more: https://github.com/cloudflare/cf/blob/main/packages/cli/telemetry.md`))}},h={command:`telemetry`,describe:`Configure whether cf collects anonymous usage telemetry`,builder:e=>e.command(m).command(p).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e,t){let n=e.fullPath.slice(0,-1).map((t,n)=>e.fullPath.slice(0,n+1).join(` `));return{command:e.command,summary:e.summary||e.description.split(`
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-C6u9qIGO.mjs";import{i as n}from"./context-A6T-NKPI.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-D5po7ScB.mjs";import{t as o}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as s,t as c}from"./body-parser-DkHKPkJ7.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{a as u,n as d}from"./prompt-BAJpE3jV.mjs";var f={method:`POST`,path:t=>e`/zones/${t.zone_id}/client_certificates`,body:`json`};function p(e){return e.usage(`$0 client-certificates create
3
+
4
+ Create a new API Shield mTLS Client Certificate.`).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 m={command:`create`,describe:`Create Client Certificate`,builder:p,handler:async e=>o({command:`client-certificates create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({csr:l(e.csr,`csr`,`text`),validity_days:e[`validity-days`]}):s(e.body)});return}let o=await t(e),d=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=s(e.body),n=await a(`Creating`,async()=>o.send(f,{body:t,zone_id:d}));r(n,{successLabel:`Created`});return}if(e.csr===void 0&&(e.csr=await u(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),e[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let p=c({csr:l(e.csr,`csr`,`text`),validity_days:e[`validity-days`]}),m=await a(`Creating`,async()=>o.send(f,{body:p,zone_id:d}));r(m,{successLabel:`Created`})})};var h={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/client_certificates/${t.client_certificate_id}`};function g(e){return e.usage(`$0 client-certificates delete <client-certificate-id>
5
+
6
+ Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`).positional(`client-certificate-id`,{type:`string`,description:`Client Certificate Tag`,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 <client-certificate-id>`,describe:`Revoke Client Certificate`,builder:g,handler:async e=>o({command:`client-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf client-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates/${e[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(e[`client-certificate-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"client-certificate-id":String(e[`client-certificate-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await d({force:!!e.force})){process.stderr.write(`Aborted.
7
+ `);return}let c=await a(`Deleting`,async()=>o.send(h,{zone_id:s,client_certificate_id:e[`client-certificate-id`]}));r(c,{successLabel:`Deleted`})})};var v={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/client_certificates/${t.client_certificate_id}`,body:`json`};function y(e){return e.usage(`$0 client-certificates edit <client-certificate-id>
8
+
9
+ If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint.`).positional(`client-certificate-id`,{type:`string`,description:`Client Certificate Tag`,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 b={command:`edit <client-certificate-id>`,describe:`Reactivate Client Certificate`,builder:y,handler:async e=>o({command:`client-certificates edit`,classification:{safeFlags:[`reactivate`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf client-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates/${e[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(e[`client-certificate-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"client-certificate-id":String(e[`client-certificate-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({reactivate:e.reactivate}):s(e.body)});return}let o=await t(e),l=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(v,{body:t,zone_id:l,client_certificate_id:e[`client-certificate-id`]}));r(n,{successLabel:`Updated`});return}let u=c({reactivate:e.reactivate}),d=await a(`Updating`,async()=>o.send(v,{body:u,zone_id:l,client_certificate_id:e[`client-certificate-id`]}));r(d,{successLabel:`Updated`})})};var x={method:`GET`,path:t=>e`/zones/${t.zone_id}/client_certificates/${t.client_certificate_id}`};function S(e){return e.usage(`$0 client-certificates get <client-certificate-id>
10
+
11
+ Get Details for a single mTLS API Shield Client Certificate.`).positional(`client-certificate-id`,{type:`string`,description:`Client Certificate Tag`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <client-certificate-id>`,describe:`Client Certificate Details`,builder:S,handler:async e=>o({command:`client-certificates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf client-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates/${e[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(e[`client-certificate-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"client-certificate-id":String(e[`client-certificate-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(x,{zone_id:s,client_certificate_id:e[`client-certificate-id`]}));r(c,{successLabel:`Loaded`})})};var w={method:`GET`,path:t=>e`/zones/${t.zone_id}/client_certificates`,query:[`status`,`page`,`per_page`,`limit`,`offset`]};function T(e){return e.usage(`$0 client-certificates list
12
+
13
+ List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination.`).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 E={command:`list`,describe:`List Client Certificates`,builder:T,handler:async e=>o({command:`client-certificates list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let o={status:e.status,page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){i({command:`cf client-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(e),c=await n({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c;let l=await a(`Loading`,async()=>s.send(w,{zone_id:c,...o}));r(l,{successLabel:`Loaded`})})},D={command:`client-certificates`,describe:`client-certificates`,builder:e=>e.command(m).command(_).command(b).command(C).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};