cf 0.3.0 → 0.4.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 +26 -21
- package/dist/_meta/commands.json +7696 -18100
- package/dist/_meta/schemas.json +6411 -13925
- package/dist/{abuse-reports-dMIfUJ8v.mjs → abuse-reports-Dy76QPNP.mjs} +1 -1
- package/dist/{accounts-Kx1epdA1.mjs → accounts-CjtZ8x1z.mjs} +2 -2
- package/dist/{acm-Utu252kC.mjs → acm-C2lYIWs1.mjs} +1 -1
- package/dist/{addressing-CBq7Z7Vq.mjs → addressing-CHFK6uxW.mjs} +1 -1
- package/dist/{agent-context-BGTU299M.mjs → agent-context-CgGCT0xU.mjs} +1 -1
- package/dist/{ai-DOOKLPkG.mjs → ai-DS3i-I1a.mjs} +1 -1
- package/dist/{ai-gateway-Cj1T3avF.mjs → ai-gateway-RIsegO2x.mjs} +1 -1
- package/dist/ai-search-Dcj4BauG.mjs +7 -0
- package/dist/{ai_gateway-C3fH22C0.mjs → ai_gateway-w7YwfcPE.mjs} +1 -1
- package/dist/{alerting-CqmEIaKn.mjs → alerting-Bk85NNf5.mjs} +1 -1
- package/dist/{analytics-Dv-X8x7D.mjs → analytics-CkhhhZWZ.mjs} +1 -1
- package/dist/{analytics_engine-DdXVR8z2.mjs → analytics_engine-B7qgDJCA.mjs} +1 -1
- package/dist/{api-gateway-CNv0IHTU.mjs → api-gateway-CWdR4Ne7.mjs} +1 -1
- package/dist/{argo-CX_A4kcn.mjs → argo-DnJRVnGX.mjs} +1 -1
- package/dist/artifacts-BVWKiJUl.mjs +4 -0
- package/dist/{audit-logs-BfBf3oo-.mjs → audit-logs-DjTstbzL.mjs} +1 -1
- package/dist/auth-BqDOIrKX.mjs +150 -0
- package/dist/auth-DKkSwnxh.mjs +5 -0
- package/dist/billing-3rEqF83h.mjs +2 -0
- package/dist/{bot-management-CFvtVx62.mjs → bot-management-CJxD1pqi.mjs} +1 -1
- package/dist/{botnet-feed-B-M4Yu0W.mjs → botnet-feed-MG91D7BR.mjs} +1 -1
- package/dist/{brand-protection-D05Eg-_6.mjs → brand-protection-CK7gJi06.mjs} +1 -1
- package/dist/browser-rendering-Rae0AUt0.mjs +4 -0
- package/dist/{build-DYkGW4dh.mjs → build-BE4o4imx.mjs} +131 -131
- package/dist/{cache-DsoW6Xwv.mjs → cache-B7pRbpTy.mjs} +1 -1
- package/dist/{calls-CZbO7TyR.mjs → calls-DXRWsZ8n.mjs} +3 -3
- package/dist/{certificate-authorities-D2yr7_3t.mjs → certificate-authorities-BR3gXBLs.mjs} +1 -1
- package/dist/chunk-6IEM75FG-U3L9fKgi.mjs +2 -0
- package/dist/{client-certificates-MJcDsTId.mjs → client-certificates-B0ebLJdk.mjs} +1 -1
- package/dist/{cloud-connector-DWOrN2eM.mjs → cloud-connector-BOjaggJk.mjs} +1 -1
- package/dist/{cloudforce-one-2Bhz8YdW.mjs → cloudforce-one-B6HYfk5Z.mjs} +1 -1
- package/dist/{completions-BwRpZQVn.mjs → completions-D_9WsLG7.mjs} +1 -1
- package/dist/config-7CBz8Xm0.mjs +2 -0
- package/dist/{connectivity-BX8C7tvK.mjs → connectivity-welFvZ7X.mjs} +1 -1
- package/dist/connector-interrupts-DTV3F-50.mjs +2 -0
- package/dist/connector-telemetry-events-kDqb_AGm.mjs +2 -0
- package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +2 -0
- package/dist/connectors-3vjrdFLB.mjs +3 -0
- package/dist/content-scanning-CnW2A0pv.mjs +4 -0
- package/dist/{context-DGlHRGWM.mjs → context-CONbNKO-.mjs} +1 -1
- package/dist/{custom-certificates-aAiEguR7.mjs → custom-certificates-CnYh6Yi-.mjs} +1 -1
- package/dist/{custom-hostnames-AG5yBHIi.mjs → custom-hostnames-C2upqZso.mjs} +1 -1
- package/dist/{custom-nameservers-D1DtlRue.mjs → custom-nameservers-BGkAD_PZ.mjs} +1 -1
- package/dist/{custom-pages-DQCi2plU.mjs → custom-pages-5fCSP8in.mjs} +1 -1
- package/dist/{d1-DbnYhw45.mjs → d1-CyiRbZZn.mjs} +1 -1
- package/dist/data-security-Casx4OS_.mjs +6 -0
- package/dist/{dcv-delegation-CHspSzTI.mjs → dcv-delegation-DVYO10oA.mjs} +1 -1
- package/dist/{deploy-CQial3kN.mjs → deploy-KBRFIatG.mjs} +1 -1
- package/dist/{dev-B38LfCTl.mjs → dev-pPazzZvt.mjs} +1 -1
- package/dist/{diagnostics-BJQGjVJn.mjs → diagnostics-BqYDoDfw.mjs} +1 -1
- package/dist/{dispatch-namespaces-DmHvoBOg.mjs → dispatch-namespaces-Cz2rajnP.mjs} +1 -1
- package/dist/{dist-AIcZFk0U.mjs → dist-DA54ZQu0.mjs} +7 -7
- package/dist/dist-DpDjsWWn.mjs +306 -0
- package/dist/{dns-VMhQSr5n.mjs → dns-62t95Xif.mjs} +1 -1
- package/dist/{dns-firewall-B4DVXFBQ.mjs → dns-firewall-Coy8d47t.mjs} +1 -1
- package/dist/{durable-objects-CTboySEo.mjs → durable-objects-BSuRERkw.mjs} +1 -1
- package/dist/{email-routing-tIR2SFu-.mjs → email-routing-BDUYYeV3.mjs} +1 -1
- package/dist/{email-security-Ca1id3rZ.mjs → email-security-ChHA6eqQ.mjs} +1 -1
- package/dist/{email-sending-DwWKc5jC.mjs → email-sending-CVrRqn6S.mjs} +1 -1
- package/dist/{filters-A4dg_a68.mjs → filters-qJpU9uAS.mjs} +1 -1
- package/dist/{firewall-DWPQgYd9.mjs → firewall-C3DDwfwh.mjs} +1 -1
- package/dist/{fraud-BMkSsJGU.mjs → fraud-DY3YXFVf.mjs} +1 -1
- package/dist/{google-tag-gateway-BGD49nRC.mjs → google-tag-gateway-B00MHDfB.mjs} +1 -1
- package/dist/{healthchecks-CtIfrFql.mjs → healthchecks-Drvb79v0.mjs} +1 -1
- package/dist/{hostnames-BiomxukN.mjs → hostnames-BdAQo1Mr.mjs} +1 -1
- package/dist/{hyperdrive-Da104VaQ.mjs → hyperdrive-99OJV9nl.mjs} +1 -1
- package/dist/{iam-BIGKo0WW.mjs → iam-BRbpg3lN.mjs} +1 -1
- package/dist/images-D1jI3r3O.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-CY6_79v8.mjs → intel-C3ajLpXd.mjs} +1 -1
- package/dist/{ips-K4bzaGqd.mjs → ips-B6JETVOY.mjs} +1 -1
- package/dist/{keyless-certificates-CZC-L8gM.mjs → keyless-certificates-C4MZ4xnf.mjs} +1 -1
- package/dist/{kv-8o27w_pY.mjs → kv-CSWoD9ks.mjs} +1 -1
- package/dist/{leaked-credential-checks-qLzRyu85.mjs → leaked-credential-checks-Dgs2oKm9.mjs} +2 -2
- package/dist/{load-balancers-DtG8nj25.mjs → load-balancers-Du1tNuUt.mjs} +1 -1
- package/dist/{logpush-4L0njy1d.mjs → logpush-SuJyO-uX.mjs} +1 -1
- package/dist/{logs-B_Yp95hv.mjs → logs-DcDNRPRl.mjs} +1 -1
- package/dist/{magic-cloud-networking-CSOM3EM-.mjs → magic-cloud-networking-D-T0RCvi.mjs} +1 -1
- package/dist/{magic-network-monitoring-BnwvM4-I.mjs → magic-network-monitoring-CqtvOePQ.mjs} +1 -1
- package/dist/{magic-transit-CXDyvhxq.mjs → magic-transit-BTbkhBtF.mjs} +32 -33
- package/dist/{managed-transforms-D15yVbZx.mjs → managed-transforms-CfUBSz9p.mjs} +1 -1
- package/dist/{mtls-certificates-D8k0AXWK.mjs → mtls-certificates-Cf1O8c2E.mjs} +1 -1
- package/dist/{network-interconnects-rrr7red3.mjs → network-interconnects-DsiNytOU.mjs} +1 -1
- package/dist/{observability-DWvpqnQJ.mjs → observability-CLqZ7OSi.mjs} +1 -1
- package/dist/open-YWOUIZ5Y-BpqIuBsR.mjs +4 -0
- package/dist/{organizations-T77D50Sq.mjs → organizations-aRi1bhFC.mjs} +2 -2
- package/dist/{origin-ca-certificates-DXIvD8H5.mjs → origin-ca-certificates-BB4H89a_.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-C8oOczyV.mjs → origin-post-quantum-encryption-DurP3PXG.mjs} +1 -1
- package/dist/{origin-tls-client-auth-CaVW1Ztp.mjs → origin-tls-client-auth-CnQNy9-l.mjs} +1 -1
- package/dist/{output-BJFNwj7b.mjs → output-CUxZRM5A.mjs} +1 -1
- package/dist/{page-rules-CjZPTMQX.mjs → page-rules-CYqtPU1p.mjs} +1 -1
- package/dist/{page-shield-D5RRNJCY.mjs → page-shield-D8l9ZMUl.mjs} +1 -1
- package/dist/{pages-CWJtJnL0.mjs → pages-ChurJ2H7.mjs} +1 -1
- package/dist/{pipelines-B0L_7j9e.mjs → pipelines-CeyujvRf.mjs} +1 -1
- package/dist/{progress-CrCGTq7N.mjs → progress-Cent9Lsg.mjs} +1 -1
- package/dist/{queues-CN6DPhRR.mjs → queues-Rf_n11Cx.mjs} +1 -1
- package/dist/{r2-DQIcyRtA.mjs → r2-BtuTO3vQ.mjs} +1 -1
- package/dist/{r2-data-catalog-Bbo93TJx.mjs → r2-data-catalog-Debz38kv.mjs} +1 -1
- package/dist/radar-CzGM92uM.mjs +2 -0
- package/dist/{rate-limits-DcrQV6Ar.mjs → rate-limits-Bbk7HxP7.mjs} +1 -1
- package/dist/{raw-fetch-Dlccg0Tr.mjs → raw-fetch-DnbAMFBp.mjs} +1 -1
- package/dist/{realtime-kit-CaquuVOE.mjs → realtime-kit-CivLpkpg.mjs} +1 -1
- package/dist/{registrar-Ko-xZemf.mjs → registrar-8IeA5DKd.mjs} +1 -1
- package/dist/{request-tracers-DOW_reTJ.mjs → request-tracers-D1aH4NmL.mjs} +1 -1
- package/dist/{resource-sharing-D7TX0JV0.mjs → resource-sharing-B-Pcto7-.mjs} +3 -3
- package/dist/{resource-tagging-C3qtLzCz.mjs → resource-tagging-Bpb6Qq1M.mjs} +1 -1
- package/dist/{rules-BXRADHL5.mjs → rules-B10XWY10.mjs} +1 -1
- package/dist/{rulesets-CBgpeSvJ.mjs → rulesets-lYczEcJp.mjs} +1 -1
- package/dist/{rum-BjPptTUP.mjs → rum-B5GUKa4I.mjs} +3 -3
- package/dist/{schema-D16TgWBg.mjs → schema-hefO-tzo.mjs} +1 -1
- package/dist/{schema-validation-Dgv_opM3.mjs → schema-validation-DTq517Em.mjs} +1 -1
- package/dist/{scim-DdSEr4kZ.mjs → scim-BiLfOQ89.mjs} +1 -1
- package/dist/{secrets-store-7BfyvJLb.mjs → secrets-store-CBX0dvHL.mjs} +1 -1
- package/dist/{security-center-DAy6AKtT.mjs → security-center-AVpTOBK3.mjs} +1 -1
- package/dist/{security-txt-xAMb7K6Y.mjs → security-txt-DVlh8y9l.mjs} +1 -1
- package/dist/{session-COHHdS7A.mjs → session-CsvPYFj8.mjs} +2 -2
- package/dist/shared-0bwWVDLo.mjs +2 -0
- package/dist/{smart-shield-TeWZFnH2.mjs → smart-shield-DblHIce0.mjs} +1 -1
- package/dist/{snippets-CCSsCXVs.mjs → snippets-DrpqSXYC.mjs} +1 -1
- package/dist/{spawn-DcppKGI5.mjs → spawn-DK7pott_.mjs} +1 -1
- package/dist/{spectrum-CTTZID8u.mjs → spectrum-CnrG0jIC.mjs} +2 -2
- package/dist/speed-BzRY3Xlh.mjs +4 -0
- package/dist/{src-BW6vfAwE.mjs → src-D9_Gq68b.mjs} +10 -10
- package/dist/{ssl-BWA2LdwC.mjs → ssl-Cp6tQkZH.mjs} +1 -1
- package/dist/stream-CGTRN4ZN.mjs +14 -0
- package/dist/{tenants-Bd7NGQ_m.mjs → tenants-o_M62Y1n.mjs} +1 -1
- package/dist/{token-validation-DAgtFOvs.mjs → token-validation-Ca5AGEns.mjs} +1 -1
- package/dist/{tools-DXQmfFuE.mjs → tools-DtNNmO6l.mjs} +1 -1
- package/dist/{turnstile-cfdaO4ca.mjs → turnstile-l7mo9BWL.mjs} +2 -2
- package/dist/{ui-D4KtlMh9.mjs → ui-B97lRnOv.mjs} +1 -1
- package/dist/{url-normalization-B5RN4nLD.mjs → url-normalization-D1CogSIG.mjs} +1 -1
- package/dist/{url-scanner-BrZ1L9OC.mjs → url-scanner-BnJHJqcz.mjs} +1 -1
- package/dist/{user-CAo-yCJA.mjs → user-CiyYZ69X.mjs} +2 -2
- package/dist/{vectorize-C7_oQlaI.mjs → vectorize-D3LgMLOn.mjs} +1 -1
- package/dist/{versions-CUwWJWmy.mjs → versions-B6E8WQyA.mjs} +1 -1
- package/dist/{waiting-rooms-Dln5ICg5.mjs → waiting-rooms-Bhy_nuV3.mjs} +1 -1
- package/dist/{web3-HQJRm38W.mjs → web3-DlHE0CZc.mjs} +1 -1
- package/dist/{workers-Dg7ddG2Q.mjs → workers-DRAkU6YR.mjs} +1 -1
- package/dist/{workers-builds-AVfx8IyL.mjs → workers-builds-BmNjiHDZ.mjs} +1 -1
- package/dist/{workflows-VquuSh2J.mjs → workflows-z6oapEJs.mjs} +1 -1
- package/dist/{zaraz-xYSWIV4P.mjs → zaraz-CyzfYOEU.mjs} +1 -1
- package/dist/{zero-trust-CP96wnSh.mjs → zero-trust-fyyIelWx.mjs} +44 -44
- package/dist/zero_trust-BAhlNkjo.mjs +3 -0
- package/dist/{zones-BSgmZ9WC.mjs → zones-MSULnDwW.mjs} +4 -4
- package/package.json +4 -4
- package/dist/ai-search-CQF_Sn7d.mjs +0 -7
- package/dist/auth-SyWhMmPu.mjs +0 -6
- package/dist/auth-ffdf9yR0.mjs +0 -135
- package/dist/autorag-BuGhGTeZ.mjs +0 -2
- package/dist/billing-PoG81XaQ.mjs +0 -2
- package/dist/browser-rendering-xu8F_Rrv.mjs +0 -4
- package/dist/config-DYzlVxcB.mjs +0 -2
- package/dist/content-scanning-r6uzMO1r.mjs +0 -4
- package/dist/data-security-D_EtYBfo.mjs +0 -6
- package/dist/dist-DNBSHor6.mjs +0 -301
- package/dist/images-BO8FbDAa.mjs +0 -5
- package/dist/radar-Bxb0WX8V.mjs +0 -2
- package/dist/shared-AGtpXwwL.mjs +0 -2
- package/dist/speed-CuzTE0AL.mjs +0 -4
- package/dist/stream-GFsIZ-pP.mjs +0 -14
- /package/dist/{body-parser-DKa8Ipg1.mjs → body-parser-CBpeIUns.mjs} +0 -0
- /package/dist/{cli-types-CRIDdDw3.mjs → cli-types-CMNMD1V7.mjs} +0 -0
- /package/dist/{input-validation-zEO81MWN.mjs → input-validation-CTqtyiY9.mjs} +0 -0
- /package/dist/{lib-Eu1wXxuh.mjs → lib-B6xvCJjc.mjs} +0 -0
- /package/dist/{local-VJaJ3BZ1.mjs → local-D8bhHUMK.mjs} +0 -0
- /package/dist/{metadata-5VwHPW6C.mjs → metadata-jh2EIan8.mjs} +0 -0
- /package/dist/{resolve-4-OSeHlK.mjs → resolve-D1mG0REg.mjs} +0 -0
- /package/dist/{theme-BklJDrb2.mjs → theme-CFHr0Dh9.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-
|
|
2
|
+
import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create-v1`,describe:`Create a new Pipeline.`,builder:p,handler:async n=>{if(n.dryRun){l({command:`cf pipelines create-v1`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`),sql:d(n.sql,`sql`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.pipelines.createV1({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Specifies the name of the Pipeline.`)),n.sql===void 0&&(n.sql=await t(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=s({name:d(n.name,`name`,`text`),sql:d(n.sql,`sql`,`text`)});c(await u(`Creating`,async()=>r.pipelines.createV1({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:h,handler:async r=>{if(r.dryRun){l({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({destination:{batch:{max_bytes:r[`destination-batch-max-bytes`],max_duration_s:r[`destination-batch-max-duration-s`],max_rows:r[`destination-batch-max-rows`]},compression:{type:d(r[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(r[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(r[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(r[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(r[`destination-format`],`destination-format`,`text`),path:{bucket:d(r[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(r[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(r[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(r[`destination-type`],`destination-type`,`text`)},name:d(r.name,`name`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.pipelines.create({...e,account_id:m})),{successLabel:`Created`});return}r[`destination-credentials-access-key-id`]===void 0&&(r[`destination-credentials-access-key-id`]=await t(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),r[`destination-credentials-endpoint`]===void 0&&(r[`destination-credentials-endpoint`]=await t(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),r[`destination-credentials-secret-access-key`]===void 0&&(r[`destination-credentials-secret-access-key`]=await t(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),r[`destination-format`]===void 0&&(r[`destination-format`]=await n(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),r[`destination-path-bucket`]===void 0&&(r[`destination-path-bucket`]=await t(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),r[`destination-type`]===void 0&&(r[`destination-type`]=await n(`destination-type`,`Specifies the type of destination.`,[`r2`])),r.name===void 0&&(r.name=await t(`name`,`Defines the name of the pipeline.`));let h=s({destination:{batch:{max_bytes:r[`destination-batch-max-bytes`],max_duration_s:r[`destination-batch-max-duration-s`],max_rows:r[`destination-batch-max-rows`]},compression:{type:d(r[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(r[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(r[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(r[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(r[`destination-format`],`destination-format`,`text`),path:{bucket:d(r[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(r[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(r[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(r[`destination-type`],`destination-type`,`text`)},name:d(r.name,`name`,`text`)});c(await u(`Creating`,async()=>p.pipelines.create({...h,account_id:m})),{successLabel:`Created`})}};function _(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete-v1 <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf pipelines delete-v1`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/pipelines/${t[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(t[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(t[`pipeline-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}c(await u(`Deleting`,async()=>n.pipelines.deleteV1({account_id:o,pipeline_id:t[`pipeline-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/${t[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(t[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(t[`pipeline-name`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}c(await u(`Deleting`,async()=>n.pipelines.delete({account_id:o,pipeline_name:t[`pipeline-name`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-v1 <pipeline-id>`,describe:`Get Pipelines Details.`,builder:x,handler:async t=>{if(t.dryRun){l({command:`cf pipelines get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/pipelines/${t[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(t[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(t[`pipeline-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.getV1({account_id:r,pipeline_id:t[`pipeline-id`]})),{successLabel:`Loaded`})}};function C(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async t=>{if(t.dryRun){l({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/${t[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(t[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(t[`pipeline-name`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.get({account_id:r,pipeline_name:t[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list-v1`,describe:`List/Filter Pipelines in Account.`,builder:T,handler:async t=>{let n={page:t.page,per_page:t[`per-page`],name:t.name};if(t.dryRun){l({command:`cf pipelines list-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.listV1({account_id:o,...n})),{successLabel:`Loaded`})}};function D(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async t=>{let n={search:t.search,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.list({account_id:o,...n})),{successLabel:`Loaded`})}};function k(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`config-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`,`config-rolling-policy-file-size-bytes`,`config-rolling-policy-inactivity-seconds`,`config-rolling-policy-interval-seconds`,`config-namespace`,`config-table-name`,`config-token`].some(t=>e[t]!==void 0)){let t={"config-credentials-access-key-id":[`config-namespace`,`config-table-name`,`config-token`],"config-credentials-secret-access-key":[`config-namespace`,`config-table-name`,`config-token`]},n=[`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0}).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --format-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --schema-* flag is set`)}return!0})}const A={command:`create`,describe:`Create a new Sink.`,builder:k,handler:async r=>{if(r.dryRun){l({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({config:{account_id:d(r[`config-account-id`],`config-account-id`,`text`),bucket:d(r[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(r[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(r[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(r[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(r[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(r[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(r[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(r[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(r[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:r[`config-rolling-policy-file-size-bytes`],inactivity_seconds:r[`config-rolling-policy-inactivity-seconds`],interval_seconds:r[`config-rolling-policy-interval-seconds`]},namespace:d(r[`config-namespace`],`config-namespace`,`text`),table_name:d(r[`config-table-name`],`config-table-name`,`text`),token:d(r[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(r[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(r[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:r[`format-unstructured`],type:d(r[`format-type`],`format-type`,`text`),compression:d(r[`format-compression`],`format-compression`,`text`),row_group_bytes:r[`format-row-group-bytes`]},name:d(r.name,`name`,`text`),schema:{format:{decimal_encoding:d(r[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(r[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:r[`schema-format-unstructured`],type:d(r[`schema-format-type`],`schema-format-type`,`text`),compression:d(r[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:r[`schema-format-row-group-bytes`]},inferred:r[`schema-inferred`]},type:d(r.type,`type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await t(`name`,`Defines the name of the Sink.`)),r.type===void 0&&(r.type=await n(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=s({config:{account_id:d(r[`config-account-id`],`config-account-id`,`text`),bucket:d(r[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(r[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(r[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(r[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(r[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(r[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(r[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(r[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(r[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:r[`config-rolling-policy-file-size-bytes`],inactivity_seconds:r[`config-rolling-policy-inactivity-seconds`],interval_seconds:r[`config-rolling-policy-interval-seconds`]},namespace:d(r[`config-namespace`],`config-namespace`,`text`),table_name:d(r[`config-table-name`],`config-table-name`,`text`),token:d(r[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(r[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(r[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:r[`format-unstructured`],type:d(r[`format-type`],`format-type`,`text`),compression:d(r[`format-compression`],`format-compression`,`text`),row_group_bytes:r[`format-row-group-bytes`]},name:d(r.name,`name`,`text`),schema:{format:{decimal_encoding:d(r[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(r[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:r[`schema-format-unstructured`],type:d(r[`schema-format-type`],`schema-format-type`,`text`),compression:d(r[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:r[`schema-format-row-group-bytes`]},inferred:r[`schema-inferred`]},type:d(r.type,`type`,`text`)});c(await u(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete sink forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`delete <sink-id>`,describe:`Delete Pipeline in Account.`,builder:j,handler:async t=>{let n={force:t.force};if(t.dryRun){l({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks/${t[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(t[`sink-id`]))}`,pathParams:{"sink-id":String(t[`sink-id`]??``)},query:n,bodyKind:`none`});return}let o=await a(t),s=t.local?f:await i(o);if(t.accountId=s,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}c(await u(`Deleting`,async()=>o.pipelines.sinks.delete({account_id:s,sink_id:t[`sink-id`],...n})),{successLabel:`Deleted`})}};function N(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:N,handler:async t=>{if(t.dryRun){l({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks/${t[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(t[`sink-id`]))}`,pathParams:{"sink-id":String(t[`sink-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.pipelines.sinks.get({account_id:r,sink_id:t[`sink-id`]})),{successLabel:`Loaded`})}};function F(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List/Filter Sinks in Account.`,builder:F,handler:async t=>{let n={pipeline_id:t[`pipeline-id`],name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.pipelines.sinks.list({account_id:o,...n})),{successLabel:`Loaded`})}},L={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --format-* flag is set`)}return!0}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --schema-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const z={command:`create`,describe:`Create a new Stream.`,builder:R,handler:async n=>{if(n.dryRun){l({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({format:{decimal_encoding:d(n[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(n[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:n[`format-unstructured`],type:d(n[`format-type`],`format-type`,`text`),compression:d(n[`format-compression`],`format-compression`,`text`),row_group_bytes:n[`format-row-group-bytes`]},http:{authentication:n[`http-authentication`],cors:{origins:n[`http-cors-origins`]},enabled:n[`http-enabled`]},name:d(n.name,`name`,`text`),schema:{format:{decimal_encoding:d(n[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(n[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:n[`schema-format-unstructured`],type:d(n[`schema-format-type`],`schema-format-type`,`text`),compression:d(n[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:n[`schema-format-row-group-bytes`]},inferred:n[`schema-inferred`]},worker_binding:{enabled:n[`worker-binding-enabled`]}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Specifies the name of the Stream.`));let m=s({format:{decimal_encoding:d(n[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(n[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:n[`format-unstructured`],type:d(n[`format-type`],`format-type`,`text`),compression:d(n[`format-compression`],`format-compression`,`text`),row_group_bytes:n[`format-row-group-bytes`]},http:{authentication:n[`http-authentication`],cors:{origins:n[`http-cors-origins`]},enabled:n[`http-enabled`]},name:d(n.name,`name`,`text`),schema:{format:{decimal_encoding:d(n[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:d(n[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:n[`schema-format-unstructured`],type:d(n[`schema-format-type`],`schema-format-type`,`text`),compression:d(n[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:n[`schema-format-row-group-bytes`]},inferred:n[`schema-inferred`]},worker_binding:{enabled:n[`worker-binding-enabled`]}});c(await u(`Creating`,async()=>r.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function B(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete stream forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:B,handler:async t=>{let n={force:t.force};if(t.dryRun){l({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/pipelines/v1/streams/${t[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(t[`stream-id`]))}`,pathParams:{"stream-id":String(t[`stream-id`]??``)},query:n,bodyKind:`none`});return}let o=await a(t),s=t.local?f:await i(o);if(t.accountId=s,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{i as e,t}from"./session-CsvPYFj8.mjs";import{r as n}from"./theme-CFHr0Dh9.mjs";import{a as r}from"./dist-DA54ZQu0.mjs";import{t as i}from"./output-CUxZRM5A.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-
|
|
2
|
+
import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";function m(e){return e.positional(`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 h={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:m,handler:async r=>{if(r.dryRun){l({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}r.type===void 0&&(r.type=await n(`type`,`The type field`,[`worker`,`http_pull`])),r.type===`worker`&&r[`script-name`]===void 0&&(r[`script-name`]=await t(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)});c(await u(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`consumer-id`,{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 g={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:ee,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers/${t[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(t[`consumer-id`]))}`,pathParams:{"consumer-id":String(t[`consumer-id`]??``),"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}c(await u(`Deleting`,async()=>n.queues.consumers.delete({account_id:o,queue_id:t[`queue-id`],consumer_id:t[`consumer-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`consumer-id`,{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 v={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers/${t[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(t[`consumer-id`]))}`,pathParams:{"consumer-id":String(t[`consumer-id`]??``),"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.consumers.get({account_id:r,queue_id:t[`queue-id`],consumer_id:t[`consumer-id`]})),{successLabel:`Loaded`})}};function y(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 b={command:`list`,describe:`Returns the consumers for a Queue`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.consumers.list({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`consumer-id`,{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 S={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:x,handler:async r=>{if(r.dryRun){l({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Updated`});return}r.type===void 0&&(r.type=await n(`type`,`The type field`,[`worker`,`http_pull`])),r.type===`worker`&&r[`script-name`]===void 0&&(r[`script-name`]=await t(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=s({dead_letter_queue:d(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:d(r.type,`type`,`text`)});c(await u(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Updated`})}},C={command:`consumers`,describe:`Operations for consumers`,builder:e=>e.command(h).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(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 T={command:`create`,describe:`Create a new queue`,builder:w,handler:async n=>{if(n.dryRun){l({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({queue_name:d(n[`queue-name`],`queue-name`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.queues.create({...e,account_id:p})),{successLabel:`Created`});return}n[`queue-name`]===void 0&&(n[`queue-name`]=await t(`queue-name`,`The queue_name field`));let m=s({queue_name:d(n[`queue-name`],`queue-name`,`text`)});c(await u(`Creating`,async()=>r.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function E(e){return e.positional(`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 D={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:E,handler:async t=>{if(t.dryRun){l({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}c(await u(`Deleting`,async()=>n.queues.delete({account_id:o,queue_id:t[`queue-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`queue-id`,{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 k={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:O,handler:async t=>{if(t.dryRun){l({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({queue_name:d(t[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:t[`settings-delivery-delay`],delivery_paused:t[`settings-delivery-paused`],message_retention_period:t[`settings-message-retention-period`]}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.queues.edit({body:e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Updated`});return}let p=s({queue_name:d(t[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:t[`settings-delivery-delay`],delivery_paused:t[`settings-delivery-paused`],message_retention_period:t[`settings-message-retention-period`]}});c(await u(`Updating`,async()=>n.queues.edit({body:p,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Updated`})}};function A(e){return e.positional(`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 j={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:A,handler:async t=>{if(t.dryRun){l({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.get({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Returns the queues owned by an account.`,builder:M,handler:async t=>{if(t.dryRun){l({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.list({account_id:r})),{successLabel:`Loaded`})}};function P(e){return e.positional(`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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`ack-preview <queue-id>`,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:P,handler:async t=>{if(t.dryRun){l({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.ackPreview({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.queues.messages.ackPreview({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function I(e){return e.positional(`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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:I,handler:async t=>{if(t.dryRun){l({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.ack({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>n.queues.messages.ack({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function R(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 z={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:R,handler:async t=>{if(t.dryRun){l({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({delay_seconds:t[`delay-seconds`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.bulkPush({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}let d=s({delay_seconds:t[`delay-seconds`]});c(await u(`Creating`,async()=>n.queues.messages.bulkPush({...d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function te(e){return e.positional(`queue-id`,{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 B={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:te,handler:async t=>{if(t.dryRun){l({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({batch_size:t[`batch-size`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Loading`,async()=>n.queues.messages.preview({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`});return}let d=s({batch_size:t[`batch-size`]});c(await u(`Loading`,async()=>n.queues.messages.preview({...d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}};function V(e){return e.positional(`queue-id`,{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 H={command:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:V,handler:async t=>{if(t.dryRun){l({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({batch_size:t[`batch-size`],visibility_timeout_ms:t[`visibility-timeout-ms`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.pull({...e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}let d=s({batch_size:t[`batch-size`],visibility_timeout_ms:t[`visibility-timeout-ms`]});c(await u(`Creating`,async()=>n.queues.messages.pull({...d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`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 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 W={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:U,handler:async t=>{if(t.dryRun){l({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/messages`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({delay_seconds:t[`delay-seconds`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.messages.push({body:e,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`});return}let d=s({delay_seconds:t[`delay-seconds`]});c(await u(`Creating`,async()=>n.queues.messages.push({body:d,account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Created`})}},G={command:`messages`,describe:`Operations for messages`,builder:e=>e.command(L).command(F).command(z).command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`queue-id`,{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 q={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:K,handler:async t=>{if(t.dryRun){l({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/purge`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({delete_messages_permanently:t[`delete-messages-permanently`]}):o(t.body)});return}let n=await a(t),d=t.local?f:await i(n);if(t.accountId=d,!await r({force:!!t.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}if(t.body){let e=o(t.body);c(await u(`Deleting`,async()=>n.queues.purge.start({...e,account_id:d,queue_id:t[`queue-id`]})),{successLabel:`Deleted`});return}let p=s({delete_messages_permanently:t[`delete-messages-permanently`]});c(await u(`Deleting`,async()=>n.queues.purge.start({...p,account_id:d,queue_id:t[`queue-id`]})),{successLabel:`Deleted`})}};function J(e){return e.positional(`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:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:J,handler:async t=>{if(t.dryRun){l({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/purge`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.queues.purge.status({account_id:r,queue_id:t[`queue-id`]})),{successLabel:`Loaded`})}},X={command:`purge`,describe:`Operations for purge`,builder:e=>e.command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(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 Q={command:`create`,describe:`Create a new event subscription for a queue`,builder:Z,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({destination:{queue_id:d(t[`destination-queue-id`],`destination-queue-id`,`text`),type:d(t[`destination-type`],`destination-type`,`text`)},enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`),source:{type:d(t[`source-type`],`source-type`,`text`),model_name:d(t[`source-model-name`],`source-model-name`,`text`),worker_name:d(t[`source-worker-name`],`source-worker-name`,`text`),workflow_name:d(t[`source-workflow-name`],`source-workflow-name`,`text`)}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.queues.subscriptions.create({...e,account_id:r})),{successLabel:`Created`});return}let p=s({destination:{queue_id:d(t[`destination-queue-id`],`destination-queue-id`,`text`),type:d(t[`destination-type`],`destination-type`,`text`)},enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`),source:{type:d(t[`source-type`],`source-type`,`text`),model_name:d(t[`source-model-name`],`source-model-name`,`text`),worker_name:d(t[`source-worker-name`],`source-worker-name`,`text`),workflow_name:d(t[`source-workflow-name`],`source-workflow-name`,`text`)}});c(await u(`Creating`,async()=>n.queues.subscriptions.create({...p,account_id:r})),{successLabel:`Created`})}};function ne(e){return e.positional(`subscription-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 re={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:ne,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_subscriptions/subscriptions/${t[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(t[`subscription-id`]))}`,pathParams:{"subscription-id":String(t[`subscription-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-
|
|
2
|
+
import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,r as c,t as l}from"./body-parser-CBpeIUns.mjs";import{t as u}from"./output-CUxZRM5A.mjs";import{n as d,t as f}from"./progress-Cent9Lsg.mjs";import{n as p}from"./input-validation-CTqtyiY9.mjs";import{t as m}from"./local-D8bhHUMK.mjs";function h(e){return e.positional(`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 g={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:h,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let s=await o(t),c=t.local?m:await i(s);if(t.accountId=c,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}u(await f(`Deleting`,async()=>a(s,`DELETE`,`/accounts/${c}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/cors`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Deleted`})}};function _(e){return e.positional(`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 ee={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:_,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let r=await o(t),s=t.local?m:await i(r);t.accountId=s,u(await f(`Loading`,async()=>a(r,`GET`,`/accounts/${s}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/cors`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function te(e){return e.positional(`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 v={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:te,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let r=await o(t),c=t.local?m:await i(r);if(t.accountId=c,t.body){let e=s(t.body);u(await f(`Updating`,async()=>a(r,`PUT`,`/accounts/${c}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}u(await f(`Updating`,async()=>a(r,`PUT`,`/accounts/${c}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/cors`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},y={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(g).command(ee).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(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 x={command:`create`,describe:`Creates a new R2 bucket.`,builder:b,handler:async n=>{let r={};if(n[`cf-r2-jurisdiction`]!==void 0&&(r[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){d({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({locationHint:p(n[`location-hint`],`location-hint`,`text`),name:p(n.name,`name`,`text`),storageClass:p(n[`storage-class`],`storage-class`,`text`)}):s(n.body)});return}let h=await o(n),g=n.local?m:await i(h);if(n.accountId=g,n.body){let e=s(n.body);u(await f(`Creating`,async()=>a(h,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the bucket.`));let _={};n[`location-hint`]!==void 0&&c(_,[`locationHint`],p(n[`location-hint`],`location-hint`,`text`)),n.name!==void 0&&c(_,[`name`],p(n.name,`name`,`text`)),n[`storage-class`]!==void 0&&c(_,[`storageClass`],p(n[`storage-class`],`storage-class`,`text`)),u(await f(`Creating`,async()=>a(h,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function S(e){return e.positional(`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 C={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:S,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let s=await o(t),c=t.local?m:await i(s);if(t.accountId=c,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}u(await f(`Deleting`,async()=>a(s,`DELETE`,`/accounts/${c}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Deleted`})}};function w(e){return e.positional(`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(`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(`zone-id`,{type:`string`,description:`Zone ID of the custom 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 T={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:w,handler:async n=>{let r={};if(n[`cf-r2-jurisdiction`]!==void 0&&(r[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){d({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?l({ciphers:n.ciphers,domain:p(n.domain,`domain`,`text`),enabled:n.enabled,minTLS:p(n[`min-tls`],`min-tls`,`text`),zoneId:p(n[`zone-id`],`zone-id`,`text`)}):s(n.body)});return}let h=await o(n),g=n.local?m:await i(h);if(n.accountId=g,n.body){let e=s(n.body);u(await f(`Creating`,async()=>a(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`});return}if(n.domain===void 0&&(n.domain=await t(`domain`,`Name of the custom domain to be added.`)),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n[`zone-id`]===void 0&&(n[`zone-id`]=await t(`zone-id`,`Zone ID of the custom domain.`));let _={};n.ciphers!==void 0&&c(_,[`ciphers`],n.ciphers),n.domain!==void 0&&c(_,[`domain`],p(n.domain,`domain`,`text`)),n.enabled!==void 0&&c(_,[`enabled`],n.enabled),n[`min-tls`]!==void 0&&c(_,[`minTLS`],p(n[`min-tls`],`min-tls`,`text`)),n[`zone-id`]!==void 0&&c(_,[`zoneId`],p(n[`zone-id`],`zone-id`,`text`)),u(await f(`Creating`,async()=>a(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:E,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${t.domain==null?`<domain>`:encodeURIComponent(String(t.domain))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``),domain:String(t.domain??``)},bodyKind:`none`});return}let s=await o(t),c=t.local?m:await i(s);if(t.accountId=c,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}u(await f(`Deleting`,async()=>a(s,`DELETE`,`/accounts/${c}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(t.domain))}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Deleted`})}};function O(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 k={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:O,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${t.domain==null?`<domain>`:encodeURIComponent(String(t.domain))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``),domain:String(t.domain??``)},bodyKind:`none`});return}let r=await o(t),s=t.local?m:await i(r);t.accountId=s,u(await f(`Loading`,async()=>a(r,`GET`,`/accounts/${s}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(t.domain))}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function A(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 j={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:A,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let r=await o(t),s=t.local?m:await i(r);t.accountId=s,u(await f(`Loading`,async()=>a(r,`GET`,`/accounts/${s}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/custom`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function M(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 N={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:M,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${t.domain==null?`<domain>`:encodeURIComponent(String(t.domain))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``),domain:String(t.domain??``)},bodyKind:`json`,body:t.body===void 0?l({ciphers:t.ciphers,enabled:t.enabled,minTLS:p(t[`min-tls`],`min-tls`,`text`)}):s(t.body)});return}let r=await o(t),h=t.local?m:await i(r);if(t.accountId=h,t.body){let e=s(t.body);u(await f(`Updating`,async()=>a(r,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(t.domain))}`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}let g={};t.ciphers!==void 0&&c(g,[`ciphers`],t.ciphers),t.enabled!==void 0&&c(g,[`enabled`],t.enabled),t[`min-tls`]!==void 0&&c(g,[`minTLS`],p(t[`min-tls`],`min-tls`,`text`)),u(await f(`Updating`,async()=>a(r,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(t.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},P={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.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 I={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:F,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let r=await o(t),s=t.local?m:await i(r);t.accountId=s,u(await f(`Loading`,async()=>a(r,`GET`,`/accounts/${s}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/managed`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Loaded`})}};function L(e){return e.positional(`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(`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 R={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:L,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`json`,body:t.body===void 0?l({enabled:t.enabled}):s(t.body)});return}let r=await o(t),p=t.local?m:await i(r);if(t.accountId=p,t.body){let e=s(t.body);u(await f(`Updating`,async()=>a(r,`PUT`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/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 h={};t.enabled!==void 0&&c(h,[`enabled`],t.enabled),u(await f(`Updating`,async()=>a(r,`PUT`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}},z={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(P).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`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(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:V,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t[`cf-r2-storage-class`]!==void 0&&(n[`cf-r2-storage-class`]=String(t[`cf-r2-storage-class`])),t.dryRun){d({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2/buckets/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let r=await o(t),s=t.local?m:await i(r);t.accountId=s,u(await f(`Updating`,async()=>a(r,`PATCH`,`/accounts/${s}/r2/buckets/${encodeURIComponent(String(t[`bucket-name`]))}`,{headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}};function U(e){return e.positional(`queue-id`,{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 W={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:U,handler:async t=>{let n={};if(t[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(t[`cf-r2-jurisdiction`])),t.dryRun){d({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/event_notifications/r2/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/configuration/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``),"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`json`,body:t.body===void 0?l({ruleIds:t[`rule-ids`]}):s(t.body)});return}let p=await o(t),h=t.local?m:await i(p);if(t.accountId=h,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{C as e,D as t,T as n,_ as r,n as i}from"./auth-
|
|
2
|
+
import{C as e,D as t,T as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";function f(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const p={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:f,handler:async n=>{if(n.dryRun){c({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?o({token:u(n.token,`token`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:n[`bucket-name`]})),{successLabel:`Created`});return}n.token===void 0&&(n.token=await t(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=o({token:u(n.token,`token`,`text`)});s(await l(`Creating`,async()=>f.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:n[`bucket-name`]})),{successLabel:`Created`})}},m={command:`credentials`,describe:`Operations for credentials`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to disable as catalog.`,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:`disable <bucket-name>`,describe:`Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force,message:`This operation turns off the data catalog for the bucket. Existing namespace or table state remains, but writes stop.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}s(await l(`Deleting`,async()=>a.r2DataCatalog.disable({account_id:o,bucket_name:t[`bucket-name`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to enable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`enable <bucket-name>`,describe:`Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.`,builder:_,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Creating`,async()=>n.r2DataCatalog.enable({account_id:a,bucket_name:t[`bucket-name`]})),{successLabel:`Created`})}};function y(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <bucket-name>`,describe:`Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.`,builder:y,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.get({account_id:a,bucket_name:t[`bucket-name`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.list({account_id:a})),{successLabel:`Loaded`})}};function C(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.r2DataCatalog.maintenanceConfigs.get({account_id:a,bucket_name:t[`bucket-name`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update catalog maintenance configuration.`})}const E={command:`update <bucket-name>`,describe:`Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/r2-catalog/${t[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(t[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(t[`bucket-name`]??``)},bodyKind:`json`,body:t.body===void 0?o({snapshot_expiration:{max_snapshot_age:u(t[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:t[`snapshot-expiration-min-snapshots-to-keep`]}}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:t[`bucket-name`]})),{successLabel:`Created`});return}let p=o({snapshot_expiration:{max_snapshot_age:u(t[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:t[`snapshot-expiration-min-snapshots-to-keep`]}});s(await l(`Creating`,async()=>n.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:t[`bucket-name`]})),{successLabel:`Created`})}},D={command:`maintenance-configs`,describe:`Operations for maintenance-configs`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
|
|
4
4
|
Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of namespaces to return per page.
|
|
5
5
|
Defaults to 100, maximum 1000.`}).option(`parent`,{type:`string`,description:`Parent namespace to filter by. Only returns direct children of this namespace.
|