cf 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CzDAjFpo.mjs} +1 -1
- package/dist/{access-RbqBFrSC.mjs → access-CxyW_sIW.mjs} +1 -1
- package/dist/{account-D7xvYqDx.mjs → account-Dd4-tDYJ.mjs} +1 -1
- package/dist/{account-tags-CKRh1jra.mjs → account-tags-65fAlHrf.mjs} +1 -1
- package/dist/{accounts-2pGhN4s8.mjs → accounts-Bp5KGc6r.mjs} +1 -1
- package/dist/{acm-Szq4CoQN.mjs → acm-CHacxa3s.mjs} +1 -1
- package/dist/{addressing-CgTTbuCF.mjs → addressing-BnqNmmYN.mjs} +1 -1
- package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-D--BQS0W.mjs} +1 -1
- package/dist/{ai-Cn0BniR4.mjs → ai-BnVlQDiI.mjs} +1 -1
- package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-CfpDKXkD.mjs} +1 -1
- package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-oG4j_oYN.mjs} +1 -1
- package/dist/{ai-search-2xP8FP_W.mjs → ai-search-B2l3B_jn.mjs} +1 -1
- package/dist/{ai-security-AUfzagSE.mjs → ai-security-byjIIrfl.mjs} +1 -1
- package/dist/{alerting-DbXVpGv3.mjs → alerting-qa8SkXlD.mjs} +1 -1
- package/dist/{analytics-UQrIx99t.mjs → analytics-DeIKjC9n.mjs} +1 -1
- package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-BnECMIWJ.mjs} +1 -1
- package/dist/{api-security-pSJdgmtK.mjs → api-security-MfHbfZyf.mjs} +1 -1
- package/dist/{argo-Br60zF3y.mjs → argo-DFerMyXF.mjs} +1 -1
- package/dist/{artifacts-D8HMRQmb.mjs → artifacts-CtyEYYDa.mjs} +1 -1
- package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-retFtvow.mjs} +1 -1
- package/dist/{auth-C6MhC9EZ.mjs → auth-DuLchM18.mjs} +2 -2
- package/dist/{auth-MeSu8lFz.mjs → auth-aazs91XL.mjs} +1 -1
- package/dist/{billing-0RNCYBJM.mjs → billing-CxQVqpGZ.mjs} +1 -1
- package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Rli7v7tg.mjs} +1 -1
- package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-Cw6XSEf8.mjs} +1 -1
- package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CTvnHGfV.mjs} +1 -1
- package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-q79xHrVW.mjs} +1 -1
- package/dist/{browser-run-C5pYOwtf.mjs → browser-run-FwtwnBzA.mjs} +1 -1
- package/dist/{build-Nivzj54_.mjs → build-Dji9BYmV.mjs} +1 -1
- package/dist/{cache-BgRIDcFJ.mjs → cache-Cl7vKJwH.mjs} +1 -1
- package/dist/{calls-JrRne0U0.mjs → calls-DtK_ANxq.mjs} +1 -1
- package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-DZP1RzAs.mjs} +1 -1
- package/dist/{cf-BUKsENG5.mjs → cf-oSz9pud_.mjs} +1 -1
- package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-BtPU9GsQ.mjs} +1 -1
- package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-DAn-3jwp.mjs} +1 -1
- package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-BpVcvhjZ.mjs} +1 -1
- package/dist/{cloudforce-one-Cp4bQmrG.mjs → cloudforce-one-2PecncfX.mjs} +1 -1
- package/dist/{connector-interrupts-BR47snkh.mjs → connector-interrupts-ollUcksZ.mjs} +1 -1
- package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-D5_3X7XW.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CJ9gLRFR.mjs} +1 -1
- package/dist/{connectors-BRCQSsos.mjs → connectors-Bo6ZT8PT.mjs} +1 -1
- package/dist/{containers-CfKOM_f5.mjs → containers-Bog7j0Hw.mjs} +1 -1
- package/dist/{content-scan-CB4xHGv1.mjs → content-scan-D03UfK2X.mjs} +1 -1
- package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DgS-7ADh.mjs} +1 -1
- package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-8AKtNnUg.mjs} +1 -1
- package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-4y35UC1X.mjs} +1 -1
- package/dist/{custom-csrs-D0zBkQT5.mjs → custom-csrs-DwBrLh-H.mjs} +1 -1
- package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-CDIAnsRa.mjs} +1 -1
- package/dist/{custom-nameservers-G2MWpRwY.mjs → custom-nameservers-stk7ymnP.mjs} +1 -1
- package/dist/{custom-pages-BINNZTds.mjs → custom-pages-vfDxrXbt.mjs} +1 -1
- package/dist/{d1-FmAh7T7l.mjs → d1-Cllm-iTT.mjs} +1 -1
- package/dist/{data-security-2fmzF_Me.mjs → data-security-rnoSCEdL.mjs} +1 -1
- package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-DCRCOL6l.mjs} +1 -1
- package/dist/{deploy-BzFbjH6a.mjs → deploy-DGlmjPTS.mjs} +1 -1
- package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-DhCo1I0I.mjs} +1 -1
- package/dist/{dev-CWaf-qW4.mjs → dev-BbLV0Ti-.mjs} +1 -1
- package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-D5Yo2xqx.mjs} +1 -1
- package/dist/{directory-CGNWfVQc.mjs → directory-CCndFkbQ.mjs} +1 -1
- package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-C48JQ9EA.mjs} +1 -1
- package/dist/{dls-CobKlH4N.mjs → dls-BBq99pjI.mjs} +1 -1
- package/dist/{dns-OfJXNYkK.mjs → dns-DdQYtenF.mjs} +1 -1
- package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-DdwVtm12.mjs} +1 -1
- package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-BvxXBht_.mjs} +1 -1
- package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DFvXKSkg.mjs} +1 -1
- package/dist/{email-routing-CRvIUSFm.mjs → email-routing-QBRPBlyl.mjs} +1 -1
- package/dist/{email-security-D-P8ln2L.mjs → email-security-BFagcRPP.mjs} +1 -1
- package/dist/{email-sending-BwRN8PMW.mjs → email-sending-Ddhe7xjN.mjs} +1 -1
- package/dist/{filters-DczM8qpH.mjs → filters-CGisPGD1.mjs} +1 -1
- package/dist/{firewall-BMiETRmM.mjs → firewall-DD8U-Brd.mjs} +1 -1
- package/dist/{flagship-CPkQMist.mjs → flagship-FJHc4mFi.mjs} +1 -1
- package/dist/{fraud-BhX0QNUl.mjs → fraud-AH47n-wL.mjs} +1 -1
- package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-149kbuG_.mjs} +1 -1
- package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-DfEUG007.mjs} +1 -1
- package/dist/{hostnames-CGAFkYT1.mjs → hostnames-DQUiD3Vr.mjs} +1 -1
- package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-RyQboMWI.mjs} +1 -1
- package/dist/{iam-Su_hpatD.mjs → iam-BhHYhMXO.mjs} +1 -1
- package/dist/{images-D2ZflvBi.mjs → images-CDViyKtZ.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DPGzVovJ.mjs → intel-YHZbPlS3.mjs} +1 -1
- package/dist/{interactive-CM2G03lr.mjs → interactive-mV8PABm6.mjs} +1 -1
- package/dist/{ips-C5-NH1b0.mjs → ips-BpCdldFx.mjs} +1 -1
- package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-oNu5jWKF.mjs} +1 -1
- package/dist/{keys-B0FBtlOD.mjs → keys-yYtv7Ztr.mjs} +1 -1
- package/dist/{kv-BbZ9st5o.mjs → kv-Bi9B4E0A.mjs} +1 -1
- package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DKRjBLcr.mjs} +1 -1
- package/dist/{load-balancers-Ct5cyyF9.mjs → load-balancers-jRCN75mX.mjs} +1 -1
- package/dist/{local-eEF0NF51.mjs → local-DTyuGwTw.mjs} +1 -1
- package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-IAXhEugU.mjs} +1 -1
- package/dist/{logexplorer-BhsAWxCr.mjs → logexplorer-kO8CULiK.mjs} +1 -1
- package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-LyDAYPbI.mjs} +1 -1
- package/dist/{logos-DS0krPAz.mjs → logos-O9f5bGSB.mjs} +1 -1
- package/dist/{logpush-CFQBi88z.mjs → logpush-dtXLu3Ck.mjs} +1 -1
- package/dist/{logs-C07M9zn-.mjs → logs-DmWWL5f9.mjs} +1 -1
- package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-XbTa6P52.mjs} +1 -1
- package/dist/{magic-network-monitoring-CY3CHSpX.mjs → magic-network-monitoring-CpfkgZMp.mjs} +1 -1
- package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-DwgZeIj-.mjs} +1 -1
- package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-DCmogkxv.mjs} +1 -1
- package/dist/{matches-CIaCrdrs.mjs → matches-BAeN8VM1.mjs} +1 -1
- package/dist/{mcp-D2afM8MD.mjs → mcp-DKZ2D050.mjs} +1 -1
- package/dist/{mesh-DLNLi3UT.mjs → mesh-CzIPtuaM.mjs} +1 -1
- package/dist/{moq-BBQVNGo1.mjs → moq-CJpE-eNj.mjs} +1 -1
- package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-Bbm_1lQI.mjs} +1 -1
- package/dist/{network-CmuJqtFJ.mjs → network-D2WRXCDe.mjs} +1 -1
- package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-Clq4X1U8.mjs} +1 -1
- package/dist/{oauth-BjHjJtnn.mjs → oauth-BPizUUqP.mjs} +1 -1
- package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-hilWfAlm.mjs} +1 -1
- package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-CmbgsPYd.mjs} +1 -1
- package/dist/{observability-B5p3iwrq.mjs → observability-DXYgDdU5.mjs} +1 -1
- package/dist/{organization-DQIfNVCT.mjs → organization-D41rIvJa.mjs} +1 -1
- package/dist/{organizations-L_ycAy6r.mjs → organizations-eNzfOwlP.mjs} +1 -1
- package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-DaiAmw45.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-7YztBged.mjs} +1 -1
- package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DRwURM8s.mjs} +1 -1
- package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-B2Csdc4h.mjs} +1 -1
- package/dist/{pages-CskAn5mR.mjs → pages-BAL6Q7OY.mjs} +1 -1
- package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-C-1-ZAtn.mjs} +1 -1
- package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-cyQOuFLb.mjs} +1 -1
- package/dist/{precursor-DgRWBN9_.mjs → precursor-BrweY39h.mjs} +1 -1
- package/dist/{progress-C-oFUtvC.mjs → progress-B84wYh91.mjs} +1 -1
- package/dist/{prompt-DM4z101s.mjs → prompt-CDtLWxNv.mjs} +1 -1
- package/dist/{queries-DrqcK0ZX.mjs → queries-oM8uGZy5.mjs} +1 -1
- package/dist/{queues-CutvMZcc.mjs → queues-CTx04ZNw.mjs} +1 -1
- package/dist/{r2-sFI62vhq.mjs → r2-CnlIUn7R.mjs} +1 -1
- package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-DLtf9d6o.mjs} +1 -1
- package/dist/{radar-Cu9rsTw_.mjs → radar-CGNgGh8v.mjs} +1 -1
- package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-B1YjnGue.mjs} +1 -1
- package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-Dz-QBoP_.mjs} +1 -1
- package/dist/{realtimekit-msnGHBbf.mjs → realtimekit-BPwzhNS9.mjs} +1 -1
- package/dist/{registrar-C0EsXf83.mjs → registrar-BEcb90RX.mjs} +1 -1
- package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-0i1T3zne.mjs} +1 -1
- package/dist/{registry-CJvn75Bq.mjs → registry-DDcSvd8H.mjs} +1 -1
- package/dist/{reporting-BB6sqe6r.mjs → reporting-CLbjHlnw.mjs} +1 -1
- package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-BcKpofP1.mjs} +1 -1
- package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-Ctdi9D-j.mjs} +1 -1
- package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-DGEyVTDN.mjs} +1 -1
- package/dist/{rules-C2BxykEe.mjs → rules-CmuB5rIN.mjs} +1 -1
- package/dist/{rulesets-BHvhAeG_.mjs → rulesets-CGaMq8vG.mjs} +1 -1
- package/dist/{rum-Dyno5zj3.mjs → rum-QT6EP4JK.mjs} +1 -1
- package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-DHryz6SF.mjs} +1 -1
- package/dist/{scim-Bb2xHpIz.mjs → scim-BgGsmHrL.mjs} +1 -1
- package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-BCpFhYFv.mjs} +1 -1
- package/dist/{security-center-DRC4Mf3R.mjs → security-center-BNm4uPVB.mjs} +1 -1
- package/dist/{security-txt-Bh_2gymk.mjs → security-txt-Be2Bif0z.mjs} +1 -1
- package/dist/{session-Br-q_UIW.mjs → session-Ckt20hHa.mjs} +1 -1
- package/dist/{share-DfTpOxhk.mjs → share-Bz2tFTUP.mjs} +1 -1
- package/dist/{shared-BNjZc02w.mjs → shared-BzPQog8H.mjs} +1 -1
- package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-SODkOUyO.mjs} +1 -1
- package/dist/{snippets-nSLwH8uJ.mjs → snippets-B5jY8v_7.mjs} +1 -1
- package/dist/{spawn-Bj8QRFJ5.mjs → spawn-CHkoow5W.mjs} +1 -1
- package/dist/{spectrum-DuhSUTZI.mjs → spectrum-BA0a42eM.mjs} +1 -1
- package/dist/{speed-Dgby_e1J.mjs → speed-mmOjxOzo.mjs} +1 -1
- package/dist/{src-CgAVPA4I.mjs → src-CHW7s5IS.mjs} +4 -4
- package/dist/{ssl-BsxTHasY.mjs → ssl-Yr6kELqg.mjs} +1 -1
- package/dist/{state-C1m9nwUm.mjs → state-DZC531l2.mjs} +1 -1
- package/dist/{stream-CkEOX5Ko.mjs → stream-Cu0kYWbc.mjs} +1 -1
- package/dist/{submit-BjdywxTq.mjs → submit-Dl_27e0n.mjs} +1 -1
- package/dist/{tags-CFAw_Sce.mjs → tags-Cdo_Pwtr.mjs} +1 -1
- package/dist/{tenant-C66iOy5O.mjs → tenant-EX-ANl6X.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-BPHUeckw.mjs} +1 -1
- package/dist/{triggers-Dv22ZXM4.mjs → triggers-Bf9hbP3h.mjs} +1 -1
- package/dist/{tunnel-BatkLdds.mjs → tunnel-CDYkWjnt.mjs} +1 -1
- package/dist/{tunnels-CstoXOoq.mjs → tunnels-CgyX8R2J.mjs} +1 -1
- package/dist/{turnstile-IoRtama4.mjs → turnstile-BUtzlW-0.mjs} +1 -1
- package/dist/{ui-DjQ4AQww.mjs → ui-DIpjthrV.mjs} +1 -1
- package/dist/{url-info-Hjhwr2la.mjs → url-info-CJsa1Oc9.mjs} +1 -1
- package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-BeKkOZz7.mjs} +1 -1
- package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-Cz-yl0_3.mjs} +1 -1
- package/dist/{user-CVHm-cnB.mjs → user-BxHjEqpd.mjs} +1 -1
- package/dist/{values-Cmlw5wGZ.mjs → values-C43NurfT.mjs} +1 -1
- package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CjXfiFH4.mjs} +1 -1
- package/dist/{versions-CU6Av1vh.mjs → versions-BFbc90Wu.mjs} +1 -1
- package/dist/{waiting-rooms-ku9UsAr9.mjs → waiting-rooms-C5jSQv_r.mjs} +1 -1
- package/dist/{web-assets-DmSKaxzf.mjs → web-assets-BzM5vVzy.mjs} +1 -1
- package/dist/{web3-DVv4jNul.mjs → web3-Ctv9HGiR.mjs} +1 -1
- package/dist/{workers-D8czeT64.mjs → workers-D-YbIedB.mjs} +1 -1
- package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B44wc67O.mjs} +1 -1
- package/dist/{workflows-BOi5MTEN.mjs → workflows-rFuQWClt.mjs} +1 -1
- package/dist/{zaraz-CGSSFJng.mjs → zaraz-BA6kY-b6.mjs} +1 -1
- package/dist/{zero-trust-BmA0VkgF.mjs → zero-trust-DOFLlUz1.mjs} +1 -1
- package/dist/{zone-Bx5ElO9U.mjs → zone-B_rgejLV.mjs} +1 -1
- package/dist/{zone-tags-izd3WWmy.mjs → zone-tags-BWdza4rH.mjs} +1 -1
- package/dist/{zones-_SnlZMiM.mjs → zones-DTWO7Vvn.mjs} +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p}from"./prompt-CDtLWxNv.mjs";function m(e){return e.option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Creates a signed JWT token used to preview custom pages before they are published.`,builder:m,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/preview_tokens`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({act:u(r.act,`act`,`text`),target:u(r.target,`target`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.customPages.accountCustomPages.previewTokens.create({body:e,account_identifier:p})),{successLabel:`Created`});return}r.act===void 0&&(r.act=await d(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),r.target===void 0&&(r.target=await d(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),r.url===void 0&&(r.url=await d(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let m=l({act:u(r.act,`act`,`text`),target:u(r.target,`target`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Creating`,async()=>f.customPages.accountCustomPages.previewTokens.create({body:m,account_identifier:p})),{successLabel:`Created`})}},ee={command:`preview-tokens`,describe:`Account preview tokens operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?l({state:u(r.state,`state`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.customPages.accountCustomPages.update({...e,account_identifier:m,identifier:r.identifier})),{successLabel:`Updated`});return}r.state===void 0&&(r.state=await f(`state`,`The custom page state.`,[`default`,`customized`])),r.url===void 0&&(r.url=await d(`url`,`The URL associated with the custom page.`));let h=l({state:u(r.state,`state`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Updating`,async()=>p.customPages.accountCustomPages.update({...h,account_identifier:m,identifier:r.identifier})),{successLabel:`Updated`})}},v={command:`account-custom-pages`,describe:`Account-scoped custom page operations`,builder:e=>e.command(_).command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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:`asset`,describe:`Creates a new custom asset at the account level.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.customPages.assets.create.custom.asset({...e,account_identifier:p})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the custom asset.`)),r.name===void 0&&(r.name=await d(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),r.url===void 0&&(r.url=await d(`url`,`The URL where the asset content is fetched from.`));let m=l({description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Creating`,async()=>f.customPages.assets.create.custom.asset({...m,account_identifier:p})),{successLabel:`Created`})}},x={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`v2 <zone-identifier>`,describe:`Creates a new custom asset at the zone level.`,builder:S,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),name:u(e.name,`name`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.customPages.assets.create.v2({...r,zone_identifier:n})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the custom asset.`)),e.name===void 0&&(e.name=await d(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),e.url===void 0&&(e.url=await d(`url`,`The URL where the asset content is fetched from.`));let f=l({description:u(e.description,`description`,`text`),name:u(e.name,`name`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Creating`,async()=>t.customPages.assets.create.v2({...f,zone_identifier:n})),{successLabel:`Created`})}},w={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`asset <asset-name>`,describe:`Deletes an existing custom asset.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets/${r[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(r[`asset-name`]))}`,pathParams:{"asset-name":String(r[`asset-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.customPages.assets.delete.custom.asset({account_identifier:l,asset_name:r[`asset-name`]})),{successLabel:`Deleted`})}},D={command:`custom`,describe:`Operations for assets.delete.custom`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const k={command:`v2 <asset-name>`,describe:`Deletes an existing custom asset.`,builder:O,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets delete v2`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>t.customPages.assets.delete.v2({zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Deleted`})}},A={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`asset <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets/${r[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(r[`asset-name`]))}`,pathParams:{"asset-name":String(r[`asset-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customPages.assets.get.custom.asset({account_identifier:l,asset_name:r[`asset-name`]})),{successLabel:`Loaded`})}},N={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`v2 <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:P,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customPages.assets.get.v2({zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Loaded`})}},I={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(F).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`assets`,describe:`Fetches all the custom assets at the account level.`,builder:L,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.customPages.assets.list.custom.assets({account_identifier:u,...c})),{successLabel:`Loaded`})}},z={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 B={command:`v2 <zone-identifier>`,describe:`Fetches all the custom assets at the zone level.`,builder:te,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf custom-pages assets list v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.customPages.assets.list.v2({zone_identifier:c,...t})),{successLabel:`Loaded`})}},V={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(B).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`asset <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets/${r[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(r[`asset-name`]))}`,pathParams:{"asset-name":String(r[`asset-name`]??``)},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.customPages.assets.update.custom.asset({...e,account_identifier:p,asset_name:r[`asset-name`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the custom asset.`)),r.url===void 0&&(r.url=await d(`url`,`The URL where the asset content is fetched from.`));let m=l({description:u(r.description,`description`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Updating`,async()=>f.customPages.assets.update.custom.asset({...m,account_identifier:p,asset_name:r[`asset-name`]})),{successLabel:`Updated`})}},W={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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:`v2 <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:G,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets update v2`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.customPages.assets.update.v2({...r,zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the custom asset.`)),e.url===void 0&&(e.url=await d(`url`,`The URL where the asset content is fetched from.`));let f=l({description:u(e.description,`description`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Updating`,async()=>t.customPages.assets.update.v2({...f,zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Updated`})}},q={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(K).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`assets`,describe:`Assets operations`,builder:e=>e.command(w).command(A).command(I).command(V).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customPages.get({account_identifier:l,identifier:r.identifier})),{successLabel:`Loaded`})}};function Z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Fetches all the custom pages at the account level.`,builder:Z,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customPages.list({account_identifier:l})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:ne,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({state:u(e.state,`state`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.customPages.update({...r,zone_identifier:n,identifier:e.identifier})),{successLabel:`Updated`});return}e.state===void 0&&(e.state=await f(`state`,`The custom page state.`,[`default`,`customized`])),e.url===void 0&&(e.url=await d(`url`,`The URL associated with the custom page.`));let p=l({state:u(e.state,`state`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Updating`,async()=>t.customPages.update({...p,zone_identifier:n,identifier:e.identifier})),{successLabel:`Updated`})}};function ie(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:ie,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages zone-custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customPages.zoneCustomPages.get({zone_identifier:n,identifier:e.identifier})),{successLabel:`Loaded`})}};function oe(e){return e.option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Fetches all the custom pages at the zone level.`,builder:oe,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages zone-custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customPages.zoneCustomPages.list({zone_identifier:n})),{successLabel:`Loaded`})}};function se(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).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 ce={command:`create <zone-identifier>`,describe:`Creates a signed JWT token used to preview custom pages before they are published. The API gateway rewrites zone-scoped requests to the account-level service endpoint.`,builder:se,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages zone-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/preview_tokens`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({act:u(e.act,`act`,`text`),target:u(e.target,`target`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.customPages.zoneCustomPages.previewTokens.create({body:r,zone_identifier:n})),{successLabel:`Created`});return}e.act===void 0&&(e.act=await d(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),e.target===void 0&&(e.target=await d(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),e.url===void 0&&(e.url=await d(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let f=l({act:u(e.act,`act`,`text`),target:u(e.target,`target`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Creating`,async()=>t.customPages.zoneCustomPages.previewTokens.create({body:f,zone_identifier:n})),{successLabel:`Created`})}},le={command:`preview-tokens`,describe:`Zone preview tokens operations`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ue={command:`zone-custom-pages`,describe:`Zone-scoped custom page operations`,builder:e=>e.command(ae).command($).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`custom-pages`,describe:`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,builder:e=>e.command(X).command(Q).command(re).command(v).command(J).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{de as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{t as r}from"./resolve-XgxRJ-Ys.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p,t as m}from"./prompt-DM4z101s.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import g from"node:fs";import _ from"node:path";const v=(e,t,n)=>{let r=e instanceof RegExp?y(e,n):e,i=t instanceof RegExp?y(t,n):t,a=r!==null&&i!=null&&ee(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},y=(e,t)=>{let n=t.match(e);return n?n[0]:null},ee=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},te=`\0SLASH`+Math.random()+`\0`,ne=`\0OPEN`+Math.random()+`\0`,b=`\0CLOSE`+Math.random()+`\0`,x=`\0COMMA`+Math.random()+`\0`,S=`\0PERIOD`+Math.random()+`\0`,re=new RegExp(te,`g`),ie=new RegExp(ne,`g`),ae=new RegExp(b,`g`),oe=new RegExp(x,`g`),se=new RegExp(S,`g`),ce=/\\\\/g,le=/\\{/g,ue=/\\}/g,de=/\\,/g,fe=/\\\./g;function C(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function pe(e){return e.replace(ce,te).replace(le,ne).replace(ue,b).replace(de,x).replace(fe,S)}function me(e){return e.replace(re,`\\`).replace(ie,`{`).replace(ae,`}`).replace(oe,`,`).replace(se,`.`)}function he(e){if(!e)return[``];let t=[],n=v(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=he(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function ge(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),w(pe(e),n,!0).map(me)}function _e(e){return`{`+e+`}`}function ve(e){return/^-?0\d/.test(e)}function ye(e,t){return e<=t}function be(e,t){return e>=t}function w(e,t,n){let r=[],i=v(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?w(i.post,t,!1):[``];if(/\$$/.test(i.pre))for(let e=0;e<o.length&&e<t;e++){let t=a+`{`+i.body+`}`+o[e];r.push(t)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=s||c,u=i.body.indexOf(`,`)>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+b+i.post,w(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=he(i.body),d.length===1&&d[0]!==void 0&&(d=w(d[0],t,!1).map(_e),d.length===1))return o.map(e=>i.pre+d[0]+e);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let e=C(d[0]),n=C(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(C(d[2])),1):1,a=ye;n<e&&(i*=-1,a=be);let o=d.some(ve);f=[];for(let s=e;a(s,n)&&f.length<t;s+=i){let e;if(c)e=String.fromCharCode(s),e===`\\`&&(e=``);else if(e=String(s),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=s<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,w(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<o.length&&r.length<t;i++){let t=a+f[e]+o[i];(!n||l||t)&&r.push(t)}}return r}const T=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},xe={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},E=e=>e.replace(/[[\]\\-]/g,`\\$&`),Se=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),D=e=>e.join(``),Ce=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(xe))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(E(d)+`-`+E(t)):t===d&&r.push(E(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(E(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(E(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[Se(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+D(r)+`]`,p=`[`+(l?``:`^`)+D(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},O=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var k;const we=new Set([`!`,`?`,`+`,`*`,`@`]),A=e=>we.has(e),j=e=>A(e.type),Te=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Ee=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),De=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),M=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),N=`(?!\\.)`,Oe=new Set([`[`,`.`]),ke=new Set([`..`,`.`]),Ae=new Set(`().*{}+?[]^$\\!`),je=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),P=`[^/]`,Me=P+`*?`,F=P+`+?`;let Ne=0;var I=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Ne;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof k&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof k&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new k(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&A(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new k(n,t);u=k.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new k(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&A(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new k(n,d);d.push(o),u=k.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new k(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,Ee)}#m(e,t=Te){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=De){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new k(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!M.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=M.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new k(null,void 0,t);return k.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!j(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?k.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&ke.has(this.#r[0]))){let n=Oe,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?N:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,O(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,O(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?N:``)+F;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?N:``)+Me+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,O(i),this.#t=!!this.#t,this.#n]}#x(){if(j(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Ae.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?F:Me,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=Ce(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=P,t=!0;continue}i+=je(c)}return[i,O(e),!!t,a]}};k=I;const Pe=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),L=(e,t,n={})=>(T(t),!n.nocomment&&t.charAt(0)===`#`?!1:new K(t,n).match(e)),Fe=/^\*+([^+@!?*[(]*)$/,Ie=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Le=e=>t=>t.endsWith(e),Re=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),ze=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Be=/^\*+\.\*+$/,Ve=e=>!e.startsWith(`.`)&&e.includes(`.`),He=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Ue=/^\.\*+$/,We=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Ge=/^\*+$/,Ke=e=>e.length!==0&&!e.startsWith(`.`),qe=e=>e.length!==0&&e!==`.`&&e!==`..`,Je=/^\?+([^+@!?*[(]*)?$/,Ye=([e,t=``])=>{let n=R([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Xe=([e,t=``])=>{let n=z([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Ze=([e,t=``])=>{let n=z([e]);return t?e=>n(e)&&e.endsWith(t):n},Qe=([e,t=``])=>{let n=R([e]);return t?e=>n(e)&&e.endsWith(t):n},R=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},z=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},B=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,V={win32:{sep:`\\`},posix:{sep:`/`}};L.sep=B===`win32`?V.win32.sep:V.posix.sep;const H=Symbol(`globstar **`);L.GLOBSTAR=H,L.filter=(e,t={})=>n=>L(n,e,t);const U=(e,t={})=>Object.assign({},e,t);L.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return L;let t=L;return Object.assign((n,r,i={})=>t(n,r,U(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,U(e,n))}static defaults(n){return t.defaults(U(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,U(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,U(e,r))}},unescape:(n,r={})=>t.unescape(n,U(e,r)),escape:(n,r={})=>t.escape(n,U(e,r)),filter:(n,r={})=>t.filter(n,U(e,r)),defaults:n=>t.defaults(U(e,n)),makeRe:(n,r={})=>t.makeRe(n,U(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,U(e,r)),match:(n,r,i={})=>t.match(n,r,U(e,i)),sep:t.sep,GLOBSTAR:H})};const W=(e,t={})=>(T(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ge(e,{max:t.braceExpandMax}));L.braceExpand=W,L.makeRe=(e,t={})=>new K(e,t).makeRe(),L.match=(e,t,n={})=>{let r=new K(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const G=/[?*]|[+@!]\(.*?\)|\[|\]/,$e=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var K=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){T(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||B,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!G.test(e[2]))&&!G.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(H)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(H,i),o=t.lastIndexOf(H),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===H?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===H)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return W(this.pattern,this.options)}parse(e){T(e);let t=this.options;if(e===`**`)return H;if(e===``)return``;let n,r=null;(n=e.match(Ge))?r=t.dot?qe:Ke:(n=e.match(Fe))?r=(t.nocase?t.dot?ze:Re:t.dot?Le:Ie)(n[1]):(n=e.match(Je))?r=(t.nocase?t.dot?Xe:Ye:t.dot?Ze:Qe)(n):(n=e.match(Be))?r=t.dot?He:Ve:(n=e.match(Ue))&&(r=We);let i=I.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?$e(e):e===H?H:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==H||a===H||(a===void 0?i!==void 0&&i!==H?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==H&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=H))});let i=t.filter(e=>e!==H);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return L.defaults(e).Minimatch}};L.AST=I,L.Minimatch=K,L.escape=Pe,L.unescape=O;function q(e){let t=e.replace(/\\/g,`/`),n=_.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function J(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}function Y(e){return`"${e.replace(/"/g,`""`)}"`}function et(e){return`CREATE TABLE IF NOT EXISTS ${Y(e)}(
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{t as r}from"./resolve-XgxRJ-Ys.mjs";import{r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p,t as m}from"./prompt-CDtLWxNv.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import g from"node:fs";import _ from"node:path";const v=(e,t,n)=>{let r=e instanceof RegExp?y(e,n):e,i=t instanceof RegExp?y(t,n):t,a=r!==null&&i!=null&&ee(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},y=(e,t)=>{let n=t.match(e);return n?n[0]:null},ee=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},te=`\0SLASH`+Math.random()+`\0`,ne=`\0OPEN`+Math.random()+`\0`,b=`\0CLOSE`+Math.random()+`\0`,x=`\0COMMA`+Math.random()+`\0`,S=`\0PERIOD`+Math.random()+`\0`,re=new RegExp(te,`g`),ie=new RegExp(ne,`g`),ae=new RegExp(b,`g`),oe=new RegExp(x,`g`),se=new RegExp(S,`g`),ce=/\\\\/g,le=/\\{/g,ue=/\\}/g,de=/\\,/g,fe=/\\\./g;function C(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function pe(e){return e.replace(ce,te).replace(le,ne).replace(ue,b).replace(de,x).replace(fe,S)}function me(e){return e.replace(re,`\\`).replace(ie,`{`).replace(ae,`}`).replace(oe,`,`).replace(se,`.`)}function he(e){if(!e)return[``];let t=[],n=v(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=he(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function ge(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),w(pe(e),n,!0).map(me)}function _e(e){return`{`+e+`}`}function ve(e){return/^-?0\d/.test(e)}function ye(e,t){return e<=t}function be(e,t){return e>=t}function w(e,t,n){let r=[],i=v(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?w(i.post,t,!1):[``];if(/\$$/.test(i.pre))for(let e=0;e<o.length&&e<t;e++){let t=a+`{`+i.body+`}`+o[e];r.push(t)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=s||c,u=i.body.indexOf(`,`)>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+b+i.post,w(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=he(i.body),d.length===1&&d[0]!==void 0&&(d=w(d[0],t,!1).map(_e),d.length===1))return o.map(e=>i.pre+d[0]+e);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let e=C(d[0]),n=C(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(C(d[2])),1):1,a=ye;n<e&&(i*=-1,a=be);let o=d.some(ve);f=[];for(let s=e;a(s,n)&&f.length<t;s+=i){let e;if(c)e=String.fromCharCode(s),e===`\\`&&(e=``);else if(e=String(s),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=s<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,w(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<o.length&&r.length<t;i++){let t=a+f[e]+o[i];(!n||l||t)&&r.push(t)}}return r}const T=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},xe={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},E=e=>e.replace(/[[\]\\-]/g,`\\$&`),Se=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),D=e=>e.join(``),Ce=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(xe))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(E(d)+`-`+E(t)):t===d&&r.push(E(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(E(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(E(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[Se(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+D(r)+`]`,p=`[`+(l?``:`^`)+D(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},O=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var k;const we=new Set([`!`,`?`,`+`,`*`,`@`]),A=e=>we.has(e),j=e=>A(e.type),Te=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Ee=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),De=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),M=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),N=`(?!\\.)`,Oe=new Set([`[`,`.`]),ke=new Set([`..`,`.`]),Ae=new Set(`().*{}+?[]^$\\!`),je=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),P=`[^/]`,Me=P+`*?`,F=P+`+?`;let Ne=0;var I=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Ne;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof k&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof k&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new k(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&A(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new k(n,t);u=k.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new k(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&A(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new k(n,d);d.push(o),u=k.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new k(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,Ee)}#m(e,t=Te){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=De){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new k(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!M.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=M.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new k(null,void 0,t);return k.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!j(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?k.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&ke.has(this.#r[0]))){let n=Oe,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?N:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,O(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,O(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?N:``)+F;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?N:``)+Me+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,O(i),this.#t=!!this.#t,this.#n]}#x(){if(j(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Ae.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?F:Me,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=Ce(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=P,t=!0;continue}i+=je(c)}return[i,O(e),!!t,a]}};k=I;const Pe=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),L=(e,t,n={})=>(T(t),!n.nocomment&&t.charAt(0)===`#`?!1:new K(t,n).match(e)),Fe=/^\*+([^+@!?*[(]*)$/,Ie=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Le=e=>t=>t.endsWith(e),Re=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),ze=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Be=/^\*+\.\*+$/,Ve=e=>!e.startsWith(`.`)&&e.includes(`.`),He=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Ue=/^\.\*+$/,We=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Ge=/^\*+$/,Ke=e=>e.length!==0&&!e.startsWith(`.`),qe=e=>e.length!==0&&e!==`.`&&e!==`..`,Je=/^\?+([^+@!?*[(]*)?$/,Ye=([e,t=``])=>{let n=R([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Xe=([e,t=``])=>{let n=z([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Ze=([e,t=``])=>{let n=z([e]);return t?e=>n(e)&&e.endsWith(t):n},Qe=([e,t=``])=>{let n=R([e]);return t?e=>n(e)&&e.endsWith(t):n},R=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},z=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},B=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,V={win32:{sep:`\\`},posix:{sep:`/`}};L.sep=B===`win32`?V.win32.sep:V.posix.sep;const H=Symbol(`globstar **`);L.GLOBSTAR=H,L.filter=(e,t={})=>n=>L(n,e,t);const U=(e,t={})=>Object.assign({},e,t);L.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return L;let t=L;return Object.assign((n,r,i={})=>t(n,r,U(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,U(e,n))}static defaults(n){return t.defaults(U(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,U(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,U(e,r))}},unescape:(n,r={})=>t.unescape(n,U(e,r)),escape:(n,r={})=>t.escape(n,U(e,r)),filter:(n,r={})=>t.filter(n,U(e,r)),defaults:n=>t.defaults(U(e,n)),makeRe:(n,r={})=>t.makeRe(n,U(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,U(e,r)),match:(n,r,i={})=>t.match(n,r,U(e,i)),sep:t.sep,GLOBSTAR:H})};const W=(e,t={})=>(T(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ge(e,{max:t.braceExpandMax}));L.braceExpand=W,L.makeRe=(e,t={})=>new K(e,t).makeRe(),L.match=(e,t,n={})=>{let r=new K(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const G=/[?*]|[+@!]\(.*?\)|\[|\]/,$e=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var K=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){T(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||B,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!G.test(e[2]))&&!G.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(H)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(H,i),o=t.lastIndexOf(H),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===H?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===H)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return W(this.pattern,this.options)}parse(e){T(e);let t=this.options;if(e===`**`)return H;if(e===``)return``;let n,r=null;(n=e.match(Ge))?r=t.dot?qe:Ke:(n=e.match(Fe))?r=(t.nocase?t.dot?ze:Re:t.dot?Le:Ie)(n[1]):(n=e.match(Je))?r=(t.nocase?t.dot?Xe:Ye:t.dot?Ze:Qe)(n):(n=e.match(Be))?r=t.dot?He:Ve:(n=e.match(Ue))&&(r=We);let i=I.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?$e(e):e===H?H:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==H||a===H||(a===void 0?i!==void 0&&i!==H?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==H&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=H))});let i=t.filter(e=>e!==H);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return L.defaults(e).Minimatch}};L.AST=I,L.Minimatch=K,L.escape=Pe,L.unescape=O;function q(e){let t=e.replace(/\\/g,`/`),n=_.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function J(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}function Y(e){return`"${e.replace(/"/g,`""`)}"`}function et(e){return`CREATE TABLE IF NOT EXISTS ${Y(e)}(
|
|
3
3
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
4
|
name TEXT UNIQUE,
|
|
5
5
|
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-DM4z101s.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const h={command:`archiveFindingInstance <finding-id>`,describe:`Archive one or more finding instances.`,builder:m,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture archiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({check_instances:l[`check-instances`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let f=c({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`new-severity`,{type:`number`,description:`The numeric severity value to apply to the finding.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a finding's severity.`})}const g={command:`changeFindingSeverity <finding-id>`,describe:"Update the severity of a Finding. This will update the `severity_override` field on the Finding payload with the new severity value.",builder:ee,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture changeFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({new_severity:l[`new-severity`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let f=c({new_severity:l[`new-severity`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function _(e){return e.option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view content flagged on or before this date.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view content flagged on or after this date.`}).option(`search`,{type:`string`,description:`Search term to filter content.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).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 content exports.`})}const v={command:`createContentExport`,describe:`Creates a CSV export for content and accepts optional filters in the payload.`,builder:_,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createContentExport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...e,account_id:f})),{successLabel:`Created`});return}let p=c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...p,account_id:f})),{successLabel:`Created`})}};function y(e){return e.option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see active items.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`severities`,{type:`string`,array:!0,description:`Filter by severity levels.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for findings export jobs.`})}const b={command:`createFindingExportCSV`,describe:`Creates a CSV export for findings and accepts optional filters in the payload.`,builder:y,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.positional(`storage-namespace-id`,{type:`string`,description:"A storage namespace identifier for the finding, used to scope finding instance exports. Constructed by base64-decoding the finding ID (which encodes `integration_id:finding_type_id`) and replacing the colon separator with a hyphen. For example, a finding ID that decodes to `00000000-0000-0000-0000-000000000001:00000000-0000-0000-0000-000000000002` becomes `00000000-0000-0000-0000-000000000001-00000000-0000-0000-0000-000000000002`.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Filter for archived status.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for finding instance exports.`})}const S={command:`createFindingInstancesExportCSV <storage-namespace-id>`,describe:"Creates a CSV export for Finding instances and accepts optional filters in the payload. The `storage_namespace_id` path parameter is derived from the finding ID by base64-decoding it (which yields `integration_id:finding_type_id`) and replacing the colon with a hyphen.",builder:x,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingInstancesExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${u[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(u[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(u[`storage-namespace-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...e,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`});return}let p=c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...p,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`})}};function C(e){return e.option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`finding-type-id`,{type:`string`,description:`The finding type this policy is associated with. All remediation actions must match this finding type.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).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 a new policy configuration.`})}const w={command:`createPolicy`,describe:`Creates a new policy configuration that defines automated actions to be executed when security findings are detected. A policy can include multiple remediation and/or webhook actions that will be triggered automatically.`,builder:C,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createPolicy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...e,account_id:p})),{successLabel:`Created`});return}if(d[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(d[`display-name`]===void 0&&(d[`display-name`]=await u(`display-name`,`Display name for the policy configuration.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`finding-type-id`]===void 0&&(d[`finding-type-id`]=await u(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let m=c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]});i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.option(`finding-instance-ids`,{type:`string`,array:!0,description:`UUIDs identifying Finding Instances.`}).option(`remediation-type-id`,{type:`string`,description:`A UUID identifying this Remediation Type.`}).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 remediation jobs.`})}const E={command:`createRemediationJobs`,describe:`Create one or more remediation jobs tied to a specific Cloudflare Account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createRemediationJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...e,account_id:p})),{successLabel:`Created`});return}if(d[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);d[`remediation-type-id`]===void 0&&(d[`remediation-type-id`]=await u(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let m=c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)});i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or before this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or after this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`status`,{type:`string`,array:!0,description:`Filter by remediation job status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for remediation jobs export.`})}const O={command:`createRemediationJobsExportCSV`,describe:`Creates a CSV export for remediation jobs and accepts optional filters in the payload.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createRemediationJobsExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status});i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function k(e){return e.option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).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 a new webhook configuration.`})}const A={command:`createWebhook`,describe:`Creates a new webhook configuration for sending finding notifications to external endpoints.`,builder:k,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture createWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),f.label===void 0&&(f.label=await u(`label`,`Account-specified display label for the webhook configuration.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.option(`finding-instance-ids`,{type:`string`,array:!0,description:`Array of finding instance IDs to send to the webhooks.`}).option(`webhook-ids`,{type:`string`,array:!0,description:`Array of webhook IDs to trigger jobs for.`}).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 up to 100 webhook jobs. The number of jobs is the product of webhook_ids and finding_instance_ids.`})}const M={command:`createWebhookJobs`,describe:`Creates webhook jobs to send a finding instance to one or more configured webhooks.`,builder:j,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture createWebhookJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...e,account_id:d})),{successLabel:`Created`});return}if(l[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(l[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let f=c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...f,account_id:d})),{successLabel:`Created`})}};function N(e){return e.positional(`policy-id`,{type:`string`,description:`A UUID identifying the policy.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`deletePolicy <policy-id>`,describe:`Deletes a policy configuration.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deletePolicy`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const h={command:`archiveFindingInstance <finding-id>`,describe:`Archive one or more finding instances.`,builder:m,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture archiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({check_instances:l[`check-instances`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let f=c({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`new-severity`,{type:`number`,description:`The numeric severity value to apply to the finding.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a finding's severity.`})}const g={command:`changeFindingSeverity <finding-id>`,describe:"Update the severity of a Finding. This will update the `severity_override` field on the Finding payload with the new severity value.",builder:ee,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture changeFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({new_severity:l[`new-severity`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let f=c({new_severity:l[`new-severity`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function _(e){return e.option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view content flagged on or before this date.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view content flagged on or after this date.`}).option(`search`,{type:`string`,description:`Search term to filter content.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).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 content exports.`})}const v={command:`createContentExport`,describe:`Creates a CSV export for content and accepts optional filters in the payload.`,builder:_,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createContentExport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...e,account_id:f})),{successLabel:`Created`});return}let p=c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...p,account_id:f})),{successLabel:`Created`})}};function y(e){return e.option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see active items.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`severities`,{type:`string`,array:!0,description:`Filter by severity levels.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for findings export jobs.`})}const b={command:`createFindingExportCSV`,describe:`Creates a CSV export for findings and accepts optional filters in the payload.`,builder:y,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.positional(`storage-namespace-id`,{type:`string`,description:"A storage namespace identifier for the finding, used to scope finding instance exports. Constructed by base64-decoding the finding ID (which encodes `integration_id:finding_type_id`) and replacing the colon separator with a hyphen. For example, a finding ID that decodes to `00000000-0000-0000-0000-000000000001:00000000-0000-0000-0000-000000000002` becomes `00000000-0000-0000-0000-000000000001-00000000-0000-0000-0000-000000000002`.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Filter for archived status.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for finding instance exports.`})}const S={command:`createFindingInstancesExportCSV <storage-namespace-id>`,describe:"Creates a CSV export for Finding instances and accepts optional filters in the payload. The `storage_namespace_id` path parameter is derived from the finding ID by base64-decoding it (which yields `integration_id:finding_type_id`) and replacing the colon with a hyphen.",builder:x,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingInstancesExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${u[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(u[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(u[`storage-namespace-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...e,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`});return}let p=c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...p,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`})}};function C(e){return e.option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`finding-type-id`,{type:`string`,description:`The finding type this policy is associated with. All remediation actions must match this finding type.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).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 a new policy configuration.`})}const w={command:`createPolicy`,describe:`Creates a new policy configuration that defines automated actions to be executed when security findings are detected. A policy can include multiple remediation and/or webhook actions that will be triggered automatically.`,builder:C,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createPolicy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...e,account_id:p})),{successLabel:`Created`});return}if(d[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(d[`display-name`]===void 0&&(d[`display-name`]=await u(`display-name`,`Display name for the policy configuration.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`finding-type-id`]===void 0&&(d[`finding-type-id`]=await u(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let m=c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]});i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.option(`finding-instance-ids`,{type:`string`,array:!0,description:`UUIDs identifying Finding Instances.`}).option(`remediation-type-id`,{type:`string`,description:`A UUID identifying this Remediation Type.`}).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 remediation jobs.`})}const E={command:`createRemediationJobs`,describe:`Create one or more remediation jobs tied to a specific Cloudflare Account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createRemediationJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...e,account_id:p})),{successLabel:`Created`});return}if(d[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);d[`remediation-type-id`]===void 0&&(d[`remediation-type-id`]=await u(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let m=c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)});i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or before this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or after this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`status`,{type:`string`,array:!0,description:`Filter by remediation job status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for remediation jobs export.`})}const O={command:`createRemediationJobsExportCSV`,describe:`Creates a CSV export for remediation jobs and accepts optional filters in the payload.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createRemediationJobsExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status});i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function k(e){return e.option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).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 a new webhook configuration.`})}const A={command:`createWebhook`,describe:`Creates a new webhook configuration for sending finding notifications to external endpoints.`,builder:k,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture createWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),f.label===void 0&&(f.label=await u(`label`,`Account-specified display label for the webhook configuration.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.option(`finding-instance-ids`,{type:`string`,array:!0,description:`Array of finding instance IDs to send to the webhooks.`}).option(`webhook-ids`,{type:`string`,array:!0,description:`Array of webhook IDs to trigger jobs for.`}).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 up to 100 webhook jobs. The number of jobs is the product of webhook_ids and finding_instance_ids.`})}const M={command:`createWebhookJobs`,describe:`Creates webhook jobs to send a finding instance to one or more configured webhooks.`,builder:j,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture createWebhookJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...e,account_id:d})),{successLabel:`Created`});return}if(l[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(l[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let f=c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...f,account_id:d})),{successLabel:`Created`})}};function N(e){return e.positional(`policy-id`,{type:`string`,description:`A UUID identifying the policy.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`deletePolicy <policy-id>`,describe:`Deletes a policy configuration.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deletePolicy`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.dataSecurity.posture.deletePolicy({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const I={command:`deleteWebhook <webhook-id>`,describe:`Soft deletes a webhook configuration by its unique identifier. The webhook will be marked as deleted and will no longer be available for use.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deleteWebhook`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.dataSecurity.posture.deleteWebhook({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Deleted`})}};function L(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`evaluateExistingWebhook <webhook-id>`,describe:`Sends a test webhook event using an existing webhook configuration. This allows customers to verify their webhook endpoint is still reachable and properly configured after creating the webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture evaluateExistingWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.dataSecurity.posture.evaluateExistingWebhook({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Created`})}};function z(e){return e.option(`authentication-type`,{type:`string`,description:`Type of authentication to use for the test webhook request.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL to send the test webhook event to.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for testing a webhook configuration before creating it.`})}const B={command:`evaluateNewWebhook`,describe:`Sends a test webhook event to the specified destination URL to verify the webhook endpoint is reachable and properly configured. This allows customers to validate their webhook configuration before creating the actual webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`,builder:z,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture evaluateNewWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL to send the test webhook event to.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...h,account_id:m})),{successLabel:`Created`})}};function V(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the export job`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`getExportJob <id>`,describe:`Retrieves a single export job by its unique identifier`,builder:V,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getExportJob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getExportJob({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function U(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`getFinding <finding-id>`,describe:`Gets a security Finding that has been identified as being problematic.`,builder:U,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFinding`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}`,pathParams:{"finding-id":String(s[`finding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFinding({account_id:l,finding_id:s[`finding-id`]})),{successLabel:`Loaded`})}};function G(e){return e.positional(`instance-id`,{type:`string`,description:`A uuid ID identifying this Finding instance.`,demandOption:!0}).option(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`getFindingInstance <instance-id>`,describe:`Gets a security Finding instance by id.`,builder:G,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFindingInstance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/instances/${s[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(s[`instance-id`]))}`,pathParams:{"finding-id":String(s[`finding-id`]??``),"instance-id":String(s[`instance-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFindingInstance({account_id:l,finding_id:s[`finding-id`],instance_id:s[`instance-id`]})),{successLabel:`Loaded`})}};function q(e){return e.positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`getFindingType <finding-type-id>`,describe:`Retrieve a specific finding type by its unique identifier.`,builder:q,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${s[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(s[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(s[`finding-type-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFindingType({account_id:l,finding_type_id:s[`finding-type-id`]})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`policy-id`,{type:`string`,description:`The UUID of the policy configuration to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`getPolicyByID <policy-id>`,describe:`Retrieves the details of a specific policy configuration, including its associated remediation and webhook actions.`,builder:Y,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getPolicyByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getPolicyById({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`getRemediationTypesForFindingType <finding-type-id>`,describe:"List all remediation types for a given finding type. This endpoint supports both cursor and offset pagination. Note that `cursor` and `page` are mutually exclusive.",builder:Z,handler:async s=>{let c={integration_id:s[`integration-id`],cursor:s.cursor,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf data-security posture getRemediationTypesForFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${s[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(s[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(s[`finding-type-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.getRemediationTypesForFindingType({account_id:u,finding_type_id:s[`finding-type-id`],...c})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`getWebhookConfigByID <webhook-id>`,describe:`Retrieves a specific webhook configuration by its unique identifier.`,builder:Q,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getWebhookConfigByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getWebhookConfigById({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Loaded`})}};function re(e){return e.option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const ie={command:`ignoreFinding`,describe:`Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`,builder:re,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture ignoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({checks:l.checks}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.ignoreFinding({body:e,account_id:d})),{successLabel:`Created`});return}if(l.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let f=c({checks:l.checks});i(await o(`Creating`,async()=>u.dataSecurity.posture.ignoreFinding({body:f,account_id:d})),{successLabel:`Created`})}};function ae(e){return e.option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-profile-id`,{type:`string`,description:`Filter by an DLP profile ID`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering content assets.`,choices:[`asset_name`,`dlp_profile_count`,`integration_name`,`latest_affliction_date`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`listContentAssets`,describe:`List DLP content findings`,builder:p(ae),handler:async s=>{let c={direction:s.direction,dlp_profile_id:s[`dlp-profile-id`],integration_id:s[`integration-id`],max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],order:s.order,page:s.page,per_page:s[`per-page`],search:s.search,vendor:s.vendor};if(s.dryRun){a({command:`cf data-security posture listContentAssets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listContentAssets({account_id:u,...c})),{successLabel:`Loaded`})}};function se(e){return e.option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`status`,{type:`string`,description:`Filter on export job's status`,choices:[`Pending`,`Success`,`Failure`,`Rescheduled`,`In-Progress`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`listExportJobs`,describe:`List all export jobs for a given requestor's organization`,builder:p(se),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],status:s.status};if(s.dryRun){a({command:`cf data-security posture listExportJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listExportJobs({account_id:u,...c})),{successLabel:`Loaded`})}};function le(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`archived`,{type:`boolean`,description:`Archived`}).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering the Finding's instances.
|
|
5
5
|
When ordering by 'remediation.status', only the most recent non-stale remediation job is considered. Stale jobs (created before the instance's affliction_date) are treated as having no status for ordering purposes.`,choices:[`affliction_date`,`asset.name`,`remediation.status`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`remediation-statuses`,{type:`string`,description:`Filter finding instances by most recent remediation job status. Supports multiple comma-separated values.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";function a(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`get`,describe:`Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation.`,builder:a,handler:async a=>{if(a.dryRun){r({command:`cf dcv-delegation get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/dcv_delegation/uuid`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.dcvDelegation.get({zone_id:s})),{successLabel:`Loaded`})}},s={command:`dcv-delegation`,describe:`dcv-delegation`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./shared-
|
|
2
|
+
import{n as e,t}from"./shared-BzPQog8H.mjs";function n(t){return e(t).option(`dispatch-namespace`,{type:`string`,description:`Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)`,requiresArg:!0})}const r={command:`deploy`,describe:`Deploy a worker to Cloudflare`,builder:n,handler:async e=>{await t(e,{command:`Deploy`})}};export{r as default};
|