cf 0.5.0 → 0.6.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/{abuse-reports-Ina5TlsU.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
- package/dist/accounts-BIY8wNGA.mjs +22 -0
- package/dist/acm-SqcV8o5o.mjs +3 -0
- package/dist/addressing-CygRm0pN.mjs +12 -0
- package/dist/{agent-context-DMPfi54f.mjs → agent-context-CKb6w43K.mjs} +1 -1
- package/dist/ai-BAmEAjN3.mjs +2 -0
- package/dist/ai-gateway-BENwPvvB.mjs +8 -0
- package/dist/ai-search-Bv_Whw3E.mjs +7 -0
- package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
- package/dist/alerting-D_qWrsoY.mjs +6 -0
- package/dist/{analytics-DSSRDZz8.mjs → analytics-CwFrx-Dr.mjs} +1 -1
- package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
- package/dist/api-gateway-D9PMVVqL.mjs +33 -0
- package/dist/argo-DwYGbyld.mjs +2 -0
- package/dist/artifacts-DKAjY_n4.mjs +4 -0
- package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BvQ9uwuy.mjs} +1 -1
- package/dist/{auth-CSC4yhEJ.mjs → auth-DX9KnJ0P.mjs} +3 -3
- package/dist/{auth-D5hNsOFq.mjs → auth-TYwGydWg.mjs} +1 -1
- package/dist/billing-CRTlRU88.mjs +2 -0
- package/dist/bot-management-DgW--8wM.mjs +5 -0
- package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
- package/dist/brand-protection-ZikBtl0y.mjs +3 -0
- package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
- package/dist/build-Bgw8TV1p.mjs +134 -0
- package/dist/cache-CeN5t6_W.mjs +5 -0
- package/dist/calls-Cv0ieVg4.mjs +4 -0
- package/dist/{certificate-authorities-CtqzAtxQ.mjs → certificate-authorities-BzZnWCac.mjs} +1 -1
- package/dist/client-certificates-BFuzeBrj.mjs +3 -0
- package/dist/{cloud-connector-BA5IRZUP.mjs → cloud-connector-D5h8Dzzg.mjs} +1 -1
- package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
- package/dist/{completions-DOeHPdCG.mjs → completions-Bvzav4Mj.mjs} +1 -1
- package/dist/connectivity-CjkXmEhO.mjs +3 -0
- package/dist/connector-interrupts-B7eSface.mjs +2 -0
- package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
- package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
- package/dist/connectors-YYu_Vx3H.mjs +3 -0
- package/dist/content-scanning-BorfRGKT.mjs +4 -0
- package/dist/{context-jpewmual.mjs → context-C-WbewL6.mjs} +1 -1
- package/dist/custom-certificates-CfRj7QZb.mjs +5 -0
- package/dist/{custom-hostnames-CtuTdFcX.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
- package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
- package/dist/custom-pages-DamGVA75.mjs +4 -0
- package/dist/d1-sK0O5THv.mjs +4 -0
- package/dist/data-security-DsWpoWiS.mjs +6 -0
- package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-BYsNl3qc.mjs} +1 -1
- package/dist/{deploy-dVrgDUOp.mjs → deploy-BzlPv3ro.mjs} +1 -1
- package/dist/{dev-C01_Lby6.mjs → dev-IOg-_s5_.mjs} +1 -1
- package/dist/diagnostics-CH7T2WR3.mjs +3 -0
- package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
- package/dist/dist-B7hsuvbF.mjs +57 -0
- package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
- package/dist/dns-o7hUPMCG.mjs +29 -0
- package/dist/durable-objects-DgrTbvoF.mjs +2 -0
- package/dist/email-routing-owCvAEpf.mjs +10 -0
- package/dist/email-security-Dng3DVuf.mjs +8 -0
- package/dist/email-sending-bExMH4lu.mjs +3 -0
- package/dist/filters-DKs-wEzt.mjs +4 -0
- package/dist/{firewall-DYZcTtIC.mjs → firewall-BLaTtX3r.mjs} +10 -10
- package/dist/{fraud-C03MtdZb.mjs → fraud-D8WmLKyH.mjs} +1 -1
- package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
- package/dist/healthchecks-BBtW8vRh.mjs +4 -0
- package/dist/hostnames-Bh2IFxIw.mjs +3 -0
- package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
- package/dist/iam-apCCcy7R.mjs +6 -0
- package/dist/images-Cxe45OHm.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-8V4h6H46.mjs +3 -0
- package/dist/{ips-nv9INuWZ.mjs → ips-BE7JbAnc.mjs} +1 -1
- package/dist/keyless-certificates-CfJmXccT.mjs +3 -0
- package/dist/kv-Dz6then8.mjs +5 -0
- package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
- package/dist/load-balancers-ilsGgudX.mjs +6 -0
- package/dist/logpush-BH14TtuA.mjs +4 -0
- package/dist/logs-B8-mkf_I.mjs +3 -0
- package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
- package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
- package/dist/magic-transit-B-kU5e3s.mjs +89 -0
- package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
- package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
- package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
- package/dist/oauth-B5k80sip.mjs +61 -0
- package/dist/observability-9APhqFHo.mjs +4 -0
- package/dist/{organizations-BqJHyvMK.mjs → organizations-Dy3kiV_z.mjs} +6 -6
- package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
- package/dist/origin-tls-client-auth-B30_2_dO.mjs +4 -0
- package/dist/{page-rules-EZHJePmn.mjs → page-rules-zQJGmTCd.mjs} +5 -5
- package/dist/{page-shield-CXJioWPs.mjs → page-shield-CxQk5k9X.mjs} +5 -5
- package/dist/pages-5DKLs7CQ.mjs +11 -0
- package/dist/pipelines-DfGE44xo.mjs +6 -0
- package/dist/{progress-DrDErV9w.mjs → progress-CL8I-7YK.mjs} +1 -1
- package/dist/prompt-q3B7sM2A.mjs +3 -0
- package/dist/queues-BoenUGIw.mjs +6 -0
- package/dist/r2-Cq_JCjK0.mjs +21 -0
- package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
- package/dist/{radar-D986zPJr.mjs → radar-YNOCio6T.mjs} +1 -1
- package/dist/rate-limits-CcAF3tMl.mjs +5 -0
- package/dist/{raw-fetch-_n0lMAnD.mjs → raw-fetch-bIXC9D1m.mjs} +1 -1
- package/dist/realtime-kit-4bCGviO5.mjs +18 -0
- package/dist/{registrar-CDIwTz3G.mjs → registrar-CfHlaOOf.mjs} +6 -6
- package/dist/request-tracers-DlHawg5l.mjs +2 -0
- package/dist/resource-sharing-7FhuboJE.mjs +5 -0
- package/dist/resource-tagging-divcugVb.mjs +16 -0
- package/dist/rules-CAXkege8.mjs +4 -0
- package/dist/rulesets-CBsdc8IV.mjs +8 -0
- package/dist/rum-D0hHPNl9.mjs +4 -0
- package/dist/{schema-BR31o4P6.mjs → schema-D8o6HcCr.mjs} +1 -1
- package/dist/schema-validation-BWNDnnIT.mjs +24 -0
- package/dist/scim-CWLli4fi.mjs +3 -0
- package/dist/{secrets-store-BAK9G12O.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
- package/dist/security-center-BQT21oiM.mjs +2 -0
- package/dist/security-txt-CVpmJo29.mjs +3 -0
- package/dist/{session-DHYCE-PM.mjs → session-B8r8LNQN.mjs} +1 -1
- package/dist/{build-HuS9-R0V.mjs → shared-DQI8NGja.mjs} +324 -388
- package/dist/smart-shield-BreBC1Ap.mjs +3 -0
- package/dist/snippets-BAJoWMSJ.mjs +4 -0
- package/dist/{spawn-CCGzKlC4.mjs → spawn-pmGERpdB.mjs} +1 -1
- package/dist/{spectrum-pVGxb7u5.mjs → spectrum-DnIRLY95.mjs} +6 -6
- package/dist/speed-UYEVue28.mjs +4 -0
- package/dist/{src-DU7FBCOX.mjs → src-BQ1dr9xR.mjs} +4 -4
- package/dist/ssl-D3Pixs8M.mjs +15 -0
- package/dist/stream-BUsuOfQh.mjs +14 -0
- package/dist/{tenants-HLGUazms.mjs → tenants-BdWJTtcg.mjs} +1 -1
- package/dist/token-validation-DUvtXWur.mjs +10 -0
- package/dist/{tools-D_hfUU_Z.mjs → tools-CQtA5-cr.mjs} +1 -1
- package/dist/turnstile-CAKVnS1L.mjs +23 -0
- package/dist/{ui-erjBdVKL.mjs → ui-BrNwNHX9.mjs} +1 -1
- package/dist/url-normalization-DA-RAxs4.mjs +3 -0
- package/dist/url-scanner-DmYu43f7.mjs +2 -0
- package/dist/user-Bah4wGGN.mjs +10 -0
- package/dist/vectorize-DhvVG2By.mjs +4 -0
- package/dist/{versions-CBHwWPAM.mjs → versions-NUXxCr0s.mjs} +1 -1
- package/dist/{waiting-rooms-u6KwrzWd.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
- package/dist/web3-n3GW50u-.mjs +4 -0
- package/dist/workers-D6IaQ_F0.mjs +18 -0
- package/dist/workers-builds-DYi0OMMU.mjs +7 -0
- package/dist/workflows-DrdXUQ2g.mjs +4 -0
- package/dist/zaraz-9l7KuLqh.mjs +2 -0
- package/dist/zero-trust-D6V9GH2W.mjs +118 -0
- package/dist/zero_trust-BzXKAX_x.mjs +3 -0
- package/dist/{zones-BXtdwt6E.mjs → zones-0MTkuaFk.mjs} +8 -8
- package/package.json +3 -1
- package/dist/accounts-B_joQcMi.mjs +0 -22
- package/dist/acm-_kIHqYME.mjs +0 -3
- package/dist/addressing-CaFlw8y1.mjs +0 -12
- package/dist/ai-CqnhNb_c.mjs +0 -2
- package/dist/ai-gateway-pgYGI519.mjs +0 -8
- package/dist/ai-search-eqQMPQol.mjs +0 -7
- package/dist/ai_gateway--vuVLnOm.mjs +0 -4
- package/dist/alerting-CPxHiYHb.mjs +0 -6
- package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
- package/dist/api-gateway-BXXGFCVR.mjs +0 -33
- package/dist/argo-aC6A3JyX.mjs +0 -2
- package/dist/artifacts-HD4V2xpK.mjs +0 -4
- package/dist/billing-COaghyxl.mjs +0 -2
- package/dist/bot-management-DmEzeV1Y.mjs +0 -5
- package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
- package/dist/brand-protection-dPrGe8sL.mjs +0 -3
- package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
- package/dist/cache-CY-7Lt71.mjs +0 -5
- package/dist/calls-wOQGDWPl.mjs +0 -4
- package/dist/client-certificates-CRf41xLe.mjs +0 -3
- package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
- package/dist/connectivity-Bx3MgTHX.mjs +0 -3
- package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
- package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
- package/dist/connectors-DRt4e6d_.mjs +0 -3
- package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
- package/dist/custom-certificates-DYE-9epx.mjs +0 -5
- package/dist/custom-nameservers-CWqA51in.mjs +0 -3
- package/dist/custom-pages-DeUKEFGe.mjs +0 -4
- package/dist/d1-DvWY9Gp4.mjs +0 -4
- package/dist/data-security-BPo6dIWu.mjs +0 -6
- package/dist/diagnostics-6nKPmVgz.mjs +0 -3
- package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
- package/dist/dist-t_YrL25p.mjs +0 -82
- package/dist/dns-ClciFGxx.mjs +0 -29
- package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
- package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
- package/dist/email-routing-CGXhFqF5.mjs +0 -10
- package/dist/email-security-D5viPq8S.mjs +0 -8
- package/dist/email-sending-C2jpc3gh.mjs +0 -3
- package/dist/filters-bzsFcWt0.mjs +0 -4
- package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
- package/dist/healthchecks-DRoAlWgr.mjs +0 -4
- package/dist/hostnames-CFgIVI3s.mjs +0 -3
- package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
- package/dist/iam-DqVPzGrb.mjs +0 -6
- package/dist/images-BYfl4YgR.mjs +0 -7
- package/dist/intel-duTEPIHc.mjs +0 -3
- package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
- package/dist/kv-CZoV4tiv.mjs +0 -5
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
- package/dist/load-balancers--OMg0HNt.mjs +0 -6
- package/dist/logpush-C0_lZTyY.mjs +0 -4
- package/dist/logs-BtpWZQfV.mjs +0 -3
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
- package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
- package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
- package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
- package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
- package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
- package/dist/oauth-Bk-F-tIO.mjs +0 -52
- package/dist/observability-BynRbTF4.mjs +0 -4
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
- package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
- package/dist/pages-D4aYteKk.mjs +0 -11
- package/dist/pipelines-G8Iusxq-.mjs +0 -6
- package/dist/queues-DEkbKqZX.mjs +0 -6
- package/dist/r2-CV0IkCAW.mjs +0 -21
- package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
- package/dist/rate-limits-B2wRsUX1.mjs +0 -5
- package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
- package/dist/request-tracers-D7SFMDik.mjs +0 -2
- package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
- package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
- package/dist/rules-DHjLP5Kx.mjs +0 -4
- package/dist/rulesets-q4QABpKs.mjs +0 -8
- package/dist/rum-SmT4HZmM.mjs +0 -4
- package/dist/schema-validation-vVetgC_P.mjs +0 -24
- package/dist/scim-ChOkZpNx.mjs +0 -3
- package/dist/security-center-eScuYDKP.mjs +0 -2
- package/dist/security-txt-x7R4gmQu.mjs +0 -3
- package/dist/shared-BAjo72Lz.mjs +0 -2
- package/dist/smart-shield-CWlSsNi8.mjs +0 -3
- package/dist/snippets-DrlgYJYp.mjs +0 -4
- package/dist/speed-ZFrMWDgd.mjs +0 -4
- package/dist/ssl-9JY05sYt.mjs +0 -15
- package/dist/stream-tRU39b8K.mjs +0 -14
- package/dist/token-validation-_VdamKpz.mjs +0 -10
- package/dist/turnstile-BRzXd28B.mjs +0 -23
- package/dist/url-normalization-D-NxuLtN.mjs +0 -3
- package/dist/url-scanner-BzzR6iDx.mjs +0 -2
- package/dist/user-C4omq__w.mjs +0 -10
- package/dist/vectorize-By6EqcNR.mjs +0 -4
- package/dist/web3-DQ5dmE9W.mjs +0 -4
- package/dist/workers-D8Be7_as.mjs +0 -18
- package/dist/workers-builds-BE3W3qNk.mjs +0 -7
- package/dist/workflows-BWWufqFA.mjs +0 -4
- package/dist/zaraz-Bsa9AvVL.mjs +0 -2
- package/dist/zero-trust-UNVZFnKu.mjs +0 -118
- package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
- /package/dist/{cli-types-BeyOc81z.mjs → cli-types-DGgEbf8K.mjs} +0 -0
- /package/dist/{metadata-OOwvpR8m.mjs → metadata-MPDDi08e.mjs} +0 -0
- /package/dist/{resolve-C3h-mwp7.mjs → resolve-DGD57PFH.mjs} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{w as e,x as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{n as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-DrDErV9w.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const c={command:`delete`,describe:`Disables all Managed Transforms.`,builder:s,handler:async r=>{if(r.dryRun){a({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let s=await n(r),c=await t({zone:r.zone},s,{quiet:r.quiet});if(r.zoneId=c,!await e({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>s.managedTransforms.delete({zone_id:c})),{successLabel:`Deleted`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A Managed Transforms patch object. Both fields are optional; only the sections provided will be updated.`})}const u={command:`edit`,describe:`Updates the status of one or more Managed Transforms.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf managed-transforms edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body)});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=r(e.body);i(await o(`Updating`,async()=>s.managedTransforms.edit({...t,zone_id:c})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>s.managedTransforms.edit({zone_id:c})),{successLabel:`Updated`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:d,handler:async e=>{if(e.dryRun){a({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),s=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=s,i(await o(`Loading`,async()=>r.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})}},p={command:`managed-transforms`,describe:`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,builder:e=>e.command(c).command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./local-CYc9q7l2.mjs";import{t as f}from"./cli-types-BeyOc81z.mjs";function p(e){return e.positional(`mtls-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 m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async e=>{if(e.dryRun){c({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates/${e[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(e[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(e[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.mtlsCertificates.associations.get({account_id:a,mtls_certificate_id:e[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async r=>{if(r.dryRun){c({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({ca:r.ca,certificates:u(r.certificates,`certificates`,`text`),name:u(r.name,`name`,`text`),private_key:u(r[`private-key`],`private-key`,`text`)}):a(r.body)});return}let f=await i(r),p=r.local?d:await n(f);if(r.accountId=p,r.body){let e=a(r.body);s(await l(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(r.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);r.certificates===void 0&&(r.certificates=await e(`certificates`,`The uploaded root CA certificate.`));let m=o({ca:r.ca,certificates:u(r.certificates,`certificates`,`text`),name:u(r.name,`name`,`text`),private_key:u(r[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-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 y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async e=>{if(e.dryRun){c({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates/${e[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(e[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(e[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}s(await l(`Deleting`,async()=>a.mtlsCertificates.delete({account_id:o,mtls_certificate_id:e[`mtls-certificate-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`mtls-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 x={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates/${e[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(e[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(e[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.mtlsCertificates.get({account_id:a,mtls_certificate_id:e[`mtls-certificate-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:f(S),handler:async e=>{let r={type:e.type};if(e.dryRun){c({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.mtlsCertificates.list({account_id:o,...r})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./local-CYc9q7l2.mjs";function f(e){return e.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
3
|
-
|
|
4
|
-
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
5
|
-
key is not treated as a secret value. This is *only* supported for preventing
|
|
6
|
-
misconfiguration, not for defending against malicious attacks.
|
|
7
|
-
|
|
8
|
-
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
9
|
-
character:
|
|
10
|
-
|
|
11
|
-
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
12
|
-
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
13
|
-
|
|
14
|
-
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
15
|
-
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
16
|
-
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
17
|
-
these disallowed characters will be rejected.`}).option(`interconnect`,{type:`string`,description:`The interconnect field`}).option(`magic-conduit-name`,{type:`string`,description:`The magic.conduit_name field`}).option(`magic-description`,{type:`string`,description:`The magic.description field`}).option(`magic-mtu`,{type:`number`,description:`The magic.mtu 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)`}).check(e=>{if([`bgp-customer-asn`,`bgp-extra-prefixes`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`,`bgp-extra-prefixes`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const p={command:`create`,describe:`Create a new CNI object`,builder:f,handler:async r=>{if(r.dryRun){c({command:`cf network-interconnects cnis create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]}}):a(r.body)});return}let f=await i(r),p=r.local?d:await n(f);if(r.accountId=p,r.body){let e=a(r.body);s(await l(`Creating`,async()=>f.networkInterconnects.cnis.create({...e,account_id:p})),{successLabel:`Created`});return}if(r.account===void 0&&(r.account=await e(`account`,`Customer account tag`)),r.interconnect===void 0&&(r.interconnect=await e(`interconnect`,`The interconnect field`)),r[`magic-conduit-name`]===void 0&&(r[`magic-conduit-name`]=await e(`magic-conduit-name`,`The magic.conduit_name field`)),r[`magic-description`]===void 0&&(r[`magic-description`]=await e(`magic-description`,`The magic.description field`)),r[`magic-mtu`]===void 0)throw Error(`--magic-mtu is required (or pass --body with this field set).`);let m=o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]}});s(await l(`Creating`,async()=>f.networkInterconnects.cnis.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`cni`,{type:`string`,description:`CNI ID to retrieve information about`,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 <cni>`,describe:`Delete a specified CNI object`,builder:m,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects cnis delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis/${e.cni==null?`<cni>`:encodeURIComponent(String(e.cni))}`,pathParams:{cni:String(e.cni??``)},bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
18
|
-
`);return}s(await l(`Deleting`,async()=>a.networkInterconnects.cnis.delete({account_id:o,cni:e.cni})),{successLabel:`Deleted`})}};function g(e){return e.positional(`cni`,{type:`string`,description:`CNI ID to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <cni>`,describe:`Get information about a CNI object`,builder:g,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects cnis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis/${e.cni==null?`<cni>`:encodeURIComponent(String(e.cni))}`,pathParams:{cni:String(e.cni??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.cnis.get({account_id:a,cni:e.cni})),{successLabel:`Loaded`})}};function v(e){return e.option(`slot`,{type:`string`,description:`If specified, only show CNIs associated with the specified slot`}).option(`tunnel-id`,{type:`string`,description:`If specified, only show cnis associated with the specified tunnel id`}).option(`cursor`,{type:`number`,description:`Cursor`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List existing CNI objects`,builder:v,handler:async e=>{let r={slot:e.slot,tunnel_id:e[`tunnel-id`],cursor:e.cursor,limit:e.limit};if(e.dryRun){c({command:`cf network-interconnects cnis list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.networkInterconnects.cnis.list({account_id:o,...r})),{successLabel:`Loaded`})}};function b(e){return e.positional(`cni`,{type:`string`,description:`CNI ID to retrieve information about`,demandOption:!0}).option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
19
|
-
|
|
20
|
-
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
21
|
-
key is not treated as a secret value. This is *only* supported for preventing
|
|
22
|
-
misconfiguration, not for defending against malicious attacks.
|
|
23
|
-
|
|
24
|
-
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
25
|
-
character:
|
|
26
|
-
|
|
27
|
-
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
28
|
-
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
29
|
-
|
|
30
|
-
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
31
|
-
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
32
|
-
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
33
|
-
these disallowed characters will be rejected.`}).option(`cust-ip`,{type:`string`,description:`Customer end of the point-to-point link
|
|
34
|
-
|
|
35
|
-
This should always be inside the same prefix as \`p2p_ip\`.`}).option(`id`,{type:`string`,description:`The id field`}).option(`interconnect`,{type:`string`,description:`Interconnect identifier hosting this CNI`}).option(`magic-conduit-name`,{type:`string`,description:`The magic.conduit_name field`}).option(`magic-description`,{type:`string`,description:`The magic.description field`}).option(`magic-mtu`,{type:`number`,description:`The magic.mtu field`}).option(`p2p-ip`,{type:`string`,description:`Cloudflare end of the point-to-point link`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-extra-prefixes`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`,`bgp-extra-prefixes`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const x={command:`update <cni>`,describe:`Modify stored information about a CNI object`,builder:b,handler:async r=>{if(r.dryRun){c({command:`cf network-interconnects cnis update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis/${r.cni==null?`<cni>`:encodeURIComponent(String(r.cni))}`,pathParams:{cni:String(r.cni??``)},bodyKind:`json`,body:r.body===void 0?o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},cust_ip:u(r[`cust-ip`],`cust-ip`,`text`),id:u(r.id,`id`,`text`),interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]},p2p_ip:u(r[`p2p-ip`],`p2p-ip`,`text`)}):a(r.body)});return}let f=await i(r),p=r.local?d:await n(f);if(r.accountId=p,r.body){let e=a(r.body);s(await l(`Updating`,async()=>f.networkInterconnects.cnis.update({body:e,account_id:p,cni:r.cni})),{successLabel:`Updated`});return}if(r.account===void 0&&(r.account=await e(`account`,`Customer account tag`)),r[`cust-ip`]===void 0&&(r[`cust-ip`]=await e(`cust-ip`,"Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`.")),r.id===void 0&&(r.id=await e(`id`,`The id field`)),r.interconnect===void 0&&(r.interconnect=await e(`interconnect`,`Interconnect identifier hosting this CNI`)),r[`magic-conduit-name`]===void 0&&(r[`magic-conduit-name`]=await e(`magic-conduit-name`,`The magic.conduit_name field`)),r[`magic-description`]===void 0&&(r[`magic-description`]=await e(`magic-description`,`The magic.description field`)),r[`magic-mtu`]===void 0)throw Error(`--magic-mtu is required (or pass --body with this field set).`);r[`p2p-ip`]===void 0&&(r[`p2p-ip`]=await e(`p2p-ip`,`Cloudflare end of the point-to-point link`));let m=o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},cust_ip:u(r[`cust-ip`],`cust-ip`,`text`),id:u(r.id,`id`,`text`),interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]},p2p_ip:u(r[`p2p-ip`],`p2p-ip`,`text`)});s(await l(`Updating`,async()=>f.networkInterconnects.cnis.update({body:m,account_id:p,cni:r.cni})),{successLabel:`Updated`})}},S={command:`cnis`,describe:`Cloud Network Interconnect (CNI) connections — private links from cloud providers to Cloudflare`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`account`,{type:`string`,description:`The account field`}).option(`type`,{type:`string`,description:`The type field`}).option(`slot-id`,{type:`string`,description:`The slot_id field`}).option(`speed`,{type:`string`,description:`The speed field`}).option(`bandwidth`,{type:`string`,description:`Bandwidth structure as visible through the customer-facing API.`,choices:[`50M`,`100M`,`200M`,`300M`,`400M`,`500M`,`1G`,`2G`,`5G`,`10G`,`20G`,`50G`]}).option(`pairing-key`,{type:`string`,description:`Pairing key provided by GCP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`slot-id`,[`bandwidth`,`pairing-key`]).conflicts(`speed`,[`bandwidth`,`pairing-key`]).conflicts(`bandwidth`,[`slot-id`,`speed`]).implies(`bandwidth`,[`pairing-key`]).conflicts(`pairing-key`,[`slot-id`,`speed`]).implies(`pairing-key`,[`bandwidth`])}const w={command:`create`,describe:`Create a new interconnect`,builder:C,handler:async r=>{if(r.dryRun){c({command:`cf network-interconnects interconnects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account:u(r.account,`account`,`text`),type:u(r.type,`type`,`text`),slot_id:u(r[`slot-id`],`slot-id`,`text`),speed:u(r.speed,`speed`,`text`),bandwidth:u(r.bandwidth,`bandwidth`,`text`),pairing_key:u(r[`pairing-key`],`pairing-key`,`text`)}):a(r.body)});return}let f=await i(r),p=r.local?d:await n(f);if(r.accountId=p,r.body){let e=a(r.body);s(await l(`Creating`,async()=>f.networkInterconnects.interconnects.create({body:e,account_id:p})),{successLabel:`Created`});return}r.account===void 0&&(r.account=await e(`account`,`The account field`)),r.type===void 0&&(r.type=await e(`type`,`The type field`));let m=o({account:u(r.account,`account`,`text`),type:u(r.type,`type`,`text`),slot_id:u(r[`slot-id`],`slot-id`,`text`),speed:u(r.speed,`speed`,`text`),bandwidth:u(r.bandwidth,`bandwidth`,`text`),pairing_key:u(r[`pairing-key`],`pairing-key`,`text`)});s(await l(`Creating`,async()=>f.networkInterconnects.interconnects.create({body:m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <icon>`,describe:`Delete an interconnect object`,builder:T,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
36
|
-
`);return}s(await l(`Deleting`,async()=>a.networkInterconnects.interconnects.delete({account_id:o,icon:e.icon})),{successLabel:`Deleted`})}};function D(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <icon>`,describe:`Get information about an interconnect object`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.interconnects.get({account_id:a,icon:e.icon})),{successLabel:`Loaded`})}};function k(e){return e.option(`site`,{type:`string`,description:`If specified, only show interconnects located at the given site`}).option(`type`,{type:`string`,description:`If specified, only show interconnects of the given type`}).option(`cursor`,{type:`number`,description:`Cursor`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List existing interconnects`,builder:k,handler:async e=>{let r={site:e.site,type:e.type,cursor:e.cursor,limit:e.limit};if(e.dryRun){c({command:`cf network-interconnects interconnects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.networkInterconnects.interconnects.list({account_id:o,...r})),{successLabel:`Loaded`})}};function j(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`loa <icon>`,describe:`Generate the Letter of Authorization (LOA) for a given interconnect`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects loa`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}/loa`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.interconnects.loa({account_id:a,icon:e.icon})),{successLabel:`Loaded`})}};function N(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`status <icon>`,describe:`Get the current status of an interconnect object`,builder:N,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}/status`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.interconnects.status({account_id:a,icon:e.icon})),{successLabel:`Loaded`})}},F={command:`interconnects`,describe:`Physical cross-connect and partner interconnect sessions with LOA and status tracking`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Get the current settings for the active account`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/settings`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.settings.get({account_id:a})),{successLabel:`Loaded`})}};function R(e){return e.option(`default-asn`,{type:`number`,description:`The default_asn 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 z={command:`update`,describe:`Update the current settings for the active account`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({default_asn:e[`default-asn`]}):a(e.body)});return}let r=await i(e),u=e.local?d:await n(r);if(e.accountId=u,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.networkInterconnects.settings.update({...t,account_id:u})),{successLabel:`Updated`});return}let f=o({default_asn:e[`default-asn`]});s(await l(`Updating`,async()=>r.networkInterconnects.settings.update({...f,account_id:u})),{successLabel:`Updated`})}},B={command:`settings`,describe:`Account-level interconnect settings and default configurations`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`slot`,{type:`string`,description:`Slot`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <slot>`,describe:`Get information about the specified slot`,builder:V,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects slots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/slots/${e.slot==null?`<slot>`:encodeURIComponent(String(e.slot))}`,pathParams:{slot:String(e.slot??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.slots.get({account_id:a,slot:e.slot})),{successLabel:`Loaded`})}};function U(e){return e.option(`address-contains`,{type:`string`,description:`If specified, only show slots with the given text in their address field`}).option(`site`,{type:`string`,description:`If specified, only show slots located at the given site`}).option(`speed`,{type:`string`,description:`If specified, only show slots that support the given speed`}).option(`occupied`,{type:`boolean`,description:`If specified, only show slots with a specific occupied/unoccupied state`}).option(`cursor`,{type:`number`,description:`Cursor`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Retrieve a list of all slots matching the specified parameters`,builder:U,handler:async e=>{let r={address_contains:e[`address-contains`],site:e.site,speed:e.speed,occupied:e.occupied,cursor:e.cursor,limit:e.limit};if(e.dryRun){c({command:`cf network-interconnects slots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/slots`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.networkInterconnects.slots.list({account_id:o,...r})),{successLabel:`Loaded`})}},G={command:`slots`,describe:`Available interconnect facility slots showing port capacity at Cloudflare data centers`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`network-interconnects`,describe:`Physical and virtual private interconnects between your infrastructure and Cloudflare's network`,builder:e=>e.command(S).command(F).command(B).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
|
package/dist/oauth-Bk-F-tIO.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{o as e,r as t}from"./chunk-DH-VkVmc.mjs";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,o as f,p,s as m,t as h,u as ee,v as g,y as _}from"./session-DHYCE-PM.mjs";import{$ as te,A as ne,I as re,M as ie,P as ae,S as v,W as y,_ as b,a as oe,et as x,j as se,s as ce,v as le}from"./dist-C6zxsVdY.mjs";import{n as S,t as C}from"./theme-DbNbIY4d.mjs";import{i as w,n as ue,r as T}from"./config-B5k-XbwS.mjs";import{c as E,f as de,h as D,i as O,m as k,o as A,r as j,s as M,t as N}from"./dist-t_YrL25p.mjs";import{n as fe,t as pe}from"./resolve-C3h-mwp7.mjs";import{chmodSync as me,existsSync as P,mkdirSync as he,readFileSync as F,readdirSync as ge,rmSync as _e,unlinkSync as ve,writeFileSync as I}from"node:fs";import"node:os";import L,{dirname as R,join as z}from"node:path";import{URLSearchParams as ye}from"node:url";import"node:process";const{white:be,gray:xe,dim:Se,hidden:Ce,bold:we,cyanBright:Te,bgCyan:Ee}=D;D.hex(`#BD5B08`);const B=D.hex(`#111`);D.hex(`#0E838F`);const De=B.bgHex(`#0E838F`);D.hex(`#AB2526`);const Oe=B.bgHex(`#AB2526`);D.hex(`#218529`);const ke=B.bgHex(`#218529`);D.hex(`#7F7322`);const Ae=B.bgHex(`#7F7322`),je=process.stdout;process.stderr;var Me=e(E(),1);const Ne={diamond:`◇`,dash:`─`,radioInactive:`○`,radioActive:`●`,backActive:`◀`,backInactive:`◁`,bar:`│`,leftT:`├`,rigthT:`┤`,arrows:{left:`‹`,right:`›`},corners:{tl:`╭`,bl:`╰`,tr:`╮`,br:`╯`}};Oe(` ERROR `),Ae(` WARNING `),De(` INFO `),ke(` SUCCESS `),be.bgRed(` X `),M(je),xe(Ne.bar),xe(Ne.corners.bl),xe(Ne.leftT);function Pe(){try{return!!(process.stdin.isTTY&&process.stdout.isTTY)}catch{return!1}}function V(){return!Pe()||Me.isCI}const Fe=Me.isCI;function Ie(){h(_)}async function Le(e){let t=S(),n=e.map(e=>({value:e,label:e.name})),r=await new de({options:n,initialValue:n[0]?.value,render(){let e=t.bold(`Select an account`),n=this.options.map((e,n)=>{let r=n===this.cursor,i=e.value,a=t.hex(C.muted)(`${i.id.slice(0,12)}...`);return r?` ${t.hex(C.orange)(`>`)} ${t.bold(i.name)} ${a}`:` ${t.dim(i.name)} ${a}`});return`${e} ${t.dim(`(use arrow keys, enter to confirm)`)}\n${n.join(`
|
|
3
|
-
`)}`}}).prompt();return k(r)||!r?null:r}async function Re(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
|
|
4
|
-
`)?t.slice(0,-1):t}async function ze(e,t,n){let r=n?.kind??`text`;if(V()){if(r===`secret`){let t=await Re();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let i=`Enter value for --${e}`,a=t||n?.question||i;Ie();let o=r===`secret`?await j({message:a,mask:`•`,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`}):await A({message:a,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`});return(k(o)||typeof o!=`string`)&&process.exit(130),o}async function Be(e,t,n){if(V())throw Error(`--${e} is required (one of: ${n.join(`, `)}). Pass --${e} <value> or run interactively.`);let r=`Select value for --${e}`,i=t||r;Ie();let a=await O({message:i,options:n.map(e=>({value:e,label:e}))});return(k(a)||typeof a!=`string`)&&process.exit(130),a}async function Ve(e={}){if(e.force===!0)return!0;let t=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(V()){let e=S();return process.stderr.write(`${e.hex(C.warning)(`?`)} ${t}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}Ie();let n=await N({message:t,initialValue:!1});return k(n)&&process.exit(130),n===!0}const H=`.cfrc`;function U(e){let t=e||process.cwd(),n=R(t);for(;t!==n;){let e=z(t,H);if(P(e))try{let t=F(e,`utf-8`).replace(/^\s*\/\/.*$/gm,``);return{config:JSON.parse(t),path:e}}catch{}t=R(t)}let r=z(t,H);if(P(r))try{let e=F(r,`utf-8`).replace(/^\s*\/\/.*$/gm,``);return{config:JSON.parse(e),path:r}}catch{}return null}function He(e,t){I(z(t||process.cwd(),H),JSON.stringify(e,null,2)+`
|
|
5
|
-
`,{mode:384})}function Ue(e){let t=z(e||process.cwd(),H);return P(t)?(ve(t),!0):!1}async function We(e){let t={},n=W(`accountId`,`CLOUDFLARE_ACCOUNT_ID`);n&&(t.accountId=n);let r=W(`zone`,`CLOUDFLARE_ZONE_ID`,e?.zone);r&&(t.zone=r);let i=W(`complianceRegion`,`CLOUDFLARE_COMPLIANCE_REGION`);return i&&(t.complianceRegion=i),t}function W(e,t,n){if(n)return{value:n,source:`flag`};let r=process.env[t];if(r)return{value:r,source:`env`};let i=U(),a=i?.config[e];if(a)return{value:a,source:`project`,path:i.path};let o=T().defaults?.[e];if(o)return{value:o,source:`config`,path:ue()}}function Ge(){return W(`accountId`,`CLOUDFLARE_ACCOUNT_ID`)?.value}async function Ke(e){let t=W(`accountId`,`CLOUDFLARE_ACCOUNT_ID`);if(t)return qe(t.value,rt(t,`accountId`)),t.value;if(e){let t=await Je(e);if(t)return t}throw Error(`No account ID found.
|
|
6
|
-
|
|
7
|
-
Please provide one of the following:
|
|
8
|
-
1. CLOUDFLARE_ACCOUNT_ID environment variable
|
|
9
|
-
2. Run 'cf context set account-id <id>' to set a default
|
|
10
|
-
3. Create a .cfrc file in your project
|
|
11
|
-
|
|
12
|
-
You can find your account ID in the Cloudflare dashboard URL:
|
|
13
|
-
https://dash.cloudflare.com/<account-id>/...`)}function qe(e,t){if(!process.env.DEBUG)return;let n=e.length>12?e.slice(0,12)+`…`:e;process.stderr.write(`Using account: ${n} (${t})\n`)}async function Je(e){let t;try{t=await ot(e)}catch{return}if(t.length===0)return;if(t.length===1&&t[0]){let n=t[0],{displayName:r}=await it(`accountId`,n.id,`user`,e);return qe(n.id,`auto-selected from token — ${r}`),n.id}if(V()){let e=t.map(e=>` ${e.id} ${e.name}`).join(`
|
|
14
|
-
`);throw Error(`Multiple accounts available but running non-interactively.
|
|
15
|
-
|
|
16
|
-
Available accounts:
|
|
17
|
-
${e}
|
|
18
|
-
|
|
19
|
-
Set one with CLOUDFLARE_ACCOUNT_ID or 'cf context set account-id'.`)}let n=await Le(t);n||process.exit(130);let{displayName:r}=await it(`accountId`,n.id,`user`,e);return qe(n.id,`selected interactively — ${r}`),n.id}async function Ye(e,t,n){if(e?.zoneId)return Xe(e.zoneId,t);let r=W(`zone`,`CLOUDFLARE_ZONE_ID`,e?.zone);if(r){if(!n?.quiet&&r.source!==`flag`){let e=rt(r);console.error(`Using zone: ${r.value} (from ${e})`)}return Xe(r.value,t)}throw Error(`No zone specified.
|
|
20
|
-
|
|
21
|
-
Please provide one of the following:
|
|
22
|
-
1. Zone as a positional argument: cf dns records list <zone>
|
|
23
|
-
2. --zone flag (or -z): cf dns records list --zone example.com
|
|
24
|
-
3. CLOUDFLARE_ZONE_ID environment variable
|
|
25
|
-
4. Run 'cf context set zone <zone>' to set a default
|
|
26
|
-
5. Create a .cfrc file in your project with {"zone": "example.com"}`)}async function Xe(e,t){if(pe(e)||!t)return e;let{resolveZoneId:n}=await import(`./resolve-C3h-mwp7.mjs`).then(e=>e.r);return n(t,await Ke(),e)}function Ze(e){if(e?.scriptName)return e.scriptName;throw Error("Required Worker name missing. Please specify the Worker name with `--worker <name>`.")}const Qe=[`public`,`fedramp_high`],$e={"account-id":`accountId`,zone:`zone`,"compliance-region":`complianceRegion`},et=Object.keys($e);function tt(e){return Qe.includes(e)}function nt(){let e=W(`complianceRegion`,`CLOUDFLARE_COMPLIANCE_REGION`);if(!e)return`public`;if(!tt(e.value))throw Error(`Invalid compliance region "${e.value}". Must be one of: ${Qe.join(`, `)}`);return e.value}function rt(e,t=`zone`){switch(e.source){case`flag`:return t===`zone`?`--zone flag`:`(flag)`;case`env`:return{accountId:`CLOUDFLARE_ACCOUNT_ID`,zone:`CLOUDFLARE_ZONE_ID`,complianceRegion:`CLOUDFLARE_COMPLIANCE_REGION`}[t];case`project`:return`.cfrc`;case`config`:return`~/.config/cf/config.json`}}async function it(e,t,n,r){let i=t,a=t;if(e===`accountId`){if(!r)throw Error(`Authentication required to validate account ID`);let{id:e,name:n}=await st(t,r);i=e,a=n?`${e.slice(0,12)}... (${n})`:e}else if(e===`zone`){if(!r)throw Error(`Authentication required to validate zone`);let e=await ct(t,r);i=t,a=e.name}else e===`complianceRegion`&&(i=t,a=t);if(n===`project`){let t=U()?.config||{};t[e]=i,He(t)}else{let t=T();t.defaults||={},t.defaults[e]=i,w(t)}return{resolvedValue:i,displayName:a}}function at(e,t){if(t===`project`)if(e===`all`)Ue();else{let t=U();t&&(delete t.config[e],Object.keys(t.config).length===0?Ue(R(t.path)):He(t.config,R(t.path)))}else{let t=T();t.defaults&&(e===`all`?delete t.defaults:(delete t.defaults[e],Object.keys(t.defaults).length===0&&delete t.defaults),w(t))}}async function ot(e){return(await e.accounts.list({})).result}async function st(e,t){let n=await ot(t),r=n.find(t=>t.id===e);if(r)return{id:r.id,name:r.name};let i=n.find(t=>t.name.toLowerCase()===e.toLowerCase());if(i)return{id:i.id,name:i.name};if(pe(e))return{id:e};throw Error(`Account not found: "${e}"
|
|
27
|
-
|
|
28
|
-
Available accounts:
|
|
29
|
-
${n.map(e=>` ${e.id.slice(0,12)}... ${e.name}`).join(`
|
|
30
|
-
`)}`)}async function ct(e,t){let n=(await t.zones.list({})).result,r=n.find(t=>t.id===e);if(r)return{id:r.id,name:r.name};let i=n.find(t=>t.name.toLowerCase()===e.toLowerCase());if(i)return{id:i.id,name:i.name};throw fe(e)?Error(`Zone not found: "${e}"
|
|
31
|
-
|
|
32
|
-
This zone either doesn't exist or you don't have access to it.
|
|
33
|
-
Run 'cf zones list' to see available zones.`):Error(`Invalid zone: "${e}"
|
|
34
|
-
|
|
35
|
-
Please provide a zone ID or domain name.
|
|
36
|
-
Run 'cf zones list' to see available zones.`)}function lt(){return z(process.cwd(),H)}function ut(e){function t(){return L.resolve(e(),`preferences.json`)}n(t,`getUserPreferencesPath`);function r(){try{let e=F(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}n(r,`readUserPreferences`);function i(e){let n={...r(),...e},i=t();he(L.dirname(i),{recursive:!0}),I(i,JSON.stringify(n,null,` `),{encoding:`utf-8`})}return n(i,`updateUserPreferences`),{readUserPreferences:r,updateUserPreferences:i}}n(ut,`createPreferences`);var dt=6e4,ft=525600,pt=43200,mt=1440,ht=Symbol.for(`constructDateFrom`);function G(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&ht in e?e[ht](t):e instanceof Date?new e.constructor(t):new Date(t)}n(G,`constructFrom`);function K(e,t){return G(t||e,e)}n(K,`toDate`);var gt={};function _t(){return gt}n(_t,`getDefaultOptions`);function vt(e){let t=K(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}n(vt,`getTimezoneOffsetInMilliseconds`);function yt(e,...t){let n=G.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}n(yt,`normalizeDates`);function bt(e,t){let n=K(e)-+K(t);return n<0?-1:n>0?1:n}n(bt,`compareAsc`);function xt(e){return G(e,Date.now())}n(xt,`constructNow`);function St(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}n(St,`getRoundingMethod`);var Ct={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},wt=n((e,t,n)=>{let r,i=Ct[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function q(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}n(q,`buildFormatLongFn`);var Tt={date:q({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:q({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:q({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Et={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Dt=n((e,t,n,r)=>Et[e],`formatRelative`);function J(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}n(J,`buildLocalizeFn`);var Ot={ordinalNumber:n((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:J({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:J({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:n(e=>e-1,`argumentCallback`)}),month:J({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:J({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:J({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Y(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?At(s,e=>e.test(o)):kt(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}n(Y,`buildMatchFn`);function kt(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}n(kt,`findKey`);function At(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}n(At,`findIndex`);function jt(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}n(jt,`buildMatchPatternFn`);var Mt={code:`en-US`,formatDistance:wt,formatLong:Tt,formatRelative:Dt,localize:Ot,match:{ordinalNumber:jt({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:n(e=>parseInt(e,10),`valueCallback`)}),era:Y({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Y({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:n(e=>e+1,`valueCallback`)}),month:Y({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Y({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Y({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Nt(e,t,n){let r=_t(),i=n?.locale??r.locale??Mt,a=bt(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=yt(n?.in,...a>0?[t,e]:[e,t]),l=St(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/dt,f=(u-(vt(c)-vt(s)))/dt,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<mt?`hour`:f<pt?`day`:f<ft?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}else if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}else if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}else if(m===`day`){let e=l(f/mt);return i.formatDistance(`xDays`,e,o)}else if(m===`month`){let e=l(f/pt);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}else{let e=l(f/ft);return i.formatDistance(`xYears`,e,o)}}n(Nt,`formatDistanceStrict`);function Pt(e,t){return Nt(e,xt(e),t)}n(Pt,`formatDistanceToNowStrict`);function X(e,t){return{read:n(()=>{let n=t();if(!P(n))return;let r=te(n);try{return p(e,r)}catch{return}},`read`),write(n){let r=t();he(L.dirname(r),{recursive:!0}),I(r,c(e,n),{encoding:`utf-8`,mode:384}),me(r,384)},clear(){let e=t(),n=P(e);return _e(e,{force:!0}),n},path:t}}n(X,`createFileStorage`);function Ft(e){let{logger:t,prompt:r}=e;return n(async function(e,n){if(ie())return t.log(n),!0;let i=await r(e);return typeof i==`string`&&i.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}n(Ft,`createTemporaryTermsPrompt`);var It=[9106,1e4];function Lt(e){return e?.code}n(Lt,`getErrorCode`);function Rt(e){let t=Lt(e);return t!==void 0&&It.includes(t)}n(Rt,`isMembershipsInaccessible`);function zt(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`}}n(zt,`notLoggedInErrorBodies`);function Bt(e,t,n){let r=new Date(t.claim.expiresAt);e.log(m`
|
|
37
|
-
Temporary account ready:
|
|
38
|
-
Account: ${t.account.name} (${n?`reused`:`created`})
|
|
39
|
-
Claim within: ${Pt(r)}
|
|
40
|
-
Claim URL: ${t.claim.url}
|
|
41
|
-
`)}n(Bt,`logTemporaryPreviewAccount`);function Vt(e,t){let{logger:i}=t,a=e.cliName,o=zt(e.commands.login),s=`
|
|
42
|
-
Run \`${e.commands.whoami}\` to check your current authentication status.`,c=ut(e.getConfigPath),d=oe(i,e.cacheNamespace?{namespace:e.cacheNamespace}:void 0),f=l({serviceName:e.keyringServiceName,getConfigPath:e.getConfigPath,isKeyringEnabled:n(()=>c.readUserPreferences().keyring_enabled===!0,`isKeyringEnabled`),logger:i,isNonInteractiveOrCI:ie,loginCommand:e.commands.login,format:e.fileFormat}),p=e.allowGlobalAuthKey??!0,m=r({logger:i,isNonInteractiveOrCI:ie,openInBrowser:n(e=>ae(e,i),`openInBrowser`),hasEnvCredentials:n(()=>u({allowGlobalAuthKey:p})!==void 0,`hasEnvCredentials`),purgeOnLoginOrLogout:d.purgeConfigCaches,clientId:e.clientId,consent:e.consent,redirectUri:e.redirectUri,storageFactory:f.storageFactory,allowGlobalAuthKey:p,temporary:{storage:X(e.fileFormat,e.getTemporaryAccountConfigPath),prompt:Ft({logger:i,prompt:t.prompt})}});function h(e){m.setProfile(e)}n(h,`setProfile`);function g(){return m.getActiveProfile()}n(g,`getActiveProfile`);function _(){return f.getActiveStore(m.getActiveProfile())}n(_,`getCredentialStore`);function te(e){m.setTemporaryAllowed(e)}n(te,`setTemporaryAllowed`);function v(){return m.getAPIToken()}n(v,`getAPIToken`);function b(){return m.requireApiToken()}n(b,`requireApiToken`);function x(t,n){return{complianceConfig:t,scopes:n?.scopes??e.getDefaultScopeKeys(),browser:n?.browser??!0,callbackHost:n?.callbackHost,callbackPort:n?.callbackPort,profile:n?.profile}}n(x,`withDefaultScopes`);async function S(e,t){return m.login(x(e,t))}n(S,`login`);async function C(e){return m.logout(e)}n(C,`logout`);async function w(e,t){return m.getActiveTemporaryAccount()?{loggedIn:!0}:m.loginOrRefreshIfRequired(x(e,t))}n(w,`loginOrRefreshIfRequired`);async function ue(){return m.getOAuthTokenFromLocalState()}n(ue,`getOAuthTokenFromLocalState`);function T(){return m.getScopes()}n(T,`getScopes`);function E(){return f.storageFactory(g()).read()}n(E,`readAuthCredentials`);function de(e){f.storageFactory(g()).write(e)}n(de,`writeAuthCredentials`);function D(){let t=m.getActiveProfile();return t===`default`?`${e.accountCachePrefix}.json`:`${e.accountCachePrefix}-${t}.json`}n(D,`getAccountCacheFileName`);function O(e){d.saveToConfigCache(D(),{account:e})}n(O,`saveAccountToCache`);function k(){return d.getConfigCache(D()).account}n(k,`getAccountFromCache`);async function A(e,n){let r=await w(e);if(!r.loggedIn)throw new y(`Not logged in. ${o[r.reason]}${s}`,{telemetryMessage:`cfetch auth login required`});let a=b(),c=[],l=!0,u=1,d;for(;l;){d=new ye(d),d.set(`page`,String(u));let{response:r,status:o}=await ce(e,n,{},t.userAgent,i,d,void 0,a);r.success?(c.push(...r.result),ne(r.result_info)?u+=1:l=!1):re(n,r,o)}return c}n(A,`fetchAccountsPaged`);async function j(t,n={}){let{throwOnEmpty:r=!0}=n,[i,a]=await Promise.allSettled([A(t,`/accounts`),A(t,`/memberships`)]);if(i.status===`rejected`)throw i.reason;if(a.status===`rejected`)if(Rt(a.reason)){if(i.status===`fulfilled`&&i.value.length>0)return i.value;throw Lt(a.reason)===9106?new y(`Failed to automatically retrieve account IDs for the logged in user.
|
|
43
|
-
You may have incorrect permissions on your API token, or an environment variable such as CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY, or CLOUDFLARE_EMAIL may be set to an invalid value.
|
|
44
|
-
Check your environment and unset or correct any Cloudflare credential variables, or run \`${e.commands.login}\` to re-authenticate.
|
|
45
|
-
You can also skip this account check by adding an \`account_id\` in your ${e.getConfigFileLabel()} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,{telemetryMessage:`user account fetch permission denied`}):new y(`Failed to automatically retrieve account IDs for the logged in user.
|
|
46
|
-
You may have incorrect permissions on your API token, or your authentication may have expired. Try running \`${e.commands.login}\` to re-authenticate. You can also skip this account check by adding an \`account_id\` in your ${e.getConfigFileLabel()} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,{telemetryMessage:`user account fetch permission denied`})}else throw a.reason;let o=new Set(a.value.map(e=>e.account.id)),s=i.value.filter(e=>o.has(e.id));if(s.length===0&&r)throw new y(`Failed to automatically retrieve account IDs for the logged in user.
|
|
47
|
-
In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your ${e.getConfigFileLabel()} file.
|
|
48
|
-
Alternatively, try running \`${e.commands.login}\` to re-authenticate.`,{telemetryMessage:`user account fetch empty`});return s}n(j,`fetchAllAccounts`);function M(e){let t=m.getActiveTemporaryAccount();return t?t.account.id:e.account_id?e.account_id:ee()||k()?.id}n(M,`getActiveAccountId`);async function N(n){let r=M(n);if(r)return r;let i=await j(n);if(i.length===1)return O({id:i[0].id,name:i[0].name}),i[0].id;try{let e=await t.select(`Select an account`,{choices:i.map(e=>({title:e.name,value:e.id}))}),n=i.find(t=>t.id===e);if(!n)throw Error(`Selected account not found in accounts list`);return O({id:n.id,name:n.name}),e}catch(n){if(t.isNoDefaultValueProvidedError(n)){let t=se();throw new y(`More than one account available but unable to select one in non-interactive mode.
|
|
49
|
-
Please set the appropriate \`account_id\` in your ${e.getConfigFileLabel()} file or assign it to the \`CLOUDFLARE_ACCOUNT_ID\` environment variable.
|
|
50
|
-
Available accounts are (\`<name>\`: \`<account_id>\`):
|
|
51
|
-
${i.map(e=>` \`${t?`(redacted)`:e.name}\`: \`${e.id}\``).join(`
|
|
52
|
-
`)}`,{telemetryMessage:`user account selection unavailable`})}throw n}}n(N,`getOrSelectAccountId`);async function fe(e){if(m.isTemporaryAllowed()){if(le(e)!==`public`)throw new y(`Temporary accounts aren't available when the compliance region is not set to public.`,{telemetryMessage:`user temporary account unavailable in compliance region`});if(v())throw new y("You're already authenticated with Cloudflare, so `--temporary` can't be used. Temporary preview accounts are only for unauthenticated use. Either remove `--temporary` to use your existing account, or log out (and unset CLOUDFLARE_API_TOKEN) first.",{telemetryMessage:`user temporary account already authenticated`});let{account:t,cached:n}=await m.activateTemporaryAccount();return Bt(i,t,n),t.account.id}let t=await w(e);if(!t.loggedIn)throw t.reason===`no-credentials-non-interactive`||t.reason===`token-expired-non-interactive`?new y(`In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for ${a} to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN.`,{telemetryMessage:`user auth missing api token non interactive`}):new y(`Did not login, quitting...`,{telemetryMessage:`user login cancelled`});let n=await N(e);if(!n)throw new y(`No account id found, quitting...`,{telemetryMessage:`user auth missing account id`});return n}return n(fe,`requireAuth`),{setProfile:h,getActiveProfile:g,getCredentialStore:_,setTemporaryAllowed:te,getAPIToken:v,requireApiToken:b,login:S,logout:C,loginOrRefreshIfRequired:w,getOAuthTokenFromLocalState:ue,getScopes:T,readAuthCredentials:E,writeAuthCredentials:de,getActiveAccountId:M,getOrSelectAccountId:N,getAccountFromCache:k,fetchAllAccounts:j,requireAuth:fe}}n(Vt,`createCloudflareAuth`);var Ht=`profiles/directory-bindings.json`,Ut=`.enc`;function Wt(e){let{logger:t,getConfigPath:r,keyringServiceName:a,format:s}=e,c=`.${s}`;function l(e){return i(r(),e,s)}n(l,`plaintextPath`);function u(e){return o(r(),e)}n(u,`encryptedPath`);function p(){return L.dirname(l(`default`))}n(p,`getProfileConfigDirectory`);let m={exists(e){return P(l(e))||P(u(e))},list(){let e=p();if(!P(e))return[];let t=new Set;for(let n of ge(e))n.endsWith(c)?t.add(n.slice(0,-c.length)):n.endsWith(Ut)&&t.add(n.slice(0,-Ut.length));return[...t]},delete(e){let{backendAvailable:n,encryptedFileExisted:i}=d({serviceName:a,configPath:r(),profile:e,format:s});X(s,()=>l(e)).clear(),i&&!n&&t.warn(`Removed the credential files for profile "${e}", but the keyring backend was not reachable on this host so its keyring entry could not be cleared. Clear it manually if it persists.`)}};function h(){return L.join(r(),Ht)}return n(h,`getDirectoryBindingsPath`),f({configs:m,bindings:{read(){try{let e=F(h(),`utf-8`);return JSON.parse(e)}catch{return{}}},write(e){let t=h();he(L.dirname(t),{recursive:!0}),I(t,JSON.stringify(e,null,` `),`utf-8`)}}})}n(Wt,`createCloudflareProfileStore`);function Gt(e){let{loginCommand:t,createProfileCommand:r,keyringServiceName:i,getConfigPath:c,format:l,preferences:u}=e,{readUserPreferences:f,updateUserPreferences:p}=u;function m(e){return e??`default`}n(m,`describeProfile`);function h(e){let t=[];P(o(c()))&&t.push(void 0);let n=Wt({logger:e,getConfigPath:c,keyringServiceName:i,format:l});for(let e of n.configs.list()){try{s(e)}catch{continue}P(o(c(),e))&&t.push(e)}return t}n(h,`listEncryptedProfiles`);function ee(e){let n=h(e);if(n.length===0)return;let a=[],o=[];for(let t of n)try{let{backendAvailable:e}=d({serviceName:i,configPath:c(),profile:t,format:l});a.push(m(t)),e||o.push(m(t))}catch(n){e.warn(`Failed to remove encrypted credentials for profile "${m(t)}": ${n instanceof Error?n.message:String(n)}. You may need to clear them manually.`)}if(a.length>0){let n=r?`Re-authenticate with \`${t}\` (default profile) or \`${r} <name>\` (named profiles).`:`Re-authenticate with \`${t}\`.`;e.log(`Removed encrypted credentials for ${a.map(e=>`"${e}"`).join(`, `)}. ${n}`)}o.length>0&&e.warn(`The keyring backend was not reachable on this host, so the keyring entry for ${o.map(e=>`"${e}"`).join(`, `)} could not be cleared. Clear it manually if it persists.`)}n(ee,`scrubAllEncryptedProfiles`);function g(e,t){let{logger:n,getCredentialStore:r}=t,i=f().keyring_enabled===!0,o=a();if(o!==void 0&&o!==e&&n.warn(`CLOUDFLARE_AUTH_USE_KEYRING=${o} overrides ${e?`enabling`:`disabling`} keyring storage for this command.`),!e&&o!==!0&&ee(n),p({keyring_enabled:e}),e&&o!==!1)try{r().kind!==`encrypted-file`&&(p({keyring_enabled:i}),n.warn(`Keyring storage isn't available on this host (see warning above), so it was not enabled. Try again once the keyring backend is reachable.`))}catch(e){throw p({keyring_enabled:i}),e}return{enabled:f().keyring_enabled===!0}}return n(g,`setKeyringPreference`),{setKeyringPreference:g}}n(Gt,`createKeyringPreference`);function Kt(e){let{getConfigPath:t,format:r}=e;function a(e){return i(t(),e,r)}n(a,`getAuthConfigFilePath`);function s(e){return o(t(),e)}n(s,`getEncryptedAuthConfigFilePath`);function c(e){return X(r,()=>a(e))}n(c,`defaultAuthConfigStorage`);function l(e,t){c(t).write(e)}n(l,`writeAuthConfigFile`);function u(e){return c(e).read()}return n(u,`readAuthConfigFile`),{getAuthConfigFilePath:a,getEncryptedAuthConfigFilePath:s,defaultAuthConfigStorage:c,readAuthConfigFile:u,writeAuthConfigFile:l}}n(Kt,`createAuthConfigFileHelpers`);var qt=`cloudflare`,Jt=`cf`,Yt=`http://localhost:8877/oauth/callback`,Xt={granted:{url:`https://welcome.developers.workers.dev/cf-oauth-consent-granted`},denied:{url:`https://welcome.developers.workers.dev/cf-oauth-consent-denied`,error:"Error: Consent denied. You must grant consent to cf in order to login.\nIf you don't want to do this consider passing an API token via the `CLOUDFLARE_API_TOKEN` environment variable"}},Zt=v({variableName:`CLOUDFLARE_CLIENT_ID`,defaultValue:n(()=>`cbca97e7-c331-4cdd-8fd8-e25a451b98bf`,`defaultValue`)});function Z(){return x({appName:`cloudflare`,leadingDot:!1,useLegacyHomeDir:!1})}n(Z,`getCfConfigPath`);var Qt=`openid.offline.user:read.account:read.access:read.access:write.agw:read.agw:run.agw:write.ai:read.ai:write.ai-search:read.ai-search:run.ai-search:write.aiaudit:read.aiaudit:write.aig:read.aig:write.auditlogs:read.browser:read.browser:write.cfone:read.cfone:write.cloudchamber:write.connectivity:admin.connectivity:bind.connectivity:read.constellation:write.containers:write.d1:write.dex:read.dex:write.dns_analytics:read.dns_records:edit.dns_records:read.dns_settings:read.firstpartytags:write.images:read.images:write.lb:edit.lb:read.logpush:read.logpush:write.mcp_portals:read.mcp_portals:write.notebook-examples:read.notification:read.notification:write.pages:read.pages:write.pipelines:read.pipelines:setup.pipelines:write.query_cache:write.queues:write.r2_catalog:write.radar:read.rag:read.rag:write.registrar:read.registrar:write.secrets_store:read.secrets_store:write.sso-connector:read.sso-connector:write.ssl_certs:write.teams:pii.teams:read.teams:secure_location.teams:write.url_scanner:read.url_scanner:write.vectorize:write.workers:read.workers:write.workers_builds:read.workers_builds:write.workers_deployments:read.workers_kv:write.workers_observability:read.workers_observability:write.workers_observability_telemetry:write.workers_routes:write.workers_scripts:write.workers_tail:read.zone:read`.split(`.`),$t=[...Qt];function en(e){$t=e}n(en,`setLoginScopeKeys`);var tn=new Set(Qt);function nn(e){return e.every(e=>tn.has(e))}n(nn,`validateScopeKeys`);function rn(){let e=b();return e===`production`?`cloudflare-temporary-account.json`:`cloudflare-temporary-account.${e}.json`}n(rn,`getTemporaryAccountConfigFile`);function an(){return L.join(Z(),rn())}n(an,`getCfTemporaryAccountConfigPath`);function on(e){return X(`json`,e)}n(on,`createJsonFileStorage`);var{getAuthConfigFilePath:sn,getEncryptedAuthConfigFilePath:cn,defaultAuthConfigStorage:ln,readAuthConfigFile:un,writeAuthConfigFile:dn}=Kt({getConfigPath:Z,format:`json`}),Q={cliName:Jt,commands:{login:`cf auth login`,whoami:`cf auth whoami`},keyringServiceName:qt,clientId:Zt,consent:Xt,redirectUri:Yt,allowGlobalAuthKey:!1,getConfigPath:Z,getTemporaryAccountConfigPath:an,fileFormat:`json`,accountCachePrefix:`cloudflare-account`,cacheNamespace:`cloudflare`,getConfigFileLabel:n(()=>`cf config`,`getConfigFileLabel`),getDefaultScopeKeys:n(()=>$t,`getDefaultScopeKeys`)},fn=ut(Z),{readUserPreferences:pn,updateUserPreferences:mn}=fn;function hn(e){return Vt(Q,e)}n(hn,`createCfAuth`);function gn(e){return Wt({logger:e.logger,getConfigPath:Z,keyringServiceName:qt,format:`json`})}n(gn,`createCfProfileStore`);var _n=Gt({loginCommand:Q.commands.login,createProfileCommand:Q.commands.createProfile,keyringServiceName:qt,getConfigPath:Z,format:`json`,preferences:fn});function vn(e,t){return _n.setKeyringPreference(e,t)}n(vn,`setKeyringPreference`);var yn=t({getActiveProfile:()=>Dn,getConfigPath:()=>Nn,getProfileStore:()=>On,getValidToken:()=>An,isOAuthLoggedIn:()=>jn,login:()=>wn,logout:()=>Tn,readAuthCredentials:()=>Mn,resolveProfile:()=>kn,setProfile:()=>En});const bn={debug:(...e)=>{process.env.DEBUG&&console.error(...e)},info:(...e)=>console.error(...e),log:(...e)=>console.error(...e),warn:(...e)=>console.error(...e),error:(...e)=>console.error(...e)};var xn=class extends Error{};async function Sn(e){if(V())throw new xn;h(_);let t=await A({message:e});return(k(t)||typeof t!=`string`)&&process.exit(130),t}async function Cn(e,t){if(V())throw new xn;h(_);let n=await O({message:e,options:t.choices.map(({title:e,value:t})=>({label:e,value:t}))});return(k(n)||typeof n!=`string`)&&process.exit(130),n}const $=hn({logger:bn,userAgent:g,prompt:Sn,select:Cn,isNoDefaultValueProvidedError:e=>e instanceof xn});function wn(e){if(e?.scopes&&!nn(e.scopes))throw Error(`One or more of the requested scopes are not valid cf OAuth scopes.`);return $.login({compliance_region:nt()},{browser:e?.browser??!0,...e?.scopes&&{scopes:e.scopes},...e?.profile&&{profile:e.profile}})}function Tn(e){return $.logout(e)}function En(e){$.setProfile(e)}function Dn(){return $.getActiveProfile()}function On(){return gn({logger:bn})}function kn(e,t=process.cwd()){let n=On().resolve({profile:e,cwd:t});return En(n),n}function An(){return $.getOAuthTokenFromLocalState()}function jn(){return $.readAuthCredentials()?.oauth_token!==void 0}function Mn(){return $.readAuthCredentials()}function Nn(){return $.getCredentialStore().path()}export{it as C,Fe as D,ze as E,V as O,Ge as S,Be as T,nt as _,jn as a,Ze as b,yn as c,et as d,$e as f,Ke as g,U as h,An as i,Pe as k,Mn as l,at as m,Nn as n,wn as o,Qe as p,On as r,Tn as s,Dn as t,En as u,We as v,Ve as w,Ye as x,lt as y};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.mjs";function m(e){return e.option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck 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 h={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:m,handler:async i=>{if(i.dryRun){l({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled,name:d(i.name,`name`,`text`),skipPreflightCheck:i[`skip-preflight-check`]}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(i[`configuration-type`]===void 0&&(i[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),i[`configuration-url`]===void 0&&(i[`configuration-url`]=await e(`configuration-url`,`The configuration.url field`)),i.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await e(`name`,`The name field`));let h=s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled,name:d(i.name,`name`,`text`),skipPreflightCheck:i[`skip-preflight-check`]});c(await u(`Creating`,async()=>p.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:g,handler:async e=>{if(e.dryRun){l({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations/${e.slug==null?`<slug>`:encodeURIComponent(String(e.slug))}`,pathParams:{slug:String(e.slug??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>n.observability.destinations.delete({account_id:o,slug:e.slug})),{successLabel:`Deleted`})}};function v(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List your Workers Observability Telemetry Destinations.`,builder:p(v),handler:async e=>{let n={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.observability.destinations.list({account_id:o,...n})),{successLabel:`Loaded`})}};function b(e){return e.positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled 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 x={command:`update <slug>`,describe:`Update an existing Workers Observability Telemetry Destination.`,builder:b,handler:async i=>{if(i.dryRun){l({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations/${i.slug==null?`<slug>`:encodeURIComponent(String(i.slug))}`,pathParams:{slug:String(i.slug??``)},bodyKind:`json`,body:i.body===void 0?s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Updating`,async()=>p.observability.destinations.update({...e,account_id:m,slug:i.slug})),{successLabel:`Updated`});return}if(i[`configuration-type`]===void 0&&(i[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),i[`configuration-url`]===void 0&&(i[`configuration-url`]=await e(`configuration-url`,`The configuration.url field`)),i.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled});c(await u(`Updating`,async()=>p.observability.destinations.update({...h,account_id:m,slug:i.slug})),{successLabel:`Updated`})}},S={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const w={command:`create`,describe:`Persist query for later use.`,builder:C,handler:async n=>{if(n.dryRun){l({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.observability.queries.create({...e,account_id:p})),{successLabel:`Created`});return}n.description===void 0&&(n.description=await e(`description`,`The description field`)),n.name===void 0&&(n.name=await e(`name`,`Query name`)),n[`parameters-order-by-value`]===void 0&&(n[`parameters-order-by-value`]=await e(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});c(await u(`Creating`,async()=>i.observability.queries.create({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <queryId>`,describe:`Delete a saved query.`,builder:T,handler:async e=>{if(e.dryRun){l({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>n.observability.queries.delete({account_id:o,queryId:e[`query-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const O={command:`edit <queryId>`,describe:`Update saved query.`,builder:D,handler:async n=>{if(n.dryRun){l({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries/${n[`query-id`]==null?`<query-id>`:encodeURIComponent(String(n[`query-id`]))}`,pathParams:{"query-id":String(n[`query-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Updating`,async()=>i.observability.queries.edit({...e,account_id:p,queryId:n[`query-id`]})),{successLabel:`Updated`});return}n.description===void 0&&(n.description=await e(`description`,`The description field`)),n.name===void 0&&(n.name=await e(`name`,`Query name`)),n[`parameters-order-by-value`]===void 0&&(n[`parameters-order-by-value`]=await e(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});c(await u(`Updating`,async()=>i.observability.queries.edit({...m,account_id:p,queryId:n[`query-id`]})),{successLabel:`Updated`})}};function k(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <queryId>`,describe:`Retrieve a saved query.`,builder:k,handler:async e=>{if(e.dryRun){l({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.observability.queries.get({account_id:i,queryId:e[`query-id`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List saved queries.`,builder:p(j),handler:async e=>{let n={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.observability.queries.list({account_id:o,...n})),{successLabel:`Loaded`})}},N={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`from`,{type:`number`,description:`The from field`}).option(`key-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`key-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`limit`,{type:`number`,description:`Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering.`}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`to`,{type:`number`,description:`The to field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Find keys in your telemetry events matching a specific filter or needle.`})}const F={command:`keys`,describe:`List all the keys in your telemetry events.`,builder:P,handler:async e=>{if(e.dryRun){l({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({datasets:e.datasets,from:e.from,keyNeedle:{isRegex:e[`key-needle-is-regex`],matchCase:e[`key-needle-match-case`]},limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},to:e.to}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.observability.telemetry.keys({...t,account_id:i})),{successLabel:`Created`});return}let d=s({datasets:e.datasets,from:e.from,keyNeedle:{isRegex:e[`key-needle-is-regex`],matchCase:e[`key-needle-match-case`]},limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},to:e.to});c(await u(`Creating`,async()=>n.observability.telemetry.keys({...d,account_id:i})),{successLabel:`Created`})}};function I(e){return e.option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`dry`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, and invocation views. Pass the $metadata.id of the last returned item to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': Durable Object agent summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query your observability events, requests, and traces to build visualizations and identify insights.`}).check(e=>{if([`parameters-datasets`,`parameters-filter-combination`,`parameters-limit`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0)){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-* flag is set`)}return!0})}const L={command:`query`,describe:`Run a temporary or saved query.`,builder:I,handler:async n=>{if(n.dryRun){l({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({chart:n.chart,compare:n.compare,dry:n.dry,granularity:n.granularity,ignoreSeries:n[`ignore-series`],limit:n.limit,offset:d(n.offset,`offset`,`text`),offsetBy:n[`offset-by`],offsetDirection:d(n[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(n[`query-id`],`query-id`,`text`),timeframe:{from:n[`timeframe-from`],to:n[`timeframe-to`]},view:d(n.view,`view`,`text`)}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Loading`,async()=>i.observability.telemetry.query({...e,account_id:p})),{successLabel:`Loaded`});return}if(n[`query-id`]===void 0&&(n[`query-id`]=await e(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),n[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(n[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=s({chart:n.chart,compare:n.compare,dry:n.dry,granularity:n.granularity,ignoreSeries:n[`ignore-series`],limit:n.limit,offset:d(n.offset,`offset`,`text`),offsetBy:n[`offset-by`],offsetDirection:d(n[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(n[`query-id`],`query-id`,`text`),timeframe:{from:n[`timeframe-from`],to:n[`timeframe-to`]},view:d(n.view,`view`,`text`)});c(await u(`Loading`,async()=>i.observability.telemetry.query({...m,account_id:p})),{successLabel:`Loaded`})}};function R(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`key`,{type:`string`,description:`The key field`}).option(`limit`,{type:`number`,description:`The limit field`,default:50}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`timeframe-from`,{type:`number`,description:`The timeframe.from field`}).option(`timeframe-to`,{type:`number`,description:`The timeframe.to field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`string`,`boolean`,`number`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Retrieve values from your telemetry events.`})}const z={command:`values`,describe:`List unique values found in your events.`,builder:R,handler:async i=>{if(i.dryRun){l({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({datasets:i.datasets,key:d(i.key,`key`,`text`),limit:i.limit,needle:{isRegex:i[`needle-is-regex`],matchCase:i[`needle-match-case`]},timeframe:{from:i[`timeframe-from`],to:i[`timeframe-to`]},type:d(i.type,`type`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.observability.telemetry.values({...e,account_id:m})),{successLabel:`Created`});return}if(i.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(i.key===void 0&&(i.key=await e(`key`,`The key field`)),i[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(i[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);i.type===void 0&&(i.type=await n(`type`,`The type field`,[`string`,`boolean`,`number`]));let h=s({datasets:i.datasets,key:d(i.key,`key`,`text`),limit:i.limit,needle:{isRegex:i[`needle-is-regex`],matchCase:i[`needle-match-case`]},timeframe:{from:i[`timeframe-from`],to:i[`timeframe-to`]},type:d(i.type,`type`,`text`)});c(await u(`Creating`,async()=>p.observability.telemetry.values({...h,account_id:m})),{successLabel:`Created`})}},B={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`observability`,describe:`observability`,builder:e=>e.command(S).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,T as t,w as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./cli-types-BeyOc81z.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`hostnames`,{type:`string`,array:!0,description:"Array of hostnames or wildcard names bound to the certificate.\nHostnames must be fully qualified domain names (FQDNs) belonging to zones on your account (e.g., `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` prefix for a single level (e.g., `*.example.com`). Double wildcards (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically converted to punycode."}).option(`request-type`,{type:`string`,description:`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,choices:[`origin-rsa`,`origin-ecc`,`keyless-certificate`]}).option(`requested-validity`,{type:`number`,description:`The number of days for which the certificate should be valid.`,default:5475}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create an Origin CA certificate. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:d,handler:async n=>{if(n.dryRun){s({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({csr:l(n.csr,`csr`,`text`),hostnames:n.hostnames,request_type:l(n[`request-type`],`request-type`,`text`),requested_validity:n[`requested-validity`]}):i(n.body)});return}let u=await r(n);if(n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(n.csr===void 0&&(n.csr=await e(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),n.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);n[`request-type`]===void 0&&(n[`request-type`]=await t(`request-type`,`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,[`origin-rsa`,`origin-ecc`,`keyless-certificate`]));let d=a({csr:l(n.csr,`csr`,`text`),hostnames:n.hostnames,request_type:l(n[`request-type`],`request-type`,`text`),requested_validity:n[`requested-validity`]});o(await c(`Creating`,async()=>u.originCaCertificates.create({...d})),{successLabel:`Created`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <certificate-id>`,describe:`Revoke an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let t=await r(e);if(!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>t.originCaCertificates.delete({certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <certificate-id>`,describe:`Get an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let t=await r(e);o(await c(`Loading`,async()=>t.originCaCertificates.get({certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`zone-id`,{type:`string`,description:`Identifier.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List all existing Origin CA certificates for a given zone. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:u(_),handler:async e=>{let t={zone_id:e[`zone-id`],page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){s({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:t,bodyKind:`none`});return}let n=await r(e);o(await c(`Loading`,async()=>n.originCaCertificates.list(t)),{successLabel:`Loaded`})}},y={command:`origin-ca-certificates`,describe:`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{T as e,x as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-DrDErV9w.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.originPostQuantumEncryption.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Post Quantum Encryption Setting.`,choices:[`preferred`,`supported`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`update`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf origin-post-quantum-encryption update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({value:c(l.value,`value`,`text`)}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await e(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=i({value:c(l.value,`value`,`text`)});a(await s(`Updating`,async()=>u.originPostQuantumEncryption.update({...f,zone_id:d})),{successLabel:`Updated`})}},p={command:`origin-post-quantum-encryption`,describe:`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,w as t,x as n}from"./oauth-Bk-F-tIO.mjs";import{i as r,n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./cli-types-BeyOc81z.mjs";function f(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of associations per page.`}).option(`status`,{type:`string`,description:`Filter associations by status. Use comma-separated values to filter by multiple statuses, or "all" to include every status. Defaults to "active" if not provided.`,choices:[`active`,`pending_deployment`,`pending_deletion`,`deleted`,`deployment_timed_out`,`deletion_timed_out`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`List certificate ID - hostname associations for the given zone. Shows which hostnames are associated to which certificates for authenticated origin pulls.`,builder:d(f),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,s(await l(`Loading`,async()=>r.originTlsClientAuth.hostnameAssociations.list({zone_id:a,...t})),{successLabel:`Loaded`})}},m={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`certificate`,{type:`string`,description:`The hostname certificate.`}).option(`private-key`,{type:`string`,description:`The hostname certificate's private key.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Upload a certificate to be used for client authentication on a hostname. 10 hostname certificates per zone are allowed.`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`text`)}):a(t.body)});return}let r=await i(t),d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await e(`certificate`,`The hostname certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await e(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function _(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <certificate-id>`,describe:"Removes a client certificate used for authenticated origin pulls on a specific hostname. Note: Before deleting the certificate, you must first invalidate the hostname for client authentication by sending a PUT request with `enabled` set to null. After invalidating the association, the certificate can be safely deleted.",builder:_,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}s(await l(`Deleting`,async()=>r.originTlsClientAuth.hostnameCertificates.delete({zone_id:a,certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <certificate-id>`,describe:`Get the certificate by ID to be used for client authentication on a hostname.`,builder:y,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.originTlsClientAuth.hostnameCertificates.get({zone_id:r,certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Lists all client certificates configured for per-hostname authenticated origin pulls on the zone.`,builder:x,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.originTlsClientAuth.hostnameCertificates.list({zone_id:r})),{successLabel:`Loaded`})}},C={command:`hostname-certificates`,describe:`Operations for hostname-certificates`,builder:e=>e.command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`hostname`,{type:`string`,description:`The hostname on the origin for which the client certificate uploaded will be used.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <hostname>`,describe:`Retrieves the client certificate authentication status for a specific hostname, showing whether authenticated origin pulls are enabled.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.originTlsClientAuth.hostnames.get({zone_id:r,hostname:e.hostname})),{successLabel:`Loaded`})}};function E(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 D={command:`update`,describe:`Associate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname even if activated at the zone level. 100 maximum associations on a single certificate are allowed. Note: Use a null value for parameter *enabled* to invalidate the association.`,builder:E,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e),o=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=o,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.originTlsClientAuth.hostnames.update({...n,zone_id:o})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>r(t,`PUT`,`/zones/${e.zoneId}/origin_tls_client_auth/hostnames`)),{successLabel:`Updated`})}},O={command:`hostnames`,describe:`Operations for hostnames`,builder:e=>e.command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Get whether zone-level authenticated origin pulls is enabled or not. It is false by default.`,builder:k,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.originTlsClientAuth.settings.get({zone_id:r})),{successLabel:`Loaded`})}};function j(e){return e.option(`enabled`,{type:`boolean`,description:`Indicates whether zone-level authenticated origin pulls is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update`,describe:`Enable or disable zone-level authenticated origin pulls. 'enabled' should be set true either before/after the certificate is uploaded to see the certificate in use.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({enabled:e.enabled}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.originTlsClientAuth.settings.update({...n,zone_id:r})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({enabled:e.enabled});s(await l(`Updating`,async()=>t.originTlsClientAuth.settings.update({...u,zone_id:r})),{successLabel:`Updated`})}},N={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`certificate`,{type:`string`,description:`The zone's leaf certificate.`}).option(`private-key`,{type:`string`,description:`The zone's private key.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create`,describe:`Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is important to keep only one certificate active. Also, make sure to enable zone-level authenticated origin pulls by making a PUT call to settings endpoint to see the uploaded certificate in use.`,builder:P,handler:async t=>{if(t.dryRun){c({command:`cf origin-tls-client-auth zone-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`text`)}):a(t.body)});return}let r=await i(t),d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await e(`certificate`,`The zone's leaf certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await e(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.zoneCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function I(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <certificate-id>`,describe:`Removes a client certificate used for zone-level authenticated origin pulls.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}s(await l(`Deleting`,async()=>r.originTlsClientAuth.zoneCertificates.delete({zone_id:a,certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function R(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <certificate-id>`,describe:`Retrieves details for a specific client certificate used in zone-level authenticated origin pulls.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.originTlsClientAuth.zoneCertificates.get({zone_id:r,certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`Lists all client certificates configured for zone-level authenticated origin pulls.`,builder:B,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.originTlsClientAuth.zoneCertificates.list({zone_id:r})),{successLabel:`Loaded`})}},H={command:`zone-certificates`,describe:`Operations for zone-certificates`,builder:e=>e.command(F).command(L).command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`origin-tls-client-auth`,describe:`Authenticated Origin Pulls — require Cloudflare to present a client certificate when connecting to your origin`,builder:e=>e.command(m).command(C).command(O).command(N).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
|
package/dist/pages-D4aYteKk.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{i,n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d,t as f}from"./input-validation-_fMCApaH.mjs";import{t as p}from"./local-CYc9q7l2.mjs";import{t as m}from"./cli-types-BeyOc81z.mjs";function ee(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
3
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
4
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const h={command:`create`,describe:`Create a new project.`,builder:ee,handler:async r=>{if(r.dryRun){l({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}}):o(r.body)});return}let i=await a(r),f=r.local?p:await n(i);if(r.accountId=f,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.pages.projects.create({...e,account_id:f})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await e(`name`,`Name of the project.`)),r[`production-branch`]===void 0&&(r[`production-branch`]=await e(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=s({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}});c(await u(`Creating`,async()=>i.pages.projects.create({...m,account_id:f})),{successLabel:`Created`})}};function g(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:g,handler:async e=>{if(e.dryRun){l({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.delete({account_id:o,project_name:e[`project-name`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`branch`,{type:`string`,description:"The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default."}).option(`commit-dirty`,{type:`string`,description:`Boolean string indicating if the working directory has uncommitted changes.`}).option(`commit-hash`,{type:`string`,description:`Git commit SHA associated with this deployment.`}).option(`commit-message`,{type:`string`,description:`Git commit message associated with this deployment.`}).option(`manifest`,{type:`string`,description:`JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. `}).option(`pages-build-output-dir`,{type:`string`,description:`The build output directory path.`}).option(`wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration file used for this deployment.`})}const y={command:`create <project-name>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:v,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,branch:e.branch,"commit-dirty":e[`commit-dirty`],"commit-hash":e[`commit-hash`],"commit-message":e[`commit-message`],manifest:e.manifest,"pages-build-output-dir":e[`pages-build-output-dir`],"wrangler-config-hash":e[`wrangler-config-hash`]}});return}let r=await a(e),o=e.local?p:await n(r);if(e.accountId=o,e.file!==void 0||e.body!==void 0||e.branch!==void 0||e[`commit-dirty`]!==void 0||e[`commit-hash`]!==void 0||e[`commit-message`]!==void 0||e.manifest!==void 0||e[`pages-build-output-dir`]!==void 0||e[`wrangler-config-hash`]!==void 0){let t=new FormData;if(e.file){let n=f(e.file);t.append(`_headers`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`_headers`,e.body);e.branch!==void 0&&t.append(`branch`,String(d(e.branch,`branch`,`text`)??``)),e[`commit-dirty`]!==void 0&&t.append(`commit_dirty`,String(d(e[`commit-dirty`],`commit-dirty`,`text`)??``)),e[`commit-hash`]!==void 0&&t.append(`commit_hash`,String(d(e[`commit-hash`],`commit-hash`,`text`)??``)),e[`commit-message`]!==void 0&&t.append(`commit_message`,String(d(e[`commit-message`],`commit-message`,`text`)??``)),e.manifest!==void 0&&t.append(`manifest`,String(d(e.manifest,`manifest`,`text`)??``)),e[`pages-build-output-dir`]!==void 0&&t.append(`pages_build_output_dir`,String(d(e[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),e[`wrangler-config-hash`]!==void 0&&t.append(`wrangler_config_hash`,String(d(e[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),c(await u(`Creating`,async()=>i(r,`POST`,`/accounts/${o}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/deployments`,{body:t})),{successLabel:`Created`});return}if(e.body){let t=d(e.body,`body`,`binary`);c(await u(`Creating`,async()=>i(r,`POST`,`/accounts/${o}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/deployments`,{body:t,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>r.pages.projects.deployments.create({account_id:o,project_name:e[`project-name`]})),{successLabel:`Created`})}};function b(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Allow deletion of aliased non-production deployments when a normal delete would be rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:b,handler:async e=>{let i={force:e.force};if(e.dryRun){l({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},query:i,bodyKind:`none`});return}let o=await a(e),s=e.local?p:await n(o);if(e.accountId=s,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}c(await u(`Deleting`,async()=>o.pages.projects.deployments.delete({account_id:s,project_name:e[`project-name`],deployment_id:e[`deployment-id`],...i})),{successLabel:`Deleted`})}};function S(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <deployment-id>`,describe:`Fetch information about a deployment.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.deployments.get({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <deployment-id>`,describe:`Fetch deployment logs for a project.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.deployments.history.logs.get({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Loaded`})}},E={command:`logs`,describe:`Operations for projects.deployments.history.logs`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`env`,{type:`string`,description:`What type of deployments to fetch.`,choices:[`production`,`preview`]}).option(`page`,{type:`number`,description:`Which page of deployments to fetch.`}).option(`per-page`,{type:`number`,description:`How many deployments to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Fetch a list of project deployments.`,builder:m(O),handler:async e=>{let r={env:e.env,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments`,pathParams:{"project-name":String(e[`project-name`]??``)},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pages.projects.deployments.list({account_id:o,project_name:e[`project-name`],...r})),{successLabel:`Loaded`})}};function A(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`retry <deployment-id>`,describe:`Retry a previous deployment.`,builder:A,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Creating`,async()=>r.pages.projects.deployments.retry({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`})}};function M(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`rollback <deployment-id>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:M,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Creating`,async()=>r.pages.projects.deployments.rollback({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`})}};function P(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create <deployment-id>`,describe:`Start a tail that receives logs and exception data.`,builder:P,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments tails create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/tails`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:o(e.body)});return}let r=await a(e),i=e.local?p:await n(r);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.pages.projects.deployments.tails.create({...t,account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>r.pages.projects.deployments.tails.create({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`})}};function I(e){return e.positional(`tail-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <tail-id>`,describe:`Deletes a tail from a Pages deployment.`,builder:I,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments tails delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/tails/${e[`tail-id`]==null?`<tail-id>`:encodeURIComponent(String(e[`tail-id`]))}`,pathParams:{"tail-id":String(e[`tail-id`]??``),"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.deployments.tails.delete({account_id:o,project_name:e[`project-name`],deployment_id:e[`deployment-id`],tail_id:e[`tail-id`]})),{successLabel:`Deleted`})}},R={command:`tails`,describe:`Operations for projects.deployments.tails`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`deployments`,describe:`Operations for projects.deployments`,builder:e=>e.command(y).command(x).command(C).command(k).command(j).command(N).command(D).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`name`,{type:`string`,description:`The domain name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`create <project-name>`,describe:`Add a new domain for the Pages project.`,builder:z,handler:async r=>{if(r.dryRun){l({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?s({name:d(r.name,`name`,`text`)}):o(r.body)});return}let i=await a(r),f=r.local?p:await n(i);if(r.accountId=f,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.pages.projects.domains.create({...e,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await e(`name`,`The domain name.`));let m=s({name:d(r.name,`name`,`text`)});c(await u(`Creating`,async()=>i.pages.projects.domains.create({...m,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`})}};function V(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const H={command:`delete <domain-name>`,describe:`Delete a Pages project's domain.`,builder:V,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.domains.delete({account_id:o,project_name:e[`project-name`],domain_name:e[`domain-name`]})),{successLabel:`Deleted`})}};function U(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`edit <domain-name>`,describe:`Retry the validation status of a single domain.`,builder:U,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Updating`,async()=>r.pages.projects.domains.edit({account_id:i,project_name:e[`project-name`],domain_name:e[`domain-name`]})),{successLabel:`Updated`})}};function G(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <domain-name>`,describe:`Fetch a single domain.`,builder:G,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.domains.get({account_id:i,project_name:e[`project-name`],domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:q,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.domains.list({account_id:i,project_name:e[`project-name`]})),{successLabel:`Loaded`})}},Y={command:`domains`,describe:`Operations for projects.domains`,builder:e=>e.command(B).command(H).command(W).command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
9
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
10
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const Z={command:`edit <project-name>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:X,handler:async e=>{if(e.dryRun){l({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`json`,body:e.body===void 0?s({build_config:{build_caching:e[`build-config-build-caching`],build_command:d(e[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(e[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(e[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(e[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(e[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:e[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(e[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-preview-compatibility-flags`],fail_open:e[`deployment-configs-preview-fail-open`],limits:{cpu_ms:e[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:e[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-production-build-image-major-version`],compatibility_date:d(e[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-production-compatibility-flags`],fail_open:e[`deployment-configs-production-fail-open`],limits:{cpu_ms:e[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(e.name,`name`,`text`),production_branch:d(e[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:e[`source-config-deployments-enabled`],owner:d(e[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(e[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:e[`source-config-path-excludes`],path_includes:e[`source-config-path-includes`],pr_comments_enabled:e[`source-config-pr-comments-enabled`],preview_branch_excludes:e[`source-config-preview-branch-excludes`],preview_branch_includes:e[`source-config-preview-branch-includes`],preview_deployment_setting:d(e[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(e[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:e[`source-config-production-deployments-enabled`],repo_id:d(e[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(e[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(e[`source-type`],`source-type`,`text`)}}):o(e.body)});return}let r=await a(e),i=e.local?p:await n(r);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>r.pages.projects.edit({...t,account_id:i,project_name:e[`project-name`]})),{successLabel:`Updated`});return}let f=s({build_config:{build_caching:e[`build-config-build-caching`],build_command:d(e[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(e[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(e[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(e[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(e[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:e[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(e[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-preview-compatibility-flags`],fail_open:e[`deployment-configs-preview-fail-open`],limits:{cpu_ms:e[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:e[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-production-build-image-major-version`],compatibility_date:d(e[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-production-compatibility-flags`],fail_open:e[`deployment-configs-production-fail-open`],limits:{cpu_ms:e[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(e.name,`name`,`text`),production_branch:d(e[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:e[`source-config-deployments-enabled`],owner:d(e[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(e[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:e[`source-config-path-excludes`],path_includes:e[`source-config-path-includes`],pr_comments_enabled:e[`source-config-pr-comments-enabled`],preview_branch_excludes:e[`source-config-preview-branch-excludes`],preview_branch_includes:e[`source-config-preview-branch-includes`],preview_deployment_setting:d(e[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(e[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:e[`source-config-production-deployments-enabled`],repo_id:d(e[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(e[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(e[`source-type`],`source-type`,`text`)}});c(await u(`Updating`,async()=>r.pages.projects.edit({...f,account_id:i,project_name:e[`project-name`]})),{successLabel:`Updated`})}};function Q(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get-upload-token <project-name>`,describe:`Get a short-lived JWT for Pages Direct Upload asset operations.`,builder:Q,handler:async e=>{if(e.dryRun){l({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/upload-token`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.getUploadToken({account_id:i,project_name:e[`project-name`]})),{successLabel:`Loaded`})}};function re(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <project-name>`,describe:`Fetch a project by name.`,builder:re,handler:async e=>{if(e.dryRun){l({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.get({account_id:i,project_name:e[`project-name`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Which page of projects to fetch.`}).option(`per-page`,{type:`number`,description:`How many projects to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Fetch a list of all user projects.`,builder:ae,handler:async e=>{let r={page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects`,pathParams:{},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pages.projects.list({account_id:o,...r})),{successLabel:`Loaded`})}};function $(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const se={command:`purge-build-cache <project-name>`,describe:`Purge all cached build artifacts for a Pages project`,builder:$,handler:async e=>{if(e.dryRun){l({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
11
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.purgeBuildCache({account_id:o,project_name:e[`project-name`]})),{successLabel:`Deleted`})}},ce={command:`projects`,describe:`Operations for projects`,builder:e=>e.command(h).command(_).command(Z).command(ie).command(ne).command(oe).command(se).command(te).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
|