cf 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +78 -41
- package/dist/_meta/commands.json +19888 -21071
- package/dist/_meta/schemas.json +14305 -15328
- package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
- package/dist/account-D8mYiWxQ.mjs +2 -0
- package/dist/accounts-CJci1Oez.mjs +23 -0
- package/dist/acm-CmCd985Q.mjs +3 -0
- package/dist/addressing-R7p6TRBe.mjs +12 -0
- package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
- package/dist/ai-BzJg0RIX.mjs +3 -0
- package/dist/ai-audit-B0vJNOZG.mjs +2 -0
- package/dist/ai-gateway-D3vJR3My.mjs +10 -0
- package/dist/ai-search-CNg7W7U4.mjs +7 -0
- package/dist/alerting-_sdM0B0S.mjs +6 -0
- package/dist/alerts-dpT6Qsdu.mjs +2 -0
- package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
- package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
- package/dist/api-gateway-D4AIEtUq.mjs +33 -0
- package/dist/argo-Bjk6nFfs.mjs +2 -0
- package/dist/artifacts-Ba4b3iOa.mjs +4 -0
- package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
- package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
- package/dist/auth-D_zyQbDR.mjs +5 -0
- package/dist/autorag-Cnpp8PAG.mjs +2 -0
- package/dist/billing-Dz6Zj8Eq.mjs +2 -0
- package/dist/bot-management-pFwIbFi-.mjs +5 -0
- package/dist/botnet-feed-BY9uGChY.mjs +3 -0
- package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
- package/dist/brands-CGpk9nZB.mjs +2 -0
- package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
- package/dist/browser-run-DhHtz4y3.mjs +4 -0
- package/dist/build-CWuStmDi.mjs +2 -0
- package/dist/cache-DVhkiIGK.mjs +5 -0
- package/dist/calls-95zjvIcO.mjs +4 -0
- package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
- package/dist/cf-BLT7uKJF.mjs +18 -0
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
- package/dist/clear-DXx8WBAN.mjs +2 -0
- package/dist/client-certificates-D6mE4vJu.mjs +3 -0
- package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
- package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
- package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
- package/dist/connectivity-DJkE3crz.mjs +3 -0
- package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
- package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
- package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
- package/dist/connectors-zWaZTi2A.mjs +3 -0
- package/dist/content-scanning-CGvGf04y.mjs +4 -0
- package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
- package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
- package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
- package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
- package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
- package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
- package/dist/d1-78Ym1P6D.mjs +4 -0
- package/dist/data-security-zmFoMwRU.mjs +6 -0
- package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
- package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
- package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
- package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
- package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
- package/dist/dist-B7hsuvbF.mjs +57 -0
- package/dist/dist-BH-4NQOV.mjs +134 -0
- package/dist/dns-D7VAaCyO.mjs +29 -0
- package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
- package/dist/domain-info-CRvKc2Lg.mjs +2 -0
- package/dist/durable-objects-BIpvyu9m.mjs +2 -0
- package/dist/email-auth-Cx--s8W4.mjs +2 -0
- package/dist/email-routing-CiDbivcN.mjs +10 -0
- package/dist/email-security-BYeAuSc6.mjs +12 -0
- package/dist/email-sending-Dg2rSmHH.mjs +4 -0
- package/dist/filters-DZ8YnQ90.mjs +4 -0
- package/dist/firewall-DEd1hs_I.mjs +11 -0
- package/dist/flagship-DVw7xGoP.mjs +4 -0
- package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
- package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
- package/dist/healthchecks-Da9N3ix4.mjs +4 -0
- package/dist/hostnames-mimZu2tB.mjs +3 -0
- package/dist/hyperdrive-BNdvxOos.mjs +21 -0
- package/dist/iam-DGQ-OgRl.mjs +6 -0
- package/dist/images-CI6Iy9ho.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BDB-aRtU.mjs +3 -0
- package/dist/internal-Czlp5Ekb.mjs +2 -0
- package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
- package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
- package/dist/kv-BHerx4dZ.mjs +5 -0
- package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
- package/dist/live-Ce7dZW7p.mjs +2 -0
- package/dist/load-balancers-DSjS5WKw.mjs +6 -0
- package/dist/logexplorer-DBIfTlRP.mjs +24 -0
- package/dist/logo-matches-C00iGpzW.mjs +2 -0
- package/dist/logos-CJLhx1go.mjs +3 -0
- package/dist/logpush-Cr1U-eK-.mjs +5 -0
- package/dist/logs-DMvtchc6.mjs +3 -0
- package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
- package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
- package/dist/magic-transit-DiKiPUax.mjs +110 -0
- package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
- package/dist/matches-B0yHbQ2I.mjs +2 -0
- package/dist/moq-UgBawOXe.mjs +13 -0
- package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
- package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
- package/dist/oauth-DBJ5GSFk.mjs +40 -0
- package/dist/observability-B-1y36QS.mjs +4 -0
- package/dist/organization-Dq3PClZ7.mjs +41 -0
- package/dist/organizations-AhsQkHyX.mjs +2 -0
- package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
- package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
- package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
- package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
- package/dist/pages-BsXF11Kv.mjs +11 -0
- package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
- package/dist/pipelines-D_QhSnGW.mjs +6 -0
- package/dist/progress-O88q63Bk.mjs +2 -0
- package/dist/prompt-DTAWiEm2.mjs +3 -0
- package/dist/queries-CAE95-OH.mjs +3 -0
- package/dist/queues-BBz35Mqd.mjs +6 -0
- package/dist/r2-Zp99S5xF.mjs +21 -0
- package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
- package/dist/radar-Cij-XVQJ.mjs +2 -0
- package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
- package/dist/rate-limits-DSdToIWv.mjs +5 -0
- package/dist/raw-fetch-DgezeshQ.mjs +2 -0
- package/dist/ready-DMpJvyaz.mjs +2 -0
- package/dist/realtime-kit-9rJcapfM.mjs +18 -0
- package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
- package/dist/refute-BGTpr5sy.mjs +2 -0
- package/dist/registrar-CXViZlah.mjs +83 -0
- package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
- package/dist/request-tracers-DATfBnE9.mjs +2 -0
- package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
- package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
- package/dist/resource-tagging-BTn05AOj.mjs +16 -0
- package/dist/rules-ens3OHme.mjs +4 -0
- package/dist/rulesets-bkreZRao.mjs +8 -0
- package/dist/rum-CpgXFcwl.mjs +4 -0
- package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
- package/dist/scan-page-BqoQTk3R.mjs +2 -0
- package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
- package/dist/schema-validation-Ca6o94ts.mjs +24 -0
- package/dist/scim-C4oT8TMc.mjs +4 -0
- package/dist/sdk-pQ5kaGUX.mjs +3 -0
- package/dist/search-C4T5riPh.mjs +2 -0
- package/dist/secrets-store-CWEuiDNo.mjs +7 -0
- package/dist/security-center-BOvm7xy6.mjs +2 -0
- package/dist/security-txt-BCAUBctN.mjs +3 -0
- package/dist/session-B1ARgLG7.mjs +2 -0
- package/dist/share-DhmVspmL.mjs +5 -0
- package/dist/shared-Bod3-Exx.mjs +990 -0
- package/dist/signed-url-DA509wgp.mjs +2 -0
- package/dist/smart-shield-DZm4fn6z.mjs +3 -0
- package/dist/snippets-oQ0u26-z.mjs +4 -0
- package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
- package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
- package/dist/speed-DqNnvLBD.mjs +4 -0
- package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
- package/dist/ssl-tS3CYZsZ.mjs +15 -0
- package/dist/state-OsdDJvdj.mjs +2 -0
- package/dist/stream-Bud9Os5V.mjs +14 -0
- package/dist/submission-info-DfIXmu-M.mjs +2 -0
- package/dist/submit-BtP8she2.mjs +2 -0
- package/dist/tenant-CMwHa-tU.mjs +2 -0
- package/dist/token-validation-BYC7HTok.mjs +10 -0
- package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
- package/dist/total-queries-DdLBNJzd.mjs +2 -0
- package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
- package/dist/turnstile-CP4nScaL.mjs +23 -0
- package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
- package/dist/url-info-Chs9h7Y-.mjs +2 -0
- package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
- package/dist/url-scanner-D4pYNlO-.mjs +2 -0
- package/dist/user-DtefniLc.mjs +11 -0
- package/dist/vectorize-BeAY2g-7.mjs +4 -0
- package/dist/verify-D7J3F_NZ.mjs +2 -0
- package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
- package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
- package/dist/web3-Dhw79l4S.mjs +4 -0
- package/dist/workers-builds-CuOAB3u4.mjs +7 -0
- package/dist/workers-l3zMNOU6.mjs +20 -0
- package/dist/workflows-rb7RYBKP.mjs +6 -0
- package/dist/zaraz-CHecMYuo.mjs +2 -0
- package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
- package/dist/zone-BnnqJwW-.mjs +2 -0
- package/dist/zones-DpI2YikF.mjs +21 -0
- package/package.json +3 -1
- package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
- 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/auth-D5hNsOFq.mjs +0 -5
- 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/build-HuS9-R0V.mjs +0 -1054
- package/dist/cache-CY-7Lt71.mjs +0 -5
- package/dist/calls-wOQGDWPl.mjs +0 -4
- package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
- package/dist/client-certificates-CRf41xLe.mjs +0 -3
- package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
- package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
- package/dist/config-B5k-XbwS.mjs +0 -2
- 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/context-jpewmual.mjs +0 -2
- package/dist/custom-certificates-DYE-9epx.mjs +0 -5
- package/dist/custom-hostnames-CtuTdFcX.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-C6zxsVdY.mjs +0 -306
- 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/firewall-DYZcTtIC.mjs +0 -11
- 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/organizations-BqJHyvMK.mjs +0 -41
- 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/progress-DrDErV9w.mjs +0 -2
- 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/radar-D986zPJr.mjs +0 -2
- package/dist/rate-limits-B2wRsUX1.mjs +0 -5
- package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
- package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
- package/dist/registrar-CDIwTz3G.mjs +0 -46
- 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/sdk-DhIhH6GB.mjs +0 -5
- package/dist/secrets-store-BAK9G12O.mjs +0 -25
- package/dist/security-center-eScuYDKP.mjs +0 -2
- package/dist/security-txt-x7R4gmQu.mjs +0 -3
- package/dist/session-DHYCE-PM.mjs +0 -93
- 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/tenants-HLGUazms.mjs +0 -2
- 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/waiting-rooms-u6KwrzWd.mjs +0 -11
- 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/zones-BXtdwt6E.mjs +0 -21
- /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
- /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
- /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
- /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
- /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
- /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
- /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{n as e}from"./auth-CZ0E51rF.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-O88q63Bk.mjs";import{n as i,t as a}from"./body-parser-BO6mfo_W.mjs";import{n as o}from"./input-validation-BwUR9z8e.mjs";import{n as s,r as c,t as l}from"./prompt-DTAWiEm2.mjs";import{t as u}from"./cli-types-CFw6Xygp.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 l=>{if(l.dryRun){n({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:l.body===void 0?a({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]}):i(l.body)});return}let u=await e(l);if(l.body){let e=i(l.body);t(await r(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);l[`request-type`]===void 0&&(l[`request-type`]=await s(`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:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]});t(await r(`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await l({force:!!i.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}t(await r(`Deleting`,async()=>a.originCaCertificates.delete({certificate_id:i[`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.originCaCertificates.get({certificate_id:i[`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 i=>{let a={zone_id:i[`zone-id`],page:i.page,per_page:i[`per-page`],limit:i.limit,offset:i.offset};if(i.dryRun){n({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.originCaCertificates.list(a)),{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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c}from"./prompt-DTAWiEm2.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 a=>{if(a.dryRun){r({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.originPostQuantumEncryption.get({zone_id:s})),{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){r({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?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{i as t,n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{n as o,t as s}from"./body-parser-BO6mfo_W.mjs";import{n as c}from"./input-validation-BwUR9z8e.mjs";import{r as l,t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.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 t=>{let o={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.originTlsClientAuth.hostnameAssociations.list({zone_id:c,...o})),{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){i({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?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The hostname certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}r(await a(`Deleting`,async()=>o.originTlsClientAuth.hostnameCertificates.delete({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.get({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,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:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.list({zone_id:s})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{hostname:String(t.hostname??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnames.get({zone_id:s,hostname:t.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 s=>{if(s.dryRun){i({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.originTlsClientAuth.hostnames.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.settings.get({zone_id:s})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({enabled:t.enabled}):o(t.body)});return}let c=await n(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=o(t.body);r(await a(`Updating`,async()=>c.originTlsClientAuth.settings.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=s({enabled:t.enabled});r(await a(`Updating`,async()=>c.originTlsClientAuth.settings.update({...u,zone_id:l})),{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){i({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?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's leaf certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}r(await a(`Deleting`,async()=>o.originTlsClientAuth.zoneCertificates.delete({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.get({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,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:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.list({zone_id:s})),{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};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{t as c}from"./prompt-DTAWiEm2.mjs";import{t as l}from"./cli-types-CFw6Xygp.mjs";function u(e){return e.option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
|
|
3
3
|
over another. A higher number indicates a higher priority. For example,
|
|
4
4
|
if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
|
|
5
5
|
specific Page Rule to take precedence (rule B: \`/images/special/*\`),
|
|
6
6
|
specify a higher priority for rule B so it overrides rule A.
|
|
7
|
-
`,default:1}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`],default:`disabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Creates a new Page Rule.`,builder:u,handler:async
|
|
8
|
-
`);return}
|
|
7
|
+
`,default:1}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`],default:`disabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Creates a new Page Rule.`,builder:u,handler:async c=>{if(c.dryRun){r({command:`cf page-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/pagerules`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({priority:c.priority,status:s(c.status,`status`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.pageRules.create({...e,zone_id:u})),{successLabel:`Created`});return}let d=o({priority:c.priority,status:s(c.status,`status`,`text`)});n(await i(`Creating`,async()=>l.pageRules.create({...d,zone_id:u})),{successLabel:`Created`})}};function f(e){return e.positional(`pagerule-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 p={command:`delete <pagerule-id>`,describe:`Deletes an existing Page Rule.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf page-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules/${a[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(a[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(a[`pagerule-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}n(await i(`Deleting`,async()=>o.pageRules.delete({zone_id:s,pagerule_id:a[`pagerule-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
|
|
9
9
|
over another. A higher number indicates a higher priority. For example,
|
|
10
10
|
if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
|
|
11
11
|
specific Page Rule to take precedence (rule B: \`/images/special/*\`),
|
|
12
12
|
specify a higher priority for rule B so it overrides rule A.
|
|
13
|
-
`}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).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:`edit <pagerule-id>`,describe:`Updates one or more fields of an existing Page Rule.`,builder:m,handler:async
|
|
13
|
+
`}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).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:`edit <pagerule-id>`,describe:`Updates one or more fields of an existing Page Rule.`,builder:m,handler:async c=>{if(c.dryRun){r({command:`cf page-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/pagerules/${c[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(c[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(c[`pagerule-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({priority:c.priority,status:s(c.status,`status`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.pageRules.edit({...e,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`});return}let d=o({priority:c.priority,status:s(c.status,`status`,`text`)});n(await i(`Updating`,async()=>l.pageRules.edit({...d,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`})}};function g(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <pagerule-id>`,describe:`Fetches the details of a Page Rule.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf page-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules/${a[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(a[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(a[`pagerule-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageRules.get({zone_id:s,pagerule_id:a[`pagerule-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`order`,{type:`string`,description:`The field used to sort returned Page Rules.`,choices:[`status`,`priority`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned Page Rules.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:"When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Fetches Page Rules in a zone.`,builder:l(v),handler:async a=>{let o={order:a.order,direction:a.direction,match:a.match,status:a.status};if(a.dryRun){r({command:`cf page-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.pageRules.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function b(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
|
|
14
14
|
over another. A higher number indicates a higher priority. For example,
|
|
15
15
|
if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
|
|
16
16
|
specific Page Rule to take precedence (rule B: \`/images/special/*\`),
|
|
17
17
|
specify a higher priority for rule B so it overrides rule A.
|
|
18
|
-
`}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).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 <pagerule-id>`,describe:`Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.`,builder:b,handler:async
|
|
18
|
+
`}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).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 <pagerule-id>`,describe:`Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.`,builder:b,handler:async c=>{if(c.dryRun){r({command:`cf page-rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/pagerules/${c[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(c[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(c[`pagerule-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({priority:c.priority,status:s(c.status,`status`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.pageRules.update({...e,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`});return}let d=o({priority:c.priority,status:s(c.status,`status`,`text`)});n(await i(`Updating`,async()=>l.pageRules.update({...d,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`})}},S={command:`page-rules`,describe:`Legacy URL-pattern rules that override zone settings for matching requests — prefer Rules/Transform Rules instead`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{S as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c,r as l,t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(e){return e.positional(`connection-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <connection-id>`,describe:`Fetches a connection detected by Page Shield by connection ID.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf page-shield connections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/connections/${a[`connection-id`]==null?`<connection-id>`:encodeURIComponent(String(a[`connection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"connection-id":String(a[`connection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.connections.get({zone_id:s,connection_id:a[`connection-id`]})),{successLabel:`Loaded`})}};function m(e){return e.option(`exclude-urls`,{type:`string`,description:`Excludes connections whose URL contains one of the URL-encoded URLs separated by commas.`}).option(`urls`,{type:`string`,description:`Includes connections whose URL contain one or more URL-encoded URLs separated by commas.`}).option(`hosts`,{type:`string`,description:`Includes connections that match one or more URL-encoded hostnames separated by commas.
|
|
3
3
|
|
|
4
4
|
Wildcards are supported at the start and end of each hostname to support starts with, ends with
|
|
5
5
|
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
|
|
@@ -9,7 +9,7 @@ with the applied filters in a single page. This feature is best-effort and it ma
|
|
|
9
9
|
a low number of connections`}).option(`per-page`,{type:`number`,description:`The number of results per page.`}).option(`order-by`,{type:`string`,description:`The field used to sort returned connections.`,choices:[`first_seen_at`,`last_seen_at`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned connections.`,choices:[`asc`,`desc`]}).option(`prioritize-malicious`,{type:`boolean`,description:`When true, malicious connections appear first in the returned connections.`}).option(`exclude-cdn-cgi`,{type:`boolean`,description:"When true, excludes connections seen in a `/cdn-cgi` path from the returned connections. The default value is true."}).option(`status`,{type:`string`,description:"Filters the returned connections using a comma-separated list of connection statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default value is `active`."}).option(`page-url`,{type:`string`,description:`Includes connections that match one or more page URLs (separated by commas) where they were last seen
|
|
10
10
|
|
|
11
11
|
Wildcards are supported at the start and end of each page URL to support starts with, ends with
|
|
12
|
-
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of connections as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`Lists all connections detected by Page Shield.`,builder:d(m),handler:async
|
|
12
|
+
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of connections as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`Lists all connections detected by Page Shield.`,builder:d(m),handler:async a=>{let o={exclude_urls:a[`exclude-urls`],urls:a.urls,hosts:a.hosts,page:a.page,per_page:a[`per-page`],order_by:a[`order-by`],direction:a.direction,prioritize_malicious:a[`prioritize-malicious`],exclude_cdn_cgi:a[`exclude-cdn-cgi`],status:a.status,page_url:a[`page-url`],export:a.export};if(a.dryRun){r({command:`cf page-shield connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/connections`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.pageShield.connections.list({zone_id:c,...o})),{successLabel:`Loaded`})}},g={command:`connections`,describe:`Third-party connections made by scripts on your pages — track data exfiltration risks`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`cookie-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <cookie-id>`,describe:`Fetches a cookie collected by Page Shield by cookie ID.`,builder:_,handler:async a=>{if(a.dryRun){r({command:`cf page-shield cookies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/cookies/${a[`cookie-id`]==null?`<cookie-id>`:encodeURIComponent(String(a[`cookie-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"cookie-id":String(a[`cookie-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.cookies.get({zone_id:s,cookie_id:a[`cookie-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`hosts`,{type:`string`,description:`Includes cookies that match one or more URL-encoded hostnames separated by commas.
|
|
13
13
|
|
|
14
14
|
Wildcards are supported at the start and end of each hostname to support starts with, ends with
|
|
15
15
|
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
|
|
@@ -21,8 +21,8 @@ a low number of cookies`}).option(`per-page`,{type:`number`,description:`The num
|
|
|
21
21
|
Wildcards are supported at the start and end of each page URL to support starts with, ends with
|
|
22
22
|
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of cookies as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`name`,{type:`string`,description:`Filters the returned cookies that match the specified name.
|
|
23
23
|
Wildcards are supported at the start and end to support starts with, ends with
|
|
24
|
-
and contains. e.g. session*`}).option(`secure`,{type:`boolean`,description:`Filters the returned cookies that are set with Secure`}).option(`http-only`,{type:`boolean`,description:`Filters the returned cookies that are set with HttpOnly`}).option(`same-site`,{type:`string`,description:`Filters the returned cookies that match the specified same_site attribute`,choices:[`lax`,`strict`,`none`]}).option(`type`,{type:`string`,description:`Filters the returned cookies that match the specified type attribute`,choices:[`first_party`,`unknown`]}).option(`path`,{type:`string`,description:`Filters the returned cookies that match the specified path attribute`}).option(`domain`,{type:`string`,description:`Filters the returned cookies that match the specified domain attribute`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists all cookies collected by Page Shield.`,builder:d(y),handler:async
|
|
25
|
-
`);return}
|
|
24
|
+
and contains. e.g. session*`}).option(`secure`,{type:`boolean`,description:`Filters the returned cookies that are set with Secure`}).option(`http-only`,{type:`boolean`,description:`Filters the returned cookies that are set with HttpOnly`}).option(`same-site`,{type:`string`,description:`Filters the returned cookies that match the specified same_site attribute`,choices:[`lax`,`strict`,`none`]}).option(`type`,{type:`string`,description:`Filters the returned cookies that match the specified type attribute`,choices:[`first_party`,`unknown`]}).option(`path`,{type:`string`,description:`Filters the returned cookies that match the specified path attribute`}).option(`domain`,{type:`string`,description:`Filters the returned cookies that match the specified domain attribute`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists all cookies collected by Page Shield.`,builder:d(y),handler:async a=>{let o={hosts:a.hosts,page:a.page,per_page:a[`per-page`],order_by:a[`order-by`],direction:a.direction,page_url:a[`page-url`],export:a.export,name:a.name,secure:a.secure,http_only:a[`http-only`],same_site:a[`same-site`],type:a.type,path:a.path,domain:a.domain};if(a.dryRun){r({command:`cf page-shield cookies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/cookies`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.pageShield.cookies.list({zone_id:c,...o})),{successLabel:`Loaded`})}},x={command:`cookies`,describe:`Cookies set by scripts on your pages with classification and same-site attribute tracking`,builder:e=>e.command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Fetches the Page Shield settings.`,builder:S,handler:async a=>{if(a.dryRun){r({command:`cf page-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.get({zone_id:s})),{successLabel:`Loaded`})}};function w(e){return e.option(`action`,{type:`string`,description:`The action to take if the expression matches`,choices:[`allow`,`log`,`add_reporting_directives`]}).option(`description`,{type:`string`,description:`A description for the policy`}).option(`enabled`,{type:`boolean`,description:`Whether the policy is enabled`}).option(`expression`,{type:`string`,description:`The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax`}).option(`value`,{type:`string`,description:`The policy which will be applied`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Create a Page Shield policy.`,builder:w,handler:async u=>{if(u.dryRun){r({command:`cf page-shield policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/page_shield/policies`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?o({action:s(u.action,`action`,`text`),description:s(u.description,`description`,`text`),enabled:u.enabled,expression:s(u.expression,`expression`,`text`),value:s(u.value,`value`,`text`)}):a(u.body)});return}let d=await t(u),f=await e({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=a(u.body);n(await i(`Creating`,async()=>d.pageShield.policies.create({...e,zone_id:f})),{successLabel:`Created`});return}if(u.action===void 0&&(u.action=await c(`action`,`The action to take if the expression matches`,[`allow`,`log`,`add_reporting_directives`])),u.description===void 0&&(u.description=await l(`description`,`A description for the policy`)),u.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);u.expression===void 0&&(u.expression=await l(`expression`,`The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax`)),u.value===void 0&&(u.value=await l(`value`,`The policy which will be applied`));let p=o({action:s(u.action,`action`,`text`),description:s(u.description,`description`,`text`),enabled:u.enabled,expression:s(u.expression,`expression`,`text`),value:s(u.value,`value`,`text`)});n(await i(`Creating`,async()=>d.pageShield.policies.create({...p,zone_id:f})),{successLabel:`Created`})}};function E(e){return e.positional(`policy-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <policy-id>`,describe:`Delete a Page Shield policy by ID.`,builder:E,handler:async a=>{if(a.dryRun){r({command:`cf page-shield policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/policies/${a[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(a[`policy-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"policy-id":String(a[`policy-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await u({force:!!a.force})){process.stderr.write(`Aborted.
|
|
25
|
+
`);return}n(await i(`Deleting`,async()=>o.pageShield.policies.delete({zone_id:s,policy_id:a[`policy-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`policy-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <policy-id>`,describe:`Fetches a Page Shield policy by ID.`,builder:O,handler:async a=>{if(a.dryRun){r({command:`cf page-shield policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/policies/${a[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(a[`policy-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"policy-id":String(a[`policy-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.policies.get({zone_id:s,policy_id:a[`policy-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Lists all Page Shield policies.`,builder:A,handler:async a=>{if(a.dryRun){r({command:`cf page-shield policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/policies`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.policies.list({zone_id:s})),{successLabel:`Loaded`})}};function M(e){return e.positional(`policy-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`action`,{type:`string`,description:`The action to take if the expression matches`,choices:[`allow`,`log`,`add_reporting_directives`]}).option(`description`,{type:`string`,description:`A description for the policy`}).option(`enabled`,{type:`boolean`,description:`Whether the policy is enabled`}).option(`expression`,{type:`string`,description:`The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax`}).option(`value`,{type:`string`,description:`The policy which will be applied`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <policy-id>`,describe:`Update a Page Shield policy by ID.`,builder:M,handler:async c=>{if(c.dryRun){r({command:`cf page-shield policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/page_shield/policies/${c[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(c[`policy-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"policy-id":String(c[`policy-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({action:s(c.action,`action`,`text`),description:s(c.description,`description`,`text`),enabled:c.enabled,expression:s(c.expression,`expression`,`text`),value:s(c.value,`value`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.pageShield.policies.update({...e,zone_id:u,policy_id:c[`policy-id`]})),{successLabel:`Updated`});return}let d=o({action:s(c.action,`action`,`text`),description:s(c.description,`description`,`text`),enabled:c.enabled,expression:s(c.expression,`expression`,`text`),value:s(c.value,`value`,`text`)});n(await i(`Updating`,async()=>l.pageShield.policies.update({...d,zone_id:u,policy_id:c[`policy-id`]})),{successLabel:`Updated`})}},P={command:`policies`,describe:`Content Security Policies that control which scripts and connections are allowed on your pages`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.positional(`script-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <script-id>`,describe:`Fetches a script detected by Page Shield by script ID.`,builder:F,handler:async a=>{if(a.dryRun){r({command:`cf page-shield scripts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/scripts/${a[`script-id`]==null?`<script-id>`:encodeURIComponent(String(a[`script-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"script-id":String(a[`script-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageShield.scripts.get({zone_id:s,script_id:a[`script-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`exclude-urls`,{type:`string`,description:`Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas.`}).option(`urls`,{type:`string`,description:`Includes scripts whose URL contain one or more URL-encoded URLs separated by commas.`}).option(`hosts`,{type:`string`,description:`Includes scripts that match one or more URL-encoded hostnames separated by commas.
|
|
26
26
|
|
|
27
27
|
Wildcards are supported at the start and end of each hostname to support starts with, ends with
|
|
28
28
|
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`page`,{type:`string`,description:`The current page number of the paginated results.
|
|
@@ -34,4 +34,4 @@ content matches and they share the same url host and zone hostname. In such case
|
|
|
34
34
|
recent script for the URL host and zone hostname combination.`}).option(`status`,{type:`string`,description:"Filters the returned scripts using a comma-separated list of scripts statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default value is `active`."}).option(`page-url`,{type:`string`,description:`Includes scripts that match one or more page URLs (separated by commas) where they were last seen
|
|
35
35
|
|
|
36
36
|
Wildcards are supported at the start and end of each page URL to support starts with, ends with
|
|
37
|
-
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of scripts as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Lists all scripts detected by Page Shield.`,builder:d(L),handler:async
|
|
37
|
+
and contains. If no wildcards are used, results will be filtered by exact match`}).option(`export`,{type:`string`,description:`Export the list of scripts as a file, limited to 50000 entries.`,choices:[`csv`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Lists all scripts detected by Page Shield.`,builder:d(L),handler:async a=>{let o={exclude_urls:a[`exclude-urls`],urls:a.urls,hosts:a.hosts,page:a.page,per_page:a[`per-page`],order_by:a[`order-by`],direction:a.direction,prioritize_malicious:a[`prioritize-malicious`],exclude_cdn_cgi:a[`exclude-cdn-cgi`],exclude_duplicates:a[`exclude-duplicates`],status:a.status,page_url:a[`page-url`],export:a.export};if(a.dryRun){r({command:`cf page-shield scripts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/page_shield/scripts`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.pageShield.scripts.list({zone_id:c,...o})),{successLabel:`Loaded`})}},z={command:`scripts`,describe:`JavaScript files detected on your pages with change tracking and malicious code detection`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`enabled`,{type:`boolean`,description:`When true, indicates that Page Shield is enabled.`}).option(`use-cloudflare-reporting-endpoint`,{type:`boolean`,description:`When true, CSP reports will be sent to https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report`}).option(`use-connection-url-path`,{type:`boolean`,description:`When true, the paths associated with connections URLs will also be analyzed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update`,describe:`Updates Page Shield settings.`,builder:B,handler:async s=>{if(s.dryRun){r({command:`cf page-shield update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/page_shield`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled,use_cloudflare_reporting_endpoint:s[`use-cloudflare-reporting-endpoint`],use_connection_url_path:s[`use-connection-url-path`]}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.pageShield.update({...e,zone_id:l})),{successLabel:`Updated`});return}let u=o({enabled:s.enabled,use_cloudflare_reporting_endpoint:s[`use-cloudflare-reporting-endpoint`],use_connection_url_path:s[`use-connection-url-path`]});n(await i(`Updating`,async()=>c.pageShield.update({...u,zone_id:l})),{successLabel:`Updated`})}},H={command:`page-shield`,describe:`Client-side security — monitor JavaScript, connections, and cookies on your pages for supply-chain attacks`,builder:e=>e.command(C).command(V).command(g).command(x).command(P).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.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 n=>{if(n.dryRun){a({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({build_config:{build_caching:n[`build-config-build-caching`],build_command:u(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:u(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(n.name,`name`,`text`),production_branch:u(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:u(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:u(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:u(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(n[`source-type`],`source-type`,`text`)}}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.pages.projects.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await f(`name`,`Name of the project.`)),n[`production-branch`]===void 0&&(n[`production-branch`]=await f(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=l({build_config:{build_caching:n[`build-config-build-caching`],build_command:u(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:u(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(n.name,`name`,`text`),production_branch:u(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:u(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:u(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:u(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(n[`source-type`],`source-type`,`text`)}});i(await o(`Creating`,async()=>d.pages.projects.create({...m,account_id:p})),{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 n=>{if(n.dryRun){a({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}i(await o(`Deleting`,async()=>c.pages.projects.delete({account_id:l,project_name:n[`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 c=>{if(c.dryRun){a({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${c[`project-name`]==null?`<project-name>`:encodeURIComponent(String(c[`project-name`]))}/deployments`,pathParams:{"project-name":String(c[`project-name`]??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file,branch:c.branch,"commit-dirty":c[`commit-dirty`],"commit-hash":c[`commit-hash`],"commit-message":c[`commit-message`],manifest:c.manifest,"pages-build-output-dir":c[`pages-build-output-dir`],"wrangler-config-hash":c[`wrangler-config-hash`]}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.branch!==void 0||c[`commit-dirty`]!==void 0||c[`commit-hash`]!==void 0||c[`commit-message`]!==void 0||c.manifest!==void 0||c[`pages-build-output-dir`]!==void 0||c[`wrangler-config-hash`]!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`_headers`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`_headers`,c.body);c.branch!==void 0&&e.append(`branch`,String(u(c.branch,`branch`,`text`)??``)),c[`commit-dirty`]!==void 0&&e.append(`commit_dirty`,String(u(c[`commit-dirty`],`commit-dirty`,`text`)??``)),c[`commit-hash`]!==void 0&&e.append(`commit_hash`,String(u(c[`commit-hash`],`commit-hash`,`text`)??``)),c[`commit-message`]!==void 0&&e.append(`commit_message`,String(u(c[`commit-message`],`commit-message`,`text`)??``)),c.manifest!==void 0&&e.append(`manifest`,String(u(c.manifest,`manifest`,`text`)??``)),c[`pages-build-output-dir`]!==void 0&&e.append(`pages_build_output_dir`,String(u(c[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),c[`wrangler-config-hash`]!==void 0&&e.append(`wrangler_config_hash`,String(u(c[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.pages.projects.deployments.create({account_id:f,project_name:c[`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 n=>{let c={force:n.force};if(n.dryRun){a({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}i(await o(`Deleting`,async()=>l.pages.projects.deployments.delete({account_id:u,project_name:n[`project-name`],deployment_id:n[`deployment-id`],...c})),{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 n=>{if(n.dryRun){a({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.pages.projects.deployments.get({account_id:l,project_name:n[`project-name`],deployment_id:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.pages.projects.deployments.history.logs.get({account_id:l,project_name:n[`project-name`],deployment_id:n[`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 n=>{let c={env:n.env,page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments`,pathParams:{"project-name":String(n[`project-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.pages.projects.deployments.list({account_id:u,project_name:n[`project-name`],...c})),{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 n=>{if(n.dryRun){a({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Creating`,async()=>c.pages.projects.deployments.retry({account_id:l,project_name:n[`project-name`],deployment_id:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Creating`,async()=>c.pages.projects.deployments.rollback({account_id:l,project_name:n[`project-name`],deployment_id:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects deployments tails create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/tails`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:c(n.body)});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.pages.projects.deployments.tails.create({...e,account_id:u,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.pages.projects.deployments.tails.create({account_id:u,project_name:n[`project-name`],deployment_id:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects deployments tails delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/tails/${n[`tail-id`]==null?`<tail-id>`:encodeURIComponent(String(n[`tail-id`]))}`,pathParams:{"tail-id":String(n[`tail-id`]??``),"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}i(await o(`Deleting`,async()=>c.pages.projects.deployments.tails.delete({account_id:l,project_name:n[`project-name`],deployment_id:n[`deployment-id`],tail_id:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`json`,body:n.body===void 0?l({name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.pages.projects.domains.create({...e,account_id:p,project_name:n[`project-name`]})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await f(`name`,`The domain name.`));let m=l({name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.pages.projects.domains.create({...m,account_id:p,project_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}i(await o(`Deleting`,async()=>c.pages.projects.domains.delete({account_id:l,project_name:n[`project-name`],domain_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Updating`,async()=>c.pages.projects.domains.edit({account_id:l,project_name:n[`project-name`],domain_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.pages.projects.domains.get({account_id:l,project_name:n[`project-name`],domain_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.pages.projects.domains.list({account_id:l,project_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`json`,body:n.body===void 0?l({build_config:{build_caching:n[`build-config-build-caching`],build_command:u(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:u(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(n.name,`name`,`text`),production_branch:u(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:u(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:u(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:u(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(n[`source-type`],`source-type`,`text`)}}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.pages.projects.edit({...e,account_id:f,project_name:n[`project-name`]})),{successLabel:`Updated`});return}let p=l({build_config:{build_caching:n[`build-config-build-caching`],build_command:u(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:u(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(n.name,`name`,`text`),production_branch:u(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:u(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:u(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:u(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(n[`source-type`],`source-type`,`text`)}});i(await o(`Updating`,async()=>d.pages.projects.edit({...p,account_id:f,project_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/upload-token`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.pages.projects.getUploadToken({account_id:l,project_name:n[`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 n=>{if(n.dryRun){a({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.pages.projects.get({account_id:l,project_name:n[`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 n=>{let c={page:n.page,per_page:n[`per-page`]};if(n.dryRun){a({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.pages.projects.list({account_id:u,...c})),{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 n=>{if(n.dryRun){a({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
11
|
+
`);return}i(await o(`Deleting`,async()=>c.pages.projects.purgeBuildCache({account_id:l,project_name:n[`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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,O as t,w as n}from"./oauth-DBJ5GSFk.mjs";import{n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{t as c}from"./cli-types-CFw6Xygp.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:`list`,describe:`Lists the crawlers known to pay-per-crawl.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl crawlers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/crawlers`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.crawlers.list({account_id:l})),{successLabel:`Loaded`})}},d={command:`crawlers`,describe:`Operations for crawlers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get-signature-link`,describe:`Gets a download link for the account's signed pay-per-crawl terms.`,builder:f,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl terms get-signature-link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/signature_link`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.terms.getSignatureLink({account_id:l})),{successLabel:`Loaded`})}};function m(e){return e.option(`remote`,{type:`boolean`,description:`Refresh the signature status from Ironclad.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get-signature`,describe:`Gets the account's pay-per-crawl terms signature status.`,builder:m,handler:async e=>{let c={remote:e.remote};if(e.dryRun){a({command:`cf pay-per-crawl terms get-signature`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Loading`,async()=>l.payPerCrawl.terms.getSignature({account_id:u,...c})),{successLabel:`Loaded`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets the pay-per-crawl terms and conditions contract.`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf pay-per-crawl terms get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.payPerCrawl.terms.get({account_id:l})),{successLabel:`Loaded`})}};function v(e){return e.option(`event-type`,{type:`string`,description:`The terms activity to record.`,choices:[`agreed`,`displayed`],demandOption:!0}).option(`vid`,{type:`string`,description:`Ironclad contract version ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`send-signature-event`,describe:`Records that an account displayed or agreed to the pay-per-crawl terms.`,builder:c(v),handler:async e=>{let c={event_type:e[`event-type`],vid:e.vid};if(e.dryRun){a({command:`cf pay-per-crawl terms send-signature-event`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Creating`,async()=>l.payPerCrawl.terms.sendSignatureEvent({account_id:u,...c})),{successLabel:`Created`})}},b={command:`terms`,describe:`Operations for terms`,builder:e=>e.command(_).command(h).command(p).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-can-be-enabled`,describe:`Gets whether pay-per-crawl can be enabled for a zone.`,builder:x,handler:async t=>{if(t.dryRun){a({command:`cf pay-per-crawl zones get-can-be-enabled`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/pay-per-crawl/can_be_enabled`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.payPerCrawl.zones.getCanBeEnabled({zone_id:s})),{successLabel:`Loaded`})}},C={command:`zones`,describe:`Operations for zones`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`pay-per-crawl`,describe:`pay-per-crawl`,builder:e=>e.command(d).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DTAWiEm2.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new Pipeline.`,builder:p,handler:async u=>{if(u.dryRun){i({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Pipeline.`)),u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)});r(await a(`Creating`,async()=>f.pipelines.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,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 g={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:h,handler:async s=>{if(s.dryRun){i({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}r(await a(`Deleting`,async()=>c.pipelines.delete({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <pipeline-id>`,describe:`Get Pipeline details.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.get({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).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:`legacy-create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async f=>{if(f.dryRun){i({command:`cf pipelines legacy-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.pipelines.legacyCreate({...e,account_id:m})),{successLabel:`Created`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});r(await a(`Creating`,async()=>p.pipelines.legacyCreate({...h,account_id:m})),{successLabel:`Created`})}};function x(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:x,handler:async s=>{if(s.dryRun){i({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}r(await a(`Deleting`,async()=>c.pipelines.legacyDelete({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async s=>{if(s.dryRun){i({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.legacyGet({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`legacy-list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:T,handler:async s=>{let c={search:s.search,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.legacyList({account_id:u,...c})),{successLabel:`Loaded`})}};function D(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`]}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).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 O={command:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async f=>{if(f.dryRun){i({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${f[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(f[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(f[`pipeline-name`]??``)},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Updating`,async()=>p.pipelines.legacyUpdate({...e,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});r(await a(`Updating`,async()=>p.pipelines.legacyUpdate({...h,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`})}};function k(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List/Filter Pipelines in Account.`,builder:k,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],name:s.name};if(s.dryRun){i({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).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(`config-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`,`config-rolling-policy-file-size-bytes`,`config-rolling-policy-inactivity-seconds`,`config-rolling-policy-interval-seconds`,`config-namespace`,`config-table-name`,`config-token`].some(t=>e[t]!==void 0)){let t={"config-credentials-access-key-id":[`config-namespace`,`config-table-name`,`config-token`],"config-credentials-secret-access-key":[`config-namespace`,`config-table-name`,`config-token`]},n=[`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0}).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-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 --format-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-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 --schema-* flag is set`)}return!0})}const M={command:`create`,describe:`Create a new Sink.`,builder:j,handler:async f=>{if(f.dryRun){i({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:l(f[`format-type`],`format-type`,`text`),compression:l(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{format:{decimal_encoding:l(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:l(f[`schema-format-type`],`schema-format-type`,`text`),compression:l(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`Defines the name of the Sink.`)),f.type===void 0&&(f.type=await u(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:l(f[`format-type`],`format-type`,`text`),compression:l(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{format:{decimal_encoding:l(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:l(f[`schema-format-type`],`schema-format-type`,`text`),compression:l(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)});r(await a(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function N(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete sink forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`delete <sink-id>`,describe:`Delete Sink in Account.`,builder:N,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}r(await a(`Deleting`,async()=>l.pipelines.sinks.delete({account_id:u,sink_id:s[`sink-id`],...c})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:F,handler:async s=>{if(s.dryRun){i({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.sinks.get({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List/Filter Sinks in Account.`,builder:L,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.sinks.list({account_id:u,...c})),{successLabel:`Loaded`})}},z={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding 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)`}).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-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 --format-* flag is set`)}return!0}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].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 --http-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-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 --schema-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].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 --worker_binding-* flag is set`)}return!0})}const V={command:`create`,describe:`Create a new Stream.`,builder:B,handler:async u=>{if(u.dryRun){i({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({format:{decimal_encoding:l(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:l(u[`format-type`],`format-type`,`text`),compression:l(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:l(u.name,`name`,`text`),schema:{format:{decimal_encoding:l(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:l(u[`schema-format-type`],`schema-format-type`,`text`),compression:l(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Stream.`));let m=c({format:{decimal_encoding:l(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:l(u[`format-type`],`format-type`,`text`),compression:l(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:l(u.name,`name`,`text`),schema:{format:{decimal_encoding:l(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:l(u[`schema-format-type`],`schema-format-type`,`text`),compression:l(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}});r(await a(`Creating`,async()=>f.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete stream forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:H,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}r(await a(`Deleting`,async()=>l.pipelines.streams.delete({account_id:u,stream_id:s[`stream-id`],...c})),{successLabel:`Deleted`})}};function W(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:W,handler:async s=>{if(s.dryRun){i({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.streams.get({account_id:l,stream_id:s[`stream-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).option(`name`,{type:`string`,description:`Filters streams by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List/Filter Streams in Account.`,builder:K,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.streams.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding 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)`}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].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 --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].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 --worker_binding-* flag is set`)}return!0})}const Y={command:`update <stream-id>`,describe:`Update a Stream.`,builder:J,handler:async l=>{if(l.dryRun){i({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${l[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(l[`stream-id`]))}`,pathParams:{"stream-id":String(l[`stream-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},worker_binding:{enabled:l[`worker-binding-enabled`]}}):s(l.body)});return}let u=await n(l),d=l.local?o:await t();if(l.accountId=d,l.body){let e=s(l.body);r(await a(`Updating`,async()=>u.pipelines.streams.update({...e,account_id:d,stream_id:l[`stream-id`]})),{successLabel:`Updated`});return}let f=c({http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},worker_binding:{enabled:l[`worker-binding-enabled`]}});r(await a(`Updating`,async()=>u.pipelines.streams.update({...f,account_id:d,stream_id:l[`stream-id`]})),{successLabel:`Updated`})}},X={command:`streams`,describe:`Operations for streams`,builder:e=>e.command(V).command(U).command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`sql`,{type:`string`,description:`Specifies SQL to validate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`validate-sql`,describe:`Validates that the Pipelines SQL is correct.`,builder:Z,handler:async u=>{if(u.dryRun){i({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({sql:l(u.sql,`sql`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL to validate.`));let m=c({sql:l(u.sql,`sql`,`text`)});r(await a(`Creating`,async()=>f.pipelines.validateSql({...m,account_id:p})),{successLabel:`Created`})}},$={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(Q).command(z).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as e,t}from"./session-B1ARgLG7.mjs";import{r as n}from"./theme-DbNbIY4d.mjs";import{a as r}from"./dist-B7hsuvbF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
|