cf 0.4.0 → 0.5.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/README.md +7 -1
- package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
- package/dist/{accounts-CjtZ8x1z.mjs → accounts-B_joQcMi.mjs} +9 -9
- package/dist/{acm-C2lYIWs1.mjs → acm-_kIHqYME.mjs} +2 -2
- package/dist/{addressing-CHFK6uxW.mjs → addressing-CaFlw8y1.mjs} +10 -10
- package/dist/{agent-context-CgGCT0xU.mjs → agent-context-DMPfi54f.mjs} +1 -1
- package/dist/ai-CqnhNb_c.mjs +2 -0
- package/dist/ai-gateway-pgYGI519.mjs +8 -0
- package/dist/ai-search-eqQMPQol.mjs +7 -0
- package/dist/ai_gateway--vuVLnOm.mjs +4 -0
- package/dist/{alerting-Bk85NNf5.mjs → alerting-CPxHiYHb.mjs} +5 -5
- package/dist/{analytics-CkhhhZWZ.mjs → analytics-DSSRDZz8.mjs} +1 -1
- package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
- package/dist/{api-gateway-CWdR4Ne7.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
- package/dist/argo-aC6A3JyX.mjs +2 -0
- package/dist/artifacts-HD4V2xpK.mjs +4 -0
- package/dist/audit-logs-BuExU_nz.mjs +2 -0
- package/dist/auth-CSC4yhEJ.mjs +9 -0
- package/dist/auth-D5hNsOFq.mjs +5 -0
- package/dist/billing-COaghyxl.mjs +2 -0
- package/dist/bot-management-DmEzeV1Y.mjs +5 -0
- package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
- package/dist/brand-protection-dPrGe8sL.mjs +3 -0
- package/dist/{browser-rendering-Rae0AUt0.mjs → browser-rendering-BiSGnpBf.mjs} +3 -3
- package/dist/{build-BE4o4imx.mjs → build-HuS9-R0V.mjs} +2 -2
- package/dist/{cache-B7pRbpTy.mjs → cache-CY-7Lt71.mjs} +4 -4
- package/dist/{calls-DXRWsZ8n.mjs → calls-wOQGDWPl.mjs} +3 -3
- package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
- package/dist/client-certificates-CRf41xLe.mjs +3 -0
- package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
- package/dist/{cloudforce-one-B6HYfk5Z.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
- package/dist/{completions-D_9WsLG7.mjs → completions-DOeHPdCG.mjs} +2 -2
- package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
- package/dist/connectivity-Bx3MgTHX.mjs +3 -0
- package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
- package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
- package/dist/connectors-DRt4e6d_.mjs +3 -0
- package/dist/{content-scanning-CnW2A0pv.mjs → content-scanning-Cd2vy5Sz.mjs} +3 -3
- package/dist/context-jpewmual.mjs +2 -0
- package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
- package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
- package/dist/custom-nameservers-CWqA51in.mjs +3 -0
- package/dist/custom-pages-DeUKEFGe.mjs +4 -0
- package/dist/d1-DvWY9Gp4.mjs +4 -0
- package/dist/data-security-BPo6dIWu.mjs +6 -0
- package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
- package/dist/{deploy-KBRFIatG.mjs → deploy-dVrgDUOp.mjs} +1 -1
- package/dist/{dev-pPazzZvt.mjs → dev-C01_Lby6.mjs} +1 -1
- package/dist/diagnostics-6nKPmVgz.mjs +3 -0
- package/dist/{dispatch-namespaces-Cz2rajnP.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
- package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
- package/dist/{dist-DA54ZQu0.mjs → dist-t_YrL25p.mjs} +1 -1
- package/dist/{dns-62t95Xif.mjs → dns-ClciFGxx.mjs} +13 -13
- package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
- package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
- package/dist/{email-routing-BDUYYeV3.mjs → email-routing-CGXhFqF5.mjs} +9 -9
- package/dist/{email-security-ChHA6eqQ.mjs → email-security-D5viPq8S.mjs} +7 -7
- package/dist/email-sending-C2jpc3gh.mjs +3 -0
- package/dist/{filters-qJpU9uAS.mjs → filters-bzsFcWt0.mjs} +3 -3
- package/dist/{firewall-C3DDwfwh.mjs → firewall-DYZcTtIC.mjs} +10 -10
- package/dist/{fraud-DY3YXFVf.mjs → fraud-C03MtdZb.mjs} +1 -1
- package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
- package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
- package/dist/hostnames-CFgIVI3s.mjs +3 -0
- package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
- package/dist/iam-DqVPzGrb.mjs +6 -0
- package/dist/{images-D1jI3r3O.mjs → images-BYfl4YgR.mjs} +6 -6
- package/dist/index.mjs +1 -1
- package/dist/intel-duTEPIHc.mjs +3 -0
- package/dist/{ips-B6JETVOY.mjs → ips-nv9INuWZ.mjs} +1 -1
- package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
- package/dist/{kv-CSWoD9ks.mjs → kv-CZoV4tiv.mjs} +4 -4
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
- package/dist/{load-balancers-Du1tNuUt.mjs → load-balancers--OMg0HNt.mjs} +5 -5
- package/dist/{logpush-SuJyO-uX.mjs → logpush-C0_lZTyY.mjs} +3 -3
- package/dist/{logs-DcDNRPRl.mjs → logs-BtpWZQfV.mjs} +2 -2
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
- package/dist/{magic-network-monitoring-CqtvOePQ.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
- package/dist/{magic-transit-BTbkhBtF.mjs → magic-transit-CLhMcJ_-.mjs} +32 -32
- package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
- package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
- package/dist/{network-interconnects-DsiNytOU.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
- package/dist/oauth-Bk-F-tIO.mjs +52 -0
- package/dist/{observability-CLqZ7OSi.mjs → observability-BynRbTF4.mjs} +3 -3
- package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
- package/dist/{organizations-aRi1bhFC.mjs → organizations-BqJHyvMK.mjs} +3 -3
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
- package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
- package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
- package/dist/{page-rules-CYqtPU1p.mjs → page-rules-EZHJePmn.mjs} +4 -4
- package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CXJioWPs.mjs} +5 -5
- package/dist/{pages-ChurJ2H7.mjs → pages-D4aYteKk.mjs} +8 -8
- package/dist/{pipelines-CeyujvRf.mjs → pipelines-G8Iusxq-.mjs} +5 -5
- package/dist/progress-DrDErV9w.mjs +2 -0
- package/dist/queues-DEkbKqZX.mjs +6 -0
- package/dist/{r2-BtuTO3vQ.mjs → r2-CV0IkCAW.mjs} +9 -9
- package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
- package/dist/{radar-CzGM92uM.mjs → radar-D986zPJr.mjs} +1 -1
- package/dist/{rate-limits-Bbk7HxP7.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
- package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
- package/dist/{realtime-kit-CivLpkpg.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
- package/dist/{registrar-8IeA5DKd.mjs → registrar-CDIwTz3G.mjs} +6 -6
- package/dist/request-tracers-D7SFMDik.mjs +2 -0
- package/dist/{resource-sharing-B-Pcto7-.mjs → resource-sharing-YIQ04jXE.mjs} +4 -4
- package/dist/{resource-tagging-Bpb6Qq1M.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
- package/dist/rules-DHjLP5Kx.mjs +4 -0
- package/dist/{rulesets-lYczEcJp.mjs → rulesets-q4QABpKs.mjs} +7 -7
- package/dist/rum-SmT4HZmM.mjs +4 -0
- package/dist/{schema-hefO-tzo.mjs → schema-BR31o4P6.mjs} +1 -1
- package/dist/{schema-validation-DTq517Em.mjs → schema-validation-vVetgC_P.mjs} +5 -5
- package/dist/{scim-BiLfOQ89.mjs → scim-ChOkZpNx.mjs} +2 -2
- package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
- package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-BAK9G12O.mjs} +12 -12
- package/dist/security-center-eScuYDKP.mjs +2 -0
- package/dist/security-txt-x7R4gmQu.mjs +3 -0
- package/dist/session-DHYCE-PM.mjs +93 -0
- package/dist/shared-BAjo72Lz.mjs +2 -0
- package/dist/{smart-shield-DblHIce0.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
- package/dist/snippets-DrlgYJYp.mjs +4 -0
- package/dist/{spawn-DK7pott_.mjs → spawn-CCGzKlC4.mjs} +1 -1
- package/dist/{spectrum-CnrG0jIC.mjs → spectrum-pVGxb7u5.mjs} +6 -6
- package/dist/speed-ZFrMWDgd.mjs +4 -0
- package/dist/src-DU7FBCOX.mjs +108 -0
- package/dist/ssl-9JY05sYt.mjs +15 -0
- package/dist/{stream-CGTRN4ZN.mjs → stream-tRU39b8K.mjs} +13 -13
- package/dist/{tenants-o_M62Y1n.mjs → tenants-HLGUazms.mjs} +1 -1
- package/dist/{token-validation-Ca5AGEns.mjs → token-validation-_VdamKpz.mjs} +4 -4
- package/dist/{tools-DtNNmO6l.mjs → tools-D_hfUU_Z.mjs} +1 -1
- package/dist/{turnstile-l7mo9BWL.mjs → turnstile-BRzXd28B.mjs} +4 -4
- package/dist/{ui-B97lRnOv.mjs → ui-erjBdVKL.mjs} +1 -1
- package/dist/url-normalization-D-NxuLtN.mjs +3 -0
- package/dist/url-scanner-BzzR6iDx.mjs +2 -0
- package/dist/{user-CiyYZ69X.mjs → user-C4omq__w.mjs} +1 -1
- package/dist/vectorize-By6EqcNR.mjs +4 -0
- package/dist/{versions-B6E8WQyA.mjs → versions-CBHwWPAM.mjs} +1 -1
- package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
- package/dist/{web3-DlHE0CZc.mjs → web3-DQ5dmE9W.mjs} +3 -3
- package/dist/{workers-DRAkU6YR.mjs → workers-D8Be7_as.mjs} +14 -14
- package/dist/workers-builds-BE3W3qNk.mjs +7 -0
- package/dist/{workflows-z6oapEJs.mjs → workflows-BWWufqFA.mjs} +3 -3
- package/dist/zaraz-Bsa9AvVL.mjs +2 -0
- package/dist/{zero-trust-fyyIelWx.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
- package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
- package/dist/{zones-MSULnDwW.mjs → zones-BXtdwt6E.mjs} +6 -6
- package/package.json +1 -1
- package/dist/ai-DS3i-I1a.mjs +0 -2
- package/dist/ai-gateway-RIsegO2x.mjs +0 -8
- package/dist/ai-search-Dcj4BauG.mjs +0 -7
- package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
- package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
- package/dist/argo-DnJRVnGX.mjs +0 -2
- package/dist/artifacts-BVWKiJUl.mjs +0 -4
- package/dist/audit-logs-DjTstbzL.mjs +0 -2
- package/dist/auth-BqDOIrKX.mjs +0 -150
- package/dist/auth-DKkSwnxh.mjs +0 -5
- package/dist/billing-3rEqF83h.mjs +0 -2
- package/dist/bot-management-CJxD1pqi.mjs +0 -5
- package/dist/botnet-feed-MG91D7BR.mjs +0 -3
- package/dist/brand-protection-CK7gJi06.mjs +0 -3
- package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
- package/dist/client-certificates-B0ebLJdk.mjs +0 -3
- package/dist/cloud-connector-BOjaggJk.mjs +0 -2
- package/dist/connectivity-welFvZ7X.mjs +0 -3
- package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
- package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
- package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
- package/dist/connectors-3vjrdFLB.mjs +0 -3
- package/dist/context-CONbNKO-.mjs +0 -2
- package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
- package/dist/custom-pages-5fCSP8in.mjs +0 -4
- package/dist/d1-CyiRbZZn.mjs +0 -4
- package/dist/data-security-Casx4OS_.mjs +0 -6
- package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
- package/dist/diagnostics-BqYDoDfw.mjs +0 -3
- package/dist/dns-firewall-Coy8d47t.mjs +0 -57
- package/dist/durable-objects-BSuRERkw.mjs +0 -2
- package/dist/email-sending-CVrRqn6S.mjs +0 -3
- package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
- package/dist/hostnames-BdAQo1Mr.mjs +0 -3
- package/dist/hyperdrive-99OJV9nl.mjs +0 -18
- package/dist/iam-BRbpg3lN.mjs +0 -6
- package/dist/intel-C3ajLpXd.mjs +0 -3
- package/dist/keyless-certificates-C4MZ4xnf.mjs +0 -3
- package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
- package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
- package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
- package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
- package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
- package/dist/progress-Cent9Lsg.mjs +0 -2
- package/dist/queues-Rf_n11Cx.mjs +0 -6
- package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
- package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
- package/dist/request-tracers-D1aH4NmL.mjs +0 -2
- package/dist/rules-B10XWY10.mjs +0 -4
- package/dist/rum-B5GUKa4I.mjs +0 -4
- package/dist/security-center-AVpTOBK3.mjs +0 -2
- package/dist/security-txt-DVlh8y9l.mjs +0 -3
- package/dist/shared-0bwWVDLo.mjs +0 -2
- package/dist/snippets-DrpqSXYC.mjs +0 -4
- package/dist/speed-BzRY3Xlh.mjs +0 -4
- package/dist/src-D9_Gq68b.mjs +0 -108
- package/dist/ssl-Cp6tQkZH.mjs +0 -15
- package/dist/url-normalization-D1CogSIG.mjs +0 -3
- package/dist/url-scanner-BnJHJqcz.mjs +0 -2
- package/dist/vectorize-D3LgMLOn.mjs +0 -4
- package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
- package/dist/zaraz-CyzfYOEU.mjs +0 -2
- package/dist/zero_trust-BAhlNkjo.mjs +0 -3
- /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
- /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
- /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-BeyOc81z.mjs} +0 -0
- /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
- /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
- /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
- /package/dist/{metadata-jh2EIan8.mjs → metadata-OOwvpR8m.mjs} +0 -0
- /package/dist/{resolve-D1mG0REg.mjs → resolve-C3h-mwp7.mjs} +0 -0
- /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{i,n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d,t as f}from"./input-validation-_fMCApaH.mjs";import{t as p}from"./local-CYc9q7l2.mjs";import{t as m}from"./cli-types-BeyOc81z.mjs";function ee(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
3
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){l({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({build_config:{build_caching:n[`build-config-build-caching`],build_command:d(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(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:d(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:d(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(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:d(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:d(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(n.name,`name`,`text`),production_branch:d(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:d(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(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:d(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:d(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(n[`source-type`],`source-type`,`text`)}}):o(n.body)});return}let i=await a(n),f=n.local?p:await r(i);if(n.accountId=f,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.pages.projects.create({...e,account_id:f})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the project.`)),n[`production-branch`]===void 0&&(n[`production-branch`]=await t(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=s({build_config:{build_caching:n[`build-config-build-caching`],build_command:d(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(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:d(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:d(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(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:d(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:d(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(n.name,`name`,`text`),production_branch:d(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:d(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(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:d(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:d(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(n[`source-type`],`source-type`,`text`)}});c(await u(`Creating`,async()=>i.pages.projects.create({...m,account_id:f})),{successLabel:`Created`})}};function g(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.delete({account_id:o,project_name:
|
|
6
|
-
`);return}c(await u(`Deleting`,async()=>o.pages.projects.deployments.delete({account_id:s,project_name:
|
|
7
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.deployments.tails.delete({account_id:o,project_name:
|
|
8
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.domains.delete({account_id:o,project_name:
|
|
4
|
+
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const h={command:`create`,describe:`Create a new project.`,builder:ee,handler:async r=>{if(r.dryRun){l({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}}):o(r.body)});return}let i=await a(r),f=r.local?p:await n(i);if(r.accountId=f,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.pages.projects.create({...e,account_id:f})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await e(`name`,`Name of the project.`)),r[`production-branch`]===void 0&&(r[`production-branch`]=await e(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=s({build_config:{build_caching:r[`build-config-build-caching`],build_command:d(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:d(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(r.name,`name`,`text`),production_branch:d(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:d(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:d(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:d(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(r[`source-type`],`source-type`,`text`)}});c(await u(`Creating`,async()=>i.pages.projects.create({...m,account_id:f})),{successLabel:`Created`})}};function g(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:g,handler:async e=>{if(e.dryRun){l({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}c(await u(`Deleting`,async()=>i.pages.projects.delete({account_id:o,project_name:e[`project-name`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`branch`,{type:`string`,description:"The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default."}).option(`commit-dirty`,{type:`string`,description:`Boolean string indicating if the working directory has uncommitted changes.`}).option(`commit-hash`,{type:`string`,description:`Git commit SHA associated with this deployment.`}).option(`commit-message`,{type:`string`,description:`Git commit message associated with this deployment.`}).option(`manifest`,{type:`string`,description:`JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. `}).option(`pages-build-output-dir`,{type:`string`,description:`The build output directory path.`}).option(`wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration file used for this deployment.`})}const y={command:`create <project-name>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:v,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,branch:e.branch,"commit-dirty":e[`commit-dirty`],"commit-hash":e[`commit-hash`],"commit-message":e[`commit-message`],manifest:e.manifest,"pages-build-output-dir":e[`pages-build-output-dir`],"wrangler-config-hash":e[`wrangler-config-hash`]}});return}let r=await a(e),o=e.local?p:await n(r);if(e.accountId=o,e.file!==void 0||e.body!==void 0||e.branch!==void 0||e[`commit-dirty`]!==void 0||e[`commit-hash`]!==void 0||e[`commit-message`]!==void 0||e.manifest!==void 0||e[`pages-build-output-dir`]!==void 0||e[`wrangler-config-hash`]!==void 0){let t=new FormData;if(e.file){let n=f(e.file);t.append(`_headers`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`_headers`,e.body);e.branch!==void 0&&t.append(`branch`,String(d(e.branch,`branch`,`text`)??``)),e[`commit-dirty`]!==void 0&&t.append(`commit_dirty`,String(d(e[`commit-dirty`],`commit-dirty`,`text`)??``)),e[`commit-hash`]!==void 0&&t.append(`commit_hash`,String(d(e[`commit-hash`],`commit-hash`,`text`)??``)),e[`commit-message`]!==void 0&&t.append(`commit_message`,String(d(e[`commit-message`],`commit-message`,`text`)??``)),e.manifest!==void 0&&t.append(`manifest`,String(d(e.manifest,`manifest`,`text`)??``)),e[`pages-build-output-dir`]!==void 0&&t.append(`pages_build_output_dir`,String(d(e[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),e[`wrangler-config-hash`]!==void 0&&t.append(`wrangler_config_hash`,String(d(e[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),c(await u(`Creating`,async()=>i(r,`POST`,`/accounts/${o}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/deployments`,{body:t})),{successLabel:`Created`});return}if(e.body){let t=d(e.body,`body`,`binary`);c(await u(`Creating`,async()=>i(r,`POST`,`/accounts/${o}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/deployments`,{body:t,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>r.pages.projects.deployments.create({account_id:o,project_name:e[`project-name`]})),{successLabel:`Created`})}};function b(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Allow deletion of aliased non-production deployments when a normal delete would be rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:b,handler:async e=>{let i={force:e.force};if(e.dryRun){l({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},query:i,bodyKind:`none`});return}let o=await a(e),s=e.local?p:await n(o);if(e.accountId=s,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}c(await u(`Deleting`,async()=>o.pages.projects.deployments.delete({account_id:s,project_name:e[`project-name`],deployment_id:e[`deployment-id`],...i})),{successLabel:`Deleted`})}};function S(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <deployment-id>`,describe:`Fetch information about a deployment.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.deployments.get({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <deployment-id>`,describe:`Fetch deployment logs for a project.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.deployments.history.logs.get({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Loaded`})}},E={command:`logs`,describe:`Operations for projects.deployments.history.logs`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`env`,{type:`string`,description:`What type of deployments to fetch.`,choices:[`production`,`preview`]}).option(`page`,{type:`number`,description:`Which page of deployments to fetch.`}).option(`per-page`,{type:`number`,description:`How many deployments to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Fetch a list of project deployments.`,builder:m(O),handler:async e=>{let r={env:e.env,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments`,pathParams:{"project-name":String(e[`project-name`]??``)},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pages.projects.deployments.list({account_id:o,project_name:e[`project-name`],...r})),{successLabel:`Loaded`})}};function A(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`retry <deployment-id>`,describe:`Retry a previous deployment.`,builder:A,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Creating`,async()=>r.pages.projects.deployments.retry({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`})}};function M(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`rollback <deployment-id>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:M,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Creating`,async()=>r.pages.projects.deployments.rollback({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`})}};function P(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create <deployment-id>`,describe:`Start a tail that receives logs and exception data.`,builder:P,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments tails create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/tails`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:o(e.body)});return}let r=await a(e),i=e.local?p:await n(r);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.pages.projects.deployments.tails.create({...t,account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>r.pages.projects.deployments.tails.create({account_id:i,project_name:e[`project-name`],deployment_id:e[`deployment-id`]})),{successLabel:`Created`})}};function I(e){return e.positional(`tail-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <tail-id>`,describe:`Deletes a tail from a Pages deployment.`,builder:I,handler:async e=>{if(e.dryRun){l({command:`cf pages projects deployments tails delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/tails/${e[`tail-id`]==null?`<tail-id>`:encodeURIComponent(String(e[`tail-id`]))}`,pathParams:{"tail-id":String(e[`tail-id`]??``),"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}c(await u(`Deleting`,async()=>i.pages.projects.deployments.tails.delete({account_id:o,project_name:e[`project-name`],deployment_id:e[`deployment-id`],tail_id:e[`tail-id`]})),{successLabel:`Deleted`})}},R={command:`tails`,describe:`Operations for projects.deployments.tails`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`deployments`,describe:`Operations for projects.deployments`,builder:e=>e.command(y).command(x).command(C).command(k).command(j).command(N).command(D).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`name`,{type:`string`,description:`The domain name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`create <project-name>`,describe:`Add a new domain for the Pages project.`,builder:z,handler:async r=>{if(r.dryRun){l({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?s({name:d(r.name,`name`,`text`)}):o(r.body)});return}let i=await a(r),f=r.local?p:await n(i);if(r.accountId=f,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.pages.projects.domains.create({...e,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await e(`name`,`The domain name.`));let m=s({name:d(r.name,`name`,`text`)});c(await u(`Creating`,async()=>i.pages.projects.domains.create({...m,account_id:f,project_name:r[`project-name`]})),{successLabel:`Created`})}};function V(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const H={command:`delete <domain-name>`,describe:`Delete a Pages project's domain.`,builder:V,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}c(await u(`Deleting`,async()=>i.pages.projects.domains.delete({account_id:o,project_name:e[`project-name`],domain_name:e[`domain-name`]})),{successLabel:`Deleted`})}};function U(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`edit <domain-name>`,describe:`Retry the validation status of a single domain.`,builder:U,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Updating`,async()=>r.pages.projects.domains.edit({account_id:i,project_name:e[`project-name`],domain_name:e[`domain-name`]})),{successLabel:`Updated`})}};function G(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <domain-name>`,describe:`Fetch a single domain.`,builder:G,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.domains.get({account_id:i,project_name:e[`project-name`],domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:q,handler:async e=>{if(e.dryRun){l({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.domains.list({account_id:i,project_name:e[`project-name`]})),{successLabel:`Loaded`})}},Y={command:`domains`,describe:`Operations for projects.domains`,builder:e=>e.command(B).command(H).command(W).command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
9
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 t=>{if(t.dryRun){l({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`json`,body:t.body===void 0?s({build_config:{build_caching:t[`build-config-build-caching`],build_command:d(t[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(t[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(t[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(t[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(t[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:t[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:t[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(t[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:t[`deployment-configs-preview-compatibility-flags`],fail_open:t[`deployment-configs-preview-fail-open`],limits:{cpu_ms:t[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(t[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(t[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(t[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:t[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:t[`deployment-configs-production-build-image-major-version`],compatibility_date:d(t[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:t[`deployment-configs-production-compatibility-flags`],fail_open:t[`deployment-configs-production-fail-open`],limits:{cpu_ms:t[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(t[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(t[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(t[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(t.name,`name`,`text`),production_branch:d(t[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:t[`source-config-deployments-enabled`],owner:d(t[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(t[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:t[`source-config-path-excludes`],path_includes:t[`source-config-path-includes`],pr_comments_enabled:t[`source-config-pr-comments-enabled`],preview_branch_excludes:t[`source-config-preview-branch-excludes`],preview_branch_includes:t[`source-config-preview-branch-includes`],preview_deployment_setting:d(t[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(t[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:t[`source-config-production-deployments-enabled`],repo_id:d(t[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(t[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(t[`source-type`],`source-type`,`text`)}}):o(t.body)});return}let n=await a(t),i=t.local?p:await r(n);if(t.accountId=i,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.pages.projects.edit({...e,account_id:i,project_name:t[`project-name`]})),{successLabel:`Updated`});return}let f=s({build_config:{build_caching:t[`build-config-build-caching`],build_command:d(t[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(t[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(t[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(t[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(t[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:t[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:t[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(t[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:t[`deployment-configs-preview-compatibility-flags`],fail_open:t[`deployment-configs-preview-fail-open`],limits:{cpu_ms:t[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(t[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(t[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(t[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:t[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:t[`deployment-configs-production-build-image-major-version`],compatibility_date:d(t[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:t[`deployment-configs-production-compatibility-flags`],fail_open:t[`deployment-configs-production-fail-open`],limits:{cpu_ms:t[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(t[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(t[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(t[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(t.name,`name`,`text`),production_branch:d(t[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:t[`source-config-deployments-enabled`],owner:d(t[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(t[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:t[`source-config-path-excludes`],path_includes:t[`source-config-path-includes`],pr_comments_enabled:t[`source-config-pr-comments-enabled`],preview_branch_excludes:t[`source-config-preview-branch-excludes`],preview_branch_includes:t[`source-config-preview-branch-includes`],preview_deployment_setting:d(t[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(t[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:t[`source-config-production-deployments-enabled`],repo_id:d(t[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(t[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(t[`source-type`],`source-type`,`text`)}});c(await u(`Updating`,async()=>n.pages.projects.edit({...f,account_id:i,project_name:t[`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 t=>{if(t.dryRun){l({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/upload-token`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?p:await r(n);t.accountId=i,c(await u(`Loading`,async()=>n.pages.projects.getUploadToken({account_id:i,project_name:t[`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 t=>{if(t.dryRun){l({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?p:await r(n);t.accountId=i,c(await u(`Loading`,async()=>n.pages.projects.get({account_id:i,project_name:t[`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 t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);t.accountId=o,c(await u(`Loading`,async()=>i.pages.projects.list({account_id:o,...n})),{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 t=>{if(t.dryRun){l({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);if(t.accountId=o,!await n({force:!!t.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
11
|
-
`);return}c(await u(`Deleting`,async()=>i.pages.projects.purgeBuildCache({account_id:o,project_name:
|
|
10
|
+
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const Z={command:`edit <project-name>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:X,handler:async e=>{if(e.dryRun){l({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`json`,body:e.body===void 0?s({build_config:{build_caching:e[`build-config-build-caching`],build_command:d(e[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(e[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(e[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(e[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(e[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:e[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(e[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-preview-compatibility-flags`],fail_open:e[`deployment-configs-preview-fail-open`],limits:{cpu_ms:e[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:e[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-production-build-image-major-version`],compatibility_date:d(e[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-production-compatibility-flags`],fail_open:e[`deployment-configs-production-fail-open`],limits:{cpu_ms:e[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(e.name,`name`,`text`),production_branch:d(e[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:e[`source-config-deployments-enabled`],owner:d(e[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(e[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:e[`source-config-path-excludes`],path_includes:e[`source-config-path-includes`],pr_comments_enabled:e[`source-config-pr-comments-enabled`],preview_branch_excludes:e[`source-config-preview-branch-excludes`],preview_branch_includes:e[`source-config-preview-branch-includes`],preview_deployment_setting:d(e[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(e[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:e[`source-config-production-deployments-enabled`],repo_id:d(e[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(e[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(e[`source-type`],`source-type`,`text`)}}):o(e.body)});return}let r=await a(e),i=e.local?p:await n(r);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>r.pages.projects.edit({...t,account_id:i,project_name:e[`project-name`]})),{successLabel:`Updated`});return}let f=s({build_config:{build_caching:e[`build-config-build-caching`],build_command:d(e[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:d(e[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:d(e[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:d(e[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:d(e[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:e[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-preview-build-image-major-version`],compatibility_date:d(e[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-preview-compatibility-flags`],fail_open:e[`deployment-configs-preview-fail-open`],limits:{cpu_ms:e[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:e[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:e[`deployment-configs-production-build-image-major-version`],compatibility_date:d(e[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:e[`deployment-configs-production-compatibility-flags`],fail_open:e[`deployment-configs-production-fail-open`],limits:{cpu_ms:e[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:d(e[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:d(e[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:d(e[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:d(e.name,`name`,`text`),production_branch:d(e[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:e[`source-config-deployments-enabled`],owner:d(e[`source-config-owner`],`source-config-owner`,`text`),owner_id:d(e[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:e[`source-config-path-excludes`],path_includes:e[`source-config-path-includes`],pr_comments_enabled:e[`source-config-pr-comments-enabled`],preview_branch_excludes:e[`source-config-preview-branch-excludes`],preview_branch_includes:e[`source-config-preview-branch-includes`],preview_deployment_setting:d(e[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:d(e[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:e[`source-config-production-deployments-enabled`],repo_id:d(e[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:d(e[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:d(e[`source-type`],`source-type`,`text`)}});c(await u(`Updating`,async()=>r.pages.projects.edit({...f,account_id:i,project_name:e[`project-name`]})),{successLabel:`Updated`})}};function Q(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get-upload-token <project-name>`,describe:`Get a short-lived JWT for Pages Direct Upload asset operations.`,builder:Q,handler:async e=>{if(e.dryRun){l({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/upload-token`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.getUploadToken({account_id:i,project_name:e[`project-name`]})),{successLabel:`Loaded`})}};function re(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <project-name>`,describe:`Fetch a project by name.`,builder:re,handler:async e=>{if(e.dryRun){l({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?p:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.pages.projects.get({account_id:i,project_name:e[`project-name`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Which page of projects to fetch.`}).option(`per-page`,{type:`number`,description:`How many projects to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Fetch a list of all user projects.`,builder:ae,handler:async e=>{let r={page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects`,pathParams:{},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pages.projects.list({account_id:o,...r})),{successLabel:`Loaded`})}};function $(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const se={command:`purge-build-cache <project-name>`,describe:`Purge all cached build artifacts for a Pages project`,builder:$,handler:async e=>{if(e.dryRun){l({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?p:await n(i);if(e.accountId=o,!await r({force:!!e.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
11
|
+
`);return}c(await u(`Deleting`,async()=>i.pages.projects.purgeBuildCache({account_id:o,project_name:e[`project-name`]})),{successLabel:`Deleted`})}},ce={command:`projects`,describe:`Operations for projects`,builder:e=>e.command(h).command(_).command(Z).command(ie).command(ne).command(oe).command(se).command(te).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>n.pipelines.deleteV1({account_id:o,pipeline_id:
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>n.pipelines.delete({account_id:o,pipeline_name:t[`pipeline-name`]})),{successLabel:`Deleted`})}};function x(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 S={command:`get-v1 <pipeline-id>`,describe:`Get Pipelines Details.`,builder:x,handler:async t=>{if(t.dryRun){l({command:`cf pipelines get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/pipelines/${t[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(t[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(t[`pipeline-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.getV1({account_id:r,pipeline_id:t[`pipeline-id`]})),{successLabel:`Loaded`})}};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:`get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async t=>{if(t.dryRun){l({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/${t[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(t[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(t[`pipeline-name`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.get({account_id:r,pipeline_name:t[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(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 E={command:`list-v1`,describe:`List/Filter Pipelines in Account.`,builder:T,handler:async t=>{let n={page:t.page,per_page:t[`per-page`],name:t.name};if(t.dryRun){l({command:`cf pipelines list-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.listV1({account_id:o,...n})),{successLabel:`Loaded`})}};function D(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 O={command:`list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async t=>{let n={search:t.search,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.list({account_id:o,...n})),{successLabel:`Loaded`})}};function k(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 A={command:`create`,describe:`Create a new Sink.`,builder:k,handler:async r=>{if(r.dryRun){l({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({config:{account_id:d(r[`config-account-id`],`config-account-id`,`text`),bucket:d(r[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(r[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(r[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(r[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(r[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(r[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(r[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(r[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(r[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:r[`config-rolling-policy-file-size-bytes`],inactivity_seconds:r[`config-rolling-policy-inactivity-seconds`],interval_seconds:r[`config-rolling-policy-interval-seconds`]},namespace:d(r[`config-namespace`],`config-namespace`,`text`),table_name:d(r[`config-table-name`],`config-table-name`,`text`),token:d(r[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(r[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(r[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:r[`format-unstructured`],type:d(r[`format-type`],`format-type`,`text`),compression:d(r[`format-compression`],`format-compression`,`text`),row_group_bytes:r[`format-row-group-bytes`]},name:d(r.name,`name`,`text`),schema:{format:{decimal_encoding:d(r[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(r[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:r[`schema-format-unstructured`],type:d(r[`schema-format-type`],`schema-format-type`,`text`),compression:d(r[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:r[`schema-format-row-group-bytes`]},inferred:r[`schema-inferred`]},type:d(r.type,`type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await t(`name`,`Defines the name of the Sink.`)),r.type===void 0&&(r.type=await n(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=s({config:{account_id:d(r[`config-account-id`],`config-account-id`,`text`),bucket:d(r[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(r[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(r[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(r[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(r[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(r[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(r[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(r[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(r[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:r[`config-rolling-policy-file-size-bytes`],inactivity_seconds:r[`config-rolling-policy-inactivity-seconds`],interval_seconds:r[`config-rolling-policy-interval-seconds`]},namespace:d(r[`config-namespace`],`config-namespace`,`text`),table_name:d(r[`config-table-name`],`config-table-name`,`text`),token:d(r[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(r[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(r[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:r[`format-unstructured`],type:d(r[`format-type`],`format-type`,`text`),compression:d(r[`format-compression`],`format-compression`,`text`),row_group_bytes:r[`format-row-group-bytes`]},name:d(r.name,`name`,`text`),schema:{format:{decimal_encoding:d(r[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(r[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:r[`schema-format-unstructured`],type:d(r[`schema-format-type`],`schema-format-type`,`text`),compression:d(r[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:r[`schema-format-row-group-bytes`]},inferred:r[`schema-inferred`]},type:d(r.type,`type`,`text`)});c(await u(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function j(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 M={command:`delete <sink-id>`,describe:`Delete Pipeline in Account.`,builder:j,handler:async t=>{let n={force:t.force};if(t.dryRun){l({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks/${t[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(t[`sink-id`]))}`,pathParams:{"sink-id":String(t[`sink-id`]??``)},query:n,bodyKind:`none`});return}let o=await a(t),s=t.local?f:await i(o);if(t.accountId=s,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}c(await u(`Deleting`,async()=>o.pipelines.sinks.delete({account_id:s,sink_id:t[`sink-id`],...n})),{successLabel:`Deleted`})}};function N(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 P={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:N,handler:async t=>{if(t.dryRun){l({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks/${t[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(t[`sink-id`]))}`,pathParams:{"sink-id":String(t[`sink-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.sinks.get({account_id:r,sink_id:t[`sink-id`]})),{successLabel:`Loaded`})}};function F(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 I={command:`list`,describe:`List/Filter Sinks in Account.`,builder:F,handler:async t=>{let n={pipeline_id:t[`pipeline-id`],name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.sinks.list({account_id:o,...n})),{successLabel:`Loaded`})}},L={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(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 z={command:`create`,describe:`Create a new Stream.`,builder:R,handler:async n=>{if(n.dryRun){l({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({format:{decimal_encoding:d(n[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(n[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:n[`format-unstructured`],type:d(n[`format-type`],`format-type`,`text`),compression:d(n[`format-compression`],`format-compression`,`text`),row_group_bytes:n[`format-row-group-bytes`]},http:{authentication:n[`http-authentication`],cors:{origins:n[`http-cors-origins`]},enabled:n[`http-enabled`]},name:d(n.name,`name`,`text`),schema:{format:{decimal_encoding:d(n[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(n[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:n[`schema-format-unstructured`],type:d(n[`schema-format-type`],`schema-format-type`,`text`),compression:d(n[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:n[`schema-format-row-group-bytes`]},inferred:n[`schema-inferred`]},worker_binding:{enabled:n[`worker-binding-enabled`]}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Specifies the name of the Stream.`));let m=s({format:{decimal_encoding:d(n[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(n[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:n[`format-unstructured`],type:d(n[`format-type`],`format-type`,`text`),compression:d(n[`format-compression`],`format-compression`,`text`),row_group_bytes:n[`format-row-group-bytes`]},http:{authentication:n[`http-authentication`],cors:{origins:n[`http-cors-origins`]},enabled:n[`http-enabled`]},name:d(n.name,`name`,`text`),schema:{format:{decimal_encoding:d(n[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(n[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:n[`schema-format-unstructured`],type:d(n[`schema-format-type`],`schema-format-type`,`text`),compression:d(n[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:n[`schema-format-row-group-bytes`]},inferred:n[`schema-inferred`]},worker_binding:{enabled:n[`worker-binding-enabled`]}});c(await u(`Creating`,async()=>r.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function B(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 V={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:B,handler:async t=>{let n={force:t.force};if(t.dryRun){l({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams/${t[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(t[`stream-id`]))}`,pathParams:{"stream-id":String(t[`stream-id`]??``)},query:n,bodyKind:`none`});return}let o=await a(t),s=t.local?f:await i(o);if(t.accountId=s,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}c(await u(`Deleting`,async()=>o.pipelines.streams.delete({account_id:s,stream_id:t[`stream-id`],...n})),{successLabel:`Deleted`})}};function H(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 U={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:H,handler:async t=>{if(t.dryRun){l({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams/${t[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(t[`stream-id`]))}`,pathParams:{"stream-id":String(t[`stream-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.streams.get({account_id:r,stream_id:t[`stream-id`]})),{successLabel:`Loaded`})}};function W(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 G={command:`list`,describe:`List/Filter Streams in Account.`,builder:W,handler:async t=>{let n={pipeline_id:t[`pipeline-id`],name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.streams.list({account_id:o,...n})),{successLabel:`Loaded`})}};function K(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 q={command:`update <stream-id>`,describe:`Update a Stream.`,builder:K,handler:async t=>{if(t.dryRun){l({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams/${t[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(t[`stream-id`]))}`,pathParams:{"stream-id":String(t[`stream-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({http:{authentication:t[`http-authentication`],cors:{origins:t[`http-cors-origins`]},enabled:t[`http-enabled`]},worker_binding:{enabled:t[`worker-binding-enabled`]}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.pipelines.streams.update({...e,account_id:r,stream_id:t[`stream-id`]})),{successLabel:`Updated`});return}let d=s({http:{authentication:t[`http-authentication`],cors:{origins:t[`http-cors-origins`]},enabled:t[`http-enabled`]},worker_binding:{enabled:t[`worker-binding-enabled`]}});c(await u(`Updating`,async()=>n.pipelines.streams.update({...d,account_id:r,stream_id:t[`stream-id`]})),{successLabel:`Updated`})}},J={command:`streams`,describe:`Operations for streams`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`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 X={command:`update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:Y,handler:async r=>{if(r.dryRun){l({command:`cf pipelines update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/${r[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(r[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(r[`pipeline-name`]??``)},bodyKind:`json`,body:r.body===void 0?s({destination:{batch:{max_bytes:r[`destination-batch-max-bytes`],max_duration_s:r[`destination-batch-max-duration-s`],max_rows:r[`destination-batch-max-rows`]},compression:{type:d(r[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(r[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(r[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(r[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(r[`destination-format`],`destination-format`,`text`),path:{bucket:d(r[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(r[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(r[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(r[`destination-type`],`destination-type`,`text`)},name:d(r.name,`name`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.pipelines.update({...e,account_id:m,pipeline_name:r[`pipeline-name`]})),{successLabel:`Updated`});return}r[`destination-credentials-access-key-id`]===void 0&&(r[`destination-credentials-access-key-id`]=await t(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),r[`destination-credentials-endpoint`]===void 0&&(r[`destination-credentials-endpoint`]=await t(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),r[`destination-credentials-secret-access-key`]===void 0&&(r[`destination-credentials-secret-access-key`]=await t(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),r[`destination-format`]===void 0&&(r[`destination-format`]=await n(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),r[`destination-path-bucket`]===void 0&&(r[`destination-path-bucket`]=await t(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),r[`destination-type`]===void 0&&(r[`destination-type`]=await n(`destination-type`,`Specifies the type of destination.`,[`r2`])),r.name===void 0&&(r.name=await t(`name`,`Defines the name of the pipeline.`));let h=s({destination:{batch:{max_bytes:r[`destination-batch-max-bytes`],max_duration_s:r[`destination-batch-max-duration-s`],max_rows:r[`destination-batch-max-rows`]},compression:{type:d(r[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(r[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(r[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(r[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(r[`destination-format`],`destination-format`,`text`),path:{bucket:d(r[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(r[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(r[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(r[`destination-type`],`destination-type`,`text`)},name:d(r.name,`name`,`text`)});c(await u(`Updating`,async()=>p.pipelines.update({...h,account_id:m,pipeline_name:r[`pipeline-name`]})),{successLabel:`Updated`})}};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:`Validate Arroyo SQL.`,builder:Z,handler:async n=>{if(n.dryRun){l({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({sql:d(n.sql,`sql`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}n.sql===void 0&&(n.sql=await t(`sql`,`Specifies SQL to validate.`));let m=s({sql:d(n.sql,`sql`,`text`)});c(await u(`Creating`,async()=>r.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(g).command(m).command(b).command(v).command(w).command(S).command(O).command(E).command(X).command(Q).command(L).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
2
|
+
import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";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-v1`,describe:`Create a new Pipeline.`,builder:p,handler:async n=>{if(n.dryRun){l({command:`cf pipelines create-v1`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`),sql:d(n.sql,`sql`,`text`)}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.pipelines.createV1({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await e(`name`,`Specifies the name of the Pipeline.`)),n.sql===void 0&&(n.sql=await e(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=s({name:d(n.name,`name`,`text`),sql:d(n.sql,`sql`,`text`)});c(await u(`Creating`,async()=>i.pipelines.createV1({...m,account_id:p})),{successLabel:`Created`})}};function h(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 g={command:`create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:h,handler:async i=>{if(i.dryRun){l({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({destination:{batch:{max_bytes:i[`destination-batch-max-bytes`],max_duration_s:i[`destination-batch-max-duration-s`],max_rows:i[`destination-batch-max-rows`]},compression:{type:d(i[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(i[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(i[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(i[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(i[`destination-format`],`destination-format`,`text`),path:{bucket:d(i[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(i[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(i[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(i[`destination-type`],`destination-type`,`text`)},name:d(i.name,`name`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.pipelines.create({...e,account_id:m})),{successLabel:`Created`});return}i[`destination-credentials-access-key-id`]===void 0&&(i[`destination-credentials-access-key-id`]=await e(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),i[`destination-credentials-endpoint`]===void 0&&(i[`destination-credentials-endpoint`]=await e(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),i[`destination-credentials-secret-access-key`]===void 0&&(i[`destination-credentials-secret-access-key`]=await e(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),i[`destination-format`]===void 0&&(i[`destination-format`]=await n(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),i[`destination-path-bucket`]===void 0&&(i[`destination-path-bucket`]=await e(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),i[`destination-type`]===void 0&&(i[`destination-type`]=await n(`destination-type`,`Specifies the type of destination.`,[`r2`])),i.name===void 0&&(i.name=await e(`name`,`Defines the name of the pipeline.`));let h=s({destination:{batch:{max_bytes:i[`destination-batch-max-bytes`],max_duration_s:i[`destination-batch-max-duration-s`],max_rows:i[`destination-batch-max-rows`]},compression:{type:d(i[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(i[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(i[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(i[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(i[`destination-format`],`destination-format`,`text`),path:{bucket:d(i[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(i[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(i[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(i[`destination-type`],`destination-type`,`text`)},name:d(i.name,`name`,`text`)});c(await u(`Creating`,async()=>p.pipelines.create({...h,account_id:m})),{successLabel:`Created`})}};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete-v1 <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async e=>{if(e.dryRun){l({command:`cf pipelines delete-v1`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines/${e[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(e[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(e[`pipeline-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}c(await u(`Deleting`,async()=>n.pipelines.deleteV1({account_id:o,pipeline_id:e[`pipeline-id`]})),{successLabel:`Deleted`})}};function y(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 b={command:`delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async e=>{if(e.dryRun){l({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}c(await u(`Deleting`,async()=>n.pipelines.delete({account_id:o,pipeline_name:e[`pipeline-name`]})),{successLabel:`Deleted`})}};function x(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 S={command:`get-v1 <pipeline-id>`,describe:`Get Pipelines Details.`,builder:x,handler:async e=>{if(e.dryRun){l({command:`cf pipelines get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines/${e[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(e[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(e[`pipeline-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.pipelines.getV1({account_id:i,pipeline_id:e[`pipeline-id`]})),{successLabel:`Loaded`})}};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:`get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async e=>{if(e.dryRun){l({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.pipelines.get({account_id:i,pipeline_name:e[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(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 E={command:`list-v1`,describe:`List/Filter Pipelines in Account.`,builder:T,handler:async e=>{let n={page:e.page,per_page:e[`per-page`],name:e.name};if(e.dryRun){l({command:`cf pipelines list-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.listV1({account_id:o,...n})),{successLabel:`Loaded`})}};function D(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 O={command:`list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async e=>{let n={search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.list({account_id:o,...n})),{successLabel:`Loaded`})}};function k(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 A={command:`create`,describe:`Create a new Sink.`,builder:k,handler:async i=>{if(i.dryRun){l({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({config:{account_id:d(i[`config-account-id`],`config-account-id`,`text`),bucket:d(i[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(i[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(i[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(i[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(i[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(i[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(i[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(i[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(i[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:i[`config-rolling-policy-file-size-bytes`],inactivity_seconds:i[`config-rolling-policy-inactivity-seconds`],interval_seconds:i[`config-rolling-policy-interval-seconds`]},namespace:d(i[`config-namespace`],`config-namespace`,`text`),table_name:d(i[`config-table-name`],`config-table-name`,`text`),token:d(i[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(i[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(i[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:i[`format-unstructured`],type:d(i[`format-type`],`format-type`,`text`),compression:d(i[`format-compression`],`format-compression`,`text`),row_group_bytes:i[`format-row-group-bytes`]},name:d(i.name,`name`,`text`),schema:{format:{decimal_encoding:d(i[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(i[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:i[`schema-format-unstructured`],type:d(i[`schema-format-type`],`schema-format-type`,`text`),compression:d(i[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:i[`schema-format-row-group-bytes`]},inferred:i[`schema-inferred`]},type:d(i.type,`type`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}i.name===void 0&&(i.name=await e(`name`,`Defines the name of the Sink.`)),i.type===void 0&&(i.type=await n(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=s({config:{account_id:d(i[`config-account-id`],`config-account-id`,`text`),bucket:d(i[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(i[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(i[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(i[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(i[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(i[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(i[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(i[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(i[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:i[`config-rolling-policy-file-size-bytes`],inactivity_seconds:i[`config-rolling-policy-inactivity-seconds`],interval_seconds:i[`config-rolling-policy-interval-seconds`]},namespace:d(i[`config-namespace`],`config-namespace`,`text`),table_name:d(i[`config-table-name`],`config-table-name`,`text`),token:d(i[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(i[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(i[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:i[`format-unstructured`],type:d(i[`format-type`],`format-type`,`text`),compression:d(i[`format-compression`],`format-compression`,`text`),row_group_bytes:i[`format-row-group-bytes`]},name:d(i.name,`name`,`text`),schema:{format:{decimal_encoding:d(i[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(i[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:i[`schema-format-unstructured`],type:d(i[`schema-format-type`],`schema-format-type`,`text`),compression:d(i[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:i[`schema-format-row-group-bytes`]},inferred:i[`schema-inferred`]},type:d(i.type,`type`,`text`)});c(await u(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function j(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 M={command:`delete <sink-id>`,describe:`Delete Pipeline in Account.`,builder:j,handler:async e=>{let n={force:e.force};if(e.dryRun){l({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks/${e[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(e[`sink-id`]))}`,pathParams:{"sink-id":String(e[`sink-id`]??``)},query:n,bodyKind:`none`});return}let o=await a(e),s=e.local?f:await r(o);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}c(await u(`Deleting`,async()=>o.pipelines.sinks.delete({account_id:s,sink_id:e[`sink-id`],...n})),{successLabel:`Deleted`})}};function N(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 P={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks/${e[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(e[`sink-id`]))}`,pathParams:{"sink-id":String(e[`sink-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.pipelines.sinks.get({account_id:i,sink_id:e[`sink-id`]})),{successLabel:`Loaded`})}};function F(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 I={command:`list`,describe:`List/Filter Sinks in Account.`,builder:F,handler:async e=>{let n={pipeline_id:e[`pipeline-id`],name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.sinks.list({account_id:o,...n})),{successLabel:`Loaded`})}},L={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(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 z={command:`create`,describe:`Create a new Stream.`,builder:R,handler:async n=>{if(n.dryRun){l({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({format:{decimal_encoding:d(n[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(n[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:n[`format-unstructured`],type:d(n[`format-type`],`format-type`,`text`),compression:d(n[`format-compression`],`format-compression`,`text`),row_group_bytes:n[`format-row-group-bytes`]},http:{authentication:n[`http-authentication`],cors:{origins:n[`http-cors-origins`]},enabled:n[`http-enabled`]},name:d(n.name,`name`,`text`),schema:{format:{decimal_encoding:d(n[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(n[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:n[`schema-format-unstructured`],type:d(n[`schema-format-type`],`schema-format-type`,`text`),compression:d(n[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:n[`schema-format-row-group-bytes`]},inferred:n[`schema-inferred`]},worker_binding:{enabled:n[`worker-binding-enabled`]}}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await e(`name`,`Specifies the name of the Stream.`));let m=s({format:{decimal_encoding:d(n[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(n[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:n[`format-unstructured`],type:d(n[`format-type`],`format-type`,`text`),compression:d(n[`format-compression`],`format-compression`,`text`),row_group_bytes:n[`format-row-group-bytes`]},http:{authentication:n[`http-authentication`],cors:{origins:n[`http-cors-origins`]},enabled:n[`http-enabled`]},name:d(n.name,`name`,`text`),schema:{format:{decimal_encoding:d(n[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(n[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:n[`schema-format-unstructured`],type:d(n[`schema-format-type`],`schema-format-type`,`text`),compression:d(n[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:n[`schema-format-row-group-bytes`]},inferred:n[`schema-inferred`]},worker_binding:{enabled:n[`worker-binding-enabled`]}});c(await u(`Creating`,async()=>i.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function B(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 V={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:B,handler:async e=>{let n={force:e.force};if(e.dryRun){l({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},query:n,bodyKind:`none`});return}let o=await a(e),s=e.local?f:await r(o);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}c(await u(`Deleting`,async()=>o.pipelines.streams.delete({account_id:s,stream_id:e[`stream-id`],...n})),{successLabel:`Deleted`})}};function H(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 U={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:H,handler:async e=>{if(e.dryRun){l({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.pipelines.streams.get({account_id:i,stream_id:e[`stream-id`]})),{successLabel:`Loaded`})}};function W(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 G={command:`list`,describe:`List/Filter Streams in Account.`,builder:W,handler:async e=>{let n={pipeline_id:e[`pipeline-id`],name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.streams.list({account_id:o,...n})),{successLabel:`Loaded`})}};function K(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 q={command:`update <stream-id>`,describe:`Update a Stream.`,builder:K,handler:async e=>{if(e.dryRun){l({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({http:{authentication:e[`http-authentication`],cors:{origins:e[`http-cors-origins`]},enabled:e[`http-enabled`]},worker_binding:{enabled:e[`worker-binding-enabled`]}}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.pipelines.streams.update({...t,account_id:i,stream_id:e[`stream-id`]})),{successLabel:`Updated`});return}let d=s({http:{authentication:e[`http-authentication`],cors:{origins:e[`http-cors-origins`]},enabled:e[`http-enabled`]},worker_binding:{enabled:e[`worker-binding-enabled`]}});c(await u(`Updating`,async()=>n.pipelines.streams.update({...d,account_id:i,stream_id:e[`stream-id`]})),{successLabel:`Updated`})}},J={command:`streams`,describe:`Operations for streams`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`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 X={command:`update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:Y,handler:async i=>{if(i.dryRun){l({command:`cf pipelines update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/${i[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(i[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(i[`pipeline-name`]??``)},bodyKind:`json`,body:i.body===void 0?s({destination:{batch:{max_bytes:i[`destination-batch-max-bytes`],max_duration_s:i[`destination-batch-max-duration-s`],max_rows:i[`destination-batch-max-rows`]},compression:{type:d(i[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(i[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(i[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(i[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(i[`destination-format`],`destination-format`,`text`),path:{bucket:d(i[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(i[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(i[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(i[`destination-type`],`destination-type`,`text`)},name:d(i.name,`name`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Updating`,async()=>p.pipelines.update({...e,account_id:m,pipeline_name:i[`pipeline-name`]})),{successLabel:`Updated`});return}i[`destination-credentials-access-key-id`]===void 0&&(i[`destination-credentials-access-key-id`]=await e(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),i[`destination-credentials-endpoint`]===void 0&&(i[`destination-credentials-endpoint`]=await e(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),i[`destination-credentials-secret-access-key`]===void 0&&(i[`destination-credentials-secret-access-key`]=await e(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),i[`destination-format`]===void 0&&(i[`destination-format`]=await n(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),i[`destination-path-bucket`]===void 0&&(i[`destination-path-bucket`]=await e(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),i[`destination-type`]===void 0&&(i[`destination-type`]=await n(`destination-type`,`Specifies the type of destination.`,[`r2`])),i.name===void 0&&(i.name=await e(`name`,`Defines the name of the pipeline.`));let h=s({destination:{batch:{max_bytes:i[`destination-batch-max-bytes`],max_duration_s:i[`destination-batch-max-duration-s`],max_rows:i[`destination-batch-max-rows`]},compression:{type:d(i[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(i[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(i[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(i[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(i[`destination-format`],`destination-format`,`text`),path:{bucket:d(i[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(i[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(i[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(i[`destination-type`],`destination-type`,`text`)},name:d(i.name,`name`,`text`)});c(await u(`Updating`,async()=>p.pipelines.update({...h,account_id:m,pipeline_name:i[`pipeline-name`]})),{successLabel:`Updated`})}};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:`Validate Arroyo SQL.`,builder:Z,handler:async n=>{if(n.dryRun){l({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({sql:d(n.sql,`sql`,`text`)}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}n.sql===void 0&&(n.sql=await e(`sql`,`Specifies SQL to validate.`));let m=s({sql:d(n.sql,`sql`,`text`)});c(await u(`Creating`,async()=>i.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(g).command(m).command(b).command(v).command(w).command(S).command(O).command(E).command(X).command(Q).command(L).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e,y as t}from"./session-DHYCE-PM.mjs";import{r as n}from"./theme-DbNbIY4d.mjs";import{a as r}from"./dist-t_YrL25p.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();e(t);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};
|