cf 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +63 -62
- package/dist/_meta/commands.json +12365 -9690
- package/dist/_meta/schemas.json +19206 -15404
- package/dist/abuse-reports-dMIfUJ8v.mjs +8 -0
- package/dist/accounts-Kx1epdA1.mjs +22 -0
- package/dist/acm-Utu252kC.mjs +3 -0
- package/dist/addressing-CBq7Z7Vq.mjs +12 -0
- package/dist/{agent-context-D26woB9J.mjs → agent-context-BGTU299M.mjs} +1 -1
- package/dist/ai-DOOKLPkG.mjs +2 -0
- package/dist/ai-gateway-Cj1T3avF.mjs +8 -0
- package/dist/ai-search-CQF_Sn7d.mjs +7 -0
- package/dist/ai_gateway-C3fH22C0.mjs +4 -0
- package/dist/alerting-CqmEIaKn.mjs +6 -0
- package/dist/analytics-Dv-X8x7D.mjs +20 -0
- package/dist/analytics_engine-DdXVR8z2.mjs +2 -0
- package/dist/api-gateway-CNv0IHTU.mjs +33 -0
- package/dist/argo-CX_A4kcn.mjs +2 -0
- package/dist/audit-logs-BfBf3oo-.mjs +2 -0
- package/dist/auth-SyWhMmPu.mjs +6 -0
- package/dist/auth-ffdf9yR0.mjs +135 -0
- package/dist/autorag-BuGhGTeZ.mjs +2 -0
- package/dist/billing-PoG81XaQ.mjs +2 -0
- package/dist/body-parser-DKa8Ipg1.mjs +2 -0
- package/dist/bot-management-CFvtVx62.mjs +5 -0
- package/dist/botnet-feed-B-M4Yu0W.mjs +3 -0
- package/dist/brand-protection-D05Eg-_6.mjs +3 -0
- package/dist/browser-rendering-xu8F_Rrv.mjs +4 -0
- package/dist/{build-5jmmOZhm.mjs → build-DYkGW4dh.mjs} +1 -1
- package/dist/cache-DsoW6Xwv.mjs +5 -0
- package/dist/calls-CZbO7TyR.mjs +4 -0
- package/dist/certificate-authorities-D2yr7_3t.mjs +2 -0
- package/dist/cli-types-CRIDdDw3.mjs +2 -0
- package/dist/client-certificates-MJcDsTId.mjs +3 -0
- package/dist/cloud-connector-DWOrN2eM.mjs +2 -0
- package/dist/cloudforce-one-2Bhz8YdW.mjs +21 -0
- package/dist/{completions-BKrxcfhN.mjs → completions-BwRpZQVn.mjs} +1 -1
- package/dist/connectivity-BX8C7tvK.mjs +3 -0
- package/dist/content-scanning-r6uzMO1r.mjs +4 -0
- package/dist/context-DGlHRGWM.mjs +2 -0
- package/dist/custom-certificates-aAiEguR7.mjs +5 -0
- package/dist/custom-hostnames-AG5yBHIi.mjs +5 -0
- package/dist/custom-nameservers-D1DtlRue.mjs +3 -0
- package/dist/custom-pages-DQCi2plU.mjs +4 -0
- package/dist/d1-DbnYhw45.mjs +4 -0
- package/dist/data-security-D_EtYBfo.mjs +6 -0
- package/dist/dcv-delegation-CHspSzTI.mjs +2 -0
- package/dist/{deploy-DbkiIzUr.mjs → deploy-CQial3kN.mjs} +1 -1
- package/dist/{dev-C6iSuQZm.mjs → dev-B38LfCTl.mjs} +1 -1
- package/dist/diagnostics-BJQGjVJn.mjs +3 -0
- package/dist/dispatch-namespaces-DmHvoBOg.mjs +7 -0
- package/dist/{dist-CnSubA1Z.mjs → dist-AIcZFk0U.mjs} +7 -7
- package/dist/dns-VMhQSr5n.mjs +29 -0
- package/dist/dns-firewall-B4DVXFBQ.mjs +57 -0
- package/dist/durable-objects-CTboySEo.mjs +2 -0
- package/dist/email-routing-tIR2SFu-.mjs +10 -0
- package/dist/email-security-Ca1id3rZ.mjs +8 -0
- package/dist/email-sending-DwWKc5jC.mjs +3 -0
- package/dist/filters-A4dg_a68.mjs +4 -0
- package/dist/firewall-DWPQgYd9.mjs +11 -0
- package/dist/fraud-BMkSsJGU.mjs +20 -0
- package/dist/google-tag-gateway-BGD49nRC.mjs +2 -0
- package/dist/healthchecks-CtIfrFql.mjs +4 -0
- package/dist/hostnames-BiomxukN.mjs +3 -0
- package/dist/hyperdrive-Da104VaQ.mjs +18 -0
- package/dist/iam-BIGKo0WW.mjs +6 -0
- package/dist/images-BO8FbDAa.mjs +5 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-CY6_79v8.mjs +3 -0
- package/dist/{ips-B8fwxKZD.mjs → ips-K4bzaGqd.mjs} +1 -1
- package/dist/keyless-certificates-CZC-L8gM.mjs +3 -0
- package/dist/kv-8o27w_pY.mjs +5 -0
- package/dist/leaked-credential-checks-qLzRyu85.mjs +3 -0
- package/dist/load-balancers-DtG8nj25.mjs +6 -0
- package/dist/logpush-4L0njy1d.mjs +4 -0
- package/dist/logs-B_Yp95hv.mjs +3 -0
- package/dist/magic-cloud-networking-CSOM3EM-.mjs +5 -0
- package/dist/magic-network-monitoring-BnwvM4-I.mjs +4 -0
- package/dist/magic-transit-CXDyvhxq.mjs +90 -0
- package/dist/managed-transforms-D15yVbZx.mjs +3 -0
- package/dist/mtls-certificates-D8k0AXWK.mjs +3 -0
- package/dist/network-interconnects-rrr7red3.mjs +36 -0
- package/dist/observability-DWvpqnQJ.mjs +4 -0
- package/dist/organizations-T77D50Sq.mjs +41 -0
- package/dist/origin-ca-certificates-DXIvD8H5.mjs +3 -0
- package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +2 -0
- package/dist/origin-tls-client-auth-CaVW1Ztp.mjs +4 -0
- package/dist/output-BJFNwj7b.mjs +2 -0
- package/dist/page-rules-CjZPTMQX.mjs +18 -0
- package/dist/page-shield-D5RRNJCY.mjs +37 -0
- package/dist/pages-CWJtJnL0.mjs +11 -0
- package/dist/pipelines-B0L_7j9e.mjs +6 -0
- package/dist/{progress-CjcQ6ato.mjs → progress-CrCGTq7N.mjs} +1 -1
- package/dist/queues-CN6DPhRR.mjs +6 -0
- package/dist/r2-DQIcyRtA.mjs +21 -0
- package/dist/r2-data-catalog-Bbo93TJx.mjs +14 -0
- package/dist/radar-Bxb0WX8V.mjs +2 -0
- package/dist/rate-limits-DcrQV6Ar.mjs +5 -0
- package/dist/raw-fetch-Dlccg0Tr.mjs +2 -0
- package/dist/realtime-kit-CaquuVOE.mjs +18 -0
- package/dist/registrar-Ko-xZemf.mjs +46 -0
- package/dist/request-tracers-DOW_reTJ.mjs +2 -0
- package/dist/{resolve-BuJRWSk0.mjs → resolve-4-OSeHlK.mjs} +1 -1
- package/dist/resource-sharing-D7TX0JV0.mjs +5 -0
- package/dist/resource-tagging-C3qtLzCz.mjs +16 -0
- package/dist/rules-BXRADHL5.mjs +4 -0
- package/dist/rulesets-CBgpeSvJ.mjs +8 -0
- package/dist/rum-BjPptTUP.mjs +4 -0
- package/dist/{schema-CHBfkARI.mjs → schema-D16TgWBg.mjs} +1 -1
- package/dist/schema-validation-Dgv_opM3.mjs +24 -0
- package/dist/scim-DdSEr4kZ.mjs +3 -0
- package/dist/secrets-store-7BfyvJLb.mjs +25 -0
- package/dist/security-center-DAy6AKtT.mjs +2 -0
- package/dist/security-txt-xAMb7K6Y.mjs +3 -0
- package/dist/session-COHHdS7A.mjs +5 -0
- package/dist/{shared-DEzmTsEC.mjs → shared-AGtpXwwL.mjs} +1 -1
- package/dist/smart-shield-TeWZFnH2.mjs +3 -0
- package/dist/snippets-CCSsCXVs.mjs +4 -0
- package/dist/{spawn-13QQ0IwO.mjs → spawn-DcppKGI5.mjs} +1 -1
- package/dist/spectrum-CTTZID8u.mjs +63 -0
- package/dist/speed-CuzTE0AL.mjs +4 -0
- package/dist/{src-B9cKsgsg.mjs → src-BW6vfAwE.mjs} +10 -10
- package/dist/ssl-BWA2LdwC.mjs +15 -0
- package/dist/stream-GFsIZ-pP.mjs +14 -0
- package/dist/tenants-Bd7NGQ_m.mjs +2 -0
- package/dist/token-validation-DAgtFOvs.mjs +10 -0
- package/dist/{tools-B7QiNu-d.mjs → tools-DXQmfFuE.mjs} +1 -1
- package/dist/turnstile-cfdaO4ca.mjs +23 -0
- package/dist/{ui-BXjU1dX1.mjs → ui-D4KtlMh9.mjs} +1 -1
- package/dist/url-normalization-B5RN4nLD.mjs +3 -0
- package/dist/url-scanner-BrZ1L9OC.mjs +2 -0
- package/dist/user-CAo-yCJA.mjs +10 -0
- package/dist/vectorize-C7_oQlaI.mjs +4 -0
- package/dist/{versions-DzyrlUAi.mjs → versions-CUwWJWmy.mjs} +1 -1
- package/dist/waiting-rooms-Dln5ICg5.mjs +11 -0
- package/dist/web3-HQJRm38W.mjs +4 -0
- package/dist/workers-Dg7ddG2Q.mjs +18 -0
- package/dist/workers-builds-AVfx8IyL.mjs +7 -0
- package/dist/workflows-VquuSh2J.mjs +4 -0
- package/dist/zaraz-xYSWIV4P.mjs +2 -0
- package/dist/zero-trust-CP96wnSh.mjs +118 -0
- package/dist/zones-BSgmZ9WC.mjs +21 -0
- package/package.json +4 -3
- package/dist/abuse-reports-KtfZhi6j.mjs +0 -8
- package/dist/accounts-BopMfODC.mjs +0 -21
- package/dist/acm-BT4vlnEJ.mjs +0 -3
- package/dist/addressing-B3uFxHst.mjs +0 -13
- package/dist/ai-DWHqwMap.mjs +0 -2
- package/dist/ai-gateway-CbKEO-3o.mjs +0 -8
- package/dist/ai-search-VnOQ5n--.mjs +0 -7
- package/dist/alerting-BmmgIlIO.mjs +0 -6
- package/dist/analytics-isY03taL.mjs +0 -20
- package/dist/api-gateway-DXurEbA-.mjs +0 -33
- package/dist/argo-B02BL_hp.mjs +0 -2
- package/dist/audit-logs-DcgR9xUc.mjs +0 -2
- package/dist/auth-CQcAgnOy.mjs +0 -135
- package/dist/auth-DenWm_X0.mjs +0 -6
- package/dist/autorag-CmrwnGVj.mjs +0 -2
- package/dist/billing-CaW1ZAB1.mjs +0 -2
- package/dist/body-parser-Br-BoYk-.mjs +0 -2
- package/dist/bot-management-CeBsFx68.mjs +0 -5
- package/dist/botnet-feed-B396vQeQ.mjs +0 -3
- package/dist/brand-protection-D4V1v5Kl.mjs +0 -3
- package/dist/browser-rendering-GF7rNtKI.mjs +0 -4
- package/dist/builds-C_ySULja.mjs +0 -2
- package/dist/cache-DmXizSMi.mjs +0 -5
- package/dist/calls-x4KQpTB4.mjs +0 -4
- package/dist/certificate-authorities-hC0SG-Ga.mjs +0 -2
- package/dist/client-certificates-BGVsDyeJ.mjs +0 -3
- package/dist/cloud-connector-BClQpEzI.mjs +0 -2
- package/dist/cloudforce-one-BfhFrO6M.mjs +0 -21
- package/dist/connectivity-G0NP6LtW.mjs +0 -3
- package/dist/content-scanning-DEtPJ7aF.mjs +0 -4
- package/dist/context-CC0Rhkhy.mjs +0 -2
- package/dist/custom-certificates-rJXFpUWu.mjs +0 -5
- package/dist/custom-hostnames-Be5mgLeF.mjs +0 -5
- package/dist/custom-nameservers-CoFdy6hD.mjs +0 -3
- package/dist/custom-pages-D-oErw57.mjs +0 -4
- package/dist/d1-C95ckPKI.mjs +0 -3
- package/dist/dcv-delegation-CWSkbGuc.mjs +0 -2
- package/dist/diagnostics-DEEhPnXj.mjs +0 -3
- package/dist/dispatch-namespaces-BzXeV7PH.mjs +0 -7
- package/dist/dns-firewall-BQXD_NxG.mjs +0 -57
- package/dist/dns-qW-3TZOT.mjs +0 -29
- package/dist/durable-objects-CgWFYEJJ.mjs +0 -2
- package/dist/email-routing-tdNJaCpJ.mjs +0 -10
- package/dist/email-security-DTVHNr2h.mjs +0 -60
- package/dist/email-sending-DsFTvE31.mjs +0 -3
- package/dist/filters-DO1Is_tI.mjs +0 -4
- package/dist/firewall-DbUhVTCg.mjs +0 -11
- package/dist/fraud-Bzr4njYb.mjs +0 -8
- package/dist/google-tag-gateway-BQxkA90M.mjs +0 -2
- package/dist/healthchecks-BBAs-lS_.mjs +0 -4
- package/dist/hostnames-Dz9PEUKS.mjs +0 -3
- package/dist/hyperdrive-B1iUJddG.mjs +0 -18
- package/dist/iam-CJM8gHpG.mjs +0 -6
- package/dist/images-DEoBmtFS.mjs +0 -5
- package/dist/intel-BM6xkZ0C.mjs +0 -3
- package/dist/keyless-certificates-DffYnd4b.mjs +0 -3
- package/dist/kv-BTceLtWZ.mjs +0 -5
- package/dist/leaked-credential-checks-CALfvoCo.mjs +0 -3
- package/dist/load-balancers-C1Ho1gCF.mjs +0 -6
- package/dist/logpush-CSYhgevA.mjs +0 -4
- package/dist/logs-DlIwmMpt.mjs +0 -3
- package/dist/magic-cloud-networking-Czu0pZ0a.mjs +0 -5
- package/dist/magic-network-monitoring-d7GJE5Yt.mjs +0 -4
- package/dist/magic-transit-qQmA-981.mjs +0 -89
- package/dist/managed-transforms-Dd6AnbWE.mjs +0 -3
- package/dist/mtls-certificates-C0rlCRGs.mjs +0 -3
- package/dist/network-interconnects-CxG2deY0.mjs +0 -36
- package/dist/organizations-DyEAiGiR.mjs +0 -41
- package/dist/origin-ca-certificates-S8RcoMF6.mjs +0 -3
- package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +0 -2
- package/dist/origin-tls-client-auth-BlxMmQrE.mjs +0 -5
- package/dist/output-D7_yAFVR.mjs +0 -2
- package/dist/page-rules-DP-w6TAm.mjs +0 -18
- package/dist/page-shield-Bf7kFp8c.mjs +0 -37
- package/dist/pages-D0Y_XRqW.mjs +0 -10
- package/dist/pipelines-C-SPESAk.mjs +0 -6
- package/dist/queues-wv6CZsi8.mjs +0 -6
- package/dist/r2-DuXjp9n5.mjs +0 -21
- package/dist/r2-data-catalog-DQCMrmNO.mjs +0 -14
- package/dist/radar-BW_ZHP8X.mjs +0 -2
- package/dist/rate-limits-DLTkIvwr.mjs +0 -5
- package/dist/raw-fetch-hRv-6P3D.mjs +0 -2
- package/dist/realtime-kit-Ch7Vg3vj.mjs +0 -6
- package/dist/registrar-DIIv6fWd.mjs +0 -46
- package/dist/request-tracers-DMej0Drs.mjs +0 -2
- package/dist/resource-sharing-CYJ7cMWq.mjs +0 -5
- package/dist/resource-tagging-Dnz65MgH.mjs +0 -16
- package/dist/rules-DLJpOYbC.mjs +0 -4
- package/dist/rulesets-D9nqEJT5.mjs +0 -8
- package/dist/rum-DBVmdPkp.mjs +0 -4
- package/dist/schema-validation-MCd3xdtX.mjs +0 -4
- package/dist/scim-DZA3VXog.mjs +0 -3
- package/dist/scm-CilfPOue.mjs +0 -2
- package/dist/secrets-store-BrvcZSOM.mjs +0 -21
- package/dist/security-center-BU6f3Cm1.mjs +0 -2
- package/dist/security-txt-BPIbP3dG.mjs +0 -3
- package/dist/session-H7IV2BrM.mjs +0 -2
- package/dist/smart-shield-e8XFBkiF.mjs +0 -3
- package/dist/snippets-B4M3MMb8.mjs +0 -4
- package/dist/spectrum-B0adfSRI.mjs +0 -59
- package/dist/speed-BVcUtkAz.mjs +0 -4
- package/dist/ssl-BAa91gsc.mjs +0 -15
- package/dist/stream-D53sxKb3.mjs +0 -14
- package/dist/tenants-bH5pt3dJ.mjs +0 -2
- package/dist/token-validation-M61Vx_Tw.mjs +0 -4
- package/dist/turnstile-wAU0Gc2Z.mjs +0 -23
- package/dist/url-normalization-DZrWDgB5.mjs +0 -3
- package/dist/url-scanner-Zo49edNp.mjs +0 -2
- package/dist/user-DbXlVReB.mjs +0 -10
- package/dist/vectorize-CUnTM0DT.mjs +0 -4
- package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
- package/dist/waiting-rooms-BZW0X69-.mjs +0 -11
- package/dist/web3-DueyOQtx.mjs +0 -4
- package/dist/workers-builds-BM_aoeUR.mjs +0 -7
- package/dist/workers-nV_vBCfV.mjs +0 -16
- package/dist/workflows-CQITmo-s.mjs +0 -4
- package/dist/zaraz-DIbpF5Op.mjs +0 -2
- package/dist/zero-trust-CKp8j512.mjs +0 -119
- package/dist/zones-BZ5tZDbH.mjs +0 -28
- /package/dist/{metadata-DGdCpUxn.mjs → metadata-5VwHPW6C.mjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,_ as t,i as n,n as r}from"./auth-ffdf9yR0.mjs";import{t as i}from"./output-BJFNwj7b.mjs";import{n as a,t as o}from"./progress-CrCGTq7N.mjs";import{t as s}from"./local-VJaJ3BZ1.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Gets the current billing profile for the account.`,builder:c,handler:async n=>{if(n.dryRun){a({command:`cf billing profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t(c);n.accountId=l,i(await o(`Loading`,async()=>c.billing.profiles.get({account_id:l})),{successLabel:`Loaded`})}},u={command:`profiles`,describe:`Billing profile with payment method, address, and invoice preferences`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function d(e){return e.option(`from`,{type:`string`,description:`Start date for the usage query (ISO 8601).`}).option(`to`,{type:`string`,description:`End date for the usage query (ISO 8601).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`paygo`,describe:`Returns billable usage data for PayGo (self-serve) accounts. When no query parameters are provided, returns usage for the current billing period.`,builder:d,handler:async n=>{let c={from:n.from,to:n.to};if(n.dryRun){a({command:`cf billing usage paygo`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/paygo-usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t(l);n.accountId=u,i(await o(`Loading`,async()=>l.billing.usage.paygo({account_id:u,...c})),{successLabel:`Loaded`})}};function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`paygo_info`,describe:`Returns high-level usage information for the account, including coverage, and subscription metadata.`,builder:p,handler:async c=>{if(c.dryRun){a({command:`cf billing usage paygo_info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/paygo-usage-info`,pathParams:{},bodyKind:`none`});return}let l=await r(c),u=c.local?s:await t(l);c.accountId=u,i(await o(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/paygo-usage-info`)),{successLabel:`Loaded`})}},h={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`billing`,describe:`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,builder:e=>e.command(u).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{readFileSync as e}from"node:fs";import{resolve as t}from"node:path";function n(e,t,n){if(t.length===0)return;let r=e;for(let e=0;e<t.length-1;e++){let n=t[e]??``;(!r[n]||typeof r[n]!=`object`)&&(r[n]={}),r=r[n]}let i=t[t.length-1]??``;r[i]=n}function r(e){let t=e=>{if(Array.isArray(e)||typeof e!=`object`||!e)return e;let n=Object.entries(e).flatMap(([e,n])=>{let r=t(n);return r===void 0||typeof r==`object`&&r&&!Array.isArray(r)&&Object.keys(r).length===0?[]:[[e,r]]});return Object.fromEntries(n)};return t(e)}function i(n){let r=n;if(n.startsWith(`@`)){let i=n.slice(1);if(i.length===0)throw Error(`--body '@' must be followed by a file path (got empty path)`);let a=t(i);try{r=e(a,`utf-8`)}catch(e){let t=e instanceof Error?e.message:`unknown read error`;throw Error(`--body: cannot read file at '${i}': ${t}`)}}try{return JSON.parse(r)}catch{throw Error(`Invalid JSON in --body. Expected valid JSON.`)}}export{i as n,n as r,r as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,E as t,S as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`Wirefilter expression describing the traffic being reported.`}).option(`first-request-seen-at`,{type:`string`,description:`The first_request_seen_at field`}).option(`last-request-seen-at`,{type:`string`,description:`The last_request_seen_at field`}).option(`requests`,{type:`number`,description:`The requests field`}).option(`subtype`,{type:`string`,description:`The subtype field`}).option(`type`,{type:`string`,description:`Type of feedback report.`,choices:[`false_positive`,`false_negative`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:"Submit a feedback report for the specified zone. Use `type` to indicate whether the report is a false positive (good traffic flagged as bot) or a false negative (bot traffic missed). Furthermore, you can also use `expression` as a wirefilter to identify the affected traffic sample. See more accepted API fields and expression types at https://developers.cloudflare.com/bots/concepts/feedback-loop/#api-fields and https://developers.cloudflare.com/bots/concepts/feedback-loop/#expression-fields, respectively.",builder:u,handler:async u=>{if(u.dryRun){s({command:`cf bot-management feedback create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?a({description:l(u.description,`description`,`text`),expression:l(u.expression,`expression`,`text`),first_request_seen_at:l(u[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:l(u[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:u.requests,subtype:l(u.subtype,`subtype`,`text`),type:l(u.type,`type`,`text`)}):i(u.body)});return}let d=await r(u),f=await n({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=i(u.body);o(await c(`Creating`,async()=>d.botManagement.feedback.create({body:e,zone_id:f})),{successLabel:`Created`});return}if(u.description===void 0&&(u.description=await e(`description`,`The description field`)),u.expression===void 0&&(u.expression=await e(`expression`,`Wirefilter expression describing the traffic being reported.`)),u[`first-request-seen-at`]===void 0&&(u[`first-request-seen-at`]=await e(`first-request-seen-at`,`The first_request_seen_at field`)),u[`last-request-seen-at`]===void 0&&(u[`last-request-seen-at`]=await e(`last-request-seen-at`,`The last_request_seen_at field`)),u.requests===void 0)throw Error(`--requests is required (or pass --body with this field set).`);u.type===void 0&&(u.type=await t(`type`,`Type of feedback report.`,[`false_positive`,`false_negative`]));let p=a({description:l(u.description,`description`,`text`),expression:l(u.expression,`expression`,`text`),first_request_seen_at:l(u[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:l(u[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:u.requests,subtype:l(u.subtype,`subtype`,`text`),type:l(u.type,`type`,`text`)});o(await c(`Creating`,async()=>d.botManagement.feedback.create({body:p,zone_id:f})),{successLabel:`Created`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`Returns all feedback reports previously submitted for the specified zone. Feedback reports help improve detection by sharing samples of traffic that were misclassified as bots or humans.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf bot-management feedback list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.botManagement.feedback.list({zone_id:i})),{successLabel:`Loaded`})}},m={command:`feedback`,describe:`Feedback operations`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve a zone's Bot Management Config`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf bot-management get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.botManagement.get({zone_id:i})),{successLabel:`Loaded`})}};function _(e){return e.option(`ai-bots-protection`,{type:`string`,description:`Enable rule to block AI Scrapers and Crawlers.`,choices:[`block`,`disabled`,`only_on_ad_pages`]}).option(`cf-robots-variant`,{type:`string`,description:`Specifies the Robots Access Control License variant to use.`,choices:[`off`,`policy_only`]}).option(`content-bots-protection`,{type:`string`,description:`Enable rule to block content bots. When enabled, blocks automated traffic with low bot scores, excluding safe verified bot categories. Exceptions should be managed via skip rules.`,choices:[`block`,`disabled`]}).option(`crawler-protection`,{type:`string`,description:`Enable rule to punish AI Scrapers and Crawlers via a link maze.`,choices:[`enabled`,`disabled`]}).option(`enable-js`,{type:`boolean`,description:`Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).`}).option(`is-robots-txt-managed`,{type:`boolean`,description:`Enable cloudflare managed robots.txt. If an existing robots.txt is detected, then managed robots.txt will be prepended to the existing robots.txt.`}).option(`fight-mode`,{type:`boolean`,description:`Whether to enable Bot Fight Mode.`}).option(`stale-zone-configuration-optimize-wordpress`,{type:`boolean`,description:`Indicates that the zone's wordpress optimization for SBFM is turned on.`}).option(`stale-zone-configuration-sbfm-definitely-automated`,{type:`string`,description:`Indicates that the zone's definitely automated requests are being blocked or challenged.`}).option(`stale-zone-configuration-sbfm-likely-automated`,{type:`string`,description:`Indicates that the zone's likely automated requests are being blocked or challenged.`}).option(`stale-zone-configuration-sbfm-static-resource-protection`,{type:`string`,description:`Indicates that the zone's static resource protection is turned on.`}).option(`stale-zone-configuration-sbfm-verified-bots`,{type:`string`,description:`Indicates that the zone's verified bot requests are being blocked.`}).option(`stale-zone-configuration-suppress-session-score`,{type:`boolean`,description:`Indicates that the zone's session score tracking is disabled.`}).option(`stale-zone-configuration-fight-mode`,{type:`boolean`,description:`Indicates that the zone's Bot Fight Mode is turned on.`}).option(`optimize-wordpress`,{type:`boolean`,description:`Whether to optimize Super Bot Fight Mode protections for Wordpress.`}).option(`sbfm-definitely-automated`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on definitely automated requests.`,choices:[`allow`,`block`,`managed_challenge`]}).option(`sbfm-static-resource-protection`,{type:`boolean`,description:`Super Bot Fight Mode (SBFM) to enable static resource protection.
|
|
3
|
+
Enable if static resources on your application need bot protection.
|
|
4
|
+
Note: Static resource protection can also result in legitimate traffic being blocked.
|
|
5
|
+
`}).option(`sbfm-verified-bots`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on verified bots requests.`,choices:[`allow`,`block`]}).option(`sbfm-likely-automated`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on likely automated requests.`,choices:[`allow`,`block`,`managed_challenge`]}).option(`auto-update-model`,{type:`boolean`,description:`Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)`}).option(`bm-cookie-enabled`,{type:`boolean`,description:`Indicates that the bot management cookie can be placed on end user devices accessing the site. Defaults to true`}).option(`suppress-session-score`,{type:`boolean`,description:`Whether to disable tracking the highest bot score for a session in the Bot Management cookie.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update`,describe:'Updates the Bot Management configuration for a zone. This API is used to update: - **Bot Fight Mode** - **Super Bot Fight Mode** - **Bot Management for Enterprise** See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more information on the different plans \\ If you recently upgraded or downgraded your plan, refer to the following examples to clean up old configurations. Copy and paste the example body to remove old zone configurations based on your current plan. #### Clean up configuration for Bot Fight Mode plan ```json { "sbfm_likely_automated": "allow", "sbfm_definitely_automated": "allow", "sbfm_verified_bots": "allow", "sbfm_static_resource_protection": false, "optimize_wordpress": false, "suppress_session_score": false } ``` #### Clean up configuration for SBFM Pro plan ```json { "sbfm_likely_automated": "allow", "fight_mode": false } ``` #### Clean up configuration for SBFM Biz plan ```json { "fight_mode": false } ``` #### Clean up configuration for BM Enterprise Subscription plan It is strongly recommended that you ensure you have [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to protect your zone before disabling the SBFM rules. Without these protections, your zone is vulnerable to attacks. ```json { "sbfm_likely_automated": "allow", "sbfm_definitely_automated": "allow", "sbfm_verified_bots": "allow", "sbfm_static_resource_protection": false, "optimize_wordpress": false, "fight_mode": false } ```',builder:_,handler:async e=>{if(e.dryRun){s({command:`cf bot-management update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({ai_bots_protection:l(e[`ai-bots-protection`],`ai-bots-protection`,`text`),cf_robots_variant:l(e[`cf-robots-variant`],`cf-robots-variant`,`text`),content_bots_protection:l(e[`content-bots-protection`],`content-bots-protection`,`text`),crawler_protection:l(e[`crawler-protection`],`crawler-protection`,`text`),enable_js:e[`enable-js`],is_robots_txt_managed:e[`is-robots-txt-managed`],fight_mode:e[`fight-mode`],stale_zone_configuration:{optimize_wordpress:e[`stale-zone-configuration-optimize-wordpress`],sbfm_definitely_automated:l(e[`stale-zone-configuration-sbfm-definitely-automated`],`stale-zone-configuration-sbfm-definitely-automated`,`text`),sbfm_likely_automated:l(e[`stale-zone-configuration-sbfm-likely-automated`],`stale-zone-configuration-sbfm-likely-automated`,`text`),sbfm_static_resource_protection:l(e[`stale-zone-configuration-sbfm-static-resource-protection`],`stale-zone-configuration-sbfm-static-resource-protection`,`text`),sbfm_verified_bots:l(e[`stale-zone-configuration-sbfm-verified-bots`],`stale-zone-configuration-sbfm-verified-bots`,`text`),suppress_session_score:e[`stale-zone-configuration-suppress-session-score`],fight_mode:e[`stale-zone-configuration-fight-mode`]},optimize_wordpress:e[`optimize-wordpress`],sbfm_definitely_automated:l(e[`sbfm-definitely-automated`],`sbfm-definitely-automated`,`text`),sbfm_static_resource_protection:e[`sbfm-static-resource-protection`],sbfm_verified_bots:l(e[`sbfm-verified-bots`],`sbfm-verified-bots`,`text`),sbfm_likely_automated:l(e[`sbfm-likely-automated`],`sbfm-likely-automated`,`text`),auto_update_model:e[`auto-update-model`],bm_cookie_enabled:e[`bm-cookie-enabled`],suppress_session_score:e[`suppress-session-score`]}):i(e.body)});return}let t=await r(e),u=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=u,e.body){let n=i(e.body);o(await c(`Updating`,async()=>t.botManagement.update({body:n,zone_id:u})),{successLabel:`Updated`});return}let d=a({ai_bots_protection:l(e[`ai-bots-protection`],`ai-bots-protection`,`text`),cf_robots_variant:l(e[`cf-robots-variant`],`cf-robots-variant`,`text`),content_bots_protection:l(e[`content-bots-protection`],`content-bots-protection`,`text`),crawler_protection:l(e[`crawler-protection`],`crawler-protection`,`text`),enable_js:e[`enable-js`],is_robots_txt_managed:e[`is-robots-txt-managed`],fight_mode:e[`fight-mode`],stale_zone_configuration:{optimize_wordpress:e[`stale-zone-configuration-optimize-wordpress`],sbfm_definitely_automated:l(e[`stale-zone-configuration-sbfm-definitely-automated`],`stale-zone-configuration-sbfm-definitely-automated`,`text`),sbfm_likely_automated:l(e[`stale-zone-configuration-sbfm-likely-automated`],`stale-zone-configuration-sbfm-likely-automated`,`text`),sbfm_static_resource_protection:l(e[`stale-zone-configuration-sbfm-static-resource-protection`],`stale-zone-configuration-sbfm-static-resource-protection`,`text`),sbfm_verified_bots:l(e[`stale-zone-configuration-sbfm-verified-bots`],`stale-zone-configuration-sbfm-verified-bots`,`text`),suppress_session_score:e[`stale-zone-configuration-suppress-session-score`],fight_mode:e[`stale-zone-configuration-fight-mode`]},optimize_wordpress:e[`optimize-wordpress`],sbfm_definitely_automated:l(e[`sbfm-definitely-automated`],`sbfm-definitely-automated`,`text`),sbfm_static_resource_protection:e[`sbfm-static-resource-protection`],sbfm_verified_bots:l(e[`sbfm-verified-bots`],`sbfm-verified-bots`,`text`),sbfm_likely_automated:l(e[`sbfm-likely-automated`],`sbfm-likely-automated`,`text`),auto_update_model:e[`auto-update-model`],bm_cookie_enabled:e[`bm-cookie-enabled`],suppress_session_score:e[`suppress-session-score`]});o(await c(`Updating`,async()=>t.botManagement.update({body:d,zone_id:u})),{successLabel:`Updated`})}},y={command:`bot-management`,describe:`Bot detection and mitigation settings — configure bot scores, JavaScript detections, and challenge behavior`,builder:e=>e.command(g).command(v).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{t as i}from"./output-BJFNwj7b.mjs";import{n as a,t as o}from"./progress-CrCGTq7N.mjs";import{t as s}from"./local-VJaJ3BZ1.mjs";import{t as c}from"./cli-types-CRIDdDw3.mjs";function l(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`date`,{type:`string`,description:`Date`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`day-report <asn-id>`,describe:`Gets all the data the botnet tracking database has for a given ASN registered to user account for given date. If no date is given, it will return results for the previous day.`,builder:c(l),handler:async t=>{let c={date:t.date};if(t.dryRun){a({command:`cf botnet-feed asn day-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/botnet_feed/asn/${t[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(t[`asn-id`]))}/day_report`,pathParams:{"asn-id":String(t[`asn-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(t),u=t.local?s:await n(l);t.accountId=u,i(await o(`Loading`,async()=>l.botnetFeed.asn.dayReport({account_id:u,asn_id:t[`asn-id`],...c})),{successLabel:`Loaded`})}};function d(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`full-report <asn-id>`,describe:`Gets all the data the botnet threat feed tracking database has for a given ASN registered to user account.`,builder:c(d),handler:async t=>{if(t.dryRun){a({command:`cf botnet-feed asn full-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/botnet_feed/asn/${t[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(t[`asn-id`]))}/full_report`,pathParams:{"asn-id":String(t[`asn-id`]??``)},bodyKind:`none`});return}let c=await r(t),l=t.local?s:await n(c);t.accountId=l,i(await o(`Loading`,async()=>c.botnetFeed.asn.fullReport({account_id:l,asn_id:t[`asn-id`]})),{successLabel:`Loaded`})}},p={command:`asn`,describe:`ASN-level botnet activity data showing networks with known C2 infrastructure`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <asn-id>`,describe:`Delete an ASN from botnet threat feed for a given user.`,builder:c(m),handler:async c=>{if(c.dryRun){a({command:`cf botnet-feed configs asn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/botnet_feed/configs/asn/${c[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(c[`asn-id`]))}`,pathParams:{"asn-id":String(c[`asn-id`]??``)},bodyKind:`none`});return}let l=await r(c),u=c.local?s:await n(l);if(c.accountId=u,!await t({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>l.botnetFeed.configs.asn.delete({account_id:u,asn_id:c[`asn-id`]})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API.`,builder:g,handler:async t=>{if(t.dryRun){a({command:`cf botnet-feed configs asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/botnet_feed/configs/asn`,pathParams:{},bodyKind:`none`});return}let c=await r(t),l=t.local?s:await n(c);t.accountId=l,i(await o(`Loading`,async()=>c.botnetFeed.configs.asn.get({account_id:l})),{successLabel:`Loaded`})}},v={command:`asn`,describe:`Botnet feed subscription configuration and notification preferences`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`configs`,describe:`Operations for configs`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`botnet-feed`,describe:`Botnet threat intelligence feeds — IP and ASN-level data on known command-and-control infrastructure`,builder:e=>e.command(p).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,D as t,T as n,_ as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";import{t as f}from"./cli-types-CRIDdDw3.mjs";function p(e){return e.option(`show-historic`,{type:`string`,description:`Include scanned images without domain metadata (historic data). Default: false (only show images with domain)`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score threshold for matches (0-1, default: 0)`,default:0}).option(`top-k`,{type:`number`,description:`Number of closest matches to return (1-100, default: 10)`,default:10}).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:`submit`,describe:`Submit an image and find the n closest matches from the scanned images index without creating any match records. Returns similarity scores and metadata for each match.`,builder:p,handler:async n=>{let f={showHistoric:n[`show-historic`],download:n.download};if(n.dryRun){c({command:`cf brand-protection submit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/search`,pathParams:{},query:f,bodyKind:`json`,body:n.body===void 0?o({image_data:u(n[`image-data`],`image-data`,`text`),score_threshold:n[`score-threshold`],top_k:n[`top-k`]}):a(n.body)});return}let p=await i(n),m=n.local?d:await r(p);if(n.accountId=m,n.body){let e=a(n.body);new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>p.brandProtection.submit({...e,account_id:m,...f})),{successLabel:`Created`});return}n[`image-data`]===void 0&&(n[`image-data`]=await t(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`));let h=o({image_data:u(n[`image-data`],`image-data`,`text`),score_threshold:n[`score-threshold`],top_k:n[`top-k`]});new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>p.brandProtection.submit({...h,account_id:m,...f})),{successLabel:`Created`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`url-info`,describe:`Get the total number of saved brand protection queries (domain + logo) for an account`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf brand-protection url-info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/total-queries`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.brandProtection.urlInfo({account_id:a})),{successLabel:`Loaded`})}};function _(e){return e.option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`query-id`,{type:`string`,description:`Query ID`,demandOption:!0}).option(`download`,{type:`string`,description:`Download`}).option(`order-by`,{type:`string`,description:`Column to sort by. Options: 'matchedAt', 'domain', 'similarityScore', or 'registrar'`,choices:[`matchedAt`,`domain`,`similarityScore`,`registrar`]}).option(`order`,{type:`string`,description:`Sort order. Options: 'asc' (ascending) or 'desc' (descending)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Get paginated list of logo matches for a specific brand protection logo query`,builder:f(_),handler:async t=>{let n={offset:t.offset,limit:t.limit,query_id:t[`query-id`],download:t.download,orderBy:t[`order-by`],order:t.order};if(t.dryRun){c({command:`cf brand-protection v2 logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/matches`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.brandProtection.v2.logoMatches.get({account_id:o,...n})),{successLabel:`Loaded`})}},y={command:`logo-matches`,describe:`Detected visual logo matches found on potentially infringing websites`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`search-lookback`,{type:`boolean`,description:`If true, search historic scanned images for matches above the similarity threshold`,default:!0}).option(`similarity-threshold`,{type:`number`,description:`Minimum similarity score (0-1) required for visual matches`}).option(`tag`,{type:`string`,description:`Unique identifier for the logo query`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Create a new saved brand protection logo query for visual similarity matching`,builder:b,handler:async n=>{if(n.dryRun){c({command:`cf brand-protection v2 logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({image_data:u(n[`image-data`],`image-data`,`text`),search_lookback:n[`search-lookback`],similarity_threshold:n[`similarity-threshold`],tag:u(n.tag,`tag`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.brandProtection.v2.logos.create({...e,account_id:p})),{successLabel:`Created`});return}if(n[`image-data`]===void 0&&(n[`image-data`]=await t(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`)),n[`similarity-threshold`]===void 0)throw Error(`--similarity-threshold is required (or pass --body with this field set).`);n.tag===void 0&&(n.tag=await t(`tag`,`Unique identifier for the logo query`));let m=o({image_data:u(n[`image-data`],`image-data`,`text`),search_lookback:n[`search-lookback`],similarity_threshold:n[`similarity-threshold`],tag:u(n.tag,`tag`,`text`)});s(await l(`Creating`,async()=>f.brandProtection.v2.logos.create({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.positional(`query-id`,{type:`string`,description:`Query ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <query-id>`,describe:`Delete a saved brand protection logo query. Returns 404 if the query ID doesn't exist.`,builder:S,handler:async t=>{if(t.dryRun){c({command:`cf brand-protection v2 logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}s(await l(`Deleting`,async()=>a.brandProtection.v2.logos.delete({account_id:o,query_id:t[`query-id`]})),{successLabel:`Deleted`})}};function w(e){return e.option(`id`,{type:`string`,description:`Optional query ID to retrieve a specific logo query`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Get all saved brand protection logo queries for an account. Optionally specify id to get a single query. Set download=true to include base64-encoded image data.`,builder:w,handler:async t=>{let n={id:t.id,download:t.download};if(t.dryRun){c({command:`cf brand-protection v2 logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.brandProtection.v2.logos.get({account_id:o,...n})),{successLabel:`Loaded`})}},E={command:`logos`,describe:`Brand monitoring queries that define search patterns for detecting brand abuse`,builder:e=>e.command(x).command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`query-id`,{type:`string`,description:`Query ID or comma-separated list of Query IDs. When multiple IDs are provided, matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and dismissed state.`,demandOption:!0}).option(`include-domain-id`,{type:`string`,description:`Include domain ID`}).option(`include-dismissed`,{type:`string`,description:`Include dismissed`}).option(`domain-search`,{type:`string`,description:`Filter matches by domain name (substring match)`}).option(`order-by`,{type:`string`,description:`Column to sort by. Options: 'domain', 'first_seen', or 'registrar'`,choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:`Sort order. Options: 'asc' (ascending) or 'desc' (descending)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Get paginated list of domain matches for one or more brand protection queries. When multiple query_ids are provided (comma-separated), matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and individual dismissed state.`,builder:f(D),handler:async t=>{let n={offset:t.offset,limit:t.limit,query_id:t[`query-id`],include_domain_id:t[`include-domain-id`],include_dismissed:t[`include-dismissed`],domain_search:t[`domain-search`],orderBy:t[`order-by`],order:t.order};if(t.dryRun){c({command:`cf brand-protection v2 matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.brandProtection.v2.matches.get({account_id:o,...n})),{successLabel:`Loaded`})}},k={command:`matches`,describe:`Detected brand abuse matches from monitoring queries with evidence downloads`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get`,describe:`Get all saved brand protection queries for an account`,builder:A,handler:async t=>{let n={id:t.id};if(t.dryRun){c({command:`cf brand-protection v2 queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.brandProtection.v2.queries.get({account_id:o,...n})),{successLabel:`Loaded`})}},M={command:`queries`,describe:`Brand monitoring queries that define search patterns for detecting brand abuse`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`v2`,describe:`Operations for v2`,builder:e=>e.command(y).command(E).command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`brand-protection`,describe:`Monitor the Internet for phishing sites, lookalike domains, and unauthorized use of your brand assets`,builder:e=>e.command(m).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,T as t,_ as n,i as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";import{t as u}from"./cli-types-CRIDdDw3.mjs";import{n as d,t as f}from"./raw-fetch-Dlccg0Tr.mjs";function p(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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:"Returns the page's accessibility tree. Use `interestingOnly` to only return semantically meaningful nodes; use `root` to scope the tree to a CSS-selector-anchored subtree. Control page loading with `gotoOptions` and `waitFor*` options.",builder:p,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering accessibilityTree create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/accessibilityTree`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.accessibilityTree.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/accessibilityTree`,{query:u})),{successLabel:`Created`})}},ee={command:`accessibilityTree`,describe:`Operations for accessibilityTree`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:"Fetches rendered HTML content from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.",builder:h,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering content create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/content`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.content.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/content`,{query:u})),{successLabel:`Created`})}},_={command:`content`,describe:`Render a page and return its full HTML content after JavaScript execution`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:"Starts a crawl job for the provided URL and its children. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.",builder:v,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering crawl create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/crawl`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.crawl.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/crawl`,{query:u})),{successLabel:`Created`})}};function b(e){return e.positional(`job-id`,{type:`string`,description:`The ID of the crawl job to cancel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <job-id>`,describe:`Cancels an ongoing crawl job by setting its status to cancelled and stopping all queued URLs.`,builder:b,handler:async r=>{if(r.dryRun){s({command:`cf browser-rendering crawl delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/crawl/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let a=await i(r),u=r.local?l:await n(a);if(r.accountId=u,!await t({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>a.browserRendering.crawl.delete({account_id:u,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`job-id`,{type:`string`,description:`Crawl job ID.`,demandOption:!0}).option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`status`,{type:`string`,description:`Filter by URL status.`,choices:[`queued`,`errored`,`completed`,`disallowed`,`skipped`,`cancelled`]}).option(`cursor`,{type:`number`,description:`Cursor for pagination.`}).option(`limit`,{type:`number`,description:`Limit for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <job-id>`,describe:`Returns the result of a crawl job.`,builder:u(S),handler:async t=>{let r={cacheTTL:t[`cache-ttl`],status:t.status,cursor:t.cursor,limit:t.limit};if(t.dryRun){s({command:`cf browser-rendering crawl get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/crawl/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``)},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.browserRendering.crawl.get({account_id:u,job_id:t[`job-id`],...r})),{successLabel:`Loaded`})}},w={command:`crawl`,describe:`Crawl operations`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID to connect to.`,demandOption:!0}).option(`keep-alive`,{type:`number`,description:`Keep-alive time in ms (only valid when acquiring new session).`}).option(`lab`,{type:`boolean`,description:`Use experimental browser.`}).option(`recording`,{type:`boolean`,description:`Recording`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`connect <session-id>`,describe:`Establishes a WebSocket connection to an existing browser session.`,builder:T,handler:async t=>{let r={keep_alive:t[`keep-alive`],lab:t.lab,recording:t.recording};if(t.dryRun){s({command:`cf browser-rendering devtools browser connect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}`,pathParams:{"session-id":String(t[`session-id`]??``)},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.browserRendering.devtools.browser.connect({account_id:u,session_id:t[`session-id`],...r})),{successLabel:`Loaded`})}};function D(e){return e.option(`keep-alive`,{type:`number`,description:`Keep-alive time in milliseconds.`}).option(`lab`,{type:`boolean`,description:`Use experimental browser.`}).option(`targets`,{type:`boolean`,description:`Include browser targets in response.`}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URL remains valid, in milliseconds (max 60 minutes). Only used when targets is true.`}).option(`recording`,{type:`boolean`,description:`Recording`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`create`,describe:`Acquires a browser and returns its session ID and websocket URL.`,builder:D,handler:async t=>{let r={keep_alive:t[`keep-alive`],lab:t.lab,targets:t.targets,liveViewUrlExpiresInMs:t[`live-view-url-expires-in-ms`],recording:t.recording};if(t.dryRun){s({command:`cf browser-rendering devtools browser create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Creating`,async()=>a.browserRendering.devtools.browser.create({account_id:u,...r})),{successLabel:`Created`})}};function k(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID to close.`,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 A={command:`delete <session-id>`,describe:`Closes an existing browser session.`,builder:k,handler:async r=>{if(r.dryRun){s({command:`cf browser-rendering devtools browser delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${r[`session-id`]==null?`<session-id>`:encodeURIComponent(String(r[`session-id`]))}`,pathParams:{"session-id":String(r[`session-id`]??``)},bodyKind:`none`});return}let a=await i(r),u=r.local?l:await n(a);if(r.accountId=u,!await t({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}o(await c(`Deleting`,async()=>a.browserRendering.devtools.browser.delete({account_id:u,session_id:r[`session-id`]})),{successLabel:`Deleted`})}};function j(e){return e.option(`keep-alive`,{type:`number`,description:`Keep-alive time in ms (only valid when acquiring new session).`}).option(`lab`,{type:`boolean`,description:`Use experimental browser.`}).option(`recording`,{type:`boolean`,description:`Recording`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`launch`,describe:`Acquires and establishes a WebSocket connection to a browser session.`,builder:j,handler:async t=>{let r={keep_alive:t[`keep-alive`],lab:t.lab,recording:t.recording};if(t.dryRun){s({command:`cf browser-rendering devtools browser launch`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.browserRendering.devtools.browser.launch({account_id:u,...r})),{successLabel:`Loaded`})}};function N(e){return e.positional(`target-id`,{type:`string`,description:`Target ID, e.g. page ID.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <target-id>`,describe:`Establishes a WebSocket connection to a specific Chrome DevTools target or page.`,builder:N,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools browser page get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/page/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"session-id":String(t[`session-id`]??``),"target-id":String(t[`target-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.browser.page.get({account_id:a,session_id:t[`session-id`],target_id:t[`target-id`]})),{successLabel:`Loaded`})}},F={command:`page`,describe:`Chrome DevTools Protocol endpoints for browser automation and debugging`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`protocol <session-id>`,describe:`Returns the complete Chrome DevTools Protocol schema including all domains, commands, events, and types. This schema describes the entire CDP API surface.`,builder:I,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools browser protocol`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/protocol`,pathParams:{"session-id":String(t[`session-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.browser.protocol({account_id:a,session_id:t[`session-id`]})),{successLabel:`Loaded`})}};function R(e){return e.positional(`target-id`,{type:`string`,description:`Target ID to activate.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`activate <target-id>`,describe:`Activates (brings to front) a specific browser target by its ID.`,builder:R,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools browser targets activate`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/activate/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"session-id":String(t[`session-id`]??``),"target-id":String(t[`target-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.browser.targets.activate({account_id:a,session_id:t[`session-id`],target_id:t[`target-id`]})),{successLabel:`Loaded`})}};function B(e){return e.positional(`target-id`,{type:`string`,description:`Target ID to close.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`close <target-id>`,describe:`Closes a specific browser target (tab, page, etc.) by its ID. Returns 'Target is closing' on success or an error if the target is not found.`,builder:B,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools browser targets close`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/close/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"session-id":String(t[`session-id`]??``),"target-id":String(t[`target-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.browser.targets.close({account_id:a,session_id:t[`session-id`],target_id:t[`target-id`]})),{successLabel:`Loaded`})}};function H(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`url`,{type:`string`,description:`Url`}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URL remains valid, in milliseconds (max 60 minutes)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`create <session-id>`,describe:`Opens a new tab in the browser. Optionally specify a URL to navigate to.`,builder:H,handler:async t=>{let r={url:t.url,liveViewUrlExpiresInMs:t[`live-view-url-expires-in-ms`]};if(t.dryRun){s({command:`cf browser-rendering devtools browser targets create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/new`,pathParams:{"session-id":String(t[`session-id`]??``)},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Updating`,async()=>a.browserRendering.devtools.browser.targets.create({account_id:u,session_id:t[`session-id`],...r})),{successLabel:`Updated`})}};function W(e){return e.positional(`target-id`,{type:`string`,description:`Target ID.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <target-id>`,describe:`Returns the debuggable target with the given ID.`,builder:W,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools browser targets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/list/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"session-id":String(t[`session-id`]??``),"target-id":String(t[`target-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.browser.targets.get({account_id:a,session_id:t[`session-id`],target_id:t[`target-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URLs remain valid, in milliseconds (max 60 minutes)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.`,builder:K,handler:async t=>{let r={liveViewUrlExpiresInMs:t[`live-view-url-expires-in-ms`]};if(t.dryRun){s({command:`cf browser-rendering devtools browser targets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/list`,pathParams:{"session-id":String(t[`session-id`]??``)},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.browserRendering.devtools.browser.targets.list({account_id:u,session_id:t[`session-id`],...r})),{successLabel:`Loaded`})}},J={command:`targets`,describe:`Chrome DevTools Protocol endpoints for browser automation and debugging`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`version <session-id>`,describe:`Get browser version metadata.`,builder:Y,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools browser version`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json/version`,pathParams:{"session-id":String(t[`session-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.browser.version({account_id:a,session_id:t[`session-id`]})),{successLabel:`Loaded`})}},te={command:`browser`,describe:`Chrome DevTools Protocol endpoints for browser automation and debugging`,builder:e=>e.command(E).command(O).command(A).command(M).command(L).command(X).command(F).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URLs remain valid, in milliseconds (max 60 minutes)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <session-id>`,describe:`Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.`,builder:Z,handler:async t=>{let r={liveViewUrlExpiresInMs:t[`live-view-url-expires-in-ms`]};if(t.dryRun){s({command:`cf browser-rendering devtools json get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/browser/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/json`,pathParams:{"session-id":String(t[`session-id`]??``)},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.browserRendering.devtools.json.get({account_id:u,session_id:t[`session-id`],...r})),{successLabel:`Loaded`})}},ne={command:`json`,describe:`Chrome DevTools Protocol endpoints for browser automation and debugging`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`session-id`,{type:`string`,description:`Session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <session-id>`,describe:`Get details for a specific browser session.`,builder:re,handler:async t=>{if(t.dryRun){s({command:`cf browser-rendering devtools session get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/session/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}`,pathParams:{"session-id":String(t[`session-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?l:await n(r);t.accountId=a,o(await c(`Loading`,async()=>r.browserRendering.devtools.session.get({account_id:a,session_id:t[`session-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List active browser sessions.`,builder:ae,handler:async t=>{let r={limit:t.limit,offset:t.offset};if(t.dryRun){s({command:`cf browser-rendering devtools session list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/devtools/session`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.browserRendering.devtools.session.list({account_id:u,...r})),{successLabel:`Loaded`})}},se={command:`session`,describe:`Chrome DevTools Protocol endpoints for browser automation and debugging`,builder:e=>e.command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`devtools`,describe:`Operations for devtools`,builder:e=>e.command(te).command(ne).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 ue={command:`create`,describe:"Gets json from a webpage from a provided URL or HTML. Pass `prompt` or `schema` in the body. Control page loading with `gotoOptions` and `waitFor*` options.",builder:le,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering json create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/json`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.json.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/json`,{query:u})),{successLabel:`Created`})}},de={command:`json`,describe:`Extract structured JSON data from rendered pages using selectors`,builder:e=>e.command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 pe={command:`create`,describe:`Get links from a web page.`,builder:fe,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering links create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/links`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.links.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/links`,{query:u})),{successLabel:`Created`})}},me={command:`links`,describe:`Extract all links from a rendered web page`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 ge={command:`create`,describe:"Gets markdown of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options.",builder:he,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering markdown create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/markdown`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.markdown.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/markdown`,{query:u})),{successLabel:`Created`})}},_e={command:`markdown`,describe:`Convert rendered web page content to clean Markdown format`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ye={command:`create`,describe:"Fetches rendered PDF from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.",builder:ve,handler:async t=>{let r={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering pdf create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/pdf`,pathParams:{},query:r,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let o=await i(t),u=t.local?l:await n(o);if(t.accountId=u,t.body){let e=a(t.body),n=new URLSearchParams(Object.entries(r).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await c(`Creating`,async()=>f(`/accounts/${u}/browser-rendering/pdf${n?`?`+n:``}`,{method:`POST`,localEndpoint:t.local?t.localEndpoint:void 0,body:JSON.stringify(e),contentType:`application/json`}));d(t.text===!0?i.toString(`utf-8`):i);return}let p=new URLSearchParams(Object.entries(r).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),m=await c(`Creating`,async()=>f(`/accounts/${u}/browser-rendering/pdf${p?`?`+p:``}`,{method:`POST`,localEndpoint:t.local?t.localEndpoint:void 0}));d(t.text===!0?m.toString(`utf-8`):m)}},be={command:`pdf`,describe:`Generate PDF documents from rendered web pages`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 xe={command:`create`,describe:`Get meta attributes like height, width, text and others of selected elements.`,builder:$,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering scrape create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/scrape`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.scrape.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/scrape`,{query:u})),{successLabel:`Created`})}},Se={command:`scrape`,describe:`Scrape structured data from web pages using CSS selectors`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const we={command:`create`,describe:"Takes a screenshot of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.",builder:Ce,handler:async t=>{let r={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering screenshot create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/screenshot`,pathParams:{},query:r,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let o=await i(t),u=t.local?l:await n(o);if(t.accountId=u,t.body){let e=a(t.body),n=new URLSearchParams(Object.entries(r).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await c(`Creating`,async()=>f(`/accounts/${u}/browser-rendering/screenshot${n?`?`+n:``}`,{method:`POST`,localEndpoint:t.local?t.localEndpoint:void 0,body:JSON.stringify(e),contentType:`application/json`}));d(t.text===!0?i.toString(`utf-8`):i);return}let p=new URLSearchParams(Object.entries(r).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),m=await c(`Creating`,async()=>f(`/accounts/${u}/browser-rendering/screenshot${p?`?`+p:``}`,{method:`POST`,localEndpoint:t.local?t.localEndpoint:void 0}));d(t.text===!0?m.toString(`utf-8`):m)}},Te={command:`screenshot`,describe:`Capture viewport or full-page screenshots as PNG or JPEG images`,builder:e=>e.command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 De={command:`create`,describe:"Returns the page's HTML content and screenshot. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.",builder:Ee,handler:async t=>{let u={cacheTTL:t[`cache-ttl`]};if(t.dryRun){s({command:`cf browser-rendering snapshot create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/browser-rendering/snapshot`,pathParams:{},query:u,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let d=await i(t),f=t.local?l:await n(d);if(t.accountId=f,t.body){let e=a(t.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o(await c(`Creating`,async()=>d.browserRendering.snapshot.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/browser-rendering/snapshot`,{query:u})),{successLabel:`Created`})}},Oe={command:`snapshot`,describe:`Capture a complete DOM snapshot including styles and resources`,builder:e=>e.command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`browser-rendering`,describe:`Headless browser API — render pages, take screenshots, generate PDFs, scrape content, and extract structured data`,builder:e=>e.command(ee).command(_).command(w).command(ce).command(de).command(me).command(_e).command(be).command(Se).command(Te).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ke as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t,o as n,r,t as i}from"./chunk-DH-VkVmc.mjs";import{t as a}from"./src-B9cKsgsg.mjs";import{A as o,B as s,D as c,E as l,F as u,I as d,K as f,L as p,M as m,N as h,O as g,P as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,b as k,d as A,i as ee,j as te,k as ne,l as re,n as j,p as ie,q as ae,r as M,u as oe,v as se,w as ce,x as le,y as ue,z as de}from"./dist-DNBSHor6.mjs";import{a as fe,o as pe}from"./theme-BklJDrb2.mjs";import"./ui-BXjU1dX1.mjs";import{c as me,d as he,f as ge,h as _e,l as ve,m as ye,n as be,p as xe,s as Se,u as Ce}from"./dist-CnSubA1Z.mjs";import{n as we,t as Te}from"./spawn-13QQ0IwO.mjs";import{createRequire as Ee}from"node:module";import{extname as De}from"path";import{debuglog as Oe,inspect as ke}from"util";import{fileURLToPath as Ae}from"url";import je,{createReadStream as Me,existsSync as Ne,mkdirSync as Pe,readFileSync as Fe,readdirSync as Ie,statSync as Le,writeFileSync as Re}from"node:fs";import ze from"node:assert";import Be from"node:os";import*as Ve from"node:path";import He,{dirname as Ue,extname as We,isAbsolute as Ge,join as Ke,resolve as qe,sep as Je}from"node:path";import{execSync as Ye,spawn as Xe,spawnSync as Ze}from"node:child_process";import{createHash as Qe}from"node:crypto";import{stripVTControlCharacters as $e}from"node:util";import{Blob as et}from"node:buffer";import{gzipSync as tt}from"node:zlib";import nt,{URLSearchParams as rt}from"node:url";import{AsyncLocalStorage as it}from"node:async_hooks";import{access as at,readFile as ot,readdir as st,stat as ct,writeFile as lt}from"node:fs/promises";import ut,{exit as dt}from"node:process";import ft from"node:tty";import pt from"node:readline";import{hash as mt}from"blake3-wasm";import{readFile as ht}from"fs/promises";var gt=Object.create,_t=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyNames,bt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty,N=(e,t)=>_t(e,`name`,{value:t,configurable:!0}),St=e===void 0?Ee(import.meta.url):e,Ct=(e,t)=>function(){return t||(0,e[yt(e)[0]])((t={exports:{}}).exports,t),t.exports},wt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of yt(t))!xt.call(e,i)&&i!==n&&_t(e,i,{get:()=>t[i],enumerable:!(r=vt(t,i))||r.enumerable});return e},Tt=(e,t,n)=>(n=e==null?{}:gt(bt(e)),wt(t||!e||!e.__esModule?_t(n,`default`,{value:e,enumerable:!0}):n,e)),P,Et,Dt,Ot,kt,At,jt,Mt;function Nt(e){P=e.logger,Et=e.fetchResult,Dt=e.fetchListResult,Ot=e.fetchPagedListResult,e.fetchKVGetValue,kt=e.confirm,At=e.prompt,jt=e.select,Mt=e.isNonInteractiveOrCI}N(Nt,`initDeployHelpersContext`);var Pt;const Ft=Object.freeze({status:`aborted`});function F(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var It=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Lt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pt=globalThis).__zod_globalConfig??(Pt.__zod_globalConfig={});const Rt=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(Rt,e),Rt}function Bt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Vt(e,t){return typeof t==`bigint`?t.toString():t}function Ht(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ut(e){return e==null}function Wt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Gt(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const Kt=Symbol(`evaluating`);function qt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Kt)return r===void 0&&(r=Kt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Xt(e){return JSON.stringify(e)}function Zt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Qt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const en=Ht(()=>{if(Rt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function tn(e){if($t(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!($t(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function nn(e){return tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const rn=new Set([`string`,`number`,`symbol`]),an=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function on(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function cn(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ln(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const un={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function dn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return sn(e,Yt(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jt(this,`shape`,e),e},checks:[]}))}function fn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return sn(e,Yt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jt(this,`shape`,r),r},checks:[]}))}function pn(e,t){if(!tn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function mn(e,t){if(!tn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function hn(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function gn(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return sn(t,Yt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Jt(this,`shape`,i),i},checks:[]}))}function _n(e,t,n){return sn(t,Yt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Jt(this,`shape`,i),i}}))}function vn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function yn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function bn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function xn(e){return typeof e==`string`?e:e?.message}function Sn(e,t,n){let r=e.message?e.message:xn(e.inst?._zod.def?.error?.(e))??xn(t?.error?.(e))??xn(n.customError?.(e))??xn(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Cn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Tn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Vt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},En=F(`$ZodError`,Tn),Dn=F(`$ZodError`,Tn,{Parent:Error});function On(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kn(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const An=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new It;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},jn=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},Mn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new It;return a.issues.length?{success:!1,error:new(e??En)(a.issues.map(e=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Nn=Mn(Dn),Pn=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Fn=Pn(Dn),In=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return An(e)(t,n,i)},Ln=e=>(t,n,r)=>An(e)(t,n,r),Rn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jn(e)(t,n,i)},zn=e=>async(t,n,r)=>jn(e)(t,n,r),Bn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mn(e)(t,n,i)},Vn=e=>(t,n,r)=>Mn(e)(t,n,r),Hn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pn(e)(t,n,i)},Un=e=>async(t,n,r)=>Pn(e)(t,n,r),Wn=/^[cC][0-9a-z]{6,}$/,Gn=/^[0-9a-z]+$/,Kn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qn=/^[0-9a-vA-V]{20}$/,Jn=/^[A-Za-z0-9]{27}$/,Yn=/^[a-zA-Z0-9_-]{21}$/,Xn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function er(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const tr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ir=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ar=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,or=/^[A-Za-z0-9_-]*$/,sr=/^https?$/,cr=/^\+[1-9]\d{6,14}$/,lr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ur=RegExp(`^${lr}$`);function dr(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function fr(e){return RegExp(`^${dr(e)}$`)}function pr(e){let t=dr({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${lr}T(?:${r})$`)}const mr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hr=/^-?\d+$/,gr=/^-?\d+(?:\.\d+)?$/,_r=/^(?:true|false)$/i,vr=/^null$/i,yr=/^[^A-Z]*$/,br=/^[^a-z]*$/,xr=F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Sr={number:`number`,bigint:`bigint`,object:`date`},Cr=F(`$ZodCheckLessThan`,(e,t)=>{xr.init(e,t);let n=Sr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wr=F(`$ZodCheckGreaterThan`,(e,t)=>{xr.init(e,t);let n=Sr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tr=F(`$ZodCheckMultipleOf`,(e,t)=>{xr.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Gt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Er=F(`$ZodCheckNumberFormat`,(e,t)=>{xr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=un[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=hr)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Dr=F(`$ZodCheckMaxLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Cn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Or=F(`$ZodCheckMinLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Cn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kr=F(`$ZodCheckLengthEquals`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Cn(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ar=F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;xr.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jr=F(`$ZodCheckRegex`,(e,t)=>{Ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mr=F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=yr,Ar.init(e,t)}),Nr=F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=br,Ar.init(e,t)}),Pr=F(`$ZodCheckIncludes`,(e,t)=>{xr.init(e,t);let n=on(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Fr=F(`$ZodCheckStartsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`^${on(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ir=F(`$ZodCheckEndsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`.*${on(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lr=F(`$ZodCheckOverwrite`,(e,t)=>{xr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Rr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
import{i as e,n as t,o as n,r,t as i}from"./chunk-DH-VkVmc.mjs";import{t as a}from"./src-BW6vfAwE.mjs";import{A as o,B as s,D as c,E as l,F as u,I as d,K as f,L as p,M as m,N as h,O as g,P as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,b as k,d as A,i as ee,j as te,k as ne,l as re,n as j,p as ie,q as ae,r as M,u as oe,v as se,w as ce,x as le,y as ue,z as de}from"./dist-DNBSHor6.mjs";import{a as fe,o as pe}from"./theme-BklJDrb2.mjs";import"./ui-D4KtlMh9.mjs";import{c as me,d as he,f as ge,h as _e,l as ve,m as ye,n as be,p as xe,s as Se,u as Ce}from"./dist-AIcZFk0U.mjs";import{n as we,t as Te}from"./spawn-DcppKGI5.mjs";import{createRequire as Ee}from"node:module";import{extname as De}from"path";import{debuglog as Oe,inspect as ke}from"util";import{fileURLToPath as Ae}from"url";import je,{createReadStream as Me,existsSync as Ne,mkdirSync as Pe,readFileSync as Fe,readdirSync as Ie,statSync as Le,writeFileSync as Re}from"node:fs";import ze from"node:assert";import Be from"node:os";import*as Ve from"node:path";import He,{dirname as Ue,extname as We,isAbsolute as Ge,join as Ke,resolve as qe,sep as Je}from"node:path";import{execSync as Ye,spawn as Xe,spawnSync as Ze}from"node:child_process";import{createHash as Qe}from"node:crypto";import{stripVTControlCharacters as $e}from"node:util";import{Blob as et}from"node:buffer";import{gzipSync as tt}from"node:zlib";import nt,{URLSearchParams as rt}from"node:url";import{AsyncLocalStorage as it}from"node:async_hooks";import{access as at,readFile as ot,readdir as st,stat as ct,writeFile as lt}from"node:fs/promises";import ut,{exit as dt}from"node:process";import ft from"node:tty";import pt from"node:readline";import{hash as mt}from"blake3-wasm";import{readFile as ht}from"fs/promises";var gt=Object.create,_t=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyNames,bt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty,N=(e,t)=>_t(e,`name`,{value:t,configurable:!0}),St=e===void 0?Ee(import.meta.url):e,Ct=(e,t)=>function(){return t||(0,e[yt(e)[0]])((t={exports:{}}).exports,t),t.exports},wt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of yt(t))!xt.call(e,i)&&i!==n&&_t(e,i,{get:()=>t[i],enumerable:!(r=vt(t,i))||r.enumerable});return e},Tt=(e,t,n)=>(n=e==null?{}:gt(bt(e)),wt(t||!e||!e.__esModule?_t(n,`default`,{value:e,enumerable:!0}):n,e)),P,Et,Dt,Ot,kt,At,jt,Mt;function Nt(e){P=e.logger,Et=e.fetchResult,Dt=e.fetchListResult,Ot=e.fetchPagedListResult,e.fetchKVGetValue,kt=e.confirm,At=e.prompt,jt=e.select,Mt=e.isNonInteractiveOrCI}N(Nt,`initDeployHelpersContext`);var Pt;const Ft=Object.freeze({status:`aborted`});function F(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var It=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Lt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pt=globalThis).__zod_globalConfig??(Pt.__zod_globalConfig={});const Rt=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(Rt,e),Rt}function Bt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Vt(e,t){return typeof t==`bigint`?t.toString():t}function Ht(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ut(e){return e==null}function Wt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Gt(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const Kt=Symbol(`evaluating`);function qt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Kt)return r===void 0&&(r=Kt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Xt(e){return JSON.stringify(e)}function Zt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Qt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const en=Ht(()=>{if(Rt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function tn(e){if($t(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!($t(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function nn(e){return tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const rn=new Set([`string`,`number`,`symbol`]),an=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function on(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function cn(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ln(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const un={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function dn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return sn(e,Yt(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jt(this,`shape`,e),e},checks:[]}))}function fn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return sn(e,Yt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jt(this,`shape`,r),r},checks:[]}))}function pn(e,t){if(!tn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function mn(e,t){if(!tn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Jt(this,`shape`,n),n}}))}function hn(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return sn(e,Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function gn(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return sn(t,Yt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Jt(this,`shape`,i),i},checks:[]}))}function _n(e,t,n){return sn(t,Yt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Jt(this,`shape`,i),i}}))}function vn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function yn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function bn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function xn(e){return typeof e==`string`?e:e?.message}function Sn(e,t,n){let r=e.message?e.message:xn(e.inst?._zod.def?.error?.(e))??xn(t?.error?.(e))??xn(n.customError?.(e))??xn(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Cn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function wn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Tn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Vt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},En=F(`$ZodError`,Tn),Dn=F(`$ZodError`,Tn,{Parent:Error});function On(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kn(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const An=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new It;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},jn=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Sn(e,a,zt())));throw Qt(t,i?.callee),t}return o.value},Mn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new It;return a.issues.length?{success:!1,error:new(e??En)(a.issues.map(e=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Nn=Mn(Dn),Pn=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Sn(e,i,zt())))}:{success:!0,data:a.value}},Fn=Pn(Dn),In=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return An(e)(t,n,i)},Ln=e=>(t,n,r)=>An(e)(t,n,r),Rn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jn(e)(t,n,i)},zn=e=>async(t,n,r)=>jn(e)(t,n,r),Bn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mn(e)(t,n,i)},Vn=e=>(t,n,r)=>Mn(e)(t,n,r),Hn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pn(e)(t,n,i)},Un=e=>async(t,n,r)=>Pn(e)(t,n,r),Wn=/^[cC][0-9a-z]{6,}$/,Gn=/^[0-9a-z]+$/,Kn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qn=/^[0-9a-vA-V]{20}$/,Jn=/^[A-Za-z0-9]{27}$/,Yn=/^[a-zA-Z0-9_-]{21}$/,Xn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function er(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const tr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ir=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ar=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,or=/^[A-Za-z0-9_-]*$/,sr=/^https?$/,cr=/^\+[1-9]\d{6,14}$/,lr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ur=RegExp(`^${lr}$`);function dr(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function fr(e){return RegExp(`^${dr(e)}$`)}function pr(e){let t=dr({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${lr}T(?:${r})$`)}const mr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hr=/^-?\d+$/,gr=/^-?\d+(?:\.\d+)?$/,_r=/^(?:true|false)$/i,vr=/^null$/i,yr=/^[^A-Z]*$/,br=/^[^a-z]*$/,xr=F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Sr={number:`number`,bigint:`bigint`,object:`date`},Cr=F(`$ZodCheckLessThan`,(e,t)=>{xr.init(e,t);let n=Sr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wr=F(`$ZodCheckGreaterThan`,(e,t)=>{xr.init(e,t);let n=Sr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tr=F(`$ZodCheckMultipleOf`,(e,t)=>{xr.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Gt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Er=F(`$ZodCheckNumberFormat`,(e,t)=>{xr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=un[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=hr)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Dr=F(`$ZodCheckMaxLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Cn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Or=F(`$ZodCheckMinLength`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Cn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kr=F(`$ZodCheckLengthEquals`,(e,t)=>{var n;xr.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ut(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Cn(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ar=F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;xr.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jr=F(`$ZodCheckRegex`,(e,t)=>{Ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mr=F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=yr,Ar.init(e,t)}),Nr=F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=br,Ar.init(e,t)}),Pr=F(`$ZodCheckIncludes`,(e,t)=>{xr.init(e,t);let n=on(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Fr=F(`$ZodCheckStartsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`^${on(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ir=F(`$ZodCheckEndsWith`,(e,t)=>{xr.init(e,t);let n=RegExp(`.*${on(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lr=F(`$ZodCheckOverwrite`,(e,t)=>{xr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Rr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
3
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
4
|
`))}};const zr={major:4,minor:4,patch:3},Br=F(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=vn(e),i;for(let a of t){if(a._zod.def.when){if(yn(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new It;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=vn(e,t))});else{if(e.issues.length===t)continue;r||=vn(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(vn(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new It;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new It;return o.then(e=>t(e,r,a))}return t(o,r,a)}}qt(e,`~standard`,()=>({validate:t=>{try{let n=Nn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Fn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Vr=F(`$ZodString`,(e,t)=>{Br.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mr(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Hr=F(`$ZodStringFormat`,(e,t)=>{Ar.init(e,t),Vr.init(e,t)}),Ur=F(`$ZodGUID`,(e,t)=>{t.pattern??=Zn,Hr.init(e,t)}),Wr=F(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Qn(e)}else t.pattern??=Qn();Hr.init(e,t)}),Gr=F(`$ZodEmail`,(e,t)=>{t.pattern??=$n,Hr.init(e,t)}),Kr=F(`$ZodURL`,(e,t)=>{Hr.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===sr.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qr=F(`$ZodEmoji`,(e,t)=>{t.pattern??=er(),Hr.init(e,t)}),Jr=F(`$ZodNanoID`,(e,t)=>{t.pattern??=Yn,Hr.init(e,t)}),Yr=F(`$ZodCUID`,(e,t)=>{t.pattern??=Wn,Hr.init(e,t)}),Xr=F(`$ZodCUID2`,(e,t)=>{t.pattern??=Gn,Hr.init(e,t)}),Zr=F(`$ZodULID`,(e,t)=>{t.pattern??=Kn,Hr.init(e,t)}),Qr=F(`$ZodXID`,(e,t)=>{t.pattern??=qn,Hr.init(e,t)}),$r=F(`$ZodKSUID`,(e,t)=>{t.pattern??=Jn,Hr.init(e,t)}),ei=F(`$ZodISODateTime`,(e,t)=>{t.pattern??=pr(t),Hr.init(e,t)}),ti=F(`$ZodISODate`,(e,t)=>{t.pattern??=ur,Hr.init(e,t)}),ni=F(`$ZodISOTime`,(e,t)=>{t.pattern??=fr(t),Hr.init(e,t)}),ri=F(`$ZodISODuration`,(e,t)=>{t.pattern??=Xn,Hr.init(e,t)}),ii=F(`$ZodIPv4`,(e,t)=>{t.pattern??=tr,Hr.init(e,t),e._zod.bag.format=`ipv4`}),ai=F(`$ZodIPv6`,(e,t)=>{t.pattern??=nr,Hr.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),oi=F(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rr,Hr.init(e,t)}),si=F(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ir,Hr.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function ci(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const li=F(`$ZodBase64`,(e,t)=>{t.pattern??=ar,Hr.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ci(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ui(e){if(!or.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ci(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const di=F(`$ZodBase64URL`,(e,t)=>{t.pattern??=or,Hr.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ui(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),fi=F(`$ZodE164`,(e,t)=>{t.pattern??=cr,Hr.init(e,t)});function pi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const mi=F(`$ZodJWT`,(e,t)=>{Hr.init(e,t),e._zod.check=n=>{pi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),hi=F(`$ZodNumber`,(e,t)=>{Br.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),gi=F(`$ZodNumberFormat`,(e,t)=>{Er.init(e,t),hi.init(e,t)}),_i=F(`$ZodBoolean`,(e,t)=>{Br.init(e,t),e._zod.pattern=_r,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),vi=F(`$ZodNull`,(e,t)=>{Br.init(e,t),e._zod.pattern=vr,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),yi=F(`$ZodUnknown`,(e,t)=>{Br.init(e,t),e._zod.parse=e=>e}),bi=F(`$ZodNever`,(e,t)=>{Br.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function xi(e,t,n){e.issues.length&&t.issues.push(...bn(n,e.issues)),t.value[n]=e.value}const Si=F(`$ZodArray`,(e,t)=>{Br.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>xi(t,n,e))):xi(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ci(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...bn(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function wi(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ln(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ti(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ci(e,n,i,t,u,d))):Ci(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Ei=F(`$ZodObject`,(e,t)=>{if(Br.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Ht(()=>wi(t));qt(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=$t,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Ci(n,t,e,s,r,i))):Ci(a,t,e,s,r,i)}return i?Ti(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Di=F(`$ZodObjectJIT`,(e,t)=>{Ei.init(e,t);let n=e._zod.parse,r=Ht(()=>wi(t)),i=e=>{let t=new Rr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Xt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Xt(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
5
|
if (${n}.issues.length) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{E as e,S as t,T as n,i as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:d,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>n.cache.cacheReserve.clear({zone_id:r})),{successLabel:`Created`})}};function p(e){return e.option(`value`,{type:`string`,description:`Value of the Cache Reserve zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`edit`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:p,handler:async n=>{if(n.dryRun){c({command:`cf cache cache-reserve edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Value of the Cache Reserve zone setting.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.cacheReserve.get({zone_id:r})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.cacheReserve.status({zone_id:r})),{successLabel:`Loaded`})}},y={command:`cache-reserve`,describe:`Persistent storage tier that keeps cached assets even after eviction from edge caches`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`purge`,describe:'### Purge All Cached Content Removes ALL files from Cloudflare\'s cache. All tiers can purge everything. ``` {"purge_everything": true} ``` ### Purge Cached Content by URL Granularly removes one or more files from Cloudflare\'s cache by specifying URLs. All tiers can purge by URL. To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header. **NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise. Single file purge example with files: ``` {"files": ["http://www.example.com/css/styles.css", "http://www.example.com/js/index.js"]} ``` Single file purge example with url and header pairs: ``` {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]} ``` ### Purge Cached Content by Tag, Host or Prefix Granularly removes one or more files from Cloudflare\'s cache either by specifying the host, the associated Cache-Tag, or a Prefix. Flex purge with tags: ``` {"tags": ["a-cache-tag", "another-cache-tag"]} ``` Flex purge with hosts: ``` {"hosts": ["www.example.com", "images.example.com"]} ``` Flex purge with prefixes: ``` {"prefixes": ["www.example.com/foo", "images.example.com/bar/baz"]} ``` ### Availability and limits Please refer to [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).',builder:b,handler:async e=>{if(e.dryRun){c({command:`cf cache purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/purge_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let o=await i(e),u=await t({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,!await n({force:!!e.force,message:`This operation destroys cached content for a zone.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}if(e.body){let t=a(e.body);s(await l(`Deleting`,async()=>o.cache.purge({body:t,zone_id:u})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>r(o,`POST`,`/zones/${e.zoneId}/purge_cache`)),{successLabel:`Deleted`})}};function S(e){return e.option(`value`,{type:`string`,description:`Value of the Regional Tiered Cache zone setting.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`edit`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:S,handler:async n=>{if(n.dryRun){c({command:`cf cache regional-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Value of the Regional Tiered Cache zone setting.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf cache regional-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.regionalTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},E={command:`regional-tiered-cache`,describe:`Restrict tiered cache topology to data centers within a specific geographic region`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}s(await l(`Deleting`,async()=>r.cache.smartTieredCache.delete({zone_id:a})),{successLabel:`Deleted`})}};function k(e){return e.option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const A={command:`edit`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:k,handler:async n=>{if(n.dryRun){c({command:`cf cache smart-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:f,zone_id:d})),{successLabel:`Updated`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.smartTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},N={command:`smart-tiered-cache`,describe:`Automatically determine the best upper-tier data centers for tiered cache topology`,builder:e=>e.command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf cache variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}s(await l(`Deleting`,async()=>r.cache.variants.delete({zone_id:a})),{successLabel:`Deleted`})}};function I(e){return e.option(`value-avif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for avif.`}).option(`value-bmp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for bmp.`}).option(`value-gif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for gif.`}).option(`value-jp2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jp2.`}).option(`value-jpeg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpeg.`}).option(`value-jpg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg.`}).option(`value-jpg2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg2.`}).option(`value-png`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for png.`}).option(`value-tif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tif.`}).option(`value-tiff`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tiff.`}).option(`value-webp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for webp.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`edit`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf cache variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}}):a(e.body)});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.cache.variants.edit({...t,zone_id:r})),{successLabel:`Updated`});return}let u=o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}});s(await l(`Updating`,async()=>n.cache.variants.edit({...u,zone_id:r})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf cache variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.variants.get({zone_id:r})),{successLabel:`Loaded`})}},B={command:`variants`,describe:`Serve different cached versions of an image based on the Accept header (WebP, AVIF, etc.)`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`cache`,describe:`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(x).command(y).command(E).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";function d(e){return e.option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Creates a new Cloudflare calls app. An app is an unique enviroment where each Session can access all Tracks within the app.`,builder:d,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.calls.sfu.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.sfu.create({body:p,account_id:f})),{successLabel:`Created`})}};function p(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <app-id>`,describe:`Deletes an app from Cloudflare Calls`,builder:p,handler:async i=>{if(i.dryRun){s({command:`cf calls sfu delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"app-id":String(i[`app-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>a.calls.sfu.delete({account_id:l,app_id:i[`app-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <app-id>`,describe:`Fetches details for a single Calls app.`,builder:h,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.get({account_id:a,app_id:t[`app-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Lists all apps in the Cloudflare account`,builder:_,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.list({account_id:a})),{successLabel:`Loaded`})}};function y(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update <app-id>`,describe:`Edit details for a single app.`,builder:y,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.calls.sfu.update({body:e,account_id:f,app_id:t[`app-id`]})),{successLabel:`Updated`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.sfu.update({body:p,account_id:f,app_id:t[`app-id`]})),{successLabel:`Updated`})}},x={command:`sfu`,describe:`Selective Forwarding Unit apps that route WebRTC media between participants`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create`,describe:`Creates a new Cloudflare Calls TURN key.`,builder:S,handler:async t=>{if(t.dryRun){s({command:`cf calls turn create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.calls.turn.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.turn.create({body:p,account_id:f})),{successLabel:`Created`})}};function w(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <key-id>`,describe:`Deletes a TURN key from Cloudflare Calls`,builder:w,handler:async i=>{if(i.dryRun){s({command:`cf calls turn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${i[`key-id`]==null?`<key-id>`:encodeURIComponent(String(i[`key-id`]))}`,pathParams:{"key-id":String(i[`key-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}o(await c(`Deleting`,async()=>a.calls.turn.delete({account_id:l,key_id:i[`key-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <key-id>`,describe:`Fetches details for a single TURN key.`,builder:E,handler:async t=>{if(t.dryRun){s({command:`cf calls turn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${t[`key-id`]==null?`<key-id>`:encodeURIComponent(String(t[`key-id`]))}`,pathParams:{"key-id":String(t[`key-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.get({account_id:a,key_id:t[`key-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists all TURN keys in the Cloudflare account`,builder:O,handler:async t=>{if(t.dryRun){s({command:`cf calls turn list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.list({account_id:a})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <key-id>`,describe:`Edit details for a single TURN key.`,builder:A,handler:async t=>{if(t.dryRun){s({command:`cf calls turn update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${t[`key-id`]==null?`<key-id>`:encodeURIComponent(String(t[`key-id`]))}`,pathParams:{"key-id":String(t[`key-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.calls.turn.update({body:e,account_id:f,key_id:t[`key-id`]})),{successLabel:`Updated`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.turn.update({body:p,account_id:f,key_id:t[`key-id`]})),{successLabel:`Updated`})}},M={command:`turn`,describe:`TURN relay keys that help clients traverse NATs and firewalls for peer-to-peer connectivity`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`calls`,describe:`Real-time audio/video communication infrastructure — SFU apps for WebRTC and TURN relay keys`,builder:e=>e.command(x).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{S as e,n as t}from"./auth-ffdf9yR0.mjs";import{n,t as r}from"./body-parser-DKa8Ipg1.mjs";import{t as i}from"./output-BJFNwj7b.mjs";import{n as a,t as o}from"./progress-CrCGTq7N.mjs";import{n as s}from"./input-validation-zEO81MWN.mjs";function c(e){return e.option(`mtls-certificate-id`,{type:`string`,description:`The UUID to match against for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the results will be the hostnames associated to your active Cloudflare Managed CA.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`List Hostname Associations.`,builder:c,handler:async n=>{let r={mtls_certificate_id:n[`mtls-certificate-id`]};if(n.dryRun){a({command:`cf certificate-authorities hostname-associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/certificate_authorities/hostname_associations`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.certificateAuthorities.hostnameAssociations.get({zone_id:c,...r})),{successLabel:`Loaded`})}};function u(e){return e.option(`hostnames`,{type:`string`,array:!0,description:`The hostnames field`}).option(`mtls-certificate-id`,{type:`string`,description:`The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the hostnames will be associated to your active Cloudflare Managed CA.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`update`,describe:`Replace Hostname Associations.`,builder:u,handler:async c=>{if(c.dryRun){a({command:`cf certificate-authorities hostname-associations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/certificate_authorities/hostname_associations`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?r({hostnames:c.hostnames,mtls_certificate_id:s(c[`mtls-certificate-id`],`mtls-certificate-id`,`text`)}):n(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=n(c.body);i(await o(`Updating`,async()=>l.certificateAuthorities.hostnameAssociations.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=r({hostnames:c.hostnames,mtls_certificate_id:s(c[`mtls-certificate-id`],`mtls-certificate-id`,`text`)});i(await o(`Updating`,async()=>l.certificateAuthorities.hostnameAssociations.update({...d,zone_id:u})),{successLabel:`Updated`})}},f={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`certificate-authorities`,describe:`Map client certificates to specific hostnames for mTLS authentication`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,S as t,T as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./cli-types-CRIDdDw3.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`validity-days`,{type:`number`,description:`The number of days the Client Certificate will be valid after the issued_on date.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create a new API Shield mTLS Client Certificate.`,builder:d,handler:async n=>{if(n.dryRun){s({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({csr:l(n.csr,`csr`,`text`),validity_days:n[`validity-days`]}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.clientCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(n.csr===void 0&&(n.csr=await e(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),n[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=a({csr:l(n.csr,`csr`,`text`),validity_days:n[`validity-days`]});o(await c(`Creating`,async()=>u.clientCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function p(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <client-certificate-id>`,describe:`Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`,builder:p,handler:async e=>{if(e.dryRun){s({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 i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>i.clientCertificates.delete({zone_id:a,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`reactivate`,{type:`boolean`,description:`The reactivate field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`edit <client-certificate-id>`,describe:`If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint.`,builder:h,handler:async e=>{if(e.dryRun){s({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?a({reactivate:e.reactivate}):i(e.body)});return}let n=await r(e),l=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.clientCertificates.edit({...t,zone_id:l,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Updated`});return}let u=a({reactivate:e.reactivate});o(await c(`Updating`,async()=>n.clientCertificates.edit({...u,zone_id:l,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Updated`})}};function _(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <client-certificate-id>`,describe:`Get Details for a single mTLS API Shield Client Certificate.`,builder:_,handler:async e=>{if(e.dryRun){s({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 n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.clientCertificates.get({zone_id:i,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`status`,{type:`string`,description:`Client Certitifcate Status to filter results by.`,choices:[`all`,`active`,`pending_reactivation`,`pending_revocation`,`revoked`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination.`,builder:u(y),handler:async e=>{let n={status:e.status,page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){s({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:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.clientCertificates.list({zone_id:a,...n})),{successLabel:`Loaded`})}},x={command:`client-certificates`,describe:`Issue and manage client certificates for mutual TLS (mTLS) authentication on your zone`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{x as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{S as e,n as t}from"./auth-ffdf9yR0.mjs";import{n}from"./body-parser-DKa8Ipg1.mjs";import{t as r}from"./output-BJFNwj7b.mjs";import{n as i,t as a}from"./progress-CrCGTq7N.mjs";function o(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`list`,describe:`Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.`,builder:o,handler:async n=>{if(n.dryRun){i({command:`cf cloud-connector rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(n),s=await e({zone:n.zone},o,{quiet:n.quiet});n.zoneId=s,r(await a(`Loading`,async()=>o.cloudConnector.rules.list({zone_id:s})),{successLabel:`Loaded`})}};function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const l={command:`update`,describe:`Updates Cloud Connector rules for a zone, replacing the existing rule configuration.`,builder:c,handler:async o=>{if(o.dryRun){i({command:`cf cloud-connector rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:n(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=n(o.body);r(await a(`Updating`,async()=>s.cloudConnector.rules.update({body:e,zone_id:c})),{successLabel:`Updated`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},u={command:`rules`,describe:`Routing rules that map request patterns to cloud provider endpoints`,builder:e=>e.command(s).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`cloud-connector`,describe:`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|