cf 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +88 -88
- package/dist/_meta/commands.json +5268 -5350
- package/dist/_meta/schemas.json +33572 -1148
- package/dist/abuse-reports-KtfZhi6j.mjs +8 -0
- package/dist/accounts-BopMfODC.mjs +21 -0
- package/dist/acm-BT4vlnEJ.mjs +3 -0
- package/dist/addressing-B3uFxHst.mjs +13 -0
- package/dist/ai-DWHqwMap.mjs +2 -0
- package/dist/ai-gateway-CbKEO-3o.mjs +8 -0
- package/dist/ai-search-VnOQ5n--.mjs +7 -0
- package/dist/alerting-BmmgIlIO.mjs +6 -0
- package/dist/analytics-isY03taL.mjs +20 -0
- package/dist/api-gateway-DXurEbA-.mjs +33 -0
- package/dist/argo-B02BL_hp.mjs +2 -0
- package/dist/audit-logs-DcgR9xUc.mjs +2 -0
- package/dist/auth-CQcAgnOy.mjs +135 -0
- package/dist/{auth-DQ8miey6.mjs → auth-DenWm_X0.mjs} +3 -3
- package/dist/autorag-CmrwnGVj.mjs +2 -0
- package/dist/{billing-lwBHNTXC.mjs → billing-CaW1ZAB1.mjs} +1 -1
- package/dist/bot-management-CeBsFx68.mjs +5 -0
- package/dist/botnet-feed-B396vQeQ.mjs +3 -0
- package/dist/brand-protection-D4V1v5Kl.mjs +3 -0
- package/dist/browser-rendering-GF7rNtKI.mjs +4 -0
- package/dist/build-5jmmOZhm.mjs +1054 -0
- package/dist/cache-DmXizSMi.mjs +5 -0
- package/dist/calls-x4KQpTB4.mjs +4 -0
- package/dist/certificate-authorities-hC0SG-Ga.mjs +2 -0
- package/dist/client-certificates-BGVsDyeJ.mjs +3 -0
- package/dist/cloud-connector-BClQpEzI.mjs +2 -0
- package/dist/cloudforce-one-BfhFrO6M.mjs +21 -0
- package/dist/{config-BIfdEY0E.mjs → config-DYzlVxcB.mjs} +1 -1
- package/dist/connectivity-G0NP6LtW.mjs +3 -0
- package/dist/content-scanning-DEtPJ7aF.mjs +4 -0
- package/dist/context-CC0Rhkhy.mjs +2 -0
- package/dist/custom-certificates-rJXFpUWu.mjs +5 -0
- package/dist/custom-hostnames-Be5mgLeF.mjs +5 -0
- package/dist/custom-nameservers-CoFdy6hD.mjs +3 -0
- package/dist/custom-pages-D-oErw57.mjs +4 -0
- package/dist/d1-C95ckPKI.mjs +3 -0
- package/dist/dcv-delegation-CWSkbGuc.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-DbkiIzUr.mjs +2 -0
- package/dist/{dev-BfKYB-R_.mjs → dev-C6iSuQZm.mjs} +1 -1
- package/dist/diagnostics-DEEhPnXj.mjs +3 -0
- package/dist/dispatch-namespaces-BzXeV7PH.mjs +7 -0
- package/dist/{dist-C_bu5HwZ.mjs → dist-CnSubA1Z.mjs} +1 -1
- package/dist/dist-DNBSHor6.mjs +301 -0
- package/dist/dns-firewall-BQXD_NxG.mjs +57 -0
- package/dist/dns-qW-3TZOT.mjs +29 -0
- package/dist/durable-objects-CgWFYEJJ.mjs +2 -0
- package/dist/email-routing-tdNJaCpJ.mjs +10 -0
- package/dist/email-security-DTVHNr2h.mjs +60 -0
- package/dist/email-sending-DsFTvE31.mjs +3 -0
- package/dist/filters-DO1Is_tI.mjs +4 -0
- package/dist/firewall-DbUhVTCg.mjs +11 -0
- package/dist/fraud-Bzr4njYb.mjs +8 -0
- package/dist/google-tag-gateway-BQxkA90M.mjs +2 -0
- package/dist/healthchecks-BBAs-lS_.mjs +4 -0
- package/dist/hostnames-Dz9PEUKS.mjs +3 -0
- package/dist/hyperdrive-B1iUJddG.mjs +18 -0
- package/dist/iam-CJM8gHpG.mjs +6 -0
- package/dist/images-DEoBmtFS.mjs +5 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BM6xkZ0C.mjs +3 -0
- package/dist/{ips-B0cK7D0_.mjs → ips-B8fwxKZD.mjs} +1 -1
- package/dist/keyless-certificates-DffYnd4b.mjs +3 -0
- package/dist/kv-BTceLtWZ.mjs +5 -0
- package/dist/leaked-credential-checks-CALfvoCo.mjs +3 -0
- package/dist/load-balancers-C1Ho1gCF.mjs +6 -0
- package/dist/logpush-CSYhgevA.mjs +4 -0
- package/dist/logs-DlIwmMpt.mjs +3 -0
- package/dist/magic-cloud-networking-Czu0pZ0a.mjs +5 -0
- package/dist/magic-network-monitoring-d7GJE5Yt.mjs +4 -0
- package/dist/magic-transit-qQmA-981.mjs +89 -0
- package/dist/managed-transforms-Dd6AnbWE.mjs +3 -0
- package/dist/mtls-certificates-C0rlCRGs.mjs +3 -0
- package/dist/network-interconnects-CxG2deY0.mjs +36 -0
- package/dist/organizations-DyEAiGiR.mjs +41 -0
- package/dist/origin-ca-certificates-S8RcoMF6.mjs +3 -0
- package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +2 -0
- package/dist/origin-tls-client-auth-BlxMmQrE.mjs +5 -0
- package/dist/page-rules-DP-w6TAm.mjs +18 -0
- package/dist/page-shield-Bf7kFp8c.mjs +37 -0
- package/dist/pages-D0Y_XRqW.mjs +10 -0
- package/dist/pipelines-C-SPESAk.mjs +6 -0
- package/dist/{progress-DZfTxbrx.mjs → progress-CjcQ6ato.mjs} +1 -1
- package/dist/queues-wv6CZsi8.mjs +6 -0
- package/dist/r2-DuXjp9n5.mjs +21 -0
- package/dist/r2-data-catalog-DQCMrmNO.mjs +14 -0
- package/dist/radar-BW_ZHP8X.mjs +2 -0
- package/dist/rate-limits-DLTkIvwr.mjs +5 -0
- package/dist/raw-fetch-hRv-6P3D.mjs +2 -0
- package/dist/realtime-kit-Ch7Vg3vj.mjs +6 -0
- package/dist/{registrar-7Qy50zbW.mjs → registrar-DIIv6fWd.mjs} +6 -6
- package/dist/request-tracers-DMej0Drs.mjs +2 -0
- package/dist/resource-sharing-CYJ7cMWq.mjs +5 -0
- package/dist/resource-tagging-Dnz65MgH.mjs +16 -0
- package/dist/rules-DLJpOYbC.mjs +4 -0
- package/dist/rulesets-D9nqEJT5.mjs +8 -0
- package/dist/rum-DBVmdPkp.mjs +4 -0
- package/dist/schema-validation-MCd3xdtX.mjs +4 -0
- package/dist/scim-DZA3VXog.mjs +3 -0
- package/dist/secrets-store-BrvcZSOM.mjs +21 -0
- package/dist/security-center-BU6f3Cm1.mjs +2 -0
- package/dist/security-txt-BPIbP3dG.mjs +3 -0
- package/dist/{session-mW-s8ghP.mjs → session-H7IV2BrM.mjs} +1 -1
- package/dist/shared-DEzmTsEC.mjs +2 -0
- package/dist/smart-shield-e8XFBkiF.mjs +3 -0
- package/dist/snippets-B4M3MMb8.mjs +4 -0
- package/dist/{spawn-D_cjG87Z.mjs → spawn-13QQ0IwO.mjs} +1 -1
- package/dist/spectrum-B0adfSRI.mjs +59 -0
- package/dist/speed-BVcUtkAz.mjs +4 -0
- package/dist/{src-C5qivNKH.mjs → src-B9cKsgsg.mjs} +8 -8
- package/dist/ssl-BAa91gsc.mjs +15 -0
- package/dist/stream-D53sxKb3.mjs +14 -0
- package/dist/tenants-bH5pt3dJ.mjs +2 -0
- package/dist/token-validation-M61Vx_Tw.mjs +4 -0
- package/dist/turnstile-wAU0Gc2Z.mjs +23 -0
- package/dist/{ui-mP_arYIg.mjs → ui-BXjU1dX1.mjs} +1 -1
- package/dist/url-normalization-DZrWDgB5.mjs +3 -0
- package/dist/url-scanner-Zo49edNp.mjs +2 -0
- package/dist/user-DbXlVReB.mjs +10 -0
- package/dist/vectorize-CUnTM0DT.mjs +4 -0
- package/dist/versions-DzyrlUAi.mjs +2 -0
- package/dist/waiting-rooms-BZW0X69-.mjs +11 -0
- package/dist/web3-DueyOQtx.mjs +4 -0
- package/dist/workers-builds-BM_aoeUR.mjs +7 -0
- package/dist/workers-nV_vBCfV.mjs +16 -0
- package/dist/workflows-CQITmo-s.mjs +4 -0
- package/dist/zaraz-DIbpF5Op.mjs +2 -0
- package/dist/zero-trust-CKp8j512.mjs +119 -0
- package/dist/zones-BZ5tZDbH.mjs +28 -0
- package/package.json +4 -4
- package/dist/abuse-reports-ChV_yD7f.mjs +0 -8
- package/dist/accounts-BCYecXFh.mjs +0 -21
- package/dist/acm-DD8zSds2.mjs +0 -3
- package/dist/addressing-D4Eqw5Bi.mjs +0 -13
- package/dist/ai-DfXMOMx_.mjs +0 -2
- package/dist/ai-gateway-DdRFthMo.mjs +0 -8
- package/dist/ai-search-C_68CDj1.mjs +0 -7
- package/dist/alerting-DbhqhVCp.mjs +0 -6
- package/dist/analytics-BSBBc7ep.mjs +0 -20
- package/dist/api-gateway-CZ4swbkQ.mjs +0 -33
- package/dist/argo-tms9ZwHO.mjs +0 -2
- package/dist/audit-logs-24qyW8cl.mjs +0 -2
- package/dist/auth-BlSmtIKd.mjs +0 -112
- package/dist/autorag-kgNt06GD.mjs +0 -2
- package/dist/bot-management-LKf7BqUr.mjs +0 -5
- package/dist/botnet-feed-nQ-gErTS.mjs +0 -3
- package/dist/brand-protection-DOKv9GRr.mjs +0 -3
- package/dist/browser-rendering-CBExtgGt.mjs +0 -4
- package/dist/build-C_48VvoK.mjs +0 -1056
- package/dist/cache-BBiiNZHP.mjs +0 -5
- package/dist/calls-DA5Xzwev.mjs +0 -4
- package/dist/certificate-authorities-sXyR_yGp.mjs +0 -2
- package/dist/client-certificates-tV0aCLQJ.mjs +0 -3
- package/dist/cloud-connector-DZfHcSso.mjs +0 -2
- package/dist/cloudforce-one-y1PgQmI9.mjs +0 -21
- package/dist/connectivity-8SOqaFDn.mjs +0 -3
- package/dist/content-scanning-B9y6K_G5.mjs +0 -4
- package/dist/context-DTIbtQn5.mjs +0 -2
- package/dist/custom-certificates-sWksR8Ys.mjs +0 -5
- package/dist/custom-hostnames-91QZkdqN.mjs +0 -5
- package/dist/custom-nameservers-DajZaZvE.mjs +0 -3
- package/dist/custom-pages-Cu7gmwzT.mjs +0 -4
- package/dist/d1-H_VRsVmF.mjs +0 -3
- package/dist/dcv-delegation-C-qhEYEZ.mjs +0 -2
- package/dist/deploy--9wYOkHg.mjs +0 -2
- package/dist/diagnostics-D2B2LPZZ.mjs +0 -3
- package/dist/dispatch-namespaces-CyrXBU_w.mjs +0 -7
- package/dist/dist-DvKjT2TT.mjs +0 -303
- package/dist/dns-Bn9Uz_Nj.mjs +0 -29
- package/dist/dns-firewall-BslP4p-j.mjs +0 -57
- package/dist/durable-objects-BN1ZnHhm.mjs +0 -2
- package/dist/email-routing-n2TnTaRR.mjs +0 -10
- package/dist/email-security-C9SEx0kh.mjs +0 -60
- package/dist/email-sending-DayZ7u3I.mjs +0 -3
- package/dist/filters-CI_XTgfQ.mjs +0 -4
- package/dist/firewall-CcaayGig.mjs +0 -11
- package/dist/fraud-Cr7aPCV8.mjs +0 -8
- package/dist/google-tag-gateway-B3GpYgQ4.mjs +0 -2
- package/dist/healthchecks-CVTsR_OC.mjs +0 -4
- package/dist/hostnames-Bd_Wa5l6.mjs +0 -3
- package/dist/hyperdrive-BBJhEDZd.mjs +0 -18
- package/dist/iam-D_FN0pDF.mjs +0 -6
- package/dist/images-CAP2hAlZ.mjs +0 -5
- package/dist/intel-CkxfzqmJ.mjs +0 -3
- package/dist/keyless-certificates-LcLmHZsX.mjs +0 -3
- package/dist/kv-_TkUQ6fs.mjs +0 -5
- package/dist/leaked-credential-checks-Dhvaen22.mjs +0 -3
- package/dist/load-balancers-Ckr0UIpk.mjs +0 -6
- package/dist/logpush-Cj946hxT.mjs +0 -4
- package/dist/logs-DgC9hjvJ.mjs +0 -3
- package/dist/magic-cloud-networking-WbDvPzuG.mjs +0 -5
- package/dist/magic-network-monitoring-BcHShvGQ.mjs +0 -4
- package/dist/magic-transit-B8sCOkt_.mjs +0 -89
- package/dist/managed-transforms-BpOr-8HY.mjs +0 -3
- package/dist/mtls-certificates-fOul8D5g.mjs +0 -3
- package/dist/network-interconnects-BSW65xlh.mjs +0 -36
- package/dist/organizations-T4vKGFAb.mjs +0 -41
- package/dist/origin-ca-certificates-ChM0lZ64.mjs +0 -3
- package/dist/origin-post-quantum-encryption-C7o26ARh.mjs +0 -2
- package/dist/origin-tls-client-auth-D32dpZk_.mjs +0 -5
- package/dist/page-rules-RFoj8CjN.mjs +0 -18
- package/dist/page-shield-VTktzKDN.mjs +0 -37
- package/dist/pages-L1ITjXDZ.mjs +0 -10
- package/dist/pipelines-BPO0Lnil.mjs +0 -6
- package/dist/queues-B0C06L9r.mjs +0 -6
- package/dist/r2-DP020Tmq.mjs +0 -21
- package/dist/r2-data-catalog-Dmipvz5F.mjs +0 -14
- package/dist/radar-DR3VMknH.mjs +0 -2
- package/dist/rate-limits-DnHPBPgU.mjs +0 -5
- package/dist/raw-fetch-DlXYwVA8.mjs +0 -2
- package/dist/realtime-kit-C430aq2d.mjs +0 -6
- package/dist/request-tracers-sv99NDIl.mjs +0 -2
- package/dist/resource-sharing-uEjC7lnQ.mjs +0 -5
- package/dist/resource-tagging-CiODdP3N.mjs +0 -16
- package/dist/rules-FXAyTrwk.mjs +0 -4
- package/dist/rulesets-B6aUsFFB.mjs +0 -8
- package/dist/rum-CyyGJhp5.mjs +0 -4
- package/dist/schema-validation-ByU49h--.mjs +0 -4
- package/dist/scim-DdTS65_C.mjs +0 -3
- package/dist/secrets-store-ClOUVhBJ.mjs +0 -18
- package/dist/security-center-4iSBqTrf.mjs +0 -2
- package/dist/security-txt-kGxdkDY6.mjs +0 -3
- package/dist/smart-shield-B-SQd2Qp.mjs +0 -3
- package/dist/snippets-Aq58ojqw.mjs +0 -4
- package/dist/spectrum-0gFvGI6y.mjs +0 -59
- package/dist/speed-DAZU8w3T.mjs +0 -4
- package/dist/ssl-BRlXa-5w.mjs +0 -15
- package/dist/stream-BAxsVeBX.mjs +0 -14
- package/dist/tenants-Df6xDqoA.mjs +0 -2
- package/dist/token-validation-pO4dCjCy.mjs +0 -4
- package/dist/turnstile-B1dmO8wE.mjs +0 -23
- package/dist/url-normalization-sUDVmrUt.mjs +0 -3
- package/dist/url-scanner-CwOKRkYo.mjs +0 -2
- package/dist/user-D_UrIdNq.mjs +0 -10
- package/dist/vectorize-BEbBn9G9.mjs +0 -4
- package/dist/waiting-rooms-BQC-urV4.mjs +0 -11
- package/dist/web3-CIH2iQeX.mjs +0 -4
- package/dist/workers-B9EvrpH3.mjs +0 -16
- package/dist/workers-builds-DzWSiRd2.mjs +0 -7
- package/dist/workflows-aD81gA4k.mjs +0 -4
- package/dist/zaraz-Cg1dsvrZ.mjs +0 -2
- package/dist/zero-trust-D-xQXWcy.mjs +0 -119
- package/dist/zones-DQzucJDd.mjs +0 -28
- /package/dist/{schema-D0_cbcDt.mjs → schema-CHBfkARI.mjs} +0 -0
- /package/dist/{tools-CtKbk6VS.mjs → tools-B7QiNu-d.mjs} +0 -0
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,t as n}from"./auth-BlSmtIKd.mjs";import{t as r}from"./output-D7_yAFVR.mjs";import{n as i,t as a}from"./progress-DZfTxbrx.mjs";import{n as o}from"./input-validation-zEO81MWN.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const c={command:`create`,describe:`Uploads a new OpenAPI schema for API Shield schema validation. The schema defines expected request/response formats for API endpoints.`,builder:s,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/schemas`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Creating`,async()=>s.post(`/zones/${e.zoneId}/schema_validation/schemas`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>s.schemaValidation.schemas.create(c)),{successLabel:`Created`})}};function l(e){return e.positional(`schemaId`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const u={command:`delete <schemaId>`,describe:`Permanently removes an uploaded OpenAPI schema from API Shield. Operations using this schema will lose their validation rules.`,builder:l,handler:async o=>{if(o.dryRun){i({command:`cf schema-validation schemas delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zoneId??`<zoneId>`}/schema_validation/schemas/${o.schemaId??`<schemaId>`}`,pathParams:{zoneId:String(o.zoneId??``),schemaId:String(o.schemaId??``)},bodyKind:`none`});return}let s=await n(o),c=await t({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,!await e({force:!!o.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}r(await a(`Deleting`,async()=>s.schemaValidation.schemas.delete(c,o.schemaId)),{successLabel:`Deleted`})}};function d(e){return e.positional(`schemaId`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`edit <schemaId>`,describe:`Modifies an existing OpenAPI schema in API Shield, updating the validation rules for associated API operations.`,builder:d,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation schemas edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/schemas/${e.schemaId??`<schemaId>`}`,pathParams:{zoneId:String(e.zoneId??``),schemaId:String(e.schemaId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.patch(`/zones/${e.zoneId}/schema_validation/schemas/${e.schemaId}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.schemas.edit(c,e.schemaId)),{successLabel:`Updated`})}};function p(e){return e.positional(`schemaId`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <schemaId>`,describe:`Gets the contents and metadata of a specific OpenAPI schema uploaded to API Shield.`,builder:p,handler:async e=>{let o={omit_source:e.omitSource};if(e.dryRun){i({command:`cf schema-validation schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/schemas/${e.schemaId??`<schemaId>`}`,pathParams:{zoneId:String(e.zoneId??``),schemaId:String(e.schemaId??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.get(c,e.schemaId,o)),{successLabel:`Loaded`})}};function h(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists all unique hosts found in uploaded OpenAPI schemas for the zone.`,builder:h,handler:async e=>{let o={page:e.page,per_page:e.perPage};if(e.dryRun){i({command:`cf schema-validation schemas hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/schemas/hosts`,pathParams:{zoneId:String(e.zoneId??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.hosts.list(c,o)),{successLabel:`Loaded`})}},_={command:`hosts`,describe:`List schema hosts and extract operations from uploaded schemas`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`,default:!1}).option(`validation-enabled`,{type:`boolean`,description:`Filter for enabled schemas`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Lists all OpenAPI schemas uploaded to API Shield with pagination support.`,builder:v,handler:async e=>{let o={page:e.page,per_page:e.perPage,omit_source:e.omitSource,validation_enabled:e.validationEnabled};if(e.dryRun){i({command:`cf schema-validation schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/schemas`,pathParams:{zoneId:String(e.zoneId??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.list(c,o)),{successLabel:`Loaded`})}};function b(e){return e.positional(`schemaId`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`host`,{type:`string`,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`operation-status`,{type:`string`,description:"Filter results by whether operations exist in Web Asset Management or not. `new` will just return operations from the schema that do not exist otherwise. `existing` will just return operations from the schema that already exist.",choices:[`new`,`existing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <schemaId>`,describe:`Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.`,builder:b,handler:async e=>{let o={feature:e.feature,host:e.host,method:e.method,endpoint:e.endpoint,page:e.page,per_page:e.perPage,operation_status:e.operationStatus};if(e.dryRun){i({command:`cf schema-validation schemas operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/schemas/${e.schemaId??`<schemaId>`}/operations`,pathParams:{zoneId:String(e.zoneId??``),schemaId:String(e.schemaId??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.operations.get(c,e.schemaId,o)),{successLabel:`Loaded`})}},S={command:`operations`,describe:`List schema hosts and extract operations from uploaded schemas`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`schemas`,describe:`Uploaded API schemas used to validate incoming requests against expected formats`,builder:e=>e.command(c).command(u).command(f).command(m).command(y).command(_).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`edit`,describe:`Partially updates global schema validation settings for a zone using PATCH semantics.`,builder:w,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.patch(`/zones/${e.zoneId}/schema_validation/settings`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.edit(c)),{successLabel:`Updated`})}};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`Retrieves the current global schema validation settings for a zone.`,builder:E,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let o=await n(e),s=await t({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s,r(await a(`Loading`,async()=>o.schemaValidation.settings.get(s)),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`bulk-edit`,describe:`Updates schema validation settings for multiple API operations in a single request. Efficient for applying consistent validation rules across endpoints.`,builder:O,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings operations bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings/operations`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.patch(`/zones/${e.zoneId}/schema_validation/settings/operations`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.operations.bulkEdit(c)),{successLabel:`Updated`})}};function A(e){return e.positional(`operationId`,{type:`string`,description:`Operation ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const j={command:`delete <operationId>`,describe:`Removes custom schema validation settings for a specific API operation, reverting to zone-level defaults.`,builder:A,handler:async o=>{if(o.dryRun){i({command:`cf schema-validation settings operations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zoneId??`<zoneId>`}/schema_validation/settings/operations/${o.operationId??`<operationId>`}`,pathParams:{zoneId:String(o.zoneId??``),operationId:String(o.operationId??``)},bodyKind:`none`});return}let s=await n(o),c=await t({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,!await e({force:!!o.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}r(await a(`Deleting`,async()=>s.schemaValidation.settings.operations.delete(c,o.operationId)),{successLabel:`Deleted`})}};function M(e){return e.positional(`operationId`,{type:`string`,description:`Operation ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <operationId>`,describe:`Retrieves the schema validation settings configured for a specific API operation.`,builder:M,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings/operations/${e.operationId??`<operationId>`}`,pathParams:{zoneId:String(e.zoneId??``),operationId:String(e.operationId??``)},bodyKind:`none`});return}let o=await n(e),s=await t({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s,r(await a(`Loading`,async()=>o.schemaValidation.settings.operations.get(s,e.operationId)),{successLabel:`Loaded`})}};function P(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists all per-operation schema validation settings configured for the zone.`,builder:P,handler:async e=>{let o={page:e.page,per_page:e.perPage};if(e.dryRun){i({command:`cf schema-validation settings operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings/operations`,pathParams:{zoneId:String(e.zoneId??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.settings.operations.list(c,o)),{successLabel:`Loaded`})}};function I(e){return e.positional(`operationId`,{type:`string`,description:`Operation ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`update <operationId>`,describe:`Fully updates schema validation settings for a specific API operation.`,builder:I,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings operations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings/operations/${e.operationId??`<operationId>`}`,pathParams:{zoneId:String(e.zoneId??``),operationId:String(e.operationId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.put(`/zones/${e.zoneId}/schema_validation/settings/operations/${e.operationId}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.operations.update(c,e.operationId)),{successLabel:`Updated`})}},R={command:`operations`,describe:`Zone-level schema validation settings including default actions for unmatched requests`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update`,describe:`Fully updates global schema validation settings for a zone, replacing existing configuration.`,builder:z,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/schema_validation/settings`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.put(`/zones/${e.zoneId}/schema_validation/settings`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.update(c)),{successLabel:`Updated`})}},V={command:`settings`,describe:`Zone-level schema validation settings including default actions for unmatched requests`,builder:e=>e.command(T).command(D).command(B).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`schema-validation`,describe:`API schema validation settings — enforce request/response schemas and configure validation behavior`,builder:e=>e.command(C).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
package/dist/scim-DdTS65_C.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,t as n,u as r}from"./auth-BlSmtIKd.mjs";import{t as i}from"./output-D7_yAFVR.mjs";import{n as a,t as o}from"./progress-DZfTxbrx.mjs";import{n as s,t as c}from"./input-validation-zEO81MWN.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const d={command:`create`,describe:"Creates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).",builder:u,handler:async t=>{if(t.dryRun){a({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:{body:t.body,file:t.file}});return}let u=await n(t),d=t.local?l:await e(u);if(t.accountId=d,t.file){let e=c(t.file);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body){let e=s(t.body,`body`,`binary`);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function f(e){return e.positional(`groupId`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <groupId>`,describe:`Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`,builder:f,handler:async s=>{if(s.dryRun){a({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups/${s.groupId??`<groupId>`}`,pathParams:{groupId:String(s.groupId??``)},bodyKind:`none`});return}let c=await n(s),u=s.local?l:await e(c);if(s.accountId=u,!await t({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.scim.groups.delete(u,s.groupId)),{successLabel:`Deleted`})}};function m(e){return e.positional(`groupId`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const h={command:`edit <groupId>`,describe:"Partially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.",builder:m,handler:async t=>{if(t.dryRun){a({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups/${t.groupId??`<groupId>`}`,pathParams:{groupId:String(t.groupId??``)},bodyKind:`octet-stream`,body:{body:t.body,file:t.file}});return}let u=await n(t),d=t.local?l:await e(u);if(t.accountId=d,t.file){let e=c(t.file);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Groups/${t.groupId}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body){let e=s(t.body,`body`,`binary`);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Groups/${t.groupId}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`groupId`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <groupId>`,describe:`Retrieves a single SCIM Group resource by group ID.`,builder:g,handler:async t=>{if(t.dryRun){a({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups/${t.groupId??`<groupId>`}`,pathParams:{groupId:String(t.groupId??``)},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.groups.get(c,t.groupId)),{successLabel:`Loaded`})}};function v(e){return e.option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `displayName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:"Lists SCIM Group resources for the account. Returns both system groups (backed by Cloudflare permission groups, prefixed `cloudflare-v1-`) and custom user groups. Supports filtering by `displayName` using SCIM filter syntax.",builder:v,handler:async t=>{let s={startIndex:t.startIndex,count:t.count,filter:t.filter};if(t.dryRun){a({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups`,pathParams:{},query:s,bodyKind:`none`});return}let c=await n(t),u=t.local?l:await e(c);t.accountId=u,i(await o(`Loading`,async()=>c.scim.groups.list(u,s)),{successLabel:`Loaded`})}},b={command:`groups`,describe:`Groups operations`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`resourceTypeId`,{type:`string`,description:`The resource type identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <resourceTypeId>`,describe:"Returns a single SCIM resource type by ID (RFC 7643 Section 6). Valid IDs are `User` and `Group`.",builder:x,handler:async t=>{if(t.dryRun){a({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/ResourceTypes/${t.resourceTypeId??`<resourceTypeId>`}`,pathParams:{resourceTypeId:String(t.resourceTypeId??``)},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.resourceTypes.get(c,t.resourceTypeId)),{successLabel:`Loaded`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Returns the list of SCIM resource types supported by the Cloudflare SCIM service (RFC 7643 Section 6, RFC 7644 Section 4). Clients use this to discover available resource categories (e.g. Users, Groups) and their associated schemas. Query parameters are not supported on this endpoint.`,builder:C,handler:async t=>{if(t.dryRun){a({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.resourceTypes.list(c)),{successLabel:`Loaded`})}},T={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.positional(`schemaId`,{type:`string`,description:`The schema URI identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <schemaId>`,describe:"Returns a single SCIM schema definition by schema URI ID (RFC 7643 Section 7). Valid IDs are `urn:ietf:params:scim:schemas:core:2.0:User` and `urn:ietf:params:scim:schemas:core:2.0:Group`.",builder:E,handler:async t=>{if(t.dryRun){a({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Schemas/${t.schemaId??`<schemaId>`}`,pathParams:{schemaId:String(t.schemaId??``)},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.schemas.get(c,t.schemaId)),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Returns the list of SCIM schemas supported by the Cloudflare SCIM service (RFC 7643 Section 7, RFC 7644 Section 4). Clients use this to introspect the attributes of each resource type. Query parameters are not supported on this endpoint.`,builder:O,handler:async t=>{if(t.dryRun){a({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.schemas.list(c)),{successLabel:`Loaded`})}},A={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`Returns the SCIM 2.0 Service Provider configuration (RFC 7643 Section 5). IdPs use this endpoint to auto-configure their SCIM integration with Cloudflare, discovering which optional features (patch, bulk, filter, etc.) are supported.`,builder:j,handler:async t=>{if(t.dryRun){a({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.serviceProviderConfig.get(c)),{successLabel:`Loaded`})}},N={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const F={command:`create`,describe:"Provisions a new account member via SCIM. The `userName` field must be a valid email address and must match the primary email in `emails`. The account must be an Enterprise account with SCIM entitlements enabled.",builder:P,handler:async t=>{if(t.dryRun){a({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:{body:t.body,file:t.file}});return}let u=await n(t),d=t.local?l:await e(u);if(t.accountId=d,t.file){let e=c(t.file);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body){let e=s(t.body,`body`,`binary`);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function I(e){return e.positional(`userId`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const L={command:`edit <userId>`,describe:'Partially updates a SCIM User via PATCH operations (RFC 7644 Section 3.5.2). Supports updating `userName`, `name.givenName`, `name.familyName`, and `active`. Setting `active: false` deprovisions the user (removes them from the account). For IdP compatibility, `emails[type eq "work"].value` is also accepted as an alias for `userName`.',builder:I,handler:async t=>{if(t.dryRun){a({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users/${t.userId??`<userId>`}`,pathParams:{userId:String(t.userId??``)},bodyKind:`octet-stream`,body:{body:t.body,file:t.file}});return}let u=await n(t),d=t.local?l:await e(u);if(t.accountId=d,t.file){let e=c(t.file);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Users/${t.userId}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body){let e=s(t.body,`body`,`binary`);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Users/${t.userId}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function R(e){return e.positional(`userId`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <userId>`,describe:`Retrieves a single account member as a SCIM User resource by user tag.`,builder:R,handler:async t=>{if(t.dryRun){a({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users/${t.userId??`<userId>`}`,pathParams:{userId:String(t.userId??``)},bodyKind:`none`});return}let s=await n(t),c=t.local?l:await e(s);t.accountId=c,i(await o(`Loading`,async()=>s.scim.users.get(c,t.userId)),{successLabel:`Loaded`})}};function B(e){return e.option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `userName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:'Lists account members as SCIM User resources. Supports optional filtering by `userName` (email) using the SCIM filter syntax (e.g. `userName eq "user@example.com"`). Pagination is controlled via `startIndex` and `count` query parameters per RFC 7644 Section 3.4.2.4.',builder:B,handler:async t=>{let s={startIndex:t.startIndex,count:t.count,filter:t.filter};if(t.dryRun){a({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users`,pathParams:{},query:s,bodyKind:`none`});return}let c=await n(t),u=t.local?l:await e(c);t.accountId=u,i(await o(`Loading`,async()=>c.scim.users.list(u,s)),{successLabel:`Loaded`})}};function H(e){return e.positional(`userId`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const U={command:`update <userId>`,describe:"Replaces a SCIM User resource (RFC 7644 Section 3.5.1). Fully replaces the mutable attributes of the user. Supports updating `userName`, `name`, `emails`, and `active`.",builder:H,handler:async t=>{if(t.dryRun){a({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users/${t.userId??`<userId>`}`,pathParams:{userId:String(t.userId??``)},bodyKind:`octet-stream`,body:{body:t.body,file:t.file}});return}let u=await n(t),d=t.local?l:await e(u);if(t.accountId=d,t.file){let e=c(t.file);i(await o(`Updating`,async()=>u.put(`/accounts/${d}/scim/v2/Users/${t.userId}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body){let e=s(t.body,`body`,`binary`);i(await o(`Updating`,async()=>u.put(`/accounts/${d}/scim/v2/Users/${t.userId}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},W={command:`users`,describe:`Users operations`,builder:e=>e.command(F).command(L).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(b).command(T).command(A).command(N).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,m as n,t as r,u as i}from"./auth-BlSmtIKd.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-DZfTxbrx.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Lists the number of secrets used in the account.`,builder:f,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.secretsStore.quota.get(a)),{successLabel:`Loaded`})}},m={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.positional(`storeId`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create <storeId>`,describe:`Creates a secret in the account`,builder:ee,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t.storeId??`<storeId>`}/secrets`,pathParams:{storeId:String(t.storeId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await r(t),a=t.local?d:await e(n);if(t.accountId=a,t.body){let e=o(t.body);s(await l(`Creating`,async()=>n.post(`/accounts/${a}/secrets_store/stores/${t.storeId}/secrets`,{body:e})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`storeId`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk deleting secrets`})}const _={command:`delete <storeId>`,describe:`Deletes one or more secrets`,builder:g,handler:async n=>{if(n.dryRun){c({command:`cf secrets-store secrets bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${n.storeId??`<storeId>`}/secrets`,pathParams:{storeId:String(n.storeId??``)},bodyKind:`json`,body:{ids:n.ids,body:n.body}});return}let u=await r(n),f=n.local?d:await e(u);if(n.accountId=f,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}if(n.body){let e=o(n.body);s(await l(`Deleting`,async()=>u.delete(`/accounts/${f}/secrets_store/stores/${n.storeId}/secrets`,{body:e})),{successLabel:`Deleted`});return}if(n.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let p={};n.ids!==void 0&&a(p,[`ids`],n.ids),s(await l(`Deleting`,async()=>u.delete(`/accounts/${f}/secrets_store/stores/${n.storeId}/secrets`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Deleted`})}},v={command:`bulk`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store 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 b={command:`delete <secretId>`,describe:`Deletes a single secret`,builder:y,handler:async n=>{if(n.dryRun){c({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${n.storeId??`<storeId>`}/secrets/${n.secretId??`<secretId>`}`,pathParams:{storeId:String(n.storeId??``),secretId:String(n.secretId??``)},bodyKind:`none`});return}let a=await r(n),o=n.local?d:await e(a);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}s(await l(`Deleting`,async()=>a.secretsStore.secrets.delete(o,n.storeId,n.secretId)),{successLabel:`Deleted`})}};function x(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`name`,{type:`string`,description:`The name of the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).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 S={command:`duplicate <secretId>`,describe:`Duplicates the secret, keeping the value`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t.storeId??`<storeId>`}/secrets/${t.secretId??`<secretId>`}/duplicate`,pathParams:{storeId:String(t.storeId??``),secretId:String(t.secretId??``)},bodyKind:`json`,body:{comment:t.comment,name:t.name,scopes:t.scopes,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores/${t.storeId}/secrets/${t.secretId}/duplicate`,{body:e})),{successLabel:`Created`});return}if(t.name===void 0&&(t.name=await n(`name`,`The name of the secret`)),t.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let m={};t.comment!==void 0&&a(m,[`comment`],u(t.comment,`comment`,`text`)),t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),t.scopes!==void 0&&a(m,[`scopes`],t.scopes),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores/${t.storeId}/secrets/${t.secretId}/duplicate`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function C(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response will provide this value, it is only used to create/modify secrets.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <secretId>`,describe:`Updates a single secret`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t.storeId??`<storeId>`}/secrets/${t.secretId??`<secretId>`}`,pathParams:{storeId:String(t.storeId??``),secretId:String(t.secretId??``)},bodyKind:`json`,body:{comment:t.comment,scopes:t.scopes,value:t.value,body:t.body}});return}let n=await r(t),f=t.local?d:await e(n);if(t.accountId=f,t.body){let e=o(t.body);s(await l(`Updating`,async()=>n.patch(`/accounts/${f}/secrets_store/stores/${t.storeId}/secrets/${t.secretId}`,{body:e})),{successLabel:`Updated`});return}let p={};t.comment!==void 0&&a(p,[`comment`],u(t.comment,`comment`,`text`)),t.scopes!==void 0&&a(p,[`scopes`],t.scopes),t.value!==void 0&&a(p,[`value`],u(t.value,`value`,`text`)),s(await l(`Updating`,async()=>n.patch(`/accounts/${f}/secrets_store/stores/${t.storeId}/secrets/${t.secretId}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function T(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <secretId>`,describe:`Returns details of a single secret`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t.storeId??`<storeId>`}/secrets/${t.secretId??`<secretId>`}`,pathParams:{storeId:String(t.storeId??``),secretId:String(t.secretId??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.secretsStore.secrets.get(a,t.storeId,t.secretId)),{successLabel:`Loaded`})}};function D(e){return e.option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,description:`Only secrets with the given scopes will be returned`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists all store secrets`,builder:D,handler:async t=>{let n={direction:t.direction,page:t.page,per_page:t.perPage,search:t.search,order:t.order,scopes:t.scopes};if(t.dryRun){c({command:`cf secrets-store secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t.storeId??`<storeId>`}/secrets`,pathParams:{storeId:String(t.storeId??``)},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.secretsStore.secrets.list(o,t.storeId,n)),{successLabel:`Loaded`})}},k={command:`secrets`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`name`,{type:`string`,description:`The name of the store`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create`,describe:`Creates a store in the account`,builder:A,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store stores create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores`,pathParams:{},bodyKind:`json`,body:{name:t.name,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`The name of the store`));let m={};t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function M(e){return e.positional(`storeId`,{type:`string`,description:`Store 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 N={command:`delete <storeId>`,describe:`Deletes a single store`,builder:M,handler:async n=>{if(n.dryRun){c({command:`cf secrets-store stores delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${n.storeId??`<storeId>`}`,pathParams:{storeId:String(n.storeId??``)},bodyKind:`none`});return}let a=await r(n),o=n.local?d:await e(a);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}s(await l(`Deleting`,async()=>a.secretsStore.stores.delete(o,n.storeId)),{successLabel:`Deleted`})}};function P(e){return e.option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists all the stores in an account`,builder:P,handler:async t=>{let n={direction:t.direction,page:t.page,per_page:t.perPage,order:t.order};if(t.dryRun){c({command:`cf secrets-store stores list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.secretsStore.stores.list(o,n)),{successLabel:`Loaded`})}},I={command:`stores`,describe:`Secret stores that hold encrypted key-value secrets accessible by Workers and services`,builder:e=>e.command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.positional(`accountTag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31'). This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the store`}).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 store via system API routes`})}const R={command:`create <accountTag>`,describe:`Creates a store in the account on behalf of the calling service. The store will be marked as managed by the authenticated service. Requires account_id in the request body.`,builder:L,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores`,pathParams:{accountTag:String(e.accountTag??``)},bodyKind:`json`,body:{name:e.name,body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/system/accounts/${e.accountTag}/stores`,{body:n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await n(`name`,`The name of the store`));let i={};e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),s(await l(`Creating`,async()=>t.post(`/system/accounts/${e.accountTag}/stores`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`storeId`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
6
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const z={command:`delete <storeId>`,describe:`Deletes a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:te,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``)},bodyKind:`none`});return}let n=await r(e);if(!await t({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}s(await l(`Deleting`,async()=>n.secretsStore.systemStores.delete(e.accountTag,e.storeId)),{successLabel:`Deleted`})}};function B(e){return e.positional(`storeId`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`id <storeId>`,describe:`Returns details of a single store`,builder:B,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store system-stores get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t.storeId??`<storeId>`}`,pathParams:{storeId:String(t.storeId??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.secretsStore.systemStores.get.by.id(a,t.storeId)),{successLabel:`Loaded`})}},H={command:`by`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`storeId`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
8
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`v2 <storeId>`,describe:`Returns details of a single store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:U,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``)},bodyKind:`none`});return}let t=await r(e);s(await l(`Loading`,async()=>t.secretsStore.systemStores.get.v2(e.accountTag,e.storeId)),{successLabel:`Loaded`})}},G={command:`get`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(W).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
9
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Lists all stores in an account that are managed by the calling service. Only returns stores where managed_by matches the authenticated service.`,builder:K,handler:async e=>{let t={direction:e.direction,page:e.page,per_page:e.perPage,order:e.order};if(e.dryRun){c({command:`cf secrets-store system-stores list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores`,pathParams:{accountTag:String(e.accountTag??``)},query:t,bodyKind:`none`});return}let n=await r(e);s(await l(`Loading`,async()=>n.secretsStore.systemStores.list(e.accountTag,t)),{successLabel:`Loaded`})}};function J(e){return e.positional(`storeId`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
10
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create <storeId>`,describe:`Creates one or more secrets in a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:J,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets`,{body:n})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function X(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
11
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store 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 Z={command:`id <secretId>`,describe:`Deletes a single secret from a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:X,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets delete by id`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets/${e.secretId??`<secretId>`}`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``),secretId:String(e.secretId??``)},bodyKind:`none`});return}let n=await r(e);if(!await t({force:!!e.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);return}s(await l(`Deleting`,async()=>n.secretsStore.systemStores.secrets.delete.by.id(e.accountTag,e.storeId,e.secretId)),{successLabel:`Deleted`})}},Q={command:`by`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
13
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk deleting secrets`})}const re={command:`bulk`,describe:`Deletes one or more secrets from a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:ne,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets delete system bulk`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``)},bodyKind:`json`,body:{ids:e.ids,body:e.body}});return}let n=await r(e);if(!await t({force:!!e.force})){process.stderr.write(`Aborted.
|
|
14
|
-
`);return}if(e.body){let t=o(e.body);s(await l(`Deleting`,async()=>n.delete(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets`,{body:t})),{successLabel:`Deleted`});return}if(e.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let i={};e.ids!==void 0&&a(i,[`ids`],e.ids),s(await l(`Deleting`,async()=>n.delete(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Deleted`})}},ie={command:`system`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ae={command:`delete`,describe:`Operations for system-stores.secrets.delete`,builder:e=>e.command(Q).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
15
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`name`,{type:`string`,description:`The name of the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).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:`create <secretId>`,describe:`Duplicates a secret in a store managed by the calling service, keeping the value. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:oe,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets duplicate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets/${e.secretId??`<secretId>`}/duplicate`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``),secretId:String(e.secretId??``)},bodyKind:`json`,body:{comment:e.comment,name:e.name,scopes:e.scopes,body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets/${e.secretId}/duplicate`,{body:n})),{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await n(`name`,`The name of the secret`)),e.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let i={};e.comment!==void 0&&a(i,[`comment`],u(e.comment,`comment`,`text`)),e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),e.scopes!==void 0&&a(i,[`scopes`],e.scopes),s(await l(`Creating`,async()=>t.post(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets/${e.secretId}/duplicate`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}},se={command:`duplicate`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
16
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response will provide this value, it is only used to create/modify secrets.`}).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 le={command:`edit <secretId>`,describe:`Updates a single secret in a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:ce,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets/${e.secretId??`<secretId>`}`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``),secretId:String(e.secretId??``)},bodyKind:`json`,body:{comment:e.comment,scopes:e.scopes,value:e.value,body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets/${e.secretId}`,{body:n})),{successLabel:`Updated`});return}let n={};e.comment!==void 0&&a(n,[`comment`],u(e.comment,`comment`,`text`)),e.scopes!==void 0&&a(n,[`scopes`],e.scopes),e.value!==void 0&&a(n,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/system/accounts/${e.accountTag}/stores/${e.storeId}/secrets/${e.secretId}`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}};function ue(e){return e.positional(`secretId`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
17
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <secretId>`,describe:`Returns details of a single secret from a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:ue,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets/${e.secretId??`<secretId>`}`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``),secretId:String(e.secretId??``)},bodyKind:`none`});return}let t=await r(e);s(await l(`Loading`,async()=>t.secretsStore.systemStores.secrets.get(e.accountTag,e.storeId,e.secretId)),{successLabel:`Loaded`})}};function fe(e){return e.option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
|
|
18
|
-
This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,description:`Only secrets with the given scopes will be returned`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Lists all secrets in a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:fe,handler:async e=>{let t={direction:e.direction,page:e.page,per_page:e.perPage,search:e.search,order:e.order,scopes:e.scopes};if(e.dryRun){c({command:`cf secrets-store system-stores secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e.accountTag??`<accountTag>`}/stores/${e.storeId??`<storeId>`}/secrets`,pathParams:{accountTag:String(e.accountTag??``),storeId:String(e.storeId??``)},query:t,bodyKind:`none`});return}let n=await r(e);s(await l(`Loading`,async()=>n.secretsStore.systemStores.secrets.list(e.accountTag,e.storeId,t)),{successLabel:`Loaded`})}},me={command:`secrets`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(Y).command(le).command(de).command(pe).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`system-stores`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(R).command(z).command(q).command(G).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`secrets-store`,describe:`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,builder:e=>e.command(m).command(k).command(I).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ge as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,l as t,t as n,u as r}from"./auth-BlSmtIKd.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-DZfTxbrx.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";function u(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Retrieves Security Center insight counts aggregated by classification class.`,builder:u,handler:async t=>{let i={dismissed:t.dismissed,issue_class:t.issueClass,issue_type:t.issueType,product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){s({command:`cf security-center insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/class`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(t),u=t.local?l:await e(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.class.get(u,i)),{successLabel:`Loaded`})}},f={command:`class`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.positional(`issueId`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`dismiss <issueId>`,describe:`Archives a Security Center insight for an account, removing it from the active insights list while preserving historical data.`,builder:p,handler:async t=>{if(t.dryRun){s({command:`cf security-center insights dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/${t.issueId??`<issueId>`}/dismiss`,pathParams:{issueId:String(t.issueId??``)},bodyKind:`json`,body:{dismiss:t.dismiss,body:t.body}});return}let u=await n(t),d=t.local?l:await e(u);if(t.accountId=d,t.body){let e=a(t.body);o(await c(`Updating`,async()=>u.put(`/accounts/${d}/security-center/insights/${t.issueId}/dismiss`,{body:e})),{successLabel:`Updated`});return}let f={};t.dismiss!==void 0&&i(f,[`dismiss`],t.dismiss),o(await c(`Updating`,async()=>u.put(`/accounts/${d}/security-center/insights/${t.issueId}/dismiss`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}};function h(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`string`,description:`Page`}).option(`per-page`,{type:`string`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists all Security Center insights for the account, showing security findings and recommendations.`,builder:h,handler:async t=>{let i={dismissed:t.dismissed,issue_class:t.issueClass,issue_type:t.issueType,product:t.product,severity:t.severity,subject:t.subject,page:t.page,per_page:t.perPage};if(t.dryRun){s({command:`cf security-center insights list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(t),u=t.local?l:await e(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.list(u,i)),{successLabel:`Loaded`})}};function _(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`,builder:_,handler:async t=>{let i={dismissed:t.dismissed,issue_class:t.issueClass,issue_type:t.issueType,product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){s({command:`cf security-center insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/severity`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(t),u=t.local?l:await e(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.severity.get(u,i)),{successLabel:`Loaded`})}},y={command:`severity`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Retrieves Security Center insight counts aggregated by insight type.`,builder:b,handler:async t=>{let i={dismissed:t.dismissed,issue_class:t.issueClass,issue_type:t.issueType,product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){s({command:`cf security-center insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/type`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(t),u=t.local?l:await e(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.type.get(u,i)),{successLabel:`Loaded`})}},S={command:`type`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`insights`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(m).command(g).command(f).command(y).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by classification class.`,builder:w,handler:async e=>{let r={dismissed:e.dismissed,issue_class:e.issueClass,issue_type:e.issueType,product:e.product,severity:e.severity,subject:e.subject};if(e.dryRun){s({command:`cf security-center zone-insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/insights/class`,pathParams:{zoneId:String(e.zoneId??``)},query:r,bodyKind:`none`});return}let i=await n(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.class.get(a,r)),{successLabel:`Loaded`})}},E={command:`class`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`issueId`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <issueId>`,describe:`Returns the full context payload for an insight. This endpoint is used for insights with large payloads that are not included inline in the list response.`,builder:D,handler:async t=>{if(t.dryRun){s({command:`cf security-center zone-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/${t.issueId??`<issueId>`}/context`,pathParams:{issueId:String(t.issueId??``)},bodyKind:`none`});return}let i=await n(t),a=t.local?l:await e(i);t.accountId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.context.get(a,t.issueId)),{successLabel:`Loaded`})}},k={command:`context`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`issueId`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`update <issueId>`,describe:`Archives a zone-specific Security Center insight, removing it from the active zone insights while preserving historical data.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf security-center zone-insights dismiss update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/insights/${e.issueId??`<issueId>`}/dismiss`,pathParams:{zoneId:String(e.zoneId??``),issueId:String(e.issueId??``)},bodyKind:`json`,body:{dismiss:e.dismiss,body:e.body}});return}let r=await n(e);if(e.zoneId=await t({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>r.put(`/zones/${e.zoneId}/security-center/insights/${e.issueId}/dismiss`,{body:t})),{successLabel:`Updated`});return}let l={};e.dismiss!==void 0&&i(l,[`dismiss`],e.dismiss),o(await c(`Updating`,async()=>r.put(`/zones/${e.zoneId}/security-center/insights/${e.issueId}/dismiss`,{body:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}},M={command:`dismiss`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`string`,description:`Page`}).option(`per-page`,{type:`string`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Lists Security Center insights for a specific zone, showing zone-level security findings.`,builder:N,handler:async e=>{let r={dismissed:e.dismissed,issue_class:e.issueClass,issue_type:e.issueType,product:e.product,severity:e.severity,subject:e.subject,page:e.page,per_page:e.perPage};if(e.dryRun){s({command:`cf security-center zone-insights get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/insights`,pathParams:{zoneId:String(e.zoneId??``)},query:r,bodyKind:`none`});return}let i=await n(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.get(a,r)),{successLabel:`Loaded`})}};function F(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by severity level.`,builder:F,handler:async e=>{let r={dismissed:e.dismissed,issue_class:e.issueClass,issue_type:e.issueType,product:e.product,severity:e.severity,subject:e.subject};if(e.dryRun){s({command:`cf security-center zone-insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/insights/severity`,pathParams:{zoneId:String(e.zoneId??``)},query:r,bodyKind:`none`});return}let i=await n(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.severity.get(a,r)),{successLabel:`Loaded`})}},L={command:`severity`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by insight type.`,builder:R,handler:async e=>{let r={dismissed:e.dismissed,issue_class:e.issueClass,issue_type:e.issueType,product:e.product,severity:e.severity,subject:e.subject};if(e.dryRun){s({command:`cf security-center zone-insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/insights/type`,pathParams:{zoneId:String(e.zoneId??``)},query:r,bodyKind:`none`});return}let i=await n(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.type.get(a,r)),{successLabel:`Loaded`})}},B={command:`type`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`zone-insights`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(P).command(E).command(k).command(M).command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`security-center`,describe:`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,builder:e=>e.command(C).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,t as n}from"./auth-BlSmtIKd.mjs";import{n as r,t as i}from"./body-parser-Br-BoYk-.mjs";import{t as a}from"./output-D7_yAFVR.mjs";import{n as o,t as s}from"./progress-DZfTxbrx.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const u={command:`delete`,describe:`Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`,builder:l,handler:async r=>{if(r.dryRun){o({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zoneId??`<zoneId>`}/security-center/securitytxt`,pathParams:{zoneId:String(r.zoneId??``)},bodyKind:`none`});return}let i=await n(r),c=await t({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await e({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>i.securityTxt.delete(c)),{successLabel:`Deleted`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Retrieves the current security.txt file configuration for a zone, used for security vulnerability reporting.`,builder:d,handler:async e=>{if(e.dryRun){o({command:`cf security-txt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/securitytxt`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.securityTxt.get(i)),{successLabel:`Loaded`})}};function p(e){return e.option(`acknowledgments`,{type:`string`,array:!0,description:`The acknowledgments field`}).option(`canonical`,{type:`string`,array:!0,description:`The canonical field`}).option(`contact`,{type:`string`,array:!0,description:`The contact field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`encryption`,{type:`string`,array:!0,description:`The encryption field`}).option(`expires`,{type:`string`,description:`The expires field`}).option(`hiring`,{type:`string`,array:!0,description:`The hiring field`}).option(`policy`,{type:`string`,array:!0,description:`The policy field`}).option(`preferred-languages`,{type:`string`,description:`The preferred_languages field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`update`,describe:`Updates the security.txt file configuration for a zone, which provides security researchers with vulnerability reporting information.`,builder:p,handler:async e=>{if(e.dryRun){o({command:`cf security-txt update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/security-center/securitytxt`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{acknowledgments:e.acknowledgments,canonical:e.canonical,contact:e.contact,enabled:e.enabled,encryption:e.encryption,expires:e.expires,hiring:e.hiring,policy:e.policy,preferredLanguages:e.preferredLanguages,body:e.body}});return}let l=await n(e);if(e.zoneId=await t({zone:e.zone},l,{quiet:e.quiet}),e.body){let t=i(e.body);a(await s(`Updating`,async()=>l.put(`/zones/${e.zoneId}/security-center/securitytxt`,{body:t})),{successLabel:`Updated`});return}let u={};e.acknowledgments!==void 0&&r(u,[`acknowledgments`],e.acknowledgments),e.canonical!==void 0&&r(u,[`canonical`],e.canonical),e.contact!==void 0&&r(u,[`contact`],e.contact),e.enabled!==void 0&&r(u,[`enabled`],e.enabled),e.encryption!==void 0&&r(u,[`encryption`],e.encryption),e.expires!==void 0&&r(u,[`expires`],c(e.expires,`expires`,`text`)),e.hiring!==void 0&&r(u,[`hiring`],e.hiring),e.policy!==void 0&&r(u,[`policy`],e.policy),e.preferredLanguages!==void 0&&r(u,[`preferred_languages`],c(e.preferredLanguages,`preferredLanguages`,`text`)),a(await s(`Updating`,async()=>l.put(`/zones/${e.zoneId}/security-center/securitytxt`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},h={command:`security-txt`,describe:`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,builder:e=>e.command(u).command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,m as n,t as r}from"./auth-BlSmtIKd.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-DZfTxbrx.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The request body is currently not used.`})}const d={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:u,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/cache_reserve_clear`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=a(e.body);o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/smart_shield/cache_reserve_clear`,{body:t})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>n.smartShield.cacheReserveClear.clear(i)),{successLabel:`Created`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield cache-reserve-clear status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/cache_reserve_clear`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.smartShield.cacheReserveClear.status(i)),{successLabel:`Loaded`})}},m={command:`cache-reserve-clear`,describe:`Cache Reserve Clear operations`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve Smart Shield Settings.`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.smartShield.get(i)),{successLabel:`Loaded`})}};function _(e){return e.option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`,default:!1}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`,default:!1}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`],default:`GET`}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`,default:`/`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`,default:80}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`],default:`connection_established`}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`,default:80}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create a new health check.`,builder:_,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield health-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/healthchecks`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{address:e.address,checkRegions:e.checkRegions,consecutiveFails:e.consecutiveFails,consecutiveSuccesses:e.consecutiveSuccesses,description:e.description,httpConfigAllowInsecure:e.httpConfigAllowInsecure,httpConfigExpectedBody:e.httpConfigExpectedBody,httpConfigExpectedCodes:e.httpConfigExpectedCodes,httpConfigFollowRedirects:e.httpConfigFollowRedirects,httpConfigMethod:e.httpConfigMethod,httpConfigPath:e.httpConfigPath,httpConfigPort:e.httpConfigPort,interval:e.interval,name:e.name,retries:e.retries,suspended:e.suspended,tcpConfigMethod:e.tcpConfigMethod,tcpConfigPort:e.tcpConfigPort,timeout:e.timeout,type:e.type,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/smart_shield/healthchecks`,{body:t})),{successLabel:`Created`});return}e.address===void 0&&(e.address=await n(`address`,`The hostname or IP address of the origin server to run health checks on.`)),e.name===void 0&&(e.name=await n(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let d={};e.address!==void 0&&i(d,[`address`],l(e.address,`address`,`text`)),e.checkRegions!==void 0&&i(d,[`check_regions`],e.checkRegions),e.consecutiveFails!==void 0&&i(d,[`consecutive_fails`],e.consecutiveFails),e.consecutiveSuccesses!==void 0&&i(d,[`consecutive_successes`],e.consecutiveSuccesses),e.description!==void 0&&i(d,[`description`],l(e.description,`description`,`text`)),e.httpConfigAllowInsecure!==void 0&&i(d,[`http_config`,`allow_insecure`],e.httpConfigAllowInsecure),e.httpConfigExpectedBody!==void 0&&i(d,[`http_config`,`expected_body`],l(e.httpConfigExpectedBody,`httpConfigExpectedBody`,`text`)),e.httpConfigExpectedCodes!==void 0&&i(d,[`http_config`,`expected_codes`],e.httpConfigExpectedCodes),e.httpConfigFollowRedirects!==void 0&&i(d,[`http_config`,`follow_redirects`],e.httpConfigFollowRedirects),e.httpConfigMethod!==void 0&&i(d,[`http_config`,`method`],l(e.httpConfigMethod,`httpConfigMethod`,`text`)),e.httpConfigPath!==void 0&&i(d,[`http_config`,`path`],l(e.httpConfigPath,`httpConfigPath`,`text`)),e.httpConfigPort!==void 0&&i(d,[`http_config`,`port`],e.httpConfigPort),e.interval!==void 0&&i(d,[`interval`],e.interval),e.name!==void 0&&i(d,[`name`],l(e.name,`name`,`text`)),e.retries!==void 0&&i(d,[`retries`],e.retries),e.suspended!==void 0&&i(d,[`suspended`],e.suspended),e.tcpConfigMethod!==void 0&&i(d,[`tcp_config`,`method`],l(e.tcpConfigMethod,`tcpConfigMethod`,`text`)),e.tcpConfigPort!==void 0&&i(d,[`tcp_config`,`port`],e.tcpConfigPort),e.timeout!==void 0&&i(d,[`timeout`],e.timeout),e.type!==void 0&&i(d,[`type`],l(e.type,`type`,`text`)),o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/smart_shield/healthchecks`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function y(e){return e.positional(`healthcheckId`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`delete <healthcheckId>`,describe:`Delete a health check.`,builder:y,handler:async n=>{if(n.dryRun){s({command:`cf smart-shield health-checks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}/smart_shield/healthchecks/${n.healthcheckId??`<healthcheckId>`}`,pathParams:{healthcheckId:String(n.healthcheckId??``),zoneId:String(n.zoneId??``)},bodyKind:`json`,body:{body:n.body}});return}let i=await r(n),l=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=l,!await e({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}if(n.body){let e=a(n.body);o(await c(`Deleting`,async()=>i.delete(`/zones/${n.zoneId}/smart_shield/healthchecks/${n.healthcheckId}`,{body:e})),{successLabel:`Deleted`});return}o(await c(`Deleting`,async()=>i.smartShield.healthChecks.delete(n.healthcheckId,l)),{successLabel:`Deleted`})}};function x(e){return e.positional(`healthcheckId`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`,default:!1}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`,default:!1}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`],default:`GET`}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`,default:`/`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`,default:80}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`],default:`connection_established`}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`,default:80}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).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 S={command:`edit <healthcheckId>`,describe:`Patch a configured health check.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield health-checks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/healthchecks/${e.healthcheckId??`<healthcheckId>`}`,pathParams:{healthcheckId:String(e.healthcheckId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{address:e.address,checkRegions:e.checkRegions,consecutiveFails:e.consecutiveFails,consecutiveSuccesses:e.consecutiveSuccesses,description:e.description,httpConfigAllowInsecure:e.httpConfigAllowInsecure,httpConfigExpectedBody:e.httpConfigExpectedBody,httpConfigExpectedCodes:e.httpConfigExpectedCodes,httpConfigFollowRedirects:e.httpConfigFollowRedirects,httpConfigMethod:e.httpConfigMethod,httpConfigPath:e.httpConfigPath,httpConfigPort:e.httpConfigPort,interval:e.interval,name:e.name,retries:e.retries,suspended:e.suspended,tcpConfigMethod:e.tcpConfigMethod,tcpConfigPort:e.tcpConfigPort,timeout:e.timeout,type:e.type,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>u.patch(`/zones/${e.zoneId}/smart_shield/healthchecks/${e.healthcheckId}`,{body:t})),{successLabel:`Updated`});return}e.address===void 0&&(e.address=await n(`address`,`The hostname or IP address of the origin server to run health checks on.`)),e.name===void 0&&(e.name=await n(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let d={};e.address!==void 0&&i(d,[`address`],l(e.address,`address`,`text`)),e.checkRegions!==void 0&&i(d,[`check_regions`],e.checkRegions),e.consecutiveFails!==void 0&&i(d,[`consecutive_fails`],e.consecutiveFails),e.consecutiveSuccesses!==void 0&&i(d,[`consecutive_successes`],e.consecutiveSuccesses),e.description!==void 0&&i(d,[`description`],l(e.description,`description`,`text`)),e.httpConfigAllowInsecure!==void 0&&i(d,[`http_config`,`allow_insecure`],e.httpConfigAllowInsecure),e.httpConfigExpectedBody!==void 0&&i(d,[`http_config`,`expected_body`],l(e.httpConfigExpectedBody,`httpConfigExpectedBody`,`text`)),e.httpConfigExpectedCodes!==void 0&&i(d,[`http_config`,`expected_codes`],e.httpConfigExpectedCodes),e.httpConfigFollowRedirects!==void 0&&i(d,[`http_config`,`follow_redirects`],e.httpConfigFollowRedirects),e.httpConfigMethod!==void 0&&i(d,[`http_config`,`method`],l(e.httpConfigMethod,`httpConfigMethod`,`text`)),e.httpConfigPath!==void 0&&i(d,[`http_config`,`path`],l(e.httpConfigPath,`httpConfigPath`,`text`)),e.httpConfigPort!==void 0&&i(d,[`http_config`,`port`],e.httpConfigPort),e.interval!==void 0&&i(d,[`interval`],e.interval),e.name!==void 0&&i(d,[`name`],l(e.name,`name`,`text`)),e.retries!==void 0&&i(d,[`retries`],e.retries),e.suspended!==void 0&&i(d,[`suspended`],e.suspended),e.tcpConfigMethod!==void 0&&i(d,[`tcp_config`,`method`],l(e.tcpConfigMethod,`tcpConfigMethod`,`text`)),e.tcpConfigPort!==void 0&&i(d,[`tcp_config`,`port`],e.tcpConfigPort),e.timeout!==void 0&&i(d,[`timeout`],e.timeout),e.type!==void 0&&i(d,[`type`],l(e.type,`type`,`text`)),o(await c(`Updating`,async()=>u.patch(`/zones/${e.zoneId}/smart_shield/healthchecks/${e.healthcheckId}`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function C(e){return e.positional(`healthcheckId`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <healthcheckId>`,describe:`Fetch a single configured health check.`,builder:C,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield health-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/healthchecks/${e.healthcheckId??`<healthcheckId>`}`,pathParams:{healthcheckId:String(e.healthcheckId??``),zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.smartShield.healthChecks.get(e.healthcheckId,i)),{successLabel:`Loaded`})}};function T(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List configured health checks.`,builder:T,handler:async e=>{let n={page:e.page,per_page:e.perPage};if(e.dryRun){s({command:`cf smart-shield health-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/healthchecks`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.smartShield.healthChecks.list(a,n)),{successLabel:`Loaded`})}};function D(e){return e.positional(`healthcheckId`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`result-address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`result-check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`result-consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`result-consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`result-description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`result-http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`,default:!1}).option(`result-http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`result-http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`result-http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`,default:!1}).option(`result-http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`],default:`GET`}).option(`result-http-config-path`,{type:`string`,description:`The endpoint path to health check against.`,default:`/`}).option(`result-http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`,default:80}).option(`result-interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`result-name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`result-retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`result-suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`result-tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`],default:`connection_established`}).option(`result-tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`,default:80}).option(`result-timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`result-type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).option(`success`,{type:`boolean`,description:`Whether the API call was successful.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <healthcheckId>`,describe:`Update a configured health check.`,builder:D,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield health-checks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield/healthchecks/${e.healthcheckId??`<healthcheckId>`}`,pathParams:{healthcheckId:String(e.healthcheckId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{resultAddress:e.resultAddress,resultCheckRegions:e.resultCheckRegions,resultConsecutiveFails:e.resultConsecutiveFails,resultConsecutiveSuccesses:e.resultConsecutiveSuccesses,resultDescription:e.resultDescription,resultHttpConfigAllowInsecure:e.resultHttpConfigAllowInsecure,resultHttpConfigExpectedBody:e.resultHttpConfigExpectedBody,resultHttpConfigExpectedCodes:e.resultHttpConfigExpectedCodes,resultHttpConfigFollowRedirects:e.resultHttpConfigFollowRedirects,resultHttpConfigMethod:e.resultHttpConfigMethod,resultHttpConfigPath:e.resultHttpConfigPath,resultHttpConfigPort:e.resultHttpConfigPort,resultInterval:e.resultInterval,resultName:e.resultName,resultRetries:e.resultRetries,resultSuspended:e.resultSuspended,resultTcpConfigMethod:e.resultTcpConfigMethod,resultTcpConfigPort:e.resultTcpConfigPort,resultTimeout:e.resultTimeout,resultType:e.resultType,success:e.success,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>n.put(`/zones/${e.zoneId}/smart_shield/healthchecks/${e.healthcheckId}`,{body:t})),{successLabel:`Updated`});return}if(e.success===void 0)throw Error(`--success is required (or pass --body with this field set).`);let u={};e.resultAddress!==void 0&&i(u,[`result`,`address`],l(e.resultAddress,`resultAddress`,`text`)),e.resultCheckRegions!==void 0&&i(u,[`result`,`check_regions`],e.resultCheckRegions),e.resultConsecutiveFails!==void 0&&i(u,[`result`,`consecutive_fails`],e.resultConsecutiveFails),e.resultConsecutiveSuccesses!==void 0&&i(u,[`result`,`consecutive_successes`],e.resultConsecutiveSuccesses),e.resultDescription!==void 0&&i(u,[`result`,`description`],l(e.resultDescription,`resultDescription`,`text`)),e.resultHttpConfigAllowInsecure!==void 0&&i(u,[`result`,`http_config`,`allow_insecure`],e.resultHttpConfigAllowInsecure),e.resultHttpConfigExpectedBody!==void 0&&i(u,[`result`,`http_config`,`expected_body`],l(e.resultHttpConfigExpectedBody,`resultHttpConfigExpectedBody`,`text`)),e.resultHttpConfigExpectedCodes!==void 0&&i(u,[`result`,`http_config`,`expected_codes`],e.resultHttpConfigExpectedCodes),e.resultHttpConfigFollowRedirects!==void 0&&i(u,[`result`,`http_config`,`follow_redirects`],e.resultHttpConfigFollowRedirects),e.resultHttpConfigMethod!==void 0&&i(u,[`result`,`http_config`,`method`],l(e.resultHttpConfigMethod,`resultHttpConfigMethod`,`text`)),e.resultHttpConfigPath!==void 0&&i(u,[`result`,`http_config`,`path`],l(e.resultHttpConfigPath,`resultHttpConfigPath`,`text`)),e.resultHttpConfigPort!==void 0&&i(u,[`result`,`http_config`,`port`],e.resultHttpConfigPort),e.resultInterval!==void 0&&i(u,[`result`,`interval`],e.resultInterval),e.resultName!==void 0&&i(u,[`result`,`name`],l(e.resultName,`resultName`,`text`)),e.resultRetries!==void 0&&i(u,[`result`,`retries`],e.resultRetries),e.resultSuspended!==void 0&&i(u,[`result`,`suspended`],e.resultSuspended),e.resultTcpConfigMethod!==void 0&&i(u,[`result`,`tcp_config`,`method`],l(e.resultTcpConfigMethod,`resultTcpConfigMethod`,`text`)),e.resultTcpConfigPort!==void 0&&i(u,[`result`,`tcp_config`,`port`],e.resultTcpConfigPort),e.resultTimeout!==void 0&&i(u,[`result`,`timeout`],e.resultTimeout),e.resultType!==void 0&&i(u,[`result`,`type`],l(e.resultType,`resultType`,`text`)),e.success!==void 0&&i(u,[`success`],e.success),o(await c(`Updating`,async()=>n.put(`/zones/${e.zoneId}/smart_shield/healthchecks/${e.healthcheckId}`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},k={command:`health-checks`,describe:`Health checks operations`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`cache-reserve-value`,{type:`string`,description:`Specifies the enablement value of Cache Reserve.`,choices:[`on`,`off`]}).option(`regional-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Regional Tiered Cache.`,choices:[`on`,`off`]}).option(`smart-routing-value`,{type:`string`,description:`Specifies the enablement value of Smart Routing.`,choices:[`on`,`off`]}).option(`smart-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The patch body for Smart Shield.`})}const j={command:`update`,describe:`Set Smart Shield Settings.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf smart-shield update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/smart_shield`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{cacheReserveValue:e.cacheReserveValue,regionalTieredCacheValue:e.regionalTieredCacheValue,smartRoutingValue:e.smartRoutingValue,smartTieredCacheValue:e.smartTieredCacheValue,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/smart_shield`,{body:t})),{successLabel:`Updated`});return}let u={};e.cacheReserveValue!==void 0&&i(u,[`cache_reserve`,`value`],l(e.cacheReserveValue,`cacheReserveValue`,`text`)),e.regionalTieredCacheValue!==void 0&&i(u,[`regional_tiered_cache`,`value`],l(e.regionalTieredCacheValue,`regionalTieredCacheValue`,`text`)),e.smartRoutingValue!==void 0&&i(u,[`smart_routing`,`value`],l(e.smartRoutingValue,`smartRoutingValue`,`text`)),e.smartTieredCacheValue!==void 0&&i(u,[`smart_tiered_cache`,`value`],l(e.smartTieredCacheValue,`smartTieredCacheValue`,`text`)),o(await c(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/smart_shield`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},M={command:`smart-shield`,describe:`Smart Shield settings, health checks, and cache reserve management`,builder:e=>e.command(g).command(j).command(m).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{M as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,t as n}from"./auth-BlSmtIKd.mjs";import{t as r}from"./output-D7_yAFVR.mjs";import{n as i,t as a}from"./progress-DZfTxbrx.mjs";import{n as o}from"./input-validation-zEO81MWN.mjs";import{n as s,t as c}from"./raw-fetch-DlXYwVA8.mjs";function l(e){return e.positional(`snippetName`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const u={command:`get <snippetName>`,describe:`Fetches the content of a snippet belonging to the zone.`,builder:l,handler:async e=>{if(e.dryRun){i({command:`cf snippets content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/snippets/${e.snippetName??`<snippetName>`}/content`,pathParams:{zoneId:String(e.zoneId??``),snippetName:String(e.snippetName??``)},bodyKind:`none`});return}let r=await n(e);e.zoneId=await t({zone:e.zone},r,{quiet:e.quiet});let o=await a(`Loading`,async()=>c(`/zones/${e.zoneId}/snippets/${e.snippetName}/content`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}));s(e.text===!0?o.toString(`utf-8`):o)}},d={command:`content`,describe:`Raw JavaScript source code content of individual snippets`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.positional(`snippetName`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <snippetName>`,describe:`Deletes a snippet belonging to the zone.`,builder:f,handler:async o=>{if(o.dryRun){i({command:`cf snippets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zoneId??`<zoneId>`}/snippets/${o.snippetName??`<snippetName>`}`,pathParams:{zoneId:String(o.zoneId??``),snippetName:String(o.snippetName??``)},bodyKind:`none`});return}let s=await n(o),c=await t({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,!await e({force:!!o.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}r(await a(`Deleting`,async()=>s.snippets.delete(c,o.snippetName)),{successLabel:`Deleted`})}};function m(e){return e.positional(`snippetName`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <snippetName>`,describe:`Fetches a snippet belonging to the zone.`,builder:m,handler:async e=>{if(e.dryRun){i({command:`cf snippets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/snippets/${e.snippetName??`<snippetName>`}`,pathParams:{zoneId:String(e.zoneId??``),snippetName:String(e.snippetName??``)},bodyKind:`none`});return}let o=await n(e),s=await t({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s,r(await a(`Loading`,async()=>o.snippets.get(s,e.snippetName)),{successLabel:`Loaded`})}};function g(e){return e.option(`page`,{type:`string`,description:`Specifies the current page number.`}).option(`per-page`,{type:`string`,description:`Specifies how many results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Fetches all snippets belonging to the zone.`,builder:g,handler:async e=>{let o={page:e.page,per_page:e.perPage};if(e.dryRun){i({command:`cf snippets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/snippets`,pathParams:{zoneId:String(e.zoneId??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.snippets.list(c,o)),{successLabel:`Loaded`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete`,describe:`Deletes all snippet rules belonging to the zone.`,builder:v,handler:async o=>{if(o.dryRun){i({command:`cf snippets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zoneId??`<zoneId>`}/snippets/snippet_rules`,pathParams:{zoneId:String(o.zoneId??``)},bodyKind:`none`});return}let s=await n(o),c=await t({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,!await e({force:!!o.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}r(await a(`Deleting`,async()=>s.snippets.rules.delete(c)),{successLabel:`Deleted`})}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Fetches all snippet rules belonging to the zone.`,builder:b,handler:async e=>{if(e.dryRun){i({command:`cf snippets rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/snippets/snippet_rules`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let o=await n(e),s=await t({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s,r(await a(`Loading`,async()=>o.snippets.rules.list(s)),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet rules object.`})}const C={command:`update`,describe:`Updates all snippet rules belonging to the zone.`,builder:S,handler:async e=>{if(e.dryRun){i({command:`cf snippets rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/snippets/snippet_rules`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.put(`/zones/${e.zoneId}/snippets/snippet_rules`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.snippets.rules.update(c)),{successLabel:`Updated`})}},w={command:`rules`,describe:`Rules that determine which requests trigger specific snippets based on URL patterns`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`snippetName`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Define a snippet object.`})}const E={command:`update <snippetName>`,describe:`Creates or updates a snippet belonging to the zone.`,builder:T,handler:async e=>{if(e.dryRun){i({command:`cf snippets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/snippets/${e.snippetName??`<snippetName>`}`,pathParams:{zoneId:String(e.zoneId??``),snippetName:String(e.snippetName??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e);if(e.zoneId=await t({zone:e.zone},s,{quiet:e.quiet}),e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.put(`/zones/${e.zoneId}/snippets/${e.snippetName}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},D={command:`snippets`,describe:`Lightweight JavaScript snippets that run on requests before Workers — for quick header modifications and redirects`,builder:e=>e.command(p).command(h).command(_).command(E).command(d).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,m as n,t as r}from"./auth-BlSmtIKd.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-DZfTxbrx.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`app-id`,{type:`string`,description:`Comma-delimited list of Spectrum Application Id(s). If provided, the response will be limited to Spectrum Application Id(s) that match.`}).option(`colo-name`,{type:`string`,description:`Co-location identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Retrieves analytics aggregated from the last minute of usage on Spectrum applications underneath a given zone.`,builder:u,handler:async e=>{let n={appID:e.appID,colo_name:e.coloName};if(e.dryRun){s({command:`cf spectrum analytics aggregates currents get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/analytics/aggregate/current`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.spectrum.analytics.aggregates.currents.get(a,n)),{successLabel:`Loaded`})}},f={command:`currents`,describe:`Real-time and historical connection analytics for Spectrum applications`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`aggregates`,describe:`Operations for analytics.aggregates`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`dimensions`,{type:`string`,description:`Can be used to break down the data by given attributes. Options are:
|
|
3
|
-
|
|
4
|
-
Dimension | Name | Example
|
|
5
|
-
--------------------------|---------------------------------|--------------------------
|
|
6
|
-
event | Connection Event | connect, progress, disconnect, originError, clientFiltered
|
|
7
|
-
appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85
|
|
8
|
-
coloName | Colo Name | SFO
|
|
9
|
-
ipVersion | IP version used by the client | 4, 6.`}).option(`sort`,{type:`string`,description:"The sort order for the result set; sort fields must be included in `metrics` or `dimensions`."}).option(`until`,{type:`string`,description:`Until`}).option(`metrics`,{type:`string`,description:`One or more metrics to compute. Options are:
|
|
10
|
-
|
|
11
|
-
Metric | Name | Example | Unit
|
|
12
|
-
--------------------------|-------------------------------------|--------------------------|--------------------------
|
|
13
|
-
count | Count of total events | 1000 | Count
|
|
14
|
-
bytesIngress | Sum of ingress bytes | 1000 | Sum
|
|
15
|
-
bytesEgress | Sum of egress bytes | 1000 | Sum
|
|
16
|
-
durationAvg | Average connection duration | 1.0 | Time in milliseconds
|
|
17
|
-
durationMedian | Median connection duration | 1.0 | Time in milliseconds
|
|
18
|
-
duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds
|
|
19
|
-
duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds.`}).option(`filters`,{type:`string`,description:`Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are:
|
|
20
|
-
|
|
21
|
-
Operator | Name | URL Encoded
|
|
22
|
-
--------------------------|---------------------------------|--------------------------
|
|
23
|
-
== | Equals | %3D%3D
|
|
24
|
-
!= | Does not equals | !%3D
|
|
25
|
-
\\> | Greater Than | %3E
|
|
26
|
-
\\< | Less Than | %3C
|
|
27
|
-
\\>= | Greater than or equal to | %3E%3D
|
|
28
|
-
\\<= | Less than or equal to | %3C%3D`}).option(`since`,{type:`string`,description:`Since`}).option(`time-delta`,{type:`string`,description:`Used to select time series resolution.`,choices:[`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Retrieves a list of aggregate metrics grouped by time interval.`,builder:m,handler:async e=>{let n={dimensions:e.dimensions,sort:e.sort,until:e.until,metrics:e.metrics,filters:e.filters,since:e.since,time_delta:e.timeDelta};if(e.dryRun){s({command:`cf spectrum analytics events bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/analytics/events/bytime`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.spectrum.analytics.events.bytimes.get(a,n)),{successLabel:`Loaded`})}},g={command:`bytimes`,describe:`Real-time and historical connection analytics for Spectrum applications`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`dimensions`,{type:`string`,description:`Can be used to break down the data by given attributes. Options are:
|
|
29
|
-
|
|
30
|
-
Dimension | Name | Example
|
|
31
|
-
--------------------------|---------------------------------|--------------------------
|
|
32
|
-
event | Connection Event | connect, progress, disconnect, originError, clientFiltered
|
|
33
|
-
appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85
|
|
34
|
-
coloName | Colo Name | SFO
|
|
35
|
-
ipVersion | IP version used by the client | 4, 6.`}).option(`sort`,{type:`string`,description:"The sort order for the result set; sort fields must be included in `metrics` or `dimensions`."}).option(`until`,{type:`string`,description:`Until`}).option(`metrics`,{type:`string`,description:`One or more metrics to compute. Options are:
|
|
36
|
-
|
|
37
|
-
Metric | Name | Example | Unit
|
|
38
|
-
--------------------------|-------------------------------------|--------------------------|--------------------------
|
|
39
|
-
count | Count of total events | 1000 | Count
|
|
40
|
-
bytesIngress | Sum of ingress bytes | 1000 | Sum
|
|
41
|
-
bytesEgress | Sum of egress bytes | 1000 | Sum
|
|
42
|
-
durationAvg | Average connection duration | 1.0 | Time in milliseconds
|
|
43
|
-
durationMedian | Median connection duration | 1.0 | Time in milliseconds
|
|
44
|
-
duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds
|
|
45
|
-
duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds.`}).option(`filters`,{type:`string`,description:`Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are:
|
|
46
|
-
|
|
47
|
-
Operator | Name | URL Encoded
|
|
48
|
-
--------------------------|---------------------------------|--------------------------
|
|
49
|
-
== | Equals | %3D%3D
|
|
50
|
-
!= | Does not equals | !%3D
|
|
51
|
-
\\> | Greater Than | %3E
|
|
52
|
-
\\< | Less Than | %3C
|
|
53
|
-
\\>= | Greater than or equal to | %3E%3D
|
|
54
|
-
\\<= | Less than or equal to | %3C%3D`}).option(`since`,{type:`string`,description:`Since`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Retrieves a list of summarised aggregate metrics over a given time period.`,builder:_,handler:async e=>{let n={dimensions:e.dimensions,sort:e.sort,until:e.until,metrics:e.metrics,filters:e.filters,since:e.since};if(e.dryRun){s({command:`cf spectrum analytics events summaries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/analytics/events/summary`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.spectrum.analytics.events.summaries.get(a,n)),{successLabel:`Loaded`})}},y={command:`summaries`,describe:`Real-time and historical connection analytics for Spectrum applications`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`events`,describe:`Operations for analytics.events`,builder:e=>e.command(g).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(p).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`argo-smart-routing`,{type:`boolean`,description:`Enables Argo Smart Routing for this application.
|
|
55
|
-
Notes: Only available for TCP applications with traffic_type set to "direct".`,default:!1}).option(`dns-name`,{type:`string`,description:`The name of the DNS record associated with the application.`}).option(`dns-type`,{type:`string`,description:`The type of DNS record associated with the application.`,choices:[`CNAME`,`ADDRESS`]}).option(`edge-ips-connectivity`,{type:`string`,description:`The IP versions supported for inbound connections on Spectrum anycast IPs.`,choices:[`all`,`ipv4`,`ipv6`]}).option(`edge-ips-type`,{type:`string`,description:`The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.`,choices:[`dynamic`,`static`]}).option(`edge-ips-ips`,{type:`string`,array:!0,description:`The array of customer owned IPs we broadcast via anycast for this hostname and application.`}).option(`ip-firewall`,{type:`boolean`,description:`Enables IP Access Rules for this application.
|
|
56
|
-
Notes: Only available for TCP applications.`,default:!1}).option(`origin-direct`,{type:`string`,array:!0,description:`List of origin IP addresses. Array may contain multiple IP addresses for load balancing.`}).option(`origin-dns-name`,{type:`string`,description:`The name of the DNS record associated with the origin.`}).option(`origin-dns-ttl`,{type:`number`,description:`The TTL of our resolution of your DNS record in seconds.`}).option(`origin-dns-type`,{type:`string`,description:`The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.`,choices:[`A`,`AAAA`,`SRV`]}).option(`protocol`,{type:`string`,description:'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'}).option(`proxy-protocol`,{type:`string`,description:`Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.`,choices:[`off`,`v1`,`v2`,`simple`],default:`off`}).option(`tls`,{type:`string`,description:`The type of TLS termination associated with the application.`,choices:[`off`,`flexible`,`full`,`strict`],default:`off`}).option(`traffic-type`,{type:`string`,description:`Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the \`protocol\`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.`,choices:[`direct`,`http`,`https`],default:`direct`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`edge-ips-connectivity`,[`edge-ips-ips`]).conflicts(`edge-ips-ips`,[`edge-ips-connectivity`])}const C={command:`create`,describe:`Creates a new Spectrum application from a configuration using a name for the origin.`,builder:S,handler:async e=>{if(e.dryRun){s({command:`cf spectrum apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/apps`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{argoSmartRouting:e.argoSmartRouting,dnsName:e.dnsName,dnsType:e.dnsType,edgeIpsConnectivity:e.edgeIpsConnectivity,edgeIpsType:e.edgeIpsType,edgeIpsIps:e.edgeIpsIps,ipFirewall:e.ipFirewall,originDirect:e.originDirect,originDnsName:e.originDnsName,originDnsTtl:e.originDnsTtl,originDnsType:e.originDnsType,protocol:e.protocol,proxyProtocol:e.proxyProtocol,tls:e.tls,trafficType:e.trafficType,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/spectrum/apps`,{body:t})),{successLabel:`Created`});return}e.protocol===void 0&&(e.protocol=await n(`protocol`,'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'));let d={};e.argoSmartRouting!==void 0&&i(d,[`argo_smart_routing`],e.argoSmartRouting),e.dnsName!==void 0&&i(d,[`dns`,`name`],l(e.dnsName,`dnsName`,`text`)),e.dnsType!==void 0&&i(d,[`dns`,`type`],l(e.dnsType,`dnsType`,`text`)),e.edgeIpsConnectivity!==void 0&&i(d,[`edge_ips`,`connectivity`],l(e.edgeIpsConnectivity,`edgeIpsConnectivity`,`text`)),e.edgeIpsType!==void 0&&i(d,[`edge_ips`,`type`],l(e.edgeIpsType,`edgeIpsType`,`text`)),e.edgeIpsIps!==void 0&&i(d,[`edge_ips`,`ips`],e.edgeIpsIps),e.ipFirewall!==void 0&&i(d,[`ip_firewall`],e.ipFirewall),e.originDirect!==void 0&&i(d,[`origin_direct`],e.originDirect),e.originDnsName!==void 0&&i(d,[`origin_dns`,`name`],l(e.originDnsName,`originDnsName`,`text`)),e.originDnsTtl!==void 0&&i(d,[`origin_dns`,`ttl`],e.originDnsTtl),e.originDnsType!==void 0&&i(d,[`origin_dns`,`type`],l(e.originDnsType,`originDnsType`,`text`)),e.protocol!==void 0&&i(d,[`protocol`],l(e.protocol,`protocol`,`text`)),e.proxyProtocol!==void 0&&i(d,[`proxy_protocol`],l(e.proxyProtocol,`proxyProtocol`,`text`)),e.tls!==void 0&&i(d,[`tls`],l(e.tls,`tls`,`text`)),e.trafficType!==void 0&&i(d,[`traffic_type`],l(e.trafficType,`trafficType`,`text`)),o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/spectrum/apps`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function w(e){return e.positional(`appId`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <appId>`,describe:`Deletes a previously existing application.`,builder:w,handler:async n=>{if(n.dryRun){s({command:`cf spectrum apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}/spectrum/apps/${n.appId??`<appId>`}`,pathParams:{appId:String(n.appId??``),zoneId:String(n.zoneId??``)},bodyKind:`none`});return}let i=await r(n),a=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=a,!await e({force:!!n.force})){process.stderr.write(`Aborted.
|
|
57
|
-
`);return}o(await c(`Deleting`,async()=>i.spectrum.apps.delete(n.appId,a)),{successLabel:`Deleted`})}};function E(e){return e.positional(`appId`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <appId>`,describe:`Gets the application configuration of a specific application inside a zone.`,builder:E,handler:async e=>{if(e.dryRun){s({command:`cf spectrum apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/apps/${e.appId??`<appId>`}`,pathParams:{appId:String(e.appId??``),zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.spectrum.apps.get(e.appId,i)),{successLabel:`Loaded`})}};function O(e){return e.option(`page`,{type:`number`,description:"Page number of paginated results. This parameter is required in order to use other pagination parameters. If included in the query, `result_info` will be present in the response."}).option(`per-page`,{type:`number`,description:`Sets the maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sets the direction by which results are ordered.`,choices:[`asc`,`desc`]}).option(`order`,{type:`string`,description:`Application field by which results are ordered.`,choices:[`protocol`,`app_id`,`created_on`,`modified_on`,`dns`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Retrieves a list of currently existing Spectrum applications inside a zone.`,builder:O,handler:async e=>{let n={page:e.page,per_page:e.perPage,direction:e.direction,order:e.order};if(e.dryRun){s({command:`cf spectrum apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/apps`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.spectrum.apps.list(a,n)),{successLabel:`Loaded`})}};function A(e){return e.positional(`appId`,{type:`string`,description:`App ID`,demandOption:!0}).option(`argo-smart-routing`,{type:`boolean`,description:`Enables Argo Smart Routing for this application.
|
|
58
|
-
Notes: Only available for TCP applications with traffic_type set to "direct".`,default:!1}).option(`dns-name`,{type:`string`,description:`The name of the DNS record associated with the application.`}).option(`dns-type`,{type:`string`,description:`The type of DNS record associated with the application.`,choices:[`CNAME`,`ADDRESS`]}).option(`edge-ips-connectivity`,{type:`string`,description:`The IP versions supported for inbound connections on Spectrum anycast IPs.`,choices:[`all`,`ipv4`,`ipv6`]}).option(`edge-ips-type`,{type:`string`,description:`The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.`,choices:[`dynamic`,`static`]}).option(`edge-ips-ips`,{type:`string`,array:!0,description:`The array of customer owned IPs we broadcast via anycast for this hostname and application.`}).option(`ip-firewall`,{type:`boolean`,description:`Enables IP Access Rules for this application.
|
|
59
|
-
Notes: Only available for TCP applications.`,default:!1}).option(`origin-direct`,{type:`string`,array:!0,description:`List of origin IP addresses. Array may contain multiple IP addresses for load balancing.`}).option(`origin-dns-name`,{type:`string`,description:`The name of the DNS record associated with the origin.`}).option(`origin-dns-ttl`,{type:`number`,description:`The TTL of our resolution of your DNS record in seconds.`}).option(`origin-dns-type`,{type:`string`,description:`The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records.`,choices:[`A`,`AAAA`,`SRV`]}).option(`protocol`,{type:`string`,description:'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'}).option(`proxy-protocol`,{type:`string`,description:`Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.`,choices:[`off`,`v1`,`v2`,`simple`],default:`off`}).option(`tls`,{type:`string`,description:`The type of TLS termination associated with the application.`,choices:[`off`,`flexible`,`full`,`strict`],default:`off`}).option(`traffic-type`,{type:`string`,description:`Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the \`protocol\`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.`,choices:[`direct`,`http`,`https`],default:`direct`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`edge-ips-connectivity`,[`edge-ips-ips`]).conflicts(`edge-ips-ips`,[`edge-ips-connectivity`])}const j={command:`update <appId>`,describe:`Updates a previously existing application's configuration that uses a name for the origin.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf spectrum apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/spectrum/apps/${e.appId??`<appId>`}`,pathParams:{appId:String(e.appId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{argoSmartRouting:e.argoSmartRouting,dnsName:e.dnsName,dnsType:e.dnsType,edgeIpsConnectivity:e.edgeIpsConnectivity,edgeIpsType:e.edgeIpsType,edgeIpsIps:e.edgeIpsIps,ipFirewall:e.ipFirewall,originDirect:e.originDirect,originDnsName:e.originDnsName,originDnsTtl:e.originDnsTtl,originDnsType:e.originDnsType,protocol:e.protocol,proxyProtocol:e.proxyProtocol,tls:e.tls,trafficType:e.trafficType,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>u.put(`/zones/${e.zoneId}/spectrum/apps/${e.appId}`,{body:t})),{successLabel:`Updated`});return}e.protocol===void 0&&(e.protocol=await n(`protocol`,'The port configuration at Cloudflare\'s edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.'));let d={};e.argoSmartRouting!==void 0&&i(d,[`argo_smart_routing`],e.argoSmartRouting),e.dnsName!==void 0&&i(d,[`dns`,`name`],l(e.dnsName,`dnsName`,`text`)),e.dnsType!==void 0&&i(d,[`dns`,`type`],l(e.dnsType,`dnsType`,`text`)),e.edgeIpsConnectivity!==void 0&&i(d,[`edge_ips`,`connectivity`],l(e.edgeIpsConnectivity,`edgeIpsConnectivity`,`text`)),e.edgeIpsType!==void 0&&i(d,[`edge_ips`,`type`],l(e.edgeIpsType,`edgeIpsType`,`text`)),e.edgeIpsIps!==void 0&&i(d,[`edge_ips`,`ips`],e.edgeIpsIps),e.ipFirewall!==void 0&&i(d,[`ip_firewall`],e.ipFirewall),e.originDirect!==void 0&&i(d,[`origin_direct`],e.originDirect),e.originDnsName!==void 0&&i(d,[`origin_dns`,`name`],l(e.originDnsName,`originDnsName`,`text`)),e.originDnsTtl!==void 0&&i(d,[`origin_dns`,`ttl`],e.originDnsTtl),e.originDnsType!==void 0&&i(d,[`origin_dns`,`type`],l(e.originDnsType,`originDnsType`,`text`)),e.protocol!==void 0&&i(d,[`protocol`],l(e.protocol,`protocol`,`text`)),e.proxyProtocol!==void 0&&i(d,[`proxy_protocol`],l(e.proxyProtocol,`proxyProtocol`,`text`)),e.tls!==void 0&&i(d,[`tls`],l(e.tls,`tls`,`text`)),e.trafficType!==void 0&&i(d,[`traffic_type`],l(e.trafficType,`trafficType`,`text`)),o(await c(`Updating`,async()=>u.put(`/zones/${e.zoneId}/spectrum/apps/${e.appId}`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},M={command:`apps`,describe:`Spectrum application configurations that map protocols and ports to origin servers`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`spectrum`,describe:`Proxy and protect arbitrary TCP/UDP applications through Cloudflare's network with DDoS mitigation`,builder:e=>e.command(x).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
|
package/dist/speed-DAZU8w3T.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,t as n}from"./auth-BlSmtIKd.mjs";import{t as r}from"./body-parser-Br-BoYk-.mjs";import{t as i}from"./output-D7_yAFVR.mjs";import{n as a,t as o}from"./progress-DZfTxbrx.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Retrieves quota for all plans, as well as the current zone quota.`,builder:s,handler:async e=>{if(e.dryRun){a({command:`cf speed availabilities list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/availabilities`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let r=await n(e),s=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=s,i(await o(`Loading`,async()=>r.speed.availabilities.list(s)),{successLabel:`Loaded`})}},l={command:`availabilities`,describe:`Check which speed test regions and configurations are available for your zone`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists all webpages which have been tested.`,builder:u,handler:async e=>{if(e.dryRun){a({command:`cf speed pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/pages`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let r=await n(e),s=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=s,i(await o(`Loading`,async()=>r.speed.pages.list(s)),{successLabel:`Loaded`})}};function f(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create <url>`,describe:`Starts a test for a specific webpage, in a specific region.`,builder:f,handler:async e=>{if(e.dryRun){a({command:`cf speed pages tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/pages/${e.url??`<url>`}/tests`,pathParams:{zoneId:String(e.zoneId??``),url:String(e.url??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=r(e.body);i(await o(`Creating`,async()=>s.post(`/zones/${e.zoneId}/speed_api/pages/${e.url}/tests`,{body:t})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>s.speed.pages.tests.create(c,e.url)),{successLabel:`Created`})}};function m(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`Region`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <url>`,describe:`Deletes all tests for a specific webpage from a specific region. Deleted tests are still counted as part of the quota.`,builder:m,handler:async r=>{let s={region:r.region};if(r.dryRun){a({command:`cf speed pages tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zoneId??`<zoneId>`}/speed_api/pages/${r.url??`<url>`}/tests`,pathParams:{zoneId:String(r.zoneId??``),url:String(r.url??``)},query:s,bodyKind:`none`});return}let c=await n(r),l=await t({zone:r.zone},c,{quiet:r.quiet});if(r.zoneId=l,!await e({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.speed.pages.tests.delete(l,r.url,s)),{successLabel:`Deleted`})}};function g(e){return e.positional(`testId`,{type:`string`,description:`Test ID`,demandOption:!0}).option(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <testId>`,describe:`Retrieves the result of a specific test.`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf speed pages tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/pages/${e.url??`<url>`}/tests/${e.testId??`<testId>`}`,pathParams:{zoneId:String(e.zoneId??``),url:String(e.url??``),testId:String(e.testId??``)},bodyKind:`none`});return}let r=await n(e),s=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=s,i(await o(`Loading`,async()=>r.speed.pages.tests.get(s,e.url,e.testId)),{successLabel:`Loaded`})}};function v(e){return e.option(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`region`,{type:`string`,description:`Region`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Test history (list of tests) for a specific webpage.`,builder:v,handler:async e=>{let r={page:e.page,per_page:e.perPage,region:e.region};if(e.dryRun){a({command:`cf speed pages tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/pages/${e.url??`<url>`}/tests`,pathParams:{zoneId:String(e.zoneId??``),url:String(e.url??``)},query:r,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,i(await o(`Loading`,async()=>s.speed.pages.tests.list(c,e.url,r)),{successLabel:`Loaded`})}},b={command:`tests`,describe:`Tested pages with their performance history, trends, and individual test results`,builder:e=>e.command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`A test region.`,choices:[`asia-east1`,`asia-northeast1`,`asia-northeast2`,`asia-south1`,`asia-southeast1`,`australia-southeast1`,`europe-north1`,`europe-southwest1`,`europe-west1`,`europe-west2`,`europe-west3`,`europe-west4`,`europe-west8`,`europe-west9`,`me-west1`,`southamerica-east1`,`us-central1`,`us-east1`,`us-east4`,`us-south1`,`us-west1`],demandOption:!0}).option(`device-type`,{type:`string`,description:`The type of device.`,choices:[`DESKTOP`,`MOBILE`],demandOption:!0}).option(`start`,{type:`string`,description:`Start`,demandOption:!0}).option(`end`,{type:`string`,description:`End`}).option(`tz`,{type:`string`,description:`The timezone of the start and end timestamps.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to include in the results.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`trend <url>`,describe:`Lists the core web vital metrics trend over time for a specific page.`,builder:x,handler:async e=>{let r={region:e.region,deviceType:e.deviceType,start:e.start,end:e.end,tz:e.tz,metrics:e.metrics};if(e.dryRun){a({command:`cf speed pages trend`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/pages/${e.url??`<url>`}/trend`,pathParams:{zoneId:String(e.zoneId??``),url:String(e.url??``)},query:r,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,i(await o(`Loading`,async()=>s.speed.pages.trend(c,e.url,r)),{successLabel:`Loaded`})}},C={command:`pages`,describe:`Tested pages with their performance history, trends, and individual test results`,builder:e=>e.command(d).command(S).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`Region`}).option(`frequency`,{type:`string`,description:`The frequency of the scheduled test. Defaults to WEEKLY for free plans, DAILY for paid plans.`,choices:[`DAILY`,`WEEKLY`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`create <url>`,describe:`Creates a scheduled test for a page.`,builder:w,handler:async e=>{let r={region:e.region,frequency:e.frequency};if(e.dryRun){a({command:`cf speed schedule create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/schedule/${e.url??`<url>`}`,pathParams:{zoneId:String(e.zoneId??``),url:String(e.url??``)},query:r,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,i(await o(`Creating`,async()=>s.speed.schedule.create(c,e.url,r)),{successLabel:`Created`})}};function E(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`Region`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <url>`,describe:`Deletes a scheduled test for a page.`,builder:E,handler:async r=>{let s={region:r.region};if(r.dryRun){a({command:`cf speed schedule delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zoneId??`<zoneId>`}/speed_api/schedule/${r.url??`<url>`}`,pathParams:{zoneId:String(r.zoneId??``),url:String(r.url??``)},query:s,bodyKind:`none`});return}let c=await n(r),l=await t({zone:r.zone},c,{quiet:r.quiet});if(r.zoneId=l,!await e({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}i(await o(`Deleting`,async()=>c.speed.schedule.delete(l,r.url,s)),{successLabel:`Deleted`})}};function O(e){return e.positional(`url`,{type:`string`,description:`A URL.`,demandOption:!0}).option(`region`,{type:`string`,description:`Region`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <url>`,describe:`Retrieves the test schedule for a page in a specific region.`,builder:O,handler:async e=>{let r={region:e.region};if(e.dryRun){a({command:`cf speed schedule get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/speed_api/schedule/${e.url??`<url>`}`,pathParams:{zoneId:String(e.zoneId??``),url:String(e.url??``)},query:r,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,i(await o(`Loading`,async()=>s.speed.schedule.get(c,e.url,r)),{successLabel:`Loaded`})}},A={command:`schedule`,describe:`Scheduled recurring speed tests that automatically run at regular intervals`,builder:e=>e.command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`speed`,describe:`Observatory speed tests — run Lighthouse audits, track performance trends, and schedule recurring tests`,builder:e=>e.command(l).command(C).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
|
package/dist/ssl-BRlXa-5w.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,p as n,t as r}from"./auth-BlSmtIKd.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-DZfTxbrx.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.`,builder:u,handler:async e=>{if(e.dryRun){s({command:`cf ssl analyze create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/analyze`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{bundleMethod:e.bundleMethod,certificate:e.certificate,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/ssl/analyze`,{body:t})),{successLabel:`Created`});return}let u={};e.bundleMethod!==void 0&&i(u,[`bundle_method`],l(e.bundleMethod,`bundleMethod`,`text`)),e.certificate!==void 0&&i(u,[`certificate`],l(e.certificate,`certificate`,`text`)),o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/ssl/analyze`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}},f={command:`analyze`,describe:`Analyze a certificate or certificate chain for validity and compatibility issues`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`If the system is enabled, the response will include next_scheduled_scan, representing the next time this zone will be scanned and the zone's ssl/tls encryption mode is potentially upgraded by the system. If the system is disabled, next_scheduled_scan will not be present in the response body.`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf ssl automatic-upgrader get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/ssl_automatic_mode`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.automaticUpgrader.get(i)),{successLabel:`Loaded`})}};function h(e){return e.option(`value`,{type:`string`,description:`Controls enablement of Automatic SSL/TLS.`,choices:[`auto`,`custom`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Automatic SSL/TLS.`})}const g={command:`patch`,describe:`The automatic system is enabled when this endpoint is hit with value in the request body is set to "auto", and disabled when the request body value is set to "custom".`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf ssl automatic-upgrader patch`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/ssl_automatic_mode`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{value:e.value,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>u.patch(`/zones/${e.zoneId}/settings/ssl_automatic_mode`,{body:t})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await n(`value`,`Controls enablement of Automatic SSL/TLS.`,[`auto`,`custom`]));let d={};e.value!==void 0&&i(d,[`value`],l(e.value,`value`,`text`)),o(await c(`Updating`,async()=>u.patch(`/zones/${e.zoneId}/settings/ssl_automatic_mode`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},_={command:`automatic-upgrader`,describe:`SSL automatic mode enrollment — get or update automatic SSL/TLS upgrader settings`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`certificate-authority`,{type:`string`,description:`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`hosts`,{type:`string`,array:!0,description:`Comma separated list of valid host names for the certificate packs. Must contain the zone apex, may not contain more than 50 hosts, and may not be empty.`}).option(`type`,{type:`string`,description:`Type of certificate pack.`,choices:[`advanced`]}).option(`validation-method`,{type:`string`,description:`Validation Method selected for the order.`,choices:[`txt`,`http`,`email`]}).option(`validity-days`,{type:`number`,description:`Validity Days selected for the order.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`For a given zone, order an advanced certificate pack.`,builder:v,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/certificate_packs/order`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{certificateAuthority:e.certificateAuthority,cloudflareBranding:e.cloudflareBranding,hosts:e.hosts,type:e.type,validationMethod:e.validationMethod,validityDays:e.validityDays,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/ssl/certificate_packs/order`,{body:t})),{successLabel:`Created`});return}if(e.certificateAuthority===void 0&&(e.certificateAuthority=await n(`certificate-authority`,`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)`,[`google`,`lets_encrypt`,`ssl_com`])),e.hosts===void 0)throw Error(`--hosts is required (or pass --body with this field set).`);if(e.type===void 0&&(e.type=await n(`type`,`Type of certificate pack.`,[`advanced`])),e.validationMethod===void 0&&(e.validationMethod=await n(`validation-method`,`Validation Method selected for the order.`,[`txt`,`http`,`email`])),e.validityDays===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let d={};e.certificateAuthority!==void 0&&i(d,[`certificate_authority`],l(e.certificateAuthority,`certificateAuthority`,`text`)),e.cloudflareBranding!==void 0&&i(d,[`cloudflare_branding`],e.cloudflareBranding),e.hosts!==void 0&&i(d,[`hosts`],e.hosts),e.type!==void 0&&i(d,[`type`],l(e.type,`type`,`text`)),e.validationMethod!==void 0&&i(d,[`validation_method`],l(e.validationMethod,`validationMethod`,`text`)),e.validityDays!==void 0&&i(d,[`validity_days`],e.validityDays),o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/ssl/certificate_packs/order`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function b(e){return e.positional(`certificatePackId`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`delete <certificatePackId>`,describe:`For a given zone, delete an advanced certificate pack.`,builder:b,handler:async n=>{if(n.dryRun){s({command:`cf ssl certificate-packs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}/ssl/certificate_packs/${n.certificatePackId??`<certificatePackId>`}`,pathParams:{certificatePackId:String(n.certificatePackId??``),zoneId:String(n.zoneId??``)},bodyKind:`json`,body:{body:n.body}});return}let i=await r(n),l=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=l,!await e({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}if(n.body){let e=a(n.body);o(await c(`Deleting`,async()=>i.delete(`/zones/${n.zoneId}/ssl/certificate_packs/${n.certificatePackId}`,{body:e})),{successLabel:`Deleted`});return}o(await c(`Deleting`,async()=>i.ssl.certificatePacks.delete(n.certificatePackId,l)),{successLabel:`Deleted`})}};function S(e){return e.positional(`certificatePackId`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).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:`edit <certificatePackId>`,describe:`For a given zone, restart validation or add cloudflare branding for an advanced certificate pack. The former is only a validation operation for a Certificate Pack in a validation_timed_out status.`,builder:S,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/certificate_packs/${e.certificatePackId??`<certificatePackId>`}`,pathParams:{certificatePackId:String(e.certificatePackId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{cloudflareBranding:e.cloudflareBranding,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/ssl/certificate_packs/${e.certificatePackId}`,{body:t})),{successLabel:`Updated`});return}let l={};e.cloudflareBranding!==void 0&&i(l,[`cloudflare_branding`],e.cloudflareBranding),o(await c(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/ssl/certificate_packs/${e.certificatePackId}`,{body:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function w(e){return e.positional(`certificatePackId`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <certificatePackId>`,describe:`For a given zone, get a certificate pack.`,builder:w,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/certificate_packs/${e.certificatePackId??`<certificatePackId>`}`,pathParams:{certificatePackId:String(e.certificatePackId??``),zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.certificatePacks.get(e.certificatePackId,i)),{successLabel:`Loaded`})}};function E(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of certificate packs per page.`}).option(`status`,{type:`string`,description:`Include Certificate Packs of all statuses, not just active ones.`,choices:[`all`]}).option(`deploy`,{type:`string`,description:`Specify the deployment environment for the certificate packs.`,choices:[`staging`,`production`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`For a given zone, list all active certificate packs.`,builder:E,handler:async e=>{let n={page:e.page,per_page:e.perPage,status:e.status,deploy:e.deploy};if(e.dryRun){s({command:`cf ssl certificate-packs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/certificate_packs`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.ssl.certificatePacks.list(a,n)),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`For a given zone, list certificate pack quotas.`,builder:O,handler:async e=>{if(e.dryRun){s({command:`cf ssl certificate-packs quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/certificate_packs/quota`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.certificatePacks.quota.get(i)),{successLabel:`Loaded`})}},A={command:`quota`,describe:`Advanced Certificate Manager packs — order, renew, and manage dedicated SSL certificates`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`certificate-packs`,describe:`Advanced Certificate Manager packs — order, renew, and manage dedicated SSL certificates`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get`,describe:`Retrieve the SSL/TLS Recommender's recommendation for a zone.`,builder:M,handler:async e=>{if(e.dryRun){s({command:`cf ssl recommendations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/recommendation`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.recommendations.get(i)),{successLabel:`Loaded`})}},P={command:`recommendations`,describe:`Get the recommended SSL/TLS encryption mode based on your origin server's certificate configuration`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`enabled`,{type:`boolean`,description:`Disabling Universal SSL removes any currently active Universal SSL certificates for your zone from the edge and prevents any future Universal SSL certificates from being ordered. If there are no advanced certificates or custom certificates uploaded for the domain, visitors will be unable to access the domain over HTTPS.
|
|
4
|
-
|
|
5
|
-
By disabling Universal SSL, you understand that the following Cloudflare settings and preferences will result in visitors being unable to visit your domain unless you have uploaded a custom certificate or purchased an advanced certificate.
|
|
6
|
-
|
|
7
|
-
* HSTS
|
|
8
|
-
* Always Use HTTPS
|
|
9
|
-
* Opportunistic Encryption
|
|
10
|
-
* Onion Routing
|
|
11
|
-
* Any Page Rules redirecting traffic to HTTPS
|
|
12
|
-
|
|
13
|
-
Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy is enabled will result in users being unable to visit your site without a valid certificate at Cloudflare's edge.
|
|
14
|
-
|
|
15
|
-
If you do not have a valid custom or advanced certificate at Cloudflare's edge and are unsure if any of the above Cloudflare settings are enabled, or if any HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for your domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`edit`,describe:`Patch Universal SSL Settings for a Zone.`,builder:F,handler:async e=>{if(e.dryRun){s({command:`cf ssl universal settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/universal/settings`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{enabled:e.enabled,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/ssl/universal/settings`,{body:t})),{successLabel:`Updated`});return}let l={};e.enabled!==void 0&&i(l,[`enabled`],e.enabled),o(await c(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/ssl/universal/settings`,{body:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get`,describe:`Get Universal SSL Settings for a Zone.`,builder:L,handler:async e=>{if(e.dryRun){s({command:`cf ssl universal settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/universal/settings`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.ssl.universal.settings.get(i)),{successLabel:`Loaded`})}},z={command:`settings`,describe:`Universal SSL settings — enable/disable automatic free SSL certificates for the zone`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`universal`,describe:`Operations for universal`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`certificatePackId`,{type:`string`,description:`Certificate Pack UUID.`,demandOption:!0}).option(`validation-method`,{type:`string`,description:`Desired validation method.`,choices:[`http`,`cname`,`txt`,`email`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`edit <certificatePackId>`,describe:`Edit SSL validation method for a certificate pack. A PATCH request will request an immediate validation check on any certificate, and return the updated status. If a validation method is provided, the validation will be immediately attempted using that method.`,builder:V,handler:async e=>{if(e.dryRun){s({command:`cf ssl verification edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/verification/${e.certificatePackId??`<certificatePackId>`}`,pathParams:{certificatePackId:String(e.certificatePackId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{validationMethod:e.validationMethod,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Updating`,async()=>u.patch(`/zones/${e.zoneId}/ssl/verification/${e.certificatePackId}`,{body:t})),{successLabel:`Updated`});return}e.validationMethod===void 0&&(e.validationMethod=await n(`validation-method`,`Desired validation method.`,[`http`,`cname`,`txt`,`email`]));let d={};e.validationMethod!==void 0&&i(d,[`validation_method`],l(e.validationMethod,`validationMethod`,`text`)),o(await c(`Updating`,async()=>u.patch(`/zones/${e.zoneId}/ssl/verification/${e.certificatePackId}`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function U(e){return e.option(`retry`,{type:`string`,description:`Immediately retry SSL Verification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:`Get SSL Verification Info for a Zone.`,builder:U,handler:async e=>{let n={retry:e.retry};if(e.dryRun){s({command:`cf ssl verification get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/ssl/verification`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.ssl.verification.get(a,n)),{successLabel:`Loaded`})}},G={command:`verification`,describe:`Check or modify the domain control validation (DCV) method for pending certificate orders`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`ssl`,describe:`SSL/TLS certificate management — certificate packs, Universal SSL, verification, and TLS mode recommendations`,builder:e=>e.command(f).command(_).command(j).command(P).command(B).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
|