cf 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +96 -95
- package/dist/_meta/commands.json +16558 -13965
- package/dist/_meta/schemas.json +52979 -16753
- package/dist/abuse-reports-dMIfUJ8v.mjs +8 -0
- package/dist/accounts-Kx1epdA1.mjs +22 -0
- package/dist/acm-Utu252kC.mjs +3 -0
- package/dist/addressing-CBq7Z7Vq.mjs +12 -0
- package/dist/{agent-context-D26woB9J.mjs → agent-context-BGTU299M.mjs} +1 -1
- package/dist/ai-DOOKLPkG.mjs +2 -0
- package/dist/ai-gateway-Cj1T3avF.mjs +8 -0
- package/dist/ai-search-CQF_Sn7d.mjs +7 -0
- package/dist/ai_gateway-C3fH22C0.mjs +4 -0
- package/dist/alerting-CqmEIaKn.mjs +6 -0
- package/dist/analytics-Dv-X8x7D.mjs +20 -0
- package/dist/analytics_engine-DdXVR8z2.mjs +2 -0
- package/dist/api-gateway-CNv0IHTU.mjs +33 -0
- package/dist/argo-CX_A4kcn.mjs +2 -0
- package/dist/audit-logs-BfBf3oo-.mjs +2 -0
- package/dist/auth-SyWhMmPu.mjs +6 -0
- package/dist/auth-ffdf9yR0.mjs +135 -0
- package/dist/autorag-BuGhGTeZ.mjs +2 -0
- package/dist/billing-PoG81XaQ.mjs +2 -0
- package/dist/body-parser-DKa8Ipg1.mjs +2 -0
- package/dist/bot-management-CFvtVx62.mjs +5 -0
- package/dist/botnet-feed-B-M4Yu0W.mjs +3 -0
- package/dist/brand-protection-D05Eg-_6.mjs +3 -0
- package/dist/browser-rendering-xu8F_Rrv.mjs +4 -0
- package/dist/build-DYkGW4dh.mjs +1054 -0
- package/dist/cache-DsoW6Xwv.mjs +5 -0
- package/dist/calls-CZbO7TyR.mjs +4 -0
- package/dist/certificate-authorities-D2yr7_3t.mjs +2 -0
- package/dist/cli-types-CRIDdDw3.mjs +2 -0
- package/dist/client-certificates-MJcDsTId.mjs +3 -0
- package/dist/cloud-connector-DWOrN2eM.mjs +2 -0
- package/dist/cloudforce-one-2Bhz8YdW.mjs +21 -0
- package/dist/{completions-BKrxcfhN.mjs → completions-BwRpZQVn.mjs} +1 -1
- package/dist/{config-BIfdEY0E.mjs → config-DYzlVxcB.mjs} +1 -1
- package/dist/connectivity-BX8C7tvK.mjs +3 -0
- package/dist/content-scanning-r6uzMO1r.mjs +4 -0
- package/dist/context-DGlHRGWM.mjs +2 -0
- package/dist/custom-certificates-aAiEguR7.mjs +5 -0
- package/dist/custom-hostnames-AG5yBHIi.mjs +5 -0
- package/dist/custom-nameservers-D1DtlRue.mjs +3 -0
- package/dist/custom-pages-DQCi2plU.mjs +4 -0
- package/dist/d1-DbnYhw45.mjs +4 -0
- package/dist/data-security-D_EtYBfo.mjs +6 -0
- package/dist/dcv-delegation-CHspSzTI.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-CQial3kN.mjs +2 -0
- package/dist/{dev-BfKYB-R_.mjs → dev-B38LfCTl.mjs} +1 -1
- package/dist/diagnostics-BJQGjVJn.mjs +3 -0
- package/dist/dispatch-namespaces-DmHvoBOg.mjs +7 -0
- package/dist/{dist-C_bu5HwZ.mjs → dist-AIcZFk0U.mjs} +7 -7
- package/dist/dist-DNBSHor6.mjs +301 -0
- package/dist/dns-VMhQSr5n.mjs +29 -0
- package/dist/dns-firewall-B4DVXFBQ.mjs +57 -0
- package/dist/durable-objects-CTboySEo.mjs +2 -0
- package/dist/email-routing-tIR2SFu-.mjs +10 -0
- package/dist/email-security-Ca1id3rZ.mjs +8 -0
- package/dist/email-sending-DwWKc5jC.mjs +3 -0
- package/dist/filters-A4dg_a68.mjs +4 -0
- package/dist/firewall-DWPQgYd9.mjs +11 -0
- package/dist/fraud-BMkSsJGU.mjs +20 -0
- package/dist/google-tag-gateway-BGD49nRC.mjs +2 -0
- package/dist/healthchecks-CtIfrFql.mjs +4 -0
- package/dist/hostnames-BiomxukN.mjs +3 -0
- package/dist/hyperdrive-Da104VaQ.mjs +18 -0
- package/dist/iam-BIGKo0WW.mjs +6 -0
- package/dist/images-BO8FbDAa.mjs +5 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-CY6_79v8.mjs +3 -0
- package/dist/{ips-B0cK7D0_.mjs → ips-K4bzaGqd.mjs} +1 -1
- package/dist/keyless-certificates-CZC-L8gM.mjs +3 -0
- package/dist/kv-8o27w_pY.mjs +5 -0
- package/dist/leaked-credential-checks-qLzRyu85.mjs +3 -0
- package/dist/load-balancers-DtG8nj25.mjs +6 -0
- package/dist/logpush-4L0njy1d.mjs +4 -0
- package/dist/logs-B_Yp95hv.mjs +3 -0
- package/dist/magic-cloud-networking-CSOM3EM-.mjs +5 -0
- package/dist/magic-network-monitoring-BnwvM4-I.mjs +4 -0
- package/dist/magic-transit-CXDyvhxq.mjs +90 -0
- package/dist/managed-transforms-D15yVbZx.mjs +3 -0
- package/dist/mtls-certificates-D8k0AXWK.mjs +3 -0
- package/dist/network-interconnects-rrr7red3.mjs +36 -0
- package/dist/observability-DWvpqnQJ.mjs +4 -0
- package/dist/organizations-T77D50Sq.mjs +41 -0
- package/dist/origin-ca-certificates-DXIvD8H5.mjs +3 -0
- package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +2 -0
- package/dist/origin-tls-client-auth-CaVW1Ztp.mjs +4 -0
- package/dist/output-BJFNwj7b.mjs +2 -0
- package/dist/page-rules-CjZPTMQX.mjs +18 -0
- package/dist/page-shield-D5RRNJCY.mjs +37 -0
- package/dist/pages-CWJtJnL0.mjs +11 -0
- package/dist/pipelines-B0L_7j9e.mjs +6 -0
- package/dist/{progress-DZfTxbrx.mjs → progress-CrCGTq7N.mjs} +1 -1
- package/dist/queues-CN6DPhRR.mjs +6 -0
- package/dist/r2-DQIcyRtA.mjs +21 -0
- package/dist/r2-data-catalog-Bbo93TJx.mjs +14 -0
- package/dist/radar-Bxb0WX8V.mjs +2 -0
- package/dist/rate-limits-DcrQV6Ar.mjs +5 -0
- package/dist/raw-fetch-Dlccg0Tr.mjs +2 -0
- package/dist/realtime-kit-CaquuVOE.mjs +18 -0
- package/dist/registrar-Ko-xZemf.mjs +46 -0
- package/dist/request-tracers-DOW_reTJ.mjs +2 -0
- package/dist/{resolve-BuJRWSk0.mjs → resolve-4-OSeHlK.mjs} +1 -1
- package/dist/resource-sharing-D7TX0JV0.mjs +5 -0
- package/dist/resource-tagging-C3qtLzCz.mjs +16 -0
- package/dist/rules-BXRADHL5.mjs +4 -0
- package/dist/rulesets-CBgpeSvJ.mjs +8 -0
- package/dist/rum-BjPptTUP.mjs +4 -0
- package/dist/{schema-D0_cbcDt.mjs → schema-D16TgWBg.mjs} +1 -1
- package/dist/schema-validation-Dgv_opM3.mjs +24 -0
- package/dist/scim-DdSEr4kZ.mjs +3 -0
- package/dist/secrets-store-7BfyvJLb.mjs +25 -0
- package/dist/security-center-DAy6AKtT.mjs +2 -0
- package/dist/security-txt-xAMb7K6Y.mjs +3 -0
- package/dist/session-COHHdS7A.mjs +5 -0
- package/dist/shared-AGtpXwwL.mjs +2 -0
- package/dist/smart-shield-TeWZFnH2.mjs +3 -0
- package/dist/snippets-CCSsCXVs.mjs +4 -0
- package/dist/{spawn-D_cjG87Z.mjs → spawn-DcppKGI5.mjs} +1 -1
- package/dist/spectrum-CTTZID8u.mjs +63 -0
- package/dist/speed-CuzTE0AL.mjs +4 -0
- package/dist/{src-C5qivNKH.mjs → src-BW6vfAwE.mjs} +15 -15
- package/dist/ssl-BWA2LdwC.mjs +15 -0
- package/dist/stream-GFsIZ-pP.mjs +14 -0
- package/dist/tenants-Bd7NGQ_m.mjs +2 -0
- package/dist/token-validation-DAgtFOvs.mjs +10 -0
- package/dist/{tools-CtKbk6VS.mjs → tools-DXQmfFuE.mjs} +1 -1
- package/dist/turnstile-cfdaO4ca.mjs +23 -0
- package/dist/{ui-mP_arYIg.mjs → ui-D4KtlMh9.mjs} +1 -1
- package/dist/url-normalization-B5RN4nLD.mjs +3 -0
- package/dist/url-scanner-BrZ1L9OC.mjs +2 -0
- package/dist/user-CAo-yCJA.mjs +10 -0
- package/dist/vectorize-C7_oQlaI.mjs +4 -0
- package/dist/versions-CUwWJWmy.mjs +2 -0
- package/dist/waiting-rooms-Dln5ICg5.mjs +11 -0
- package/dist/web3-HQJRm38W.mjs +4 -0
- package/dist/workers-Dg7ddG2Q.mjs +18 -0
- package/dist/workers-builds-AVfx8IyL.mjs +7 -0
- package/dist/workflows-VquuSh2J.mjs +4 -0
- package/dist/zaraz-xYSWIV4P.mjs +2 -0
- package/dist/zero-trust-CP96wnSh.mjs +118 -0
- package/dist/zones-BSgmZ9WC.mjs +21 -0
- package/package.json +7 -6
- package/dist/abuse-reports-ChV_yD7f.mjs +0 -8
- package/dist/accounts-BCYecXFh.mjs +0 -21
- package/dist/acm-DD8zSds2.mjs +0 -3
- package/dist/addressing-D4Eqw5Bi.mjs +0 -13
- package/dist/ai-DfXMOMx_.mjs +0 -2
- package/dist/ai-gateway-DdRFthMo.mjs +0 -8
- package/dist/ai-search-C_68CDj1.mjs +0 -7
- package/dist/alerting-DbhqhVCp.mjs +0 -6
- package/dist/analytics-BSBBc7ep.mjs +0 -20
- package/dist/api-gateway-CZ4swbkQ.mjs +0 -33
- package/dist/argo-tms9ZwHO.mjs +0 -2
- package/dist/audit-logs-24qyW8cl.mjs +0 -2
- package/dist/auth-BlSmtIKd.mjs +0 -112
- package/dist/auth-DQ8miey6.mjs +0 -6
- package/dist/autorag-kgNt06GD.mjs +0 -2
- package/dist/billing-lwBHNTXC.mjs +0 -2
- package/dist/body-parser-Br-BoYk-.mjs +0 -2
- package/dist/bot-management-LKf7BqUr.mjs +0 -5
- package/dist/botnet-feed-nQ-gErTS.mjs +0 -3
- package/dist/brand-protection-DOKv9GRr.mjs +0 -3
- package/dist/browser-rendering-CBExtgGt.mjs +0 -4
- package/dist/build-C_48VvoK.mjs +0 -1056
- package/dist/builds-C_ySULja.mjs +0 -2
- package/dist/cache-BBiiNZHP.mjs +0 -5
- package/dist/calls-DA5Xzwev.mjs +0 -4
- package/dist/certificate-authorities-sXyR_yGp.mjs +0 -2
- package/dist/client-certificates-tV0aCLQJ.mjs +0 -3
- package/dist/cloud-connector-DZfHcSso.mjs +0 -2
- package/dist/cloudforce-one-y1PgQmI9.mjs +0 -21
- package/dist/connectivity-8SOqaFDn.mjs +0 -3
- package/dist/content-scanning-B9y6K_G5.mjs +0 -4
- package/dist/context-DTIbtQn5.mjs +0 -2
- package/dist/custom-certificates-sWksR8Ys.mjs +0 -5
- package/dist/custom-hostnames-91QZkdqN.mjs +0 -5
- package/dist/custom-nameservers-DajZaZvE.mjs +0 -3
- package/dist/custom-pages-Cu7gmwzT.mjs +0 -4
- package/dist/d1-H_VRsVmF.mjs +0 -3
- package/dist/dcv-delegation-C-qhEYEZ.mjs +0 -2
- package/dist/deploy--9wYOkHg.mjs +0 -2
- package/dist/diagnostics-D2B2LPZZ.mjs +0 -3
- package/dist/dispatch-namespaces-CyrXBU_w.mjs +0 -7
- package/dist/dist-DvKjT2TT.mjs +0 -303
- package/dist/dns-Bn9Uz_Nj.mjs +0 -29
- package/dist/dns-firewall-BslP4p-j.mjs +0 -57
- package/dist/durable-objects-BN1ZnHhm.mjs +0 -2
- package/dist/email-routing-n2TnTaRR.mjs +0 -10
- package/dist/email-security-C9SEx0kh.mjs +0 -60
- package/dist/email-sending-DayZ7u3I.mjs +0 -3
- package/dist/filters-CI_XTgfQ.mjs +0 -4
- package/dist/firewall-CcaayGig.mjs +0 -11
- package/dist/fraud-Cr7aPCV8.mjs +0 -8
- package/dist/google-tag-gateway-B3GpYgQ4.mjs +0 -2
- package/dist/healthchecks-CVTsR_OC.mjs +0 -4
- package/dist/hostnames-Bd_Wa5l6.mjs +0 -3
- package/dist/hyperdrive-BBJhEDZd.mjs +0 -18
- package/dist/iam-D_FN0pDF.mjs +0 -6
- package/dist/images-CAP2hAlZ.mjs +0 -5
- package/dist/intel-CkxfzqmJ.mjs +0 -3
- package/dist/keyless-certificates-LcLmHZsX.mjs +0 -3
- package/dist/kv-_TkUQ6fs.mjs +0 -5
- package/dist/leaked-credential-checks-Dhvaen22.mjs +0 -3
- package/dist/load-balancers-Ckr0UIpk.mjs +0 -6
- package/dist/logpush-Cj946hxT.mjs +0 -4
- package/dist/logs-DgC9hjvJ.mjs +0 -3
- package/dist/magic-cloud-networking-WbDvPzuG.mjs +0 -5
- package/dist/magic-network-monitoring-BcHShvGQ.mjs +0 -4
- package/dist/magic-transit-B8sCOkt_.mjs +0 -89
- package/dist/managed-transforms-BpOr-8HY.mjs +0 -3
- package/dist/mtls-certificates-fOul8D5g.mjs +0 -3
- package/dist/network-interconnects-BSW65xlh.mjs +0 -36
- package/dist/organizations-T4vKGFAb.mjs +0 -41
- package/dist/origin-ca-certificates-ChM0lZ64.mjs +0 -3
- package/dist/origin-post-quantum-encryption-C7o26ARh.mjs +0 -2
- package/dist/origin-tls-client-auth-D32dpZk_.mjs +0 -5
- package/dist/output-D7_yAFVR.mjs +0 -2
- package/dist/page-rules-RFoj8CjN.mjs +0 -18
- package/dist/page-shield-VTktzKDN.mjs +0 -37
- package/dist/pages-L1ITjXDZ.mjs +0 -10
- package/dist/pipelines-BPO0Lnil.mjs +0 -6
- package/dist/queues-B0C06L9r.mjs +0 -6
- package/dist/r2-DP020Tmq.mjs +0 -21
- package/dist/r2-data-catalog-Dmipvz5F.mjs +0 -14
- package/dist/radar-DR3VMknH.mjs +0 -2
- package/dist/rate-limits-DnHPBPgU.mjs +0 -5
- package/dist/raw-fetch-DlXYwVA8.mjs +0 -2
- package/dist/realtime-kit-C430aq2d.mjs +0 -6
- package/dist/registrar-7Qy50zbW.mjs +0 -46
- package/dist/request-tracers-sv99NDIl.mjs +0 -2
- package/dist/resource-sharing-uEjC7lnQ.mjs +0 -5
- package/dist/resource-tagging-CiODdP3N.mjs +0 -16
- package/dist/rules-FXAyTrwk.mjs +0 -4
- package/dist/rulesets-B6aUsFFB.mjs +0 -8
- package/dist/rum-CyyGJhp5.mjs +0 -4
- package/dist/schema-validation-ByU49h--.mjs +0 -4
- package/dist/scim-DdTS65_C.mjs +0 -3
- package/dist/scm-CilfPOue.mjs +0 -2
- package/dist/secrets-store-ClOUVhBJ.mjs +0 -18
- package/dist/security-center-4iSBqTrf.mjs +0 -2
- package/dist/security-txt-kGxdkDY6.mjs +0 -3
- package/dist/session-mW-s8ghP.mjs +0 -2
- package/dist/smart-shield-B-SQd2Qp.mjs +0 -3
- package/dist/snippets-Aq58ojqw.mjs +0 -4
- package/dist/spectrum-0gFvGI6y.mjs +0 -59
- package/dist/speed-DAZU8w3T.mjs +0 -4
- package/dist/ssl-BRlXa-5w.mjs +0 -15
- package/dist/stream-BAxsVeBX.mjs +0 -14
- package/dist/tenants-Df6xDqoA.mjs +0 -2
- package/dist/token-validation-pO4dCjCy.mjs +0 -4
- package/dist/turnstile-B1dmO8wE.mjs +0 -23
- package/dist/url-normalization-sUDVmrUt.mjs +0 -3
- package/dist/url-scanner-CwOKRkYo.mjs +0 -2
- package/dist/user-D_UrIdNq.mjs +0 -10
- package/dist/vectorize-BEbBn9G9.mjs +0 -4
- package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
- package/dist/waiting-rooms-BQC-urV4.mjs +0 -11
- package/dist/web3-CIH2iQeX.mjs +0 -4
- package/dist/workers-B9EvrpH3.mjs +0 -16
- package/dist/workers-builds-DzWSiRd2.mjs +0 -7
- package/dist/workflows-aD81gA4k.mjs +0 -4
- package/dist/zaraz-Cg1dsvrZ.mjs +0 -2
- package/dist/zero-trust-D-xQXWcy.mjs +0 -119
- package/dist/zones-DQzucJDd.mjs +0 -28
- /package/dist/{metadata-DGdCpUxn.mjs → metadata-5VwHPW6C.mjs} +0 -0
package/dist/pages-L1ITjXDZ.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,m as n,t as r,u as i}from"./auth-BlSmtIKd.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-DZfTxbrx.mjs";import{n as u,t as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
3
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
4
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const m={command:`create`,describe:`Create a new project.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:{buildConfigBuildCaching:t.buildConfigBuildCaching,buildConfigBuildCommand:t.buildConfigBuildCommand,buildConfigDestinationDir:t.buildConfigDestinationDir,buildConfigRootDir:t.buildConfigRootDir,buildConfigWebAnalyticsTag:t.buildConfigWebAnalyticsTag,buildConfigWebAnalyticsToken:t.buildConfigWebAnalyticsToken,deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate:t.deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate,deploymentConfigsPreviewBuildImageMajorVersion:t.deploymentConfigsPreviewBuildImageMajorVersion,deploymentConfigsPreviewCompatibilityDate:t.deploymentConfigsPreviewCompatibilityDate,deploymentConfigsPreviewCompatibilityFlags:t.deploymentConfigsPreviewCompatibilityFlags,deploymentConfigsPreviewFailOpen:t.deploymentConfigsPreviewFailOpen,deploymentConfigsPreviewLimitsCpuMs:t.deploymentConfigsPreviewLimitsCpuMs,deploymentConfigsPreviewPlacementMode:t.deploymentConfigsPreviewPlacementMode,deploymentConfigsPreviewUsageModel:t.deploymentConfigsPreviewUsageModel,deploymentConfigsPreviewWranglerConfigHash:t.deploymentConfigsPreviewWranglerConfigHash,deploymentConfigsProductionAlwaysUseLatestCompatibilityDate:t.deploymentConfigsProductionAlwaysUseLatestCompatibilityDate,deploymentConfigsProductionBuildImageMajorVersion:t.deploymentConfigsProductionBuildImageMajorVersion,deploymentConfigsProductionCompatibilityDate:t.deploymentConfigsProductionCompatibilityDate,deploymentConfigsProductionCompatibilityFlags:t.deploymentConfigsProductionCompatibilityFlags,deploymentConfigsProductionFailOpen:t.deploymentConfigsProductionFailOpen,deploymentConfigsProductionLimitsCpuMs:t.deploymentConfigsProductionLimitsCpuMs,deploymentConfigsProductionPlacementMode:t.deploymentConfigsProductionPlacementMode,deploymentConfigsProductionUsageModel:t.deploymentConfigsProductionUsageModel,deploymentConfigsProductionWranglerConfigHash:t.deploymentConfigsProductionWranglerConfigHash,name:t.name,productionBranch:t.productionBranch,sourceConfigDeploymentsEnabled:t.sourceConfigDeploymentsEnabled,sourceConfigOwner:t.sourceConfigOwner,sourceConfigOwnerId:t.sourceConfigOwnerId,sourceConfigPathExcludes:t.sourceConfigPathExcludes,sourceConfigPathIncludes:t.sourceConfigPathIncludes,sourceConfigPrCommentsEnabled:t.sourceConfigPrCommentsEnabled,sourceConfigPreviewBranchExcludes:t.sourceConfigPreviewBranchExcludes,sourceConfigPreviewBranchIncludes:t.sourceConfigPreviewBranchIncludes,sourceConfigPreviewDeploymentSetting:t.sourceConfigPreviewDeploymentSetting,sourceConfigProductionBranch:t.sourceConfigProductionBranch,sourceConfigProductionDeploymentsEnabled:t.sourceConfigProductionDeploymentsEnabled,sourceConfigRepoId:t.sourceConfigRepoId,sourceConfigRepoName:t.sourceConfigRepoName,sourceType:t.sourceType,body:t.body}});return}let d=await r(t),p=t.local?f:await e(d);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`Name of the project.`)),t.productionBranch===void 0&&(t.productionBranch=await n(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m={};t.buildConfigBuildCaching!==void 0&&a(m,[`build_config`,`build_caching`],t.buildConfigBuildCaching),t.buildConfigBuildCommand!==void 0&&a(m,[`build_config`,`build_command`],u(t.buildConfigBuildCommand,`buildConfigBuildCommand`,`text`)),t.buildConfigDestinationDir!==void 0&&a(m,[`build_config`,`destination_dir`],u(t.buildConfigDestinationDir,`buildConfigDestinationDir`,`text`)),t.buildConfigRootDir!==void 0&&a(m,[`build_config`,`root_dir`],u(t.buildConfigRootDir,`buildConfigRootDir`,`text`)),t.buildConfigWebAnalyticsTag!==void 0&&a(m,[`build_config`,`web_analytics_tag`],u(t.buildConfigWebAnalyticsTag,`buildConfigWebAnalyticsTag`,`text`)),t.buildConfigWebAnalyticsToken!==void 0&&a(m,[`build_config`,`web_analytics_token`],u(t.buildConfigWebAnalyticsToken,`buildConfigWebAnalyticsToken`,`text`)),t.deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate!==void 0&&a(m,[`deployment_configs`,`preview`,`always_use_latest_compatibility_date`],t.deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate),t.deploymentConfigsPreviewBuildImageMajorVersion!==void 0&&a(m,[`deployment_configs`,`preview`,`build_image_major_version`],t.deploymentConfigsPreviewBuildImageMajorVersion),t.deploymentConfigsPreviewCompatibilityDate!==void 0&&a(m,[`deployment_configs`,`preview`,`compatibility_date`],u(t.deploymentConfigsPreviewCompatibilityDate,`deploymentConfigsPreviewCompatibilityDate`,`text`)),t.deploymentConfigsPreviewCompatibilityFlags!==void 0&&a(m,[`deployment_configs`,`preview`,`compatibility_flags`],t.deploymentConfigsPreviewCompatibilityFlags),t.deploymentConfigsPreviewFailOpen!==void 0&&a(m,[`deployment_configs`,`preview`,`fail_open`],t.deploymentConfigsPreviewFailOpen),t.deploymentConfigsPreviewLimitsCpuMs!==void 0&&a(m,[`deployment_configs`,`preview`,`limits`,`cpu_ms`],t.deploymentConfigsPreviewLimitsCpuMs),t.deploymentConfigsPreviewPlacementMode!==void 0&&a(m,[`deployment_configs`,`preview`,`placement`,`mode`],u(t.deploymentConfigsPreviewPlacementMode,`deploymentConfigsPreviewPlacementMode`,`text`)),t.deploymentConfigsPreviewUsageModel!==void 0&&a(m,[`deployment_configs`,`preview`,`usage_model`],u(t.deploymentConfigsPreviewUsageModel,`deploymentConfigsPreviewUsageModel`,`text`)),t.deploymentConfigsPreviewWranglerConfigHash!==void 0&&a(m,[`deployment_configs`,`preview`,`wrangler_config_hash`],u(t.deploymentConfigsPreviewWranglerConfigHash,`deploymentConfigsPreviewWranglerConfigHash`,`text`)),t.deploymentConfigsProductionAlwaysUseLatestCompatibilityDate!==void 0&&a(m,[`deployment_configs`,`production`,`always_use_latest_compatibility_date`],t.deploymentConfigsProductionAlwaysUseLatestCompatibilityDate),t.deploymentConfigsProductionBuildImageMajorVersion!==void 0&&a(m,[`deployment_configs`,`production`,`build_image_major_version`],t.deploymentConfigsProductionBuildImageMajorVersion),t.deploymentConfigsProductionCompatibilityDate!==void 0&&a(m,[`deployment_configs`,`production`,`compatibility_date`],u(t.deploymentConfigsProductionCompatibilityDate,`deploymentConfigsProductionCompatibilityDate`,`text`)),t.deploymentConfigsProductionCompatibilityFlags!==void 0&&a(m,[`deployment_configs`,`production`,`compatibility_flags`],t.deploymentConfigsProductionCompatibilityFlags),t.deploymentConfigsProductionFailOpen!==void 0&&a(m,[`deployment_configs`,`production`,`fail_open`],t.deploymentConfigsProductionFailOpen),t.deploymentConfigsProductionLimitsCpuMs!==void 0&&a(m,[`deployment_configs`,`production`,`limits`,`cpu_ms`],t.deploymentConfigsProductionLimitsCpuMs),t.deploymentConfigsProductionPlacementMode!==void 0&&a(m,[`deployment_configs`,`production`,`placement`,`mode`],u(t.deploymentConfigsProductionPlacementMode,`deploymentConfigsProductionPlacementMode`,`text`)),t.deploymentConfigsProductionUsageModel!==void 0&&a(m,[`deployment_configs`,`production`,`usage_model`],u(t.deploymentConfigsProductionUsageModel,`deploymentConfigsProductionUsageModel`,`text`)),t.deploymentConfigsProductionWranglerConfigHash!==void 0&&a(m,[`deployment_configs`,`production`,`wrangler_config_hash`],u(t.deploymentConfigsProductionWranglerConfigHash,`deploymentConfigsProductionWranglerConfigHash`,`text`)),t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),t.productionBranch!==void 0&&a(m,[`production_branch`],u(t.productionBranch,`productionBranch`,`text`)),t.sourceConfigDeploymentsEnabled!==void 0&&a(m,[`source`,`config`,`deployments_enabled`],t.sourceConfigDeploymentsEnabled),t.sourceConfigOwner!==void 0&&a(m,[`source`,`config`,`owner`],u(t.sourceConfigOwner,`sourceConfigOwner`,`text`)),t.sourceConfigOwnerId!==void 0&&a(m,[`source`,`config`,`owner_id`],u(t.sourceConfigOwnerId,`sourceConfigOwnerId`,`text`)),t.sourceConfigPathExcludes!==void 0&&a(m,[`source`,`config`,`path_excludes`],t.sourceConfigPathExcludes),t.sourceConfigPathIncludes!==void 0&&a(m,[`source`,`config`,`path_includes`],t.sourceConfigPathIncludes),t.sourceConfigPrCommentsEnabled!==void 0&&a(m,[`source`,`config`,`pr_comments_enabled`],t.sourceConfigPrCommentsEnabled),t.sourceConfigPreviewBranchExcludes!==void 0&&a(m,[`source`,`config`,`preview_branch_excludes`],t.sourceConfigPreviewBranchExcludes),t.sourceConfigPreviewBranchIncludes!==void 0&&a(m,[`source`,`config`,`preview_branch_includes`],t.sourceConfigPreviewBranchIncludes),t.sourceConfigPreviewDeploymentSetting!==void 0&&a(m,[`source`,`config`,`preview_deployment_setting`],u(t.sourceConfigPreviewDeploymentSetting,`sourceConfigPreviewDeploymentSetting`,`text`)),t.sourceConfigProductionBranch!==void 0&&a(m,[`source`,`config`,`production_branch`],u(t.sourceConfigProductionBranch,`sourceConfigProductionBranch`,`text`)),t.sourceConfigProductionDeploymentsEnabled!==void 0&&a(m,[`source`,`config`,`production_deployments_enabled`],t.sourceConfigProductionDeploymentsEnabled),t.sourceConfigRepoId!==void 0&&a(m,[`source`,`config`,`repo_id`],u(t.sourceConfigRepoId,`sourceConfigRepoId`,`text`)),t.sourceConfigRepoName!==void 0&&a(m,[`source`,`config`,`repo_name`],u(t.sourceConfigRepoName,`sourceConfigRepoName`,`text`)),t.sourceType!==void 0&&a(m,[`source`,`type`],u(t.sourceType,`sourceType`,`text`)),s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function h(e){return e.positional(`projectName`,{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 g={command:`delete <projectName>`,describe:`Delete a project by name.`,builder:h,handler:async n=>{if(n.dryRun){c({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${n.projectName??`<projectName>`}`,pathParams:{projectName:String(n.projectName??``)},bodyKind:`none`});return}let a=await r(n),o=n.local?f:await e(a);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}s(await l(`Deleting`,async()=>a.pages.projects.delete(n.projectName,o)),{successLabel:`Deleted`})}};function _(e){return e.positional(`projectName`,{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 v={command:`create <projectName>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:_,handler:async t=>{if(t.dryRun){c({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/deployments`,pathParams:{projectName:String(t.projectName??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file,branch:t.branch,commitDirty:t.commitDirty,commitHash:t.commitHash,commitMessage:t.commitMessage,manifest:t.manifest,pagesBuildOutputDir:t.pagesBuildOutputDir,wranglerConfigHash:t.wranglerConfigHash}});return}let n=await r(t),a=t.local?f:await e(n);if(t.accountId=a,t.file!==void 0||t.body!==void 0||t.branch!==void 0||t.commitDirty!==void 0||t.commitHash!==void 0||t.commitMessage!==void 0||t.manifest!==void 0||t.pagesBuildOutputDir!==void 0||t.wranglerConfigHash!==void 0){let e=new FormData;if(t.file){let n=d(t.file);e.append(`_headers`,new Blob([n]),t.file.split(`/`).pop())}else t.body!==void 0&&e.append(`_headers`,t.body);t.branch!==void 0&&e.append(`branch`,String(u(t.branch,`branch`,`text`)??``)),t.commitDirty!==void 0&&e.append(`commit_dirty`,String(u(t.commitDirty,`commitDirty`,`text`)??``)),t.commitHash!==void 0&&e.append(`commit_hash`,String(u(t.commitHash,`commitHash`,`text`)??``)),t.commitMessage!==void 0&&e.append(`commit_message`,String(u(t.commitMessage,`commitMessage`,`text`)??``)),t.manifest!==void 0&&e.append(`manifest`,String(u(t.manifest,`manifest`,`text`)??``)),t.pagesBuildOutputDir!==void 0&&e.append(`pages_build_output_dir`,String(u(t.pagesBuildOutputDir,`pagesBuildOutputDir`,`text`)??``)),t.wranglerConfigHash!==void 0&&e.append(`wrangler_config_hash`,String(u(t.wranglerConfigHash,`wranglerConfigHash`,`text`)??``)),s(await l(`Creating`,async()=>n.post(`/accounts/${a}/pages/projects/${t.projectName}/deployments`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=u(t.body,`body`,`binary`);s(await l(`Creating`,async()=>n.post(`/accounts/${a}/pages/projects/${t.projectName}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function y(e){return e.positional(`deploymentId`,{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.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`delete <deploymentId>`,describe:`Delete a deployment.`,builder:y,handler:async n=>{let a={force:n.force};if(n.dryRun){c({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${n.projectName??`<projectName>`}/deployments/${n.deploymentId??`<deploymentId>`}`,pathParams:{deploymentId:String(n.deploymentId??``),projectName:String(n.projectName??``)},query:a,bodyKind:`none`});return}let o=await r(n),u=n.local?f:await e(o);if(n.accountId=u,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}s(await l(`Deleting`,async()=>o.pages.projects.deployments.delete(n.deploymentId,n.projectName,u,a)),{successLabel:`Deleted`})}};function x(e){return e.positional(`deploymentId`,{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 S={command:`get <deploymentId>`,describe:`Fetch information about a deployment.`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/deployments/${t.deploymentId??`<deploymentId>`}`,pathParams:{deploymentId:String(t.deploymentId??``),projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.pages.projects.deployments.get(t.deploymentId,t.projectName,a)),{successLabel:`Loaded`})}};function C(e){return e.positional(`deploymentId`,{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 w={command:`get <deploymentId>`,describe:`Fetch deployment logs for a project.`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/deployments/${t.deploymentId??`<deploymentId>`}/history/logs`,pathParams:{deploymentId:String(t.deploymentId??``),projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.pages.projects.deployments.history.logs.get(t.deploymentId,t.projectName,a)),{successLabel:`Loaded`})}},T={command:`logs`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(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 O={command:`list`,describe:`Fetch a list of project deployments.`,builder:D,handler:async t=>{let n={env:t.env,page:t.page,per_page:t.perPage};if(t.dryRun){c({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/deployments`,pathParams:{projectName:String(t.projectName??``)},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?f:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.pages.projects.deployments.list(t.projectName,o,n)),{successLabel:`Loaded`})}};function k(e){return e.positional(`deploymentId`,{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 A={command:`retry <deploymentId>`,describe:`Retry a previous deployment.`,builder:k,handler:async t=>{if(t.dryRun){c({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/deployments/${t.deploymentId??`<deploymentId>`}/retry`,pathParams:{deploymentId:String(t.deploymentId??``),projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Creating`,async()=>n.pages.projects.deployments.retry(t.deploymentId,t.projectName,a)),{successLabel:`Created`})}};function j(e){return e.positional(`deploymentId`,{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 ee={command:`rollback <deploymentId>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:j,handler:async t=>{if(t.dryRun){c({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/deployments/${t.deploymentId??`<deploymentId>`}/rollback`,pathParams:{deploymentId:String(t.deploymentId??``),projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Creating`,async()=>n.pages.projects.deployments.rollback(t.deploymentId,t.projectName,a)),{successLabel:`Created`})}},M={command:`deployments`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(v).command(b).command(S).command(O).command(A).command(ee).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`projectName`,{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 P={command:`create <projectName>`,describe:`Add a new domain for the Pages project.`,builder:N,handler:async t=>{if(t.dryRun){c({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/domains`,pathParams:{projectName:String(t.projectName??``)},bodyKind:`json`,body:{name:t.name,body:t.body}});return}let d=await r(t),p=t.local?f:await e(d);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects/${t.projectName}/domains`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`The domain name.`));let m={};t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects/${t.projectName}/domains`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function F(e){return e.positional(`domainName`,{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 I={command:`delete <domainName>`,describe:`Delete a Pages project's domain.`,builder:F,handler:async n=>{if(n.dryRun){c({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${n.projectName??`<projectName>`}/domains/${n.domainName??`<domainName>`}`,pathParams:{domainName:String(n.domainName??``),projectName:String(n.projectName??``)},bodyKind:`none`});return}let a=await r(n),o=n.local?f:await e(a);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}s(await l(`Deleting`,async()=>a.pages.projects.domains.delete(n.domainName,n.projectName,o)),{successLabel:`Deleted`})}};function L(e){return e.positional(`domainName`,{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 R={command:`edit <domainName>`,describe:`Retry the validation status of a single domain.`,builder:L,handler:async t=>{if(t.dryRun){c({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/domains/${t.domainName??`<domainName>`}`,pathParams:{domainName:String(t.domainName??``),projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Updating`,async()=>n.pages.projects.domains.edit(t.domainName,t.projectName,a)),{successLabel:`Updated`})}};function z(e){return e.positional(`domainName`,{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 B={command:`get <domainName>`,describe:`Fetch a single domain.`,builder:z,handler:async t=>{if(t.dryRun){c({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/domains/${t.domainName??`<domainName>`}`,pathParams:{domainName:String(t.domainName??``),projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.pages.projects.domains.get(t.domainName,t.projectName,a)),{successLabel:`Loaded`})}};function V(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 H={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:V,handler:async t=>{if(t.dryRun){c({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}/domains`,pathParams:{projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.pages.projects.domains.list(t.projectName,a)),{successLabel:`Loaded`})}},U={command:`domains`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`projectName`,{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.`,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.
|
|
8
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
9
|
-
`}).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 G={command:`edit <projectName>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:W,handler:async t=>{if(t.dryRun){c({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}`,pathParams:{projectName:String(t.projectName??``)},bodyKind:`json`,body:{buildConfigBuildCaching:t.buildConfigBuildCaching,buildConfigBuildCommand:t.buildConfigBuildCommand,buildConfigDestinationDir:t.buildConfigDestinationDir,buildConfigRootDir:t.buildConfigRootDir,buildConfigWebAnalyticsTag:t.buildConfigWebAnalyticsTag,buildConfigWebAnalyticsToken:t.buildConfigWebAnalyticsToken,deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate:t.deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate,deploymentConfigsPreviewBuildImageMajorVersion:t.deploymentConfigsPreviewBuildImageMajorVersion,deploymentConfigsPreviewCompatibilityDate:t.deploymentConfigsPreviewCompatibilityDate,deploymentConfigsPreviewCompatibilityFlags:t.deploymentConfigsPreviewCompatibilityFlags,deploymentConfigsPreviewFailOpen:t.deploymentConfigsPreviewFailOpen,deploymentConfigsPreviewLimitsCpuMs:t.deploymentConfigsPreviewLimitsCpuMs,deploymentConfigsPreviewPlacementMode:t.deploymentConfigsPreviewPlacementMode,deploymentConfigsPreviewUsageModel:t.deploymentConfigsPreviewUsageModel,deploymentConfigsPreviewWranglerConfigHash:t.deploymentConfigsPreviewWranglerConfigHash,deploymentConfigsProductionAlwaysUseLatestCompatibilityDate:t.deploymentConfigsProductionAlwaysUseLatestCompatibilityDate,deploymentConfigsProductionBuildImageMajorVersion:t.deploymentConfigsProductionBuildImageMajorVersion,deploymentConfigsProductionCompatibilityDate:t.deploymentConfigsProductionCompatibilityDate,deploymentConfigsProductionCompatibilityFlags:t.deploymentConfigsProductionCompatibilityFlags,deploymentConfigsProductionFailOpen:t.deploymentConfigsProductionFailOpen,deploymentConfigsProductionLimitsCpuMs:t.deploymentConfigsProductionLimitsCpuMs,deploymentConfigsProductionPlacementMode:t.deploymentConfigsProductionPlacementMode,deploymentConfigsProductionUsageModel:t.deploymentConfigsProductionUsageModel,deploymentConfigsProductionWranglerConfigHash:t.deploymentConfigsProductionWranglerConfigHash,name:t.name,productionBranch:t.productionBranch,sourceConfigDeploymentsEnabled:t.sourceConfigDeploymentsEnabled,sourceConfigOwner:t.sourceConfigOwner,sourceConfigOwnerId:t.sourceConfigOwnerId,sourceConfigPathExcludes:t.sourceConfigPathExcludes,sourceConfigPathIncludes:t.sourceConfigPathIncludes,sourceConfigPrCommentsEnabled:t.sourceConfigPrCommentsEnabled,sourceConfigPreviewBranchExcludes:t.sourceConfigPreviewBranchExcludes,sourceConfigPreviewBranchIncludes:t.sourceConfigPreviewBranchIncludes,sourceConfigPreviewDeploymentSetting:t.sourceConfigPreviewDeploymentSetting,sourceConfigProductionBranch:t.sourceConfigProductionBranch,sourceConfigProductionDeploymentsEnabled:t.sourceConfigProductionDeploymentsEnabled,sourceConfigRepoId:t.sourceConfigRepoId,sourceConfigRepoName:t.sourceConfigRepoName,sourceType:t.sourceType,body:t.body}});return}let n=await r(t),d=t.local?f:await e(n);if(t.accountId=d,t.body){let e=o(t.body);s(await l(`Updating`,async()=>n.patch(`/accounts/${d}/pages/projects/${t.projectName}`,{body:e})),{successLabel:`Updated`});return}let p={};t.buildConfigBuildCaching!==void 0&&a(p,[`build_config`,`build_caching`],t.buildConfigBuildCaching),t.buildConfigBuildCommand!==void 0&&a(p,[`build_config`,`build_command`],u(t.buildConfigBuildCommand,`buildConfigBuildCommand`,`text`)),t.buildConfigDestinationDir!==void 0&&a(p,[`build_config`,`destination_dir`],u(t.buildConfigDestinationDir,`buildConfigDestinationDir`,`text`)),t.buildConfigRootDir!==void 0&&a(p,[`build_config`,`root_dir`],u(t.buildConfigRootDir,`buildConfigRootDir`,`text`)),t.buildConfigWebAnalyticsTag!==void 0&&a(p,[`build_config`,`web_analytics_tag`],u(t.buildConfigWebAnalyticsTag,`buildConfigWebAnalyticsTag`,`text`)),t.buildConfigWebAnalyticsToken!==void 0&&a(p,[`build_config`,`web_analytics_token`],u(t.buildConfigWebAnalyticsToken,`buildConfigWebAnalyticsToken`,`text`)),t.deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate!==void 0&&a(p,[`deployment_configs`,`preview`,`always_use_latest_compatibility_date`],t.deploymentConfigsPreviewAlwaysUseLatestCompatibilityDate),t.deploymentConfigsPreviewBuildImageMajorVersion!==void 0&&a(p,[`deployment_configs`,`preview`,`build_image_major_version`],t.deploymentConfigsPreviewBuildImageMajorVersion),t.deploymentConfigsPreviewCompatibilityDate!==void 0&&a(p,[`deployment_configs`,`preview`,`compatibility_date`],u(t.deploymentConfigsPreviewCompatibilityDate,`deploymentConfigsPreviewCompatibilityDate`,`text`)),t.deploymentConfigsPreviewCompatibilityFlags!==void 0&&a(p,[`deployment_configs`,`preview`,`compatibility_flags`],t.deploymentConfigsPreviewCompatibilityFlags),t.deploymentConfigsPreviewFailOpen!==void 0&&a(p,[`deployment_configs`,`preview`,`fail_open`],t.deploymentConfigsPreviewFailOpen),t.deploymentConfigsPreviewLimitsCpuMs!==void 0&&a(p,[`deployment_configs`,`preview`,`limits`,`cpu_ms`],t.deploymentConfigsPreviewLimitsCpuMs),t.deploymentConfigsPreviewPlacementMode!==void 0&&a(p,[`deployment_configs`,`preview`,`placement`,`mode`],u(t.deploymentConfigsPreviewPlacementMode,`deploymentConfigsPreviewPlacementMode`,`text`)),t.deploymentConfigsPreviewUsageModel!==void 0&&a(p,[`deployment_configs`,`preview`,`usage_model`],u(t.deploymentConfigsPreviewUsageModel,`deploymentConfigsPreviewUsageModel`,`text`)),t.deploymentConfigsPreviewWranglerConfigHash!==void 0&&a(p,[`deployment_configs`,`preview`,`wrangler_config_hash`],u(t.deploymentConfigsPreviewWranglerConfigHash,`deploymentConfigsPreviewWranglerConfigHash`,`text`)),t.deploymentConfigsProductionAlwaysUseLatestCompatibilityDate!==void 0&&a(p,[`deployment_configs`,`production`,`always_use_latest_compatibility_date`],t.deploymentConfigsProductionAlwaysUseLatestCompatibilityDate),t.deploymentConfigsProductionBuildImageMajorVersion!==void 0&&a(p,[`deployment_configs`,`production`,`build_image_major_version`],t.deploymentConfigsProductionBuildImageMajorVersion),t.deploymentConfigsProductionCompatibilityDate!==void 0&&a(p,[`deployment_configs`,`production`,`compatibility_date`],u(t.deploymentConfigsProductionCompatibilityDate,`deploymentConfigsProductionCompatibilityDate`,`text`)),t.deploymentConfigsProductionCompatibilityFlags!==void 0&&a(p,[`deployment_configs`,`production`,`compatibility_flags`],t.deploymentConfigsProductionCompatibilityFlags),t.deploymentConfigsProductionFailOpen!==void 0&&a(p,[`deployment_configs`,`production`,`fail_open`],t.deploymentConfigsProductionFailOpen),t.deploymentConfigsProductionLimitsCpuMs!==void 0&&a(p,[`deployment_configs`,`production`,`limits`,`cpu_ms`],t.deploymentConfigsProductionLimitsCpuMs),t.deploymentConfigsProductionPlacementMode!==void 0&&a(p,[`deployment_configs`,`production`,`placement`,`mode`],u(t.deploymentConfigsProductionPlacementMode,`deploymentConfigsProductionPlacementMode`,`text`)),t.deploymentConfigsProductionUsageModel!==void 0&&a(p,[`deployment_configs`,`production`,`usage_model`],u(t.deploymentConfigsProductionUsageModel,`deploymentConfigsProductionUsageModel`,`text`)),t.deploymentConfigsProductionWranglerConfigHash!==void 0&&a(p,[`deployment_configs`,`production`,`wrangler_config_hash`],u(t.deploymentConfigsProductionWranglerConfigHash,`deploymentConfigsProductionWranglerConfigHash`,`text`)),t.name!==void 0&&a(p,[`name`],u(t.name,`name`,`text`)),t.productionBranch!==void 0&&a(p,[`production_branch`],u(t.productionBranch,`productionBranch`,`text`)),t.sourceConfigDeploymentsEnabled!==void 0&&a(p,[`source`,`config`,`deployments_enabled`],t.sourceConfigDeploymentsEnabled),t.sourceConfigOwner!==void 0&&a(p,[`source`,`config`,`owner`],u(t.sourceConfigOwner,`sourceConfigOwner`,`text`)),t.sourceConfigOwnerId!==void 0&&a(p,[`source`,`config`,`owner_id`],u(t.sourceConfigOwnerId,`sourceConfigOwnerId`,`text`)),t.sourceConfigPathExcludes!==void 0&&a(p,[`source`,`config`,`path_excludes`],t.sourceConfigPathExcludes),t.sourceConfigPathIncludes!==void 0&&a(p,[`source`,`config`,`path_includes`],t.sourceConfigPathIncludes),t.sourceConfigPrCommentsEnabled!==void 0&&a(p,[`source`,`config`,`pr_comments_enabled`],t.sourceConfigPrCommentsEnabled),t.sourceConfigPreviewBranchExcludes!==void 0&&a(p,[`source`,`config`,`preview_branch_excludes`],t.sourceConfigPreviewBranchExcludes),t.sourceConfigPreviewBranchIncludes!==void 0&&a(p,[`source`,`config`,`preview_branch_includes`],t.sourceConfigPreviewBranchIncludes),t.sourceConfigPreviewDeploymentSetting!==void 0&&a(p,[`source`,`config`,`preview_deployment_setting`],u(t.sourceConfigPreviewDeploymentSetting,`sourceConfigPreviewDeploymentSetting`,`text`)),t.sourceConfigProductionBranch!==void 0&&a(p,[`source`,`config`,`production_branch`],u(t.sourceConfigProductionBranch,`sourceConfigProductionBranch`,`text`)),t.sourceConfigProductionDeploymentsEnabled!==void 0&&a(p,[`source`,`config`,`production_deployments_enabled`],t.sourceConfigProductionDeploymentsEnabled),t.sourceConfigRepoId!==void 0&&a(p,[`source`,`config`,`repo_id`],u(t.sourceConfigRepoId,`sourceConfigRepoId`,`text`)),t.sourceConfigRepoName!==void 0&&a(p,[`source`,`config`,`repo_name`],u(t.sourceConfigRepoName,`sourceConfigRepoName`,`text`)),t.sourceType!==void 0&&a(p,[`source`,`type`],u(t.sourceType,`sourceType`,`text`)),s(await l(`Updating`,async()=>n.patch(`/accounts/${d}/pages/projects/${t.projectName}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function K(e){return e.positional(`projectName`,{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 q={command:`get <projectName>`,describe:`Fetch a project by name.`,builder:K,handler:async t=>{if(t.dryRun){c({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t.projectName??`<projectName>`}`,pathParams:{projectName:String(t.projectName??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?f:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.pages.projects.get(t.projectName,a)),{successLabel:`Loaded`})}};function J(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 Y={command:`list`,describe:`Fetch a list of all user projects.`,builder:J,handler:async t=>{let n={page:t.page,per_page:t.perPage};if(t.dryRun){c({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?f:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.pages.projects.list(o,n)),{successLabel:`Loaded`})}};function X(e){return e.positional(`projectName`,{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 Z={command:`purge-build-cache <projectName>`,describe:`Purge all cached build artifacts for a Pages project`,builder:X,handler:async n=>{if(n.dryRun){c({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${n.projectName??`<projectName>`}/purge_build_cache`,pathParams:{projectName:String(n.projectName??``)},bodyKind:`none`});return}let a=await r(n),o=n.local?f:await e(a);if(n.accountId=o,!await t({force:!!n.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
10
|
-
`);return}s(await l(`Deleting`,async()=>a.pages.projects.purgeBuildCache(n.projectName,o)),{successLabel:`Deleted`})}},Q={command:`projects`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(m).command(g).command(G).command(q).command(Y).command(Z).command(M).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,m as n,p as r,t as i,u as a}from"./auth-BlSmtIKd.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-DZfTxbrx.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.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 t=>{if(t.dryRun){l({command:`cf pipelines create-v1`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:{name:t.name,sql:t.sql,body:t.body}});return}let r=await i(t),p=t.local?f:await e(r);if(t.accountId=p,t.body){let e=s(t.body);c(await u(`Creating`,async()=>r.post(`/accounts/${p}/pipelines/v1/pipelines`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`Specifies the name of the Pipeline.`)),t.sql===void 0&&(t.sql=await n(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m={};t.name!==void 0&&o(m,[`name`],d(t.name,`name`,`text`)),t.sql!==void 0&&o(m,[`sql`],d(t.sql,`sql`,`text`)),c(await u(`Creating`,async()=>r.post(`/accounts/${p}/pipelines/v1/pipelines`,{body:Object.keys(m).length>0?m:void 0})),{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 t=>{if(t.dryRun){l({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:{destinationBatchMaxBytes:t.destinationBatchMaxBytes,destinationBatchMaxDurationS:t.destinationBatchMaxDurationS,destinationBatchMaxRows:t.destinationBatchMaxRows,destinationCompressionType:t.destinationCompressionType,destinationCredentialsAccessKeyId:t.destinationCredentialsAccessKeyId,destinationCredentialsEndpoint:t.destinationCredentialsEndpoint,destinationCredentialsSecretAccessKey:t.destinationCredentialsSecretAccessKey,destinationFormat:t.destinationFormat,destinationPathBucket:t.destinationPathBucket,destinationPathFilepath:t.destinationPathFilepath,destinationPathPrefix:t.destinationPathPrefix,destinationType:t.destinationType,name:t.name,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines`,{body:e})),{successLabel:`Created`});return}t.destinationCredentialsAccessKeyId===void 0&&(t.destinationCredentialsAccessKeyId=await n(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),t.destinationCredentialsEndpoint===void 0&&(t.destinationCredentialsEndpoint=await n(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),t.destinationCredentialsSecretAccessKey===void 0&&(t.destinationCredentialsSecretAccessKey=await n(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),t.destinationFormat===void 0&&(t.destinationFormat=await r(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),t.destinationPathBucket===void 0&&(t.destinationPathBucket=await n(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),t.destinationType===void 0&&(t.destinationType=await r(`destination-type`,`Specifies the type of destination.`,[`r2`])),t.name===void 0&&(t.name=await n(`name`,`Defines the name of the pipeline.`));let h={};t.destinationBatchMaxBytes!==void 0&&o(h,[`destination`,`batch`,`max_bytes`],t.destinationBatchMaxBytes),t.destinationBatchMaxDurationS!==void 0&&o(h,[`destination`,`batch`,`max_duration_s`],t.destinationBatchMaxDurationS),t.destinationBatchMaxRows!==void 0&&o(h,[`destination`,`batch`,`max_rows`],t.destinationBatchMaxRows),t.destinationCompressionType!==void 0&&o(h,[`destination`,`compression`,`type`],d(t.destinationCompressionType,`destinationCompressionType`,`text`)),t.destinationCredentialsAccessKeyId!==void 0&&o(h,[`destination`,`credentials`,`access_key_id`],d(t.destinationCredentialsAccessKeyId,`destinationCredentialsAccessKeyId`,`text`)),t.destinationCredentialsEndpoint!==void 0&&o(h,[`destination`,`credentials`,`endpoint`],d(t.destinationCredentialsEndpoint,`destinationCredentialsEndpoint`,`text`)),t.destinationCredentialsSecretAccessKey!==void 0&&o(h,[`destination`,`credentials`,`secret_access_key`],d(t.destinationCredentialsSecretAccessKey,`destinationCredentialsSecretAccessKey`,`text`)),t.destinationFormat!==void 0&&o(h,[`destination`,`format`],d(t.destinationFormat,`destinationFormat`,`text`)),t.destinationPathBucket!==void 0&&o(h,[`destination`,`path`,`bucket`],d(t.destinationPathBucket,`destinationPathBucket`,`text`)),t.destinationPathFilepath!==void 0&&o(h,[`destination`,`path`,`filepath`],d(t.destinationPathFilepath,`destinationPathFilepath`,`text`)),t.destinationPathPrefix!==void 0&&o(h,[`destination`,`path`,`prefix`],d(t.destinationPathPrefix,`destinationPathPrefix`,`text`)),t.destinationType!==void 0&&o(h,[`destination`,`type`],d(t.destinationType,`destinationType`,`text`)),t.name!==void 0&&o(h,[`name`],d(t.name,`name`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function _(e){return e.positional(`pipelineId`,{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 <pipelineId>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async n=>{if(n.dryRun){l({command:`cf pipelines delete-v1`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines/${n.pipelineId??`<pipelineId>`}`,pathParams:{pipelineId:String(n.pipelineId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>r.pipelines.deleteV1(o,n.pipelineId)),{successLabel:`Deleted`})}};function y(e){return e.positional(`pipelineName`,{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 <pipelineName>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async n=>{if(n.dryRun){l({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/${n.pipelineName??`<pipelineName>`}`,pathParams:{pipelineName:String(n.pipelineName??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>r.pipelines.delete(o,n.pipelineName)),{successLabel:`Deleted`})}};function x(e){return e.positional(`pipelineId`,{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 <pipelineId>`,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/${a()??`<account-id>`}/pipelines/v1/pipelines/${t.pipelineId??`<pipelineId>`}`,pathParams:{pipelineId:String(t.pipelineId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.getV1(r,t.pipelineId)),{successLabel:`Loaded`})}};function C(e){return e.positional(`pipelineName`,{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 <pipelineName>`,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/${a()??`<account-id>`}/pipelines/${t.pipelineName??`<pipelineName>`}`,pathParams:{pipelineName:String(t.pipelineName??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.get(r,t.pipelineName)),{successLabel:`Loaded`})}};function T(e){return e.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 E={command:`list-v1`,describe:`List/Filter Pipelines in Account.`,builder:T,handler:async t=>{let n={page:t.page,per_page:t.perPage};if(t.dryRun){l({command:`cf pipelines list-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.listV1(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.perPage};if(t.dryRun){l({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.list(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-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].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 --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 t=>{if(t.dryRun){l({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:{configAccountId:t.configAccountId,configBucket:t.configBucket,configCredentialsAccessKeyId:t.configCredentialsAccessKeyId,configCredentialsSecretAccessKey:t.configCredentialsSecretAccessKey,configFileNamingPrefix:t.configFileNamingPrefix,configFileNamingStrategy:t.configFileNamingStrategy,configFileNamingSuffix:t.configFileNamingSuffix,configJurisdiction:t.configJurisdiction,configPartitioningTimePattern:t.configPartitioningTimePattern,configPath:t.configPath,configRollingPolicyFileSizeBytes:t.configRollingPolicyFileSizeBytes,configRollingPolicyInactivitySeconds:t.configRollingPolicyInactivitySeconds,configRollingPolicyIntervalSeconds:t.configRollingPolicyIntervalSeconds,configNamespace:t.configNamespace,configTableName:t.configTableName,configToken:t.configToken,formatDecimalEncoding:t.formatDecimalEncoding,formatTimestampFormat:t.formatTimestampFormat,formatUnstructured:t.formatUnstructured,formatType:t.formatType,formatCompression:t.formatCompression,formatRowGroupBytes:t.formatRowGroupBytes,name:t.name,schemaFormatDecimalEncoding:t.schemaFormatDecimalEncoding,schemaFormatTimestampFormat:t.schemaFormatTimestampFormat,schemaFormatUnstructured:t.schemaFormatUnstructured,schemaFormatType:t.schemaFormatType,schemaFormatCompression:t.schemaFormatCompression,schemaFormatRowGroupBytes:t.schemaFormatRowGroupBytes,schemaInferred:t.schemaInferred,type:t.type,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines/v1/sinks`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`Defines the name of the Sink.`)),t.type===void 0&&(t.type=await r(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h={};t.configAccountId!==void 0&&o(h,[`config`,`account_id`],d(t.configAccountId,`configAccountId`,`text`)),t.configBucket!==void 0&&o(h,[`config`,`bucket`],d(t.configBucket,`configBucket`,`text`)),t.configCredentialsAccessKeyId!==void 0&&o(h,[`config`,`credentials`,`access_key_id`],d(t.configCredentialsAccessKeyId,`configCredentialsAccessKeyId`,`text`)),t.configCredentialsSecretAccessKey!==void 0&&o(h,[`config`,`credentials`,`secret_access_key`],d(t.configCredentialsSecretAccessKey,`configCredentialsSecretAccessKey`,`text`)),t.configFileNamingPrefix!==void 0&&o(h,[`config`,`file_naming`,`prefix`],d(t.configFileNamingPrefix,`configFileNamingPrefix`,`text`)),t.configFileNamingStrategy!==void 0&&o(h,[`config`,`file_naming`,`strategy`],d(t.configFileNamingStrategy,`configFileNamingStrategy`,`text`)),t.configFileNamingSuffix!==void 0&&o(h,[`config`,`file_naming`,`suffix`],d(t.configFileNamingSuffix,`configFileNamingSuffix`,`text`)),t.configJurisdiction!==void 0&&o(h,[`config`,`jurisdiction`],d(t.configJurisdiction,`configJurisdiction`,`text`)),t.configPartitioningTimePattern!==void 0&&o(h,[`config`,`partitioning`,`time_pattern`],d(t.configPartitioningTimePattern,`configPartitioningTimePattern`,`text`)),t.configPath!==void 0&&o(h,[`config`,`path`],d(t.configPath,`configPath`,`text`)),t.configRollingPolicyFileSizeBytes!==void 0&&o(h,[`config`,`rolling_policy`,`file_size_bytes`],t.configRollingPolicyFileSizeBytes),t.configRollingPolicyInactivitySeconds!==void 0&&o(h,[`config`,`rolling_policy`,`inactivity_seconds`],t.configRollingPolicyInactivitySeconds),t.configRollingPolicyIntervalSeconds!==void 0&&o(h,[`config`,`rolling_policy`,`interval_seconds`],t.configRollingPolicyIntervalSeconds),t.configNamespace!==void 0&&o(h,[`config`,`namespace`],d(t.configNamespace,`configNamespace`,`text`)),t.configTableName!==void 0&&o(h,[`config`,`table_name`],d(t.configTableName,`configTableName`,`text`)),t.configToken!==void 0&&o(h,[`config`,`token`],d(t.configToken,`configToken`,`text`)),t.formatDecimalEncoding!==void 0&&o(h,[`format`,`decimal_encoding`],d(t.formatDecimalEncoding,`formatDecimalEncoding`,`text`)),t.formatTimestampFormat!==void 0&&o(h,[`format`,`timestamp_format`],d(t.formatTimestampFormat,`formatTimestampFormat`,`text`)),t.formatUnstructured!==void 0&&o(h,[`format`,`unstructured`],t.formatUnstructured),t.formatType!==void 0&&o(h,[`format`,`type`],d(t.formatType,`formatType`,`text`)),t.formatCompression!==void 0&&o(h,[`format`,`compression`],d(t.formatCompression,`formatCompression`,`text`)),t.formatRowGroupBytes!==void 0&&o(h,[`format`,`row_group_bytes`],t.formatRowGroupBytes),t.name!==void 0&&o(h,[`name`],d(t.name,`name`,`text`)),t.schemaFormatDecimalEncoding!==void 0&&o(h,[`schema`,`format`,`decimal_encoding`],d(t.schemaFormatDecimalEncoding,`schemaFormatDecimalEncoding`,`text`)),t.schemaFormatTimestampFormat!==void 0&&o(h,[`schema`,`format`,`timestamp_format`],d(t.schemaFormatTimestampFormat,`schemaFormatTimestampFormat`,`text`)),t.schemaFormatUnstructured!==void 0&&o(h,[`schema`,`format`,`unstructured`],t.schemaFormatUnstructured),t.schemaFormatType!==void 0&&o(h,[`schema`,`format`,`type`],d(t.schemaFormatType,`schemaFormatType`,`text`)),t.schemaFormatCompression!==void 0&&o(h,[`schema`,`format`,`compression`],d(t.schemaFormatCompression,`schemaFormatCompression`,`text`)),t.schemaFormatRowGroupBytes!==void 0&&o(h,[`schema`,`format`,`row_group_bytes`],t.schemaFormatRowGroupBytes),t.schemaInferred!==void 0&&o(h,[`schema`,`inferred`],t.schemaInferred),t.type!==void 0&&o(h,[`type`],d(t.type,`type`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines/v1/sinks`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function j(e){return e.positional(`sinkId`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`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 <sinkId>`,describe:`Delete Pipeline in Account.`,builder:j,handler:async n=>{let r={force:n.force};if(n.dryRun){l({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks/${n.sinkId??`<sinkId>`}`,pathParams:{sinkId:String(n.sinkId??``)},query:r,bodyKind:`none`});return}let o=await i(n),s=n.local?f:await e(o);if(n.accountId=s,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}c(await u(`Deleting`,async()=>o.pipelines.sinks.delete(s,n.sinkId,r)),{successLabel:`Deleted`})}};function N(e){return e.positional(`sinkId`,{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 <sinkId>`,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/${a()??`<account-id>`}/pipelines/v1/sinks/${t.sinkId??`<sinkId>`}`,pathParams:{sinkId:String(t.sinkId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.sinks.get(r,t.sinkId)),{successLabel:`Loaded`})}};function F(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).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.pipelineId,page:t.page,per_page:t.perPage};if(t.dryRun){l({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.sinks.list(o,n)),{successLabel:`Loaded`})}},L={command:`sinks`,describe:`Destinations where pipeline data is written — R2 buckets, HTTP endpoints, or other storage`,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 t=>{if(t.dryRun){l({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:{formatDecimalEncoding:t.formatDecimalEncoding,formatTimestampFormat:t.formatTimestampFormat,formatUnstructured:t.formatUnstructured,formatType:t.formatType,formatCompression:t.formatCompression,formatRowGroupBytes:t.formatRowGroupBytes,httpAuthentication:t.httpAuthentication,httpCorsOrigins:t.httpCorsOrigins,httpEnabled:t.httpEnabled,name:t.name,schemaFormatDecimalEncoding:t.schemaFormatDecimalEncoding,schemaFormatTimestampFormat:t.schemaFormatTimestampFormat,schemaFormatUnstructured:t.schemaFormatUnstructured,schemaFormatType:t.schemaFormatType,schemaFormatCompression:t.schemaFormatCompression,schemaFormatRowGroupBytes:t.schemaFormatRowGroupBytes,schemaInferred:t.schemaInferred,workerBindingEnabled:t.workerBindingEnabled,body:t.body}});return}let r=await i(t),p=t.local?f:await e(r);if(t.accountId=p,t.body){let e=s(t.body);c(await u(`Creating`,async()=>r.post(`/accounts/${p}/pipelines/v1/streams`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`Specifies the name of the Stream.`));let m={};t.formatDecimalEncoding!==void 0&&o(m,[`format`,`decimal_encoding`],d(t.formatDecimalEncoding,`formatDecimalEncoding`,`text`)),t.formatTimestampFormat!==void 0&&o(m,[`format`,`timestamp_format`],d(t.formatTimestampFormat,`formatTimestampFormat`,`text`)),t.formatUnstructured!==void 0&&o(m,[`format`,`unstructured`],t.formatUnstructured),t.formatType!==void 0&&o(m,[`format`,`type`],d(t.formatType,`formatType`,`text`)),t.formatCompression!==void 0&&o(m,[`format`,`compression`],d(t.formatCompression,`formatCompression`,`text`)),t.formatRowGroupBytes!==void 0&&o(m,[`format`,`row_group_bytes`],t.formatRowGroupBytes),t.httpAuthentication!==void 0&&o(m,[`http`,`authentication`],t.httpAuthentication),t.httpCorsOrigins!==void 0&&o(m,[`http`,`cors`,`origins`],t.httpCorsOrigins),t.httpEnabled!==void 0&&o(m,[`http`,`enabled`],t.httpEnabled),t.name!==void 0&&o(m,[`name`],d(t.name,`name`,`text`)),t.schemaFormatDecimalEncoding!==void 0&&o(m,[`schema`,`format`,`decimal_encoding`],d(t.schemaFormatDecimalEncoding,`schemaFormatDecimalEncoding`,`text`)),t.schemaFormatTimestampFormat!==void 0&&o(m,[`schema`,`format`,`timestamp_format`],d(t.schemaFormatTimestampFormat,`schemaFormatTimestampFormat`,`text`)),t.schemaFormatUnstructured!==void 0&&o(m,[`schema`,`format`,`unstructured`],t.schemaFormatUnstructured),t.schemaFormatType!==void 0&&o(m,[`schema`,`format`,`type`],d(t.schemaFormatType,`schemaFormatType`,`text`)),t.schemaFormatCompression!==void 0&&o(m,[`schema`,`format`,`compression`],d(t.schemaFormatCompression,`schemaFormatCompression`,`text`)),t.schemaFormatRowGroupBytes!==void 0&&o(m,[`schema`,`format`,`row_group_bytes`],t.schemaFormatRowGroupBytes),t.schemaInferred!==void 0&&o(m,[`schema`,`inferred`],t.schemaInferred),t.workerBindingEnabled!==void 0&&o(m,[`worker_binding`,`enabled`],t.workerBindingEnabled),c(await u(`Creating`,async()=>r.post(`/accounts/${p}/pipelines/v1/streams`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function B(e){return e.positional(`streamId`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`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 <streamId>`,describe:`Delete Stream in Account.`,builder:B,handler:async n=>{let r={force:n.force};if(n.dryRun){l({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams/${n.streamId??`<streamId>`}`,pathParams:{streamId:String(n.streamId??``)},query:r,bodyKind:`none`});return}let o=await i(n),s=n.local?f:await e(o);if(n.accountId=s,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}c(await u(`Deleting`,async()=>o.pipelines.streams.delete(s,n.streamId,r)),{successLabel:`Deleted`})}};function H(e){return e.positional(`streamId`,{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 <streamId>`,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/${a()??`<account-id>`}/pipelines/v1/streams/${t.streamId??`<streamId>`}`,pathParams:{streamId:String(t.streamId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.streams.get(r,t.streamId)),{successLabel:`Loaded`})}};function W(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).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.pipelineId,page:t.page,per_page:t.perPage};if(t.dryRun){l({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.streams.list(o,n)),{successLabel:`Loaded`})}};function K(e){return e.positional(`streamId`,{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 <streamId>`,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/${a()??`<account-id>`}/pipelines/v1/streams/${t.streamId??`<streamId>`}`,pathParams:{streamId:String(t.streamId??``)},bodyKind:`json`,body:{httpAuthentication:t.httpAuthentication,httpCorsOrigins:t.httpCorsOrigins,httpEnabled:t.httpEnabled,workerBindingEnabled:t.workerBindingEnabled,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/pipelines/v1/streams/${t.streamId}`,{body:e})),{successLabel:`Updated`});return}let d={};t.httpAuthentication!==void 0&&o(d,[`http`,`authentication`],t.httpAuthentication),t.httpCorsOrigins!==void 0&&o(d,[`http`,`cors`,`origins`],t.httpCorsOrigins),t.httpEnabled!==void 0&&o(d,[`http`,`enabled`],t.httpEnabled),t.workerBindingEnabled!==void 0&&o(d,[`worker_binding`,`enabled`],t.workerBindingEnabled),c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/pipelines/v1/streams/${t.streamId}`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},J={command:`streams`,describe:`Inbound data streams that feed events into a pipeline for processing`,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(`pipelineName`,{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 <pipelineName>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:Y,handler:async t=>{if(t.dryRun){l({command:`cf pipelines update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/${t.pipelineName??`<pipelineName>`}`,pathParams:{pipelineName:String(t.pipelineName??``)},bodyKind:`json`,body:{destinationBatchMaxBytes:t.destinationBatchMaxBytes,destinationBatchMaxDurationS:t.destinationBatchMaxDurationS,destinationBatchMaxRows:t.destinationBatchMaxRows,destinationCompressionType:t.destinationCompressionType,destinationCredentialsAccessKeyId:t.destinationCredentialsAccessKeyId,destinationCredentialsEndpoint:t.destinationCredentialsEndpoint,destinationCredentialsSecretAccessKey:t.destinationCredentialsSecretAccessKey,destinationFormat:t.destinationFormat,destinationPathBucket:t.destinationPathBucket,destinationPathFilepath:t.destinationPathFilepath,destinationPathPrefix:t.destinationPathPrefix,destinationType:t.destinationType,name:t.name,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Updating`,async()=>p.put(`/accounts/${m}/pipelines/${t.pipelineName}`,{body:e})),{successLabel:`Updated`});return}t.destinationCredentialsAccessKeyId===void 0&&(t.destinationCredentialsAccessKeyId=await n(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),t.destinationCredentialsEndpoint===void 0&&(t.destinationCredentialsEndpoint=await n(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),t.destinationCredentialsSecretAccessKey===void 0&&(t.destinationCredentialsSecretAccessKey=await n(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),t.destinationFormat===void 0&&(t.destinationFormat=await r(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),t.destinationPathBucket===void 0&&(t.destinationPathBucket=await n(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),t.destinationType===void 0&&(t.destinationType=await r(`destination-type`,`Specifies the type of destination.`,[`r2`])),t.name===void 0&&(t.name=await n(`name`,`Defines the name of the pipeline.`));let h={};t.destinationBatchMaxBytes!==void 0&&o(h,[`destination`,`batch`,`max_bytes`],t.destinationBatchMaxBytes),t.destinationBatchMaxDurationS!==void 0&&o(h,[`destination`,`batch`,`max_duration_s`],t.destinationBatchMaxDurationS),t.destinationBatchMaxRows!==void 0&&o(h,[`destination`,`batch`,`max_rows`],t.destinationBatchMaxRows),t.destinationCompressionType!==void 0&&o(h,[`destination`,`compression`,`type`],d(t.destinationCompressionType,`destinationCompressionType`,`text`)),t.destinationCredentialsAccessKeyId!==void 0&&o(h,[`destination`,`credentials`,`access_key_id`],d(t.destinationCredentialsAccessKeyId,`destinationCredentialsAccessKeyId`,`text`)),t.destinationCredentialsEndpoint!==void 0&&o(h,[`destination`,`credentials`,`endpoint`],d(t.destinationCredentialsEndpoint,`destinationCredentialsEndpoint`,`text`)),t.destinationCredentialsSecretAccessKey!==void 0&&o(h,[`destination`,`credentials`,`secret_access_key`],d(t.destinationCredentialsSecretAccessKey,`destinationCredentialsSecretAccessKey`,`text`)),t.destinationFormat!==void 0&&o(h,[`destination`,`format`],d(t.destinationFormat,`destinationFormat`,`text`)),t.destinationPathBucket!==void 0&&o(h,[`destination`,`path`,`bucket`],d(t.destinationPathBucket,`destinationPathBucket`,`text`)),t.destinationPathFilepath!==void 0&&o(h,[`destination`,`path`,`filepath`],d(t.destinationPathFilepath,`destinationPathFilepath`,`text`)),t.destinationPathPrefix!==void 0&&o(h,[`destination`,`path`,`prefix`],d(t.destinationPathPrefix,`destinationPathPrefix`,`text`)),t.destinationType!==void 0&&o(h,[`destination`,`type`],d(t.destinationType,`destinationType`,`text`)),t.name!==void 0&&o(h,[`name`],d(t.name,`name`,`text`)),c(await u(`Updating`,async()=>p.put(`/accounts/${m}/pipelines/${t.pipelineName}`,{body:Object.keys(h).length>0?h:void 0})),{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 t=>{if(t.dryRun){l({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:{sql:t.sql,body:t.body}});return}let r=await i(t),p=t.local?f:await e(r);if(t.accountId=p,t.body){let e=s(t.body);c(await u(`Creating`,async()=>r.post(`/accounts/${p}/pipelines/v1/validate_sql`,{body:e})),{successLabel:`Created`});return}t.sql===void 0&&(t.sql=await n(`sql`,`Specifies SQL to validate.`));let m={};t.sql!==void 0&&o(m,[`sql`],d(t.sql,`sql`,`text`)),c(await u(`Creating`,async()=>r.post(`/accounts/${p}/pipelines/v1/validate_sql`,{body:Object.keys(m).length>0?m:void 0})),{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};
|
package/dist/queues-B0C06L9r.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,m as n,p as r,t as i,u as a}from"./auth-BlSmtIKd.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-DZfTxbrx.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const m={command:`create <queueId>`,describe:`Creates a new consumer for a Queue`,builder:p,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/consumers`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{deadLetterQueue:t.deadLetterQueue,scriptName:t.scriptName,settingsBatchSize:t.settingsBatchSize,settingsMaxConcurrency:t.settingsMaxConcurrency,settingsMaxRetries:t.settingsMaxRetries,settingsMaxWaitTimeMs:t.settingsMaxWaitTimeMs,settingsRetryDelay:t.settingsRetryDelay,settingsVisibilityTimeoutMs:t.settingsVisibilityTimeoutMs,type:t.type,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/queues/${t.queueId}/consumers`,{body:e})),{successLabel:`Created`});return}t.type===void 0&&(t.type=await r(`type`,``,[`worker`,`http_pull`])),t.type===`worker`&&t.scriptName===void 0&&(t.scriptName=await n(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h={};t.deadLetterQueue!==void 0&&o(h,[`dead_letter_queue`],d(t.deadLetterQueue,`deadLetterQueue`,`text`)),t.scriptName!==void 0&&o(h,[`script_name`],d(t.scriptName,`scriptName`,`text`)),t.settingsBatchSize!==void 0&&o(h,[`settings`,`batch_size`],t.settingsBatchSize),t.settingsMaxConcurrency!==void 0&&o(h,[`settings`,`max_concurrency`],t.settingsMaxConcurrency),t.settingsMaxRetries!==void 0&&o(h,[`settings`,`max_retries`],t.settingsMaxRetries),t.settingsMaxWaitTimeMs!==void 0&&o(h,[`settings`,`max_wait_time_ms`],t.settingsMaxWaitTimeMs),t.settingsRetryDelay!==void 0&&o(h,[`settings`,`retry_delay`],t.settingsRetryDelay),t.settingsVisibilityTimeoutMs!==void 0&&o(h,[`settings`,`visibility_timeout_ms`],t.settingsVisibilityTimeoutMs),t.type!==void 0&&o(h,[`type`],d(t.type,`type`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/queues/${t.queueId}/consumers`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function h(e){return e.positional(`consumerId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource 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 ee={command:`delete <consumerId>`,describe:`Deletes the consumer for a queue.`,builder:h,handler:async n=>{if(n.dryRun){l({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${n.queueId??`<queueId>`}/consumers/${n.consumerId??`<consumerId>`}`,pathParams:{consumerId:String(n.consumerId??``),queueId:String(n.queueId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>r.queues.consumers.delete(n.consumerId,n.queueId,o)),{successLabel:`Deleted`})}};function g(e){return e.positional(`consumerId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <consumerId>`,describe:`Fetches the consumer for a queue by consumer id`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/consumers/${t.consumerId??`<consumerId>`}`,pathParams:{consumerId:String(t.consumerId??``),queueId:String(t.queueId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.consumers.get(t.consumerId,t.queueId,r)),{successLabel:`Loaded`})}};function v(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Returns the consumers for a Queue`,builder:v,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/consumers`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.consumers.list(t.queueId,r)),{successLabel:`Loaded`})}};function b(e){return e.positional(`consumerId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const x={command:`update <consumerId>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:b,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/consumers/${t.consumerId??`<consumerId>`}`,pathParams:{consumerId:String(t.consumerId??``),queueId:String(t.queueId??``)},bodyKind:`json`,body:{deadLetterQueue:t.deadLetterQueue,scriptName:t.scriptName,settingsBatchSize:t.settingsBatchSize,settingsMaxConcurrency:t.settingsMaxConcurrency,settingsMaxRetries:t.settingsMaxRetries,settingsMaxWaitTimeMs:t.settingsMaxWaitTimeMs,settingsRetryDelay:t.settingsRetryDelay,settingsVisibilityTimeoutMs:t.settingsVisibilityTimeoutMs,type:t.type,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Updating`,async()=>p.put(`/accounts/${m}/queues/${t.queueId}/consumers/${t.consumerId}`,{body:e})),{successLabel:`Updated`});return}t.type===void 0&&(t.type=await r(`type`,``,[`worker`,`http_pull`])),t.type===`worker`&&t.scriptName===void 0&&(t.scriptName=await n(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h={};t.deadLetterQueue!==void 0&&o(h,[`dead_letter_queue`],d(t.deadLetterQueue,`deadLetterQueue`,`text`)),t.scriptName!==void 0&&o(h,[`script_name`],d(t.scriptName,`scriptName`,`text`)),t.settingsBatchSize!==void 0&&o(h,[`settings`,`batch_size`],t.settingsBatchSize),t.settingsMaxConcurrency!==void 0&&o(h,[`settings`,`max_concurrency`],t.settingsMaxConcurrency),t.settingsMaxRetries!==void 0&&o(h,[`settings`,`max_retries`],t.settingsMaxRetries),t.settingsMaxWaitTimeMs!==void 0&&o(h,[`settings`,`max_wait_time_ms`],t.settingsMaxWaitTimeMs),t.settingsRetryDelay!==void 0&&o(h,[`settings`,`retry_delay`],t.settingsRetryDelay),t.settingsVisibilityTimeoutMs!==void 0&&o(h,[`settings`,`visibility_timeout_ms`],t.settingsVisibilityTimeoutMs),t.type!==void 0&&o(h,[`type`],d(t.type,`type`,`text`)),c(await u(`Updating`,async()=>p.put(`/accounts/${m}/queues/${t.queueId}/consumers/${t.consumerId}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`})}},S={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(m).command(ee).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create a new queue`,builder:C,handler:async t=>{if(t.dryRun){l({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:{queueName:t.queueName,body:t.body}});return}let r=await i(t),p=t.local?f:await e(r);if(t.accountId=p,t.body){let e=s(t.body);c(await u(`Creating`,async()=>r.post(`/accounts/${p}/queues`,{body:e})),{successLabel:`Created`});return}t.queueName===void 0&&(t.queueName=await n(`queue-name`,``));let m={};t.queueName!==void 0&&o(m,[`queue_name`],d(t.queueName,`queueName`,`text`)),c(await u(`Creating`,async()=>r.post(`/accounts/${p}/queues`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function T(e){return e.positional(`queueId`,{type:`string`,description:`A Resource 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 E={command:`delete <queueId>`,describe:`Deletes a queue`,builder:T,handler:async n=>{if(n.dryRun){l({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${n.queueId??`<queueId>`}`,pathParams:{queueId:String(n.queueId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>r.queues.delete(n.queueId,o)),{successLabel:`Deleted`})}};function D(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`edit <queueId>`,describe:`Updates a Queue.`,builder:D,handler:async t=>{if(t.dryRun){l({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{queueName:t.queueName,settingsDeliveryDelay:t.settingsDeliveryDelay,settingsDeliveryPaused:t.settingsDeliveryPaused,settingsMessageRetentionPeriod:t.settingsMessageRetentionPeriod,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/queues/${t.queueId}`,{body:e})),{successLabel:`Updated`});return}let p={};t.queueName!==void 0&&o(p,[`queue_name`],d(t.queueName,`queueName`,`text`)),t.settingsDeliveryDelay!==void 0&&o(p,[`settings`,`delivery_delay`],t.settingsDeliveryDelay),t.settingsDeliveryPaused!==void 0&&o(p,[`settings`,`delivery_paused`],t.settingsDeliveryPaused),t.settingsMessageRetentionPeriod!==void 0&&o(p,[`settings`,`message_retention_period`],t.settingsMessageRetentionPeriod),c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/queues/${t.queueId}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function k(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <queueId>`,describe:`Get details about a specific queue.`,builder:k,handler:async t=>{if(t.dryRun){l({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.get(t.queueId,r)),{successLabel:`Loaded`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Returns the queues owned by an account.`,builder:j,handler:async t=>{if(t.dryRun){l({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.list(r)),{successLabel:`Loaded`})}};function N(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,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 P={command:`ack-preview <queueId>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:N,handler:async t=>{if(t.dryRun){l({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/messages/preview/ack`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/preview/ack`,{body:e})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.queues.messages.ackPreview(t.queueId,r)),{successLabel:`Created`})}};function F(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,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 I={command:`ack <queueId>`,describe:`Acknowledge + Retry messages from a Queue`,builder:F,handler:async t=>{if(t.dryRun){l({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/messages/ack`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/ack`,{body:e})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.queues.messages.ack(t.queueId,r)),{successLabel:`Created`})}};function L(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).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 R={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:L,handler:async t=>{if(t.dryRun){l({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/messages/batch`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{delaySeconds:t.delaySeconds,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/batch`,{body:e})),{successLabel:`Created`});return}let d={};t.delaySeconds!==void 0&&o(d,[`delay_seconds`],t.delaySeconds),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/batch`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function z(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).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 te={command:`preview <queueId>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:z,handler:async t=>{if(t.dryRun){l({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/messages/preview`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{batchSize:t.batchSize,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Loading`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/preview`,{body:e})),{successLabel:`Loaded`});return}let d={};t.batchSize!==void 0&&o(d,[`batch_size`],t.batchSize),c(await u(`Loading`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/preview`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Loaded`})}};function B(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`pull <queueId>`,describe:`Pull a batch of messages from a Queue`,builder:B,handler:async t=>{if(t.dryRun){l({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/messages/pull`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{batchSize:t.batchSize,visibilityTimeoutMs:t.visibilityTimeoutMs,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/pull`,{body:e})),{successLabel:`Created`});return}let d={};t.batchSize!==void 0&&o(d,[`batch_size`],t.batchSize),t.visibilityTimeoutMs!==void 0&&o(d,[`visibility_timeout_ms`],t.visibilityTimeoutMs),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages/pull`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function H(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).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 U={command:`push <queueId>`,describe:`Push a message to a Queue`,builder:H,handler:async t=>{if(t.dryRun){l({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/messages`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{delaySeconds:t.delaySeconds,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages`,{body:e})),{successLabel:`Created`});return}let d={};t.delaySeconds!==void 0&&o(d,[`delay_seconds`],t.delaySeconds),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/queues/${t.queueId}/messages`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}},W={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(I).command(P).command(R).command(te).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`start <queueId>`,describe:`Deletes all messages from the Queue.`,builder:G,handler:async n=>{if(n.dryRun){l({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${n.queueId??`<queueId>`}/purge`,pathParams:{queueId:String(n.queueId??``)},bodyKind:`json`,body:{deleteMessagesPermanently:n.deleteMessagesPermanently,body:n.body}});return}let r=await i(n),d=n.local?f:await e(r);if(n.accountId=d,!await t({force:!!n.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>r.post(`/accounts/${d}/queues/${n.queueId}/purge`,{body:e})),{successLabel:`Deleted`});return}let p={};n.deleteMessagesPermanently!==void 0&&o(p,[`delete_messages_permanently`],n.deleteMessagesPermanently),c(await u(`Deleting`,async()=>r.post(`/accounts/${d}/queues/${n.queueId}/purge`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Deleted`})}};function q(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`status <queueId>`,describe:`Get details about a Queue's purge status.`,builder:q,handler:async t=>{if(t.dryRun){l({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}/purge`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.purge.status(t.queueId,r)),{successLabel:`Loaded`})}},Y={command:`purge`,describe:`Remove all pending messages from a queue`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).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(`source-model-name`,[`source-worker-name`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-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 --destination-* flag is set`)}return!0})}const Z={command:`create`,describe:`Create a new event subscription for a queue`,builder:X,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:{destinationQueueId:t.destinationQueueId,destinationType:t.destinationType,enabled:t.enabled,events:t.events,name:t.name,sourceType:t.sourceType,sourceModelName:t.sourceModelName,sourceWorkerName:t.sourceWorkerName,sourceWorkflowName:t.sourceWorkflowName,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/event_subscriptions/subscriptions`,{body:e})),{successLabel:`Created`});return}let p={};t.destinationQueueId!==void 0&&o(p,[`destination`,`queue_id`],d(t.destinationQueueId,`destinationQueueId`,`text`)),t.destinationType!==void 0&&o(p,[`destination`,`type`],d(t.destinationType,`destinationType`,`text`)),t.enabled!==void 0&&o(p,[`enabled`],t.enabled),t.events!==void 0&&o(p,[`events`],t.events),t.name!==void 0&&o(p,[`name`],d(t.name,`name`,`text`)),t.sourceType!==void 0&&o(p,[`source`,`type`],d(t.sourceType,`sourceType`,`text`)),t.sourceModelName!==void 0&&o(p,[`source`,`model_name`],d(t.sourceModelName,`sourceModelName`,`text`)),t.sourceWorkerName!==void 0&&o(p,[`source`,`worker_name`],d(t.sourceWorkerName,`sourceWorkerName`,`text`)),t.sourceWorkflowName!==void 0&&o(p,[`source`,`workflow_name`],d(t.sourceWorkflowName,`sourceWorkflowName`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/event_subscriptions/subscriptions`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function Q(e){return e.positional(`subscriptionId`,{type:`string`,description:`A Resource 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 ne={command:`delete <subscriptionId>`,describe:`Delete an existing event subscription`,builder:Q,handler:async n=>{if(n.dryRun){l({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions/${n.subscriptionId??`<subscriptionId>`}`,pathParams:{subscriptionId:String(n.subscriptionId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}c(await u(`Deleting`,async()=>r.queues.subscriptions.delete(o,n.subscriptionId)),{successLabel:`Deleted`})}};function re(e){return e.positional(`subscriptionId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <subscriptionId>`,describe:`Get details about an existing event subscription`,builder:re,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions/${t.subscriptionId??`<subscriptionId>`}`,pathParams:{subscriptionId:String(t.subscriptionId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.subscriptions.get(r,t.subscriptionId)),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:ae,handler:async t=>{let n={page:t.page,per_page:t.perPage,order:t.order,direction:t.direction};if(t.dryRun){l({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.queues.subscriptions.list(o,n)),{successLabel:`Loaded`})}};function $(e){return e.positional(`subscriptionId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).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([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-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 --destination-* flag is set`)}return!0})}const se={command:`update <subscriptionId>`,describe:`Update an existing event subscription`,builder:$,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions/${t.subscriptionId??`<subscriptionId>`}`,pathParams:{subscriptionId:String(t.subscriptionId??``)},bodyKind:`json`,body:{destinationQueueId:t.destinationQueueId,destinationType:t.destinationType,enabled:t.enabled,events:t.events,name:t.name,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/event_subscriptions/subscriptions/${t.subscriptionId}`,{body:e})),{successLabel:`Updated`});return}let p={};t.destinationQueueId!==void 0&&o(p,[`destination`,`queue_id`],d(t.destinationQueueId,`destinationQueueId`,`text`)),t.destinationType!==void 0&&o(p,[`destination`,`type`],d(t.destinationType,`destinationType`,`text`)),t.enabled!==void 0&&o(p,[`enabled`],t.enabled),t.events!==void 0&&o(p,[`events`],t.events),t.name!==void 0&&o(p,[`name`],d(t.name,`name`,`text`)),c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/event_subscriptions/subscriptions/${t.subscriptionId}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},ce={command:`subscriptions`,describe:`Manage queue subscriptions for event-driven message routing`,builder:e=>e.command(Z).command(ne).command(ie).command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`queueId`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`update <queueId>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:le,handler:async t=>{if(t.dryRun){l({command:`cf queues update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t.queueId??`<queueId>`}`,pathParams:{queueId:String(t.queueId??``)},bodyKind:`json`,body:{queueName:t.queueName,settingsDeliveryDelay:t.settingsDeliveryDelay,settingsDeliveryPaused:t.settingsDeliveryPaused,settingsMessageRetentionPeriod:t.settingsMessageRetentionPeriod,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.put(`/accounts/${r}/queues/${t.queueId}`,{body:e})),{successLabel:`Updated`});return}let p={};t.queueName!==void 0&&o(p,[`queue_name`],d(t.queueName,`queueName`,`text`)),t.settingsDeliveryDelay!==void 0&&o(p,[`settings`,`delivery_delay`],t.settingsDeliveryDelay),t.settingsDeliveryPaused!==void 0&&o(p,[`settings`,`delivery_paused`],t.settingsDeliveryPaused),t.settingsMessageRetentionPeriod!==void 0&&o(p,[`settings`,`message_retention_period`],t.settingsMessageRetentionPeriod),c(await u(`Updating`,async()=>n.put(`/accounts/${r}/queues/${t.queueId}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},de={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).command(ue).command(S).command(W).command(Y).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{de as default};
|
package/dist/r2-DP020Tmq.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,m as n,p as r,t as i,u as a}from"./auth-BlSmtIKd.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-DZfTxbrx.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <bucketName>`,describe:`Delete the CORS policy for a bucket.`,builder:p,handler:async n=>{let r={};if(n.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(n.cfR2Jurisdiction)),n.dryRun){l({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${n.bucketName??`<bucketName>`}/cors`,pathParams:{bucketName:String(n.bucketName??``)},bodyKind:`none`});return}let o=await i(n),s=n.local?f:await e(o);if(n.accountId=s,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>o.delete(`/accounts/${s}/r2/buckets/${n.bucketName}/cors`,{headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`})}};function h(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <bucketName>`,describe:`Get the CORS policy for a bucket.`,builder:h,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/cors`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/cors`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function te(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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:`update <bucketName>`,describe:`Set the CORS policy for a bucket.`,builder:te,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/cors`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),o=t.local?f:await e(r);if(t.accountId=o,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${o}/r2/buckets/${t.bucketName}/cors`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>r.put(`/accounts/${o}/r2/buckets/${t.bucketName}/cors`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},_={command:`cors`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(m).command(ee).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`location-hint`,{type:`string`,description:`Location of the bucket.`,choices:[`apac`,`eeur`,`enam`,`weur`,`wnam`,`oc`]}).option(`name`,{type:`string`,description:`Name of the bucket.`}).option(`storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,choices:[`Standard`,`InfrequentAccess`],default:`Standard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Creates a new R2 bucket.`,builder:v,handler:async t=>{let r={};if(t.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:{locationHint:t.locationHint,name:t.name,storageClass:t.storageClass,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/r2/buckets`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`Name of the bucket.`));let h={};t.locationHint!==void 0&&o(h,[`locationHint`],d(t.locationHint,`locationHint`,`text`)),t.name!==void 0&&o(h,[`name`],d(t.name,`name`,`text`)),t.storageClass!==void 0&&o(h,[`storageClass`],d(t.storageClass,`storageClass`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/r2/buckets`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function b(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <bucketName>`,describe:`Deletes an existing R2 bucket.`,builder:b,handler:async n=>{let r={};if(n.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(n.cfR2Jurisdiction)),n.dryRun){l({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${n.bucketName??`<bucketName>`}`,pathParams:{bucketName:String(n.bucketName??``)},bodyKind:`none`});return}let o=await i(n),s=n.local?f:await e(o);if(n.accountId=s,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>o.delete(`/accounts/${s}/r2/buckets/${n.bucketName}`,{headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`})}};function S(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`domain`,{type:`string`,description:`Name of the custom domain to be added.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the custom domain. If undefined, the domain will be enabled.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create <bucketName>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:S,handler:async t=>{let r={};if(t.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/domains/custom`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{ciphers:t.ciphers,domain:t.domain,enabled:t.enabled,minTls:t.minTls,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/r2/buckets/${t.bucketName}/domains/custom`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`});return}if(t.domain===void 0&&(t.domain=await n(`domain`,`Name of the custom domain to be added.`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};t.ciphers!==void 0&&o(h,[`ciphers`],t.ciphers),t.domain!==void 0&&o(h,[`domain`],d(t.domain,`domain`,`text`)),t.enabled!==void 0&&o(h,[`enabled`],t.enabled),t.minTls!==void 0&&o(h,[`minTLS`],d(t.minTls,`minTls`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/r2/buckets/${t.bucketName}/domains/custom`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function w(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:w,handler:async n=>{let r={};if(n.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(n.cfR2Jurisdiction)),n.dryRun){l({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${n.bucketName??`<bucketName>`}/domains/custom/${n.domain??`<domain>`}`,pathParams:{bucketName:String(n.bucketName??``),domain:String(n.domain??``)},bodyKind:`none`});return}let o=await i(n),s=n.local?f:await e(o);if(n.accountId=s,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}c(await u(`Deleting`,async()=>o.delete(`/accounts/${s}/r2/buckets/${n.bucketName}/domains/custom/${n.domain}`,{headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`})}};function E(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:E,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/domains/custom/${t.domain??`<domain>`}`,pathParams:{bucketName:String(t.bucketName??``),domain:String(t.domain??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/domains/custom/${t.domain}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function O(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:O,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/domains/custom`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/domains/custom`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function A(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the specified custom domain.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:A,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/domains/custom/${t.domain??`<domain>`}`,pathParams:{bucketName:String(t.bucketName??``),domain:String(t.domain??``)},bodyKind:`json`,body:{ciphers:t.ciphers,enabled:t.enabled,minTls:t.minTls,body:t.body}});return}let r=await i(t),p=t.local?f:await e(r);if(t.accountId=p,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${p}/r2/buckets/${t.bucketName}/domains/custom/${t.domain}`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}let m={};t.ciphers!==void 0&&o(m,[`ciphers`],t.ciphers),t.enabled!==void 0&&o(m,[`enabled`],t.enabled),t.minTls!==void 0&&o(m,[`minTLS`],d(t.minTls,`minTls`,`text`)),c(await u(`Updating`,async()=>r.put(`/accounts/${p}/r2/buckets/${t.bucketName}/domains/custom/${t.domain}`,{body:Object.keys(m).length>0?m:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},M={command:`custom`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:N,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/domains/managed`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/domains/managed`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function F(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the r2.dev domain.`}).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 I={command:`update <bucketName>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:F,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/domains/managed`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{enabled:t.enabled,body:t.body}});return}let r=await i(t),d=t.local?f:await e(r);if(t.accountId=d,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${d}/r2/buckets/${t.bucketName}/domains/managed`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let p={};t.enabled!==void 0&&o(p,[`enabled`],t.enabled),c(await u(`Updating`,async()=>r.put(`/accounts/${d}/r2/buckets/${t.bucketName}/domains/managed`,{body:Object.keys(p).length>0?p:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},L={command:`managed`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(M).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`The cf-r2-storage-class header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`edit <bucketName>`,describe:`Updates properties of an existing R2 bucket.`,builder:z,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.cfR2StorageClass!==void 0&&(n[`cf-r2-storage-class`]=String(t.cfR2StorageClass)),t.dryRun){l({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Updating`,async()=>r.patch(`/accounts/${o}/r2/buckets/${t.bucketName}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}};function V(e){return e.positional(`queueId`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rule-ids`,{type:`string`,array:!0,description:`Array of rule ids to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`delete <queueId>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:V,handler:async n=>{let r={};if(n.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(n.cfR2Jurisdiction)),n.dryRun){l({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_notifications/r2/${n.bucketName??`<bucketName>`}/configuration/queues/${n.queueId??`<queueId>`}`,pathParams:{queueId:String(n.queueId??``),bucketName:String(n.bucketName??``)},bodyKind:`json`,body:{ruleIds:n.ruleIds,body:n.body}});return}let d=await i(n),p=n.local?f:await e(d);if(n.accountId=p,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>d.delete(`/accounts/${p}/event_notifications/r2/${n.bucketName}/configuration/queues/${n.queueId}`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`});return}let m={};n.ruleIds!==void 0&&o(m,[`ruleIds`],n.ruleIds),c(await u(`Deleting`,async()=>d.delete(`/accounts/${p}/event_notifications/r2/${n.bucketName}/configuration/queues/${n.queueId}`,{body:Object.keys(m).length>0?m:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`})}};function U(e){return e.positional(`queueId`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`The bucket jurisdiction.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <queueId>`,describe:`Get a single event notification rule.`,builder:U,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_notifications/r2/${t.bucketName??`<bucketName>`}/configuration/queues/${t.queueId??`<queueId>`}`,pathParams:{queueId:String(t.queueId??``),bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/event_notifications/r2/${t.bucketName}/configuration/queues/${t.queueId}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function G(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List all event notification rules for a bucket.`,builder:G,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_notifications/r2/${t.bucketName??`<bucketName>`}/configuration`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/event_notifications/r2/${t.bucketName}/configuration`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function q(e){return e.positional(`queueId`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`update <queueId>`,describe:`Create event notification rule.`,builder:q,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_notifications/r2/${t.bucketName??`<bucketName>`}/configuration/queues/${t.queueId??`<queueId>`}`,pathParams:{queueId:String(t.queueId??``),bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),o=t.local?f:await e(r);if(t.accountId=o,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${o}/event_notifications/r2/${t.bucketName}/configuration/queues/${t.queueId}`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>r.put(`/accounts/${o}/event_notifications/r2/${t.bucketName}/configuration/queues/${t.queueId}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},Y={command:`event-notifications`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(H).command(W).command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <bucketName>`,describe:`Gets properties of an existing R2 bucket.`,builder:X,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <bucketName>`,describe:`Get object lifecycle rules for a bucket.`,builder:Q,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/lifecycle`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/lifecycle`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function re(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 ie={command:`update <bucketName>`,describe:`Set the object lifecycle rules for a bucket.`,builder:re,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/lifecycle`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),o=t.local?f:await e(r);if(t.accountId=o,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${o}/r2/buckets/${t.bucketName}/lifecycle`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>r.put(`/accounts/${o}/r2/buckets/${t.bucketName}/lifecycle`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},ae={command:`lifecycle`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.option(`name-contains`,{type:`string`,description:`Bucket names to filter by. Only buckets with this phrase in their name will be returned.`}).option(`start-after`,{type:`string`,description:`Bucket name to start searching after. Buckets are ordered lexicographically.`}).option(`per-page`,{type:`number`,description:`Maximum number of buckets to return in a single call.`}).option(`order`,{type:`string`,description:`Field to order buckets by.`,choices:[`name`]}).option(`direction`,{type:`string`,description:`Direction to order buckets.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Pagination cursor received during the last List Buckets call. R2 buckets are paginated using cursors instead of page numbers.`}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`Lists all R2 buckets on your account.`,builder:oe,handler:async t=>{let n={name_contains:t.nameContains,start_after:t.startAfter,per_page:t.perPage,order:t.order,direction:t.direction,cursor:t.cursor},r={};if(t.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets`,pathParams:{},query:n,bodyKind:`none`});return}let o=await i(t),s=t.local?f:await e(o);t.accountId=s,c(await u(`Loading`,async()=>o.get(`/accounts/${s}/r2/buckets`,{query:n,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Loaded`})}};function ce(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`get <bucketName>`,describe:`Get the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`,builder:ce,handler:async t=>{if(t.dryRun){l({command:`cf r2 buckets local-uploads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/local-uploads`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.r2.buckets.localUploads.get(t.bucketName,r)),{successLabel:`Loaded`})}};function ue(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable local uploads for this bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`update <bucketName>`,describe:`Set the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`,builder:ue,handler:async t=>{if(t.dryRun){l({command:`cf r2 buckets local-uploads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/local-uploads`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{enabled:t.enabled,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.put(`/accounts/${r}/r2/buckets/${t.bucketName}/local-uploads`,{body:e})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d={};t.enabled!==void 0&&o(d,[`enabled`],t.enabled),c(await u(`Updating`,async()=>n.put(`/accounts/${r}/r2/buckets/${t.bucketName}/local-uploads`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},fe={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(le).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <bucketName>`,describe:`Get lock rules for a bucket.`,builder:pe,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/lock`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/lock`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function he(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ge={command:`update <bucketName>`,describe:`Set lock rules for a bucket.`,builder:he,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/lock`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),o=t.local?f:await e(r);if(t.accountId=o,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${o}/r2/buckets/${t.bucketName}/lock`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>r.put(`/accounts/${o}/r2/buckets/${t.bucketName}/lock`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},_e={command:`locks`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`list`,describe:`Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.`,builder:ve,handler:async t=>{if(t.dryRun){l({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.r2.buckets.metrics.list(r)),{successLabel:`Loaded`})}},be={command:`metrics`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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:`delete <bucketName>`,describe:`Disables Sippy on this bucket.`,builder:xe,handler:async n=>{let r={};if(n.cfR2Jurisdiction!==void 0&&(r[`cf-r2-jurisdiction`]=String(n.cfR2Jurisdiction)),n.dryRun){l({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${n.bucketName??`<bucketName>`}/sippy`,pathParams:{bucketName:String(n.bucketName??``)},bodyKind:`none`});return}let o=await i(n),s=n.local?f:await e(o);if(n.accountId=s,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}c(await u(`Deleting`,async()=>o.delete(`/accounts/${s}/r2/buckets/${n.bucketName}/sippy`,{headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Deleted`})}};function Ce(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get <bucketName>`,describe:`Gets configuration for Sippy for an existing R2 bucket.`,builder:Ce,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/sippy`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.get(`/accounts/${o}/r2/buckets/${t.bucketName}/sippy`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function Te(e){return e.positional(`bucketName`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`destination-access-key-id`,{type:`string`,description:`ID of a Cloudflare API token.
|
|
8
|
-
This is the value labelled "Access Key ID" when creating an API.
|
|
9
|
-
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
10
|
-
|
|
11
|
-
Sippy will use this token when writing objects to R2, so it is
|
|
12
|
-
best to scope this token to the bucket you're enabling Sippy for.
|
|
13
|
-
`}).option(`destination-provider`,{type:`string`,description:`The destination.provider field`,choices:[`r2`]}).option(`destination-secret-access-key`,{type:`string`,description:`Value of a Cloudflare API token.
|
|
14
|
-
This is the value labelled "Secret Access Key" when creating an API.
|
|
15
|
-
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
16
|
-
|
|
17
|
-
Sippy will use this token when writing objects to R2, so it is
|
|
18
|
-
best to scope this token to the bucket you're enabling Sippy for.
|
|
19
|
-
`}).option(`source-access-key-id`,{type:`string`,description:`Access Key ID of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-bucket`,{type:`string`,description:`Name of the AWS S3 bucket.`}).option(`source-provider`,{type:`string`,description:`The source.provider field`,choices:[`aws`,`gcs`,`s3`]}).option(`source-region`,{type:`string`,description:`Name of the AWS availability zone.`}).option(`source-secret-access-key`,{type:`string`,description:`Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-client-email`,{type:`string`,description:`Client email of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-private-key`,{type:`string`,description:`Private Key of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-bucket-url`,{type:`string`,description:`URL to the S3-compatible API of the bucket.`}).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(`source-bucket`,[`source-bucket-url`]).conflicts(`source-region`,[`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-client-email`,[`source-region`,`source-bucket-url`]).conflicts(`source-private-key`,[`source-region`,`source-bucket-url`]).conflicts(`source-bucket-url`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`])}const Ee={command:`update <bucketName>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Te,handler:async t=>{let n={};if(t.cfR2Jurisdiction!==void 0&&(n[`cf-r2-jurisdiction`]=String(t.cfR2Jurisdiction)),t.dryRun){l({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/buckets/${t.bucketName??`<bucketName>`}/sippy`,pathParams:{bucketName:String(t.bucketName??``)},bodyKind:`json`,body:{destinationAccessKeyId:t.destinationAccessKeyId,destinationProvider:t.destinationProvider,destinationSecretAccessKey:t.destinationSecretAccessKey,sourceAccessKeyId:t.sourceAccessKeyId,sourceBucket:t.sourceBucket,sourceProvider:t.sourceProvider,sourceRegion:t.sourceRegion,sourceSecretAccessKey:t.sourceSecretAccessKey,sourceClientEmail:t.sourceClientEmail,sourcePrivateKey:t.sourcePrivateKey,sourceBucketUrl:t.sourceBucketUrl,body:t.body}});return}let r=await i(t),p=t.local?f:await e(r);if(t.accountId=p,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${p}/r2/buckets/${t.bucketName}/sippy`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}let m={};t.destinationAccessKeyId!==void 0&&o(m,[`destination`,`accessKeyId`],d(t.destinationAccessKeyId,`destinationAccessKeyId`,`text`)),t.destinationProvider!==void 0&&o(m,[`destination`,`provider`],d(t.destinationProvider,`destinationProvider`,`text`)),t.destinationSecretAccessKey!==void 0&&o(m,[`destination`,`secretAccessKey`],d(t.destinationSecretAccessKey,`destinationSecretAccessKey`,`text`)),t.sourceAccessKeyId!==void 0&&o(m,[`source`,`accessKeyId`],d(t.sourceAccessKeyId,`sourceAccessKeyId`,`text`)),t.sourceBucket!==void 0&&o(m,[`source`,`bucket`],d(t.sourceBucket,`sourceBucket`,`text`)),t.sourceProvider!==void 0&&o(m,[`source`,`provider`],d(t.sourceProvider,`sourceProvider`,`text`)),t.sourceRegion!==void 0&&o(m,[`source`,`region`],d(t.sourceRegion,`sourceRegion`,`text`)),t.sourceSecretAccessKey!==void 0&&o(m,[`source`,`secretAccessKey`],d(t.sourceSecretAccessKey,`sourceSecretAccessKey`,`text`)),t.sourceClientEmail!==void 0&&o(m,[`source`,`clientEmail`],d(t.sourceClientEmail,`sourceClientEmail`,`text`)),t.sourcePrivateKey!==void 0&&o(m,[`source`,`privateKey`],d(t.sourcePrivateKey,`sourcePrivateKey`,`text`)),t.sourceBucketUrl!==void 0&&o(m,[`source`,`bucketUrl`],d(t.sourceBucketUrl,`sourceBucketUrl`,`text`)),c(await u(`Updating`,async()=>r.put(`/accounts/${p}/r2/buckets/${t.bucketName}/sippy`,{body:Object.keys(m).length>0?m:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},De={command:`sippy`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(Se).command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(y).command(x).command(B).command(Z).command(se).command(_).command(R).command(Y).command(ae).command(fe).command(_e).command(be).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`endpoint`,{type:`string`,description:`The endpoint field`}).option(`keys`,{type:`string`,array:!0,description:`The keys field`}).option(`path-prefix`,{type:`string`,description:`The pathPrefix field`}).option(`region`,{type:`string`,description:`The region field`}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`secret-client-email`,{type:`string`,description:`The secret.clientEmail field`}).option(`secret-private-key`,{type:`string`,description:`The secret.privateKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`s3`,`gcs`,`r2`]}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).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(`endpoint`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`region`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`secret-access-key-id`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-secret-access-key`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-client-email`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`secret-private-key`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`jurisdiction`,[`endpoint`,`region`,`secret-client-email`,`secret-private-key`])}const Ae={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:ke,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:{bucket:t.bucket,endpoint:t.endpoint,keys:t.keys,pathPrefix:t.pathPrefix,region:t.region,secretAccessKeyId:t.secretAccessKeyId,secretSecretAccessKey:t.secretSecretAccessKey,secretClientEmail:t.secretClientEmail,secretPrivateKey:t.secretPrivateKey,vendor:t.vendor,jurisdiction:t.jurisdiction,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Updating`,async()=>p.put(`/accounts/${m}/slurper/source/connectivity-precheck`,{body:e})),{successLabel:`Updated`});return}t.bucket===void 0&&(t.bucket=await n(`bucket`,``)),t.vendor===void 0&&(t.vendor=await r(`vendor`,``,[`s3`,`gcs`,`r2`]));let h={};t.bucket!==void 0&&o(h,[`bucket`],d(t.bucket,`bucket`,`text`)),t.endpoint!==void 0&&o(h,[`endpoint`],d(t.endpoint,`endpoint`,`text`)),t.keys!==void 0&&o(h,[`keys`],t.keys),t.pathPrefix!==void 0&&o(h,[`pathPrefix`],d(t.pathPrefix,`pathPrefix`,`text`)),t.region!==void 0&&o(h,[`region`],d(t.region,`region`,`text`)),t.secretAccessKeyId!==void 0&&o(h,[`secret`,`accessKeyId`],d(t.secretAccessKeyId,`secretAccessKeyId`,`text`)),t.secretSecretAccessKey!==void 0&&o(h,[`secret`,`secretAccessKey`],d(t.secretSecretAccessKey,`secretSecretAccessKey`,`text`)),t.secretClientEmail!==void 0&&o(h,[`secret`,`clientEmail`],d(t.secretClientEmail,`secretClientEmail`,`text`)),t.secretPrivateKey!==void 0&&o(h,[`secret`,`privateKey`],d(t.secretPrivateKey,`secretPrivateKey`,`text`)),t.vendor!==void 0&&o(h,[`vendor`],d(t.vendor,`vendor`,`text`)),t.jurisdiction!==void 0&&o(h,[`jurisdiction`],d(t.jurisdiction,`jurisdiction`,`text`)),c(await u(`Updating`,async()=>p.put(`/accounts/${m}/slurper/source/connectivity-precheck`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`})}};function je(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`r2`]}).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 Me={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:je,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:{bucket:t.bucket,jurisdiction:t.jurisdiction,secretAccessKeyId:t.secretAccessKeyId,secretSecretAccessKey:t.secretSecretAccessKey,vendor:t.vendor,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Updating`,async()=>p.put(`/accounts/${m}/slurper/target/connectivity-precheck`,{body:e})),{successLabel:`Updated`});return}t.bucket===void 0&&(t.bucket=await n(`bucket`,``)),t.secretAccessKeyId===void 0&&(t.secretAccessKeyId=await n(`secret-access-key-id`,``)),t.secretSecretAccessKey===void 0&&(t.secretSecretAccessKey=await n(`secret-secret-access-key`,``,{kind:`secret`})),t.vendor===void 0&&(t.vendor=await r(`vendor`,``,[`r2`]));let h={};t.bucket!==void 0&&o(h,[`bucket`],d(t.bucket,`bucket`,`text`)),t.jurisdiction!==void 0&&o(h,[`jurisdiction`],d(t.jurisdiction,`jurisdiction`,`text`)),t.secretAccessKeyId!==void 0&&o(h,[`secret`,`accessKeyId`],d(t.secretAccessKeyId,`secretAccessKeyId`,`text`)),t.secretSecretAccessKey!==void 0&&o(h,[`secret`,`secretAccessKey`],d(t.secretSecretAccessKey,`secretSecretAccessKey`,`text`)),t.vendor!==void 0&&o(h,[`vendor`],d(t.vendor,`vendor`,`text`)),c(await u(`Updating`,async()=>p.put(`/accounts/${m}/slurper/target/connectivity-precheck`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`})}},Ne={command:`connectivity-precheck`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(Ae).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Fe={command:`abort-all`,describe:`Cancels all running R2 Super Slurper migration jobs for the account. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`,builder:Pe,handler:async n=>{if(n.dryRun){l({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
|
|
20
|
-
`);return}c(await u(`Deleting`,async()=>r.r2.superSlurper.jobs.abortAll(o)),{successLabel:`Deleted`})}};function Ie(e){return e.positional(`jobId`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Le={command:`abort <jobId>`,describe:`Cancels a specific R2 Super Slurper migration job. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`,builder:Ie,handler:async n=>{if(n.dryRun){l({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/${n.jobId??`<jobId>`}/abort`,pathParams:{jobId:String(n.jobId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?f:await e(r);if(n.accountId=o,!await t({force:!!n.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
|
|
21
|
-
`);return}c(await u(`Deleting`,async()=>r.r2.superSlurper.jobs.abort(o,n.jobId)),{successLabel:`Deleted`})}};function Re(e){return e.option(`overwrite`,{type:`boolean`,description:`The overwrite field`,default:!0}).option(`source-bucket`,{type:`string`,description:`The source.bucket field`}).option(`source-endpoint`,{type:`string`,description:`The source.endpoint field`}).option(`source-keys`,{type:`string`,array:!0,description:`The source.keys field`}).option(`source-path-prefix`,{type:`string`,description:`The source.pathPrefix field`}).option(`source-region`,{type:`string`,description:`The source.region field`}).option(`source-secret-access-key-id`,{type:`string`,description:`The source.secret.accessKeyId field`}).option(`source-secret-secret-access-key`,{type:`string`,description:`The source.secret.secretAccessKey field`}).option(`source-secret-client-email`,{type:`string`,description:`The source.secret.clientEmail field`}).option(`source-secret-private-key`,{type:`string`,description:`The source.secret.privateKey field`}).option(`source-vendor`,{type:`string`,description:`The source.vendor field`,choices:[`s3`,`gcs`,`r2`]}).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).option(`target-secret-access-key-id`,{type:`string`,description:`The target.secret.accessKeyId field`}).option(`target-secret-secret-access-key`,{type:`string`,description:`The target.secret.secretAccessKey field`}).option(`target-vendor`,{type:`string`,description:`The target.vendor field`,choices:[`r2`]}).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(`source-endpoint`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).check(e=>{if([`source-bucket`,`source-endpoint`,`source-keys`,`source-path-prefix`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-secret-client-email`,`source-secret-private-key`,`source-vendor`,`source-jurisdiction`].some(t=>e[t]!==void 0)){let t=[`source-bucket`,`source-vendor`].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}).check(e=>{if([`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0)){let t=[`target-bucket`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].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 --target-* flag is set`)}return!0})}const ze={command:`create`,describe:`Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`,builder:Re,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:{overwrite:t.overwrite,sourceBucket:t.sourceBucket,sourceEndpoint:t.sourceEndpoint,sourceKeys:t.sourceKeys,sourcePathPrefix:t.sourcePathPrefix,sourceRegion:t.sourceRegion,sourceSecretAccessKeyId:t.sourceSecretAccessKeyId,sourceSecretSecretAccessKey:t.sourceSecretSecretAccessKey,sourceSecretClientEmail:t.sourceSecretClientEmail,sourceSecretPrivateKey:t.sourceSecretPrivateKey,sourceVendor:t.sourceVendor,sourceJurisdiction:t.sourceJurisdiction,targetBucket:t.targetBucket,targetJurisdiction:t.targetJurisdiction,targetSecretAccessKeyId:t.targetSecretAccessKeyId,targetSecretSecretAccessKey:t.targetSecretSecretAccessKey,targetVendor:t.targetVendor,body:t.body}});return}let n=await i(t),r=t.local?f:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/slurper/jobs`,{body:e})),{successLabel:`Created`});return}let p={};t.overwrite!==void 0&&o(p,[`overwrite`],t.overwrite),t.sourceBucket!==void 0&&o(p,[`source`,`bucket`],d(t.sourceBucket,`sourceBucket`,`text`)),t.sourceEndpoint!==void 0&&o(p,[`source`,`endpoint`],d(t.sourceEndpoint,`sourceEndpoint`,`text`)),t.sourceKeys!==void 0&&o(p,[`source`,`keys`],t.sourceKeys),t.sourcePathPrefix!==void 0&&o(p,[`source`,`pathPrefix`],d(t.sourcePathPrefix,`sourcePathPrefix`,`text`)),t.sourceRegion!==void 0&&o(p,[`source`,`region`],d(t.sourceRegion,`sourceRegion`,`text`)),t.sourceSecretAccessKeyId!==void 0&&o(p,[`source`,`secret`,`accessKeyId`],d(t.sourceSecretAccessKeyId,`sourceSecretAccessKeyId`,`text`)),t.sourceSecretSecretAccessKey!==void 0&&o(p,[`source`,`secret`,`secretAccessKey`],d(t.sourceSecretSecretAccessKey,`sourceSecretSecretAccessKey`,`text`)),t.sourceSecretClientEmail!==void 0&&o(p,[`source`,`secret`,`clientEmail`],d(t.sourceSecretClientEmail,`sourceSecretClientEmail`,`text`)),t.sourceSecretPrivateKey!==void 0&&o(p,[`source`,`secret`,`privateKey`],d(t.sourceSecretPrivateKey,`sourceSecretPrivateKey`,`text`)),t.sourceVendor!==void 0&&o(p,[`source`,`vendor`],d(t.sourceVendor,`sourceVendor`,`text`)),t.sourceJurisdiction!==void 0&&o(p,[`source`,`jurisdiction`],d(t.sourceJurisdiction,`sourceJurisdiction`,`text`)),t.targetBucket!==void 0&&o(p,[`target`,`bucket`],d(t.targetBucket,`targetBucket`,`text`)),t.targetJurisdiction!==void 0&&o(p,[`target`,`jurisdiction`],d(t.targetJurisdiction,`targetJurisdiction`,`text`)),t.targetSecretAccessKeyId!==void 0&&o(p,[`target`,`secret`,`accessKeyId`],d(t.targetSecretAccessKeyId,`targetSecretAccessKeyId`,`text`)),t.targetSecretSecretAccessKey!==void 0&&o(p,[`target`,`secret`,`secretAccessKey`],d(t.targetSecretSecretAccessKey,`targetSecretSecretAccessKey`,`text`)),t.targetVendor!==void 0&&o(p,[`target`,`vendor`],d(t.targetVendor,`targetVendor`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/slurper/jobs`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function Be(e){return e.positional(`jobId`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`get <jobId>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:Be,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/${t.jobId??`<jobId>`}`,pathParams:{jobId:String(t.jobId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.r2.superSlurper.jobs.get(r,t.jobId)),{successLabel:`Loaded`})}};function He(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:He,handler:async t=>{let n={limit:t.limit,offset:t.offset};if(t.dryRun){l({command:`cf r2 super-slurper jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs`,pathParams:{},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.r2.superSlurper.jobs.list(o,n)),{successLabel:`Loaded`})}};function We(e){return e.option(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:We,handler:async t=>{let n={limit:t.limit,offset:t.offset};if(t.dryRun){l({command:`cf r2 super-slurper jobs logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/${t.jobId??`<jobId>`}/logs`,pathParams:{jobId:String(t.jobId??``)},query:n,bodyKind:`none`});return}let r=await i(t),o=t.local?f:await e(r);t.accountId=o,c(await u(`Loading`,async()=>r.r2.superSlurper.jobs.logs.list(o,t.jobId,n)),{successLabel:`Loaded`})}},Ke={command:`logs`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.positional(`jobId`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`pause <jobId>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:qe,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper jobs pause`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/${t.jobId??`<jobId>`}/pause`,pathParams:{jobId:String(t.jobId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Updating`,async()=>n.r2.superSlurper.jobs.pause(r,t.jobId)),{successLabel:`Updated`})}};function $(e){return e.positional(`jobId`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`progress <jobId>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:$,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper jobs progress`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/${t.jobId??`<jobId>`}/progress`,pathParams:{jobId:String(t.jobId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.r2.superSlurper.jobs.progress(r,t.jobId)),{successLabel:`Loaded`})}};function Xe(e){return e.positional(`jobId`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`resume <jobId>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:Xe,handler:async t=>{if(t.dryRun){l({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/slurper/jobs/${t.jobId??`<jobId>`}/resume`,pathParams:{jobId:String(t.jobId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?f:await e(n);t.accountId=r,c(await u(`Updating`,async()=>n.r2.superSlurper.jobs.resume(r,t.jobId)),{successLabel:`Updated`})}},Qe={command:`jobs`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(Le).command(Fe).command(ze).command(Ve).command(Ue).command(Je).command(Ye).command(Ze).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$e={command:`super-slurper`,describe:`Operations for super-slurper`,builder:e=>e.command(Ne).command(Qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function et(e){return e.option(`bucket`,{type:`string`,description:`Name of the R2 bucket.`}).option(`objects`,{type:`string`,array:!0,description:`Optional object paths to scope the credentials to.`}).option(`parent-access-key-id`,{type:`string`,description:`The parent access key id to use for signing.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`How long the credentials will live for in seconds.`,default:900}).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 tt={command:`create`,describe:`Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`,builder:et,handler:async t=>{if(t.dryRun){l({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:{bucket:t.bucket,objects:t.objects,parentAccessKeyId:t.parentAccessKeyId,permission:t.permission,prefixes:t.prefixes,ttlSeconds:t.ttlSeconds,body:t.body}});return}let p=await i(t),m=t.local?f:await e(p);if(t.accountId=m,t.body){let e=s(t.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/r2/temp-access-credentials`,{body:e})),{successLabel:`Created`});return}if(t.bucket===void 0&&(t.bucket=await n(`bucket`,`Name of the R2 bucket.`)),t.parentAccessKeyId===void 0&&(t.parentAccessKeyId=await n(`parent-access-key-id`,`The parent access key id to use for signing.`)),t.permission===void 0&&(t.permission=await r(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),t.ttlSeconds===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let h={};t.bucket!==void 0&&o(h,[`bucket`],d(t.bucket,`bucket`,`text`)),t.objects!==void 0&&o(h,[`objects`],t.objects),t.parentAccessKeyId!==void 0&&o(h,[`parentAccessKeyId`],d(t.parentAccessKeyId,`parentAccessKeyId`,`text`)),t.permission!==void 0&&o(h,[`permission`],d(t.permission,`permission`,`text`)),t.prefixes!==void 0&&o(h,[`prefixes`],t.prefixes),t.ttlSeconds!==void 0&&o(h,[`ttlSeconds`],t.ttlSeconds),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/r2/temp-access-credentials`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}},nt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(Oe).command($e).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{rt as default};
|