cf 0.7.0 → 0.8.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 +1 -1
- package/dist/_meta/commands.json +9 -112
- package/dist/{abuse-reports-BsF9JZPW.mjs → abuse-reports-C6GFnuYE.mjs} +1 -1
- package/dist/{account-D8mYiWxQ.mjs → account-DxzpnGA8.mjs} +1 -1
- package/dist/{accounts-CJci1Oez.mjs → accounts-6RFDuFLF.mjs} +1 -1
- package/dist/{acm-CmCd985Q.mjs → acm-Bndi5Jqo.mjs} +1 -1
- package/dist/{addressing-R7p6TRBe.mjs → addressing-C8HB4n_n.mjs} +1 -1
- package/dist/ai-B4La9Oqk.mjs +8 -0
- package/dist/{ai-audit-B0vJNOZG.mjs → ai-audit-B9kKFhoY.mjs} +1 -1
- package/dist/{ai-gateway-D3vJR3My.mjs → ai-gateway-Bx9MzNxL.mjs} +1 -1
- package/dist/{ai-search-CNg7W7U4.mjs → ai-search-BgIOIgXd.mjs} +1 -1
- package/dist/{alerting-_sdM0B0S.mjs → alerting-DVI-v6mE.mjs} +1 -1
- package/dist/{analytics-BFBJhDrP.mjs → analytics-B98epmDb.mjs} +1 -1
- package/dist/{analytics_engine-CWhFvyeK.mjs → analytics_engine-DwDePA2c.mjs} +1 -1
- package/dist/{api-gateway-D4AIEtUq.mjs → api-gateway-DW2GX64w.mjs} +1 -1
- package/dist/{argo-Bjk6nFfs.mjs → argo-DKEx-B66.mjs} +1 -1
- package/dist/{artifacts-Ba4b3iOa.mjs → artifacts-BEU8fBqt.mjs} +1 -1
- package/dist/{audit-logs-BE0T5All.mjs → audit-logs-DZiEPYL0.mjs} +1 -1
- package/dist/{auth-D_zyQbDR.mjs → auth-009DISzb.mjs} +1 -1
- package/dist/{auth-CZ0E51rF.mjs → auth-B1CY5zpC.mjs} +2 -2
- package/dist/{billing-Dz6Zj8Eq.mjs → billing-10B4_1qb.mjs} +1 -1
- package/dist/{bot-management-pFwIbFi-.mjs → bot-management-D51WzJBO.mjs} +1 -1
- package/dist/{botnet-feed-BY9uGChY.mjs → botnet-feed-Dw-leAwX.mjs} +1 -1
- package/dist/{brand-protection-DkPAk2Cz.mjs → brand-protection-BTYkTsER.mjs} +1 -1
- package/dist/{browser-extension-D9P6Yv8i.mjs → browser-extension-BFa5Ky8u.mjs} +1 -1
- package/dist/{browser-run-DhHtz4y3.mjs → browser-run-BMA8Z_hI.mjs} +1 -1
- package/dist/build-C1FOoThn.mjs +70 -0
- package/dist/{cache-DVhkiIGK.mjs → cache-DrX4gWvg.mjs} +1 -1
- package/dist/{calls-95zjvIcO.mjs → calls-m4WyL1Rb.mjs} +1 -1
- package/dist/{certificate-authorities-BowBqbVq.mjs → certificate-authorities-BA-S8NE-.mjs} +1 -1
- package/dist/{cf-BLT7uKJF.mjs → cf-BhDnTcDR.mjs} +7 -7
- package/dist/chunk-2SIGYDH3-_JSHaszR.mjs +473 -0
- package/dist/{chunk-6IEM75FG-BEjRFMGh.mjs → chunk-Q72B4Q5Z-B-N_eqrM.mjs} +1 -1
- package/dist/{client-certificates-D6mE4vJu.mjs → client-certificates-5h-fXoNq.mjs} +1 -1
- package/dist/{cloud-connector-DmwsjeFN.mjs → cloud-connector-ywFQuqtV.mjs} +1 -1
- package/dist/{cloudforce-one-CG3TT7IN.mjs → cloudforce-one-CPx4C-r3.mjs} +1 -1
- package/dist/{completions-DMc_PlIw.mjs → completions-CCRu-jvY.mjs} +1 -1
- package/dist/{connectivity-DJkE3crz.mjs → connectivity-y-Gav-Ge.mjs} +1 -1
- package/dist/{connector-interrupts-DTgQ7onV.mjs → connector-interrupts-Bs-jfuh8.mjs} +1 -1
- package/dist/{connector-telemetry-events-D0rTHDou.mjs → connector-telemetry-events-Bc6f3xpx.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots--0QmD3z6.mjs → connector-telemetry-snapshots-Bl54XZ3h.mjs} +1 -1
- package/dist/{connectors-zWaZTi2A.mjs → connectors-BnQq_R19.mjs} +1 -1
- package/dist/{content-scanning-CGvGf04y.mjs → content-scanning-Bxk-WkSL.mjs} +1 -1
- package/dist/{ct-alerting-ebSPSWNC.mjs → ct-alerting-BSn2Jqou.mjs} +1 -1
- package/dist/{custom-certificates-CWUrPYLP.mjs → custom-certificates-BBqr4S9W.mjs} +1 -1
- package/dist/{custom-csrs-CRtdrF9R.mjs → custom-csrs-CXeBzLUy.mjs} +1 -1
- package/dist/{custom-hostnames-CVQSksqq.mjs → custom-hostnames-CfCOedoN.mjs} +1 -1
- package/dist/{custom-nameservers-BRwbIdsX.mjs → custom-nameservers-RPXeu7f_.mjs} +1 -1
- package/dist/{custom-pages-Ci8sTQX7.mjs → custom-pages-xGG1xo88.mjs} +1 -1
- package/dist/{d1-78Ym1P6D.mjs → d1-CRIOfBsJ.mjs} +1 -1
- package/dist/{data-security-zmFoMwRU.mjs → data-security-D5Sw5rwj.mjs} +1 -1
- package/dist/{dcv-delegation-Dd4FZ2IG.mjs → dcv-delegation-BBnlgr6F.mjs} +1 -1
- package/dist/deploy-D0_KIUpW.mjs +2 -0
- package/dist/deploy-input-CdWrpzPA.mjs +1178 -0
- package/dist/{dev-DSslyDXx.mjs → dev-Bz87BeKt.mjs} +1 -1
- package/dist/{diagnostics-B8Ev5m_o.mjs → diagnostics-C1qryRf4.mjs} +1 -1
- package/dist/{dispatch-namespaces-Dm5vGeEP.mjs → dispatch-namespaces-DbosPgPV.mjs} +1 -1
- package/dist/{dist-BH-4NQOV.mjs → dist-C-6VkMPZ.mjs} +35 -35
- package/dist/dist-CnaLMpVH.mjs +18 -0
- package/dist/{dns-D7VAaCyO.mjs → dns-ByufYrJH.mjs} +1 -1
- package/dist/{dns-firewall-ByLCsf0q.mjs → dns-firewall-CiokCKRr.mjs} +1 -1
- package/dist/{durable-objects-BIpvyu9m.mjs → durable-objects-DjF-WAD3.mjs} +1 -1
- package/dist/{email-auth-Cx--s8W4.mjs → email-auth-B4BIYMb-.mjs} +1 -1
- package/dist/{email-routing-CiDbivcN.mjs → email-routing-BbbtpVyS.mjs} +1 -1
- package/dist/{email-security-BYeAuSc6.mjs → email-security-DuBVypAO.mjs} +1 -1
- package/dist/{email-sending-Dg2rSmHH.mjs → email-sending-5g-k05Lv.mjs} +1 -1
- package/dist/{filters-DZ8YnQ90.mjs → filters-CzJmLFcS.mjs} +1 -1
- package/dist/{firewall-DEd1hs_I.mjs → firewall-CjmeWA2M.mjs} +1 -1
- package/dist/{flagship-DVw7xGoP.mjs → flagship-BfyVrWP-.mjs} +1 -1
- package/dist/{fraud-BbGS3FZs.mjs → fraud-reRvxNg-.mjs} +1 -1
- package/dist/{google-tag-gateway-CBnRGYQR.mjs → google-tag-gateway-CGwzMZU1.mjs} +1 -1
- package/dist/{healthchecks-Da9N3ix4.mjs → healthchecks-BhCsPWcG.mjs} +1 -1
- package/dist/{hostnames-mimZu2tB.mjs → hostnames-JpgQW4kn.mjs} +1 -1
- package/dist/{hyperdrive-BNdvxOos.mjs → hyperdrive-iwYttuwV.mjs} +1 -1
- package/dist/{iam-DGQ-OgRl.mjs → iam-ffI98_4v.mjs} +1 -1
- package/dist/{images-CI6Iy9ho.mjs → images-Bgb9DGlr.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-BDB-aRtU.mjs → intel-DVRjKpyU.mjs} +1 -1
- package/dist/{ips-B9UuPvsY.mjs → ips-BtLRO19r.mjs} +1 -1
- package/dist/{keyless-certificates-Ua9uJgPt.mjs → keyless-certificates-13w8KOcC.mjs} +1 -1
- package/dist/{kv-BHerx4dZ.mjs → kv-CvQyF_NB.mjs} +1 -1
- package/dist/{leaked-credential-checks-B8Vunj9h.mjs → leaked-credential-checks-DvY8VReW.mjs} +1 -1
- package/dist/{load-balancers-DSjS5WKw.mjs → load-balancers-6lgExyS7.mjs} +1 -1
- package/dist/{logexplorer-DBIfTlRP.mjs → logexplorer-DBfrK1hn.mjs} +1 -1
- package/dist/{logo-matches-C00iGpzW.mjs → logo-matches-XS2RaxQu.mjs} +1 -1
- package/dist/{logos-CJLhx1go.mjs → logos-COtlpbRq.mjs} +1 -1
- package/dist/{logpush-Cr1U-eK-.mjs → logpush-CIpiK3Xl.mjs} +1 -1
- package/dist/{logs-DMvtchc6.mjs → logs-0KjIf_3g.mjs} +1 -1
- package/dist/{magic-cloud-networking-FQfO8QWH.mjs → magic-cloud-networking-q_d9-he-.mjs} +1 -1
- package/dist/{magic-network-monitoring-CDd70fJQ.mjs → magic-network-monitoring-DLNCrUsn.mjs} +1 -1
- package/dist/{magic-transit-DiKiPUax.mjs → magic-transit-sIwSlzoK.mjs} +1 -1
- package/dist/{managed-transforms-fPVUTrAv.mjs → managed-transforms-BKRjmzJS.mjs} +1 -1
- package/dist/{matches-B0yHbQ2I.mjs → matches-DZLS60M2.mjs} +1 -1
- package/dist/{moq-UgBawOXe.mjs → moq-Dbb9QhC1.mjs} +1 -1
- package/dist/{mtls-certificates-xKUbC5EL.mjs → mtls-certificates-BpIqoWpc.mjs} +1 -1
- package/dist/{network-interconnects-BJzOE2ny.mjs → network-interconnects-DZwGJFYT.mjs} +1 -1
- package/dist/{oauth-DBJ5GSFk.mjs → oauth-DC9g9uK_.mjs} +1 -1
- package/dist/{observability-B-1y36QS.mjs → observability-CVLjPAir.mjs} +1 -1
- package/dist/{open-YWOUIZ5Y-CFRcYALi.mjs → open-PBXRGS4R-D5C2-7de.mjs} +1 -1
- package/dist/{organization-Dq3PClZ7.mjs → organization-BGF8N1QQ.mjs} +1 -1
- package/dist/{organizations-AhsQkHyX.mjs → organizations-BInE8nlx.mjs} +1 -1
- package/dist/{origin-ca-certificates-CRgF0UyU.mjs → origin-ca-certificates-wPzWcEa0.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-BXTx7DPa.mjs → origin-post-quantum-encryption-t1Cl9hiy.mjs} +1 -1
- package/dist/{origin-tls-client-auth-BDw5q-6G.mjs → origin-tls-client-auth-Cvr9D8eq.mjs} +1 -1
- package/dist/{page-rules-DqYQ23eg.mjs → page-rules-CMo73oVb.mjs} +1 -1
- package/dist/{page-shield-DKdlZOLO.mjs → page-shield-Z23iqabu.mjs} +1 -1
- package/dist/{pages-BsXF11Kv.mjs → pages-ByaZvYjA.mjs} +1 -1
- package/dist/{pay-per-crawl-BGAwuAP3.mjs → pay-per-crawl-BXTenh_d.mjs} +1 -1
- package/dist/{pipelines-D_QhSnGW.mjs → pipelines-7KWm5BYN.mjs} +1 -1
- package/dist/{progress-O88q63Bk.mjs → progress-BLQ2xXwD.mjs} +1 -1
- package/dist/{prompt-DTAWiEm2.mjs → prompt-DcfYBioA.mjs} +1 -1
- package/dist/{queries-CAE95-OH.mjs → queries-Cgx1lQbn.mjs} +1 -1
- package/dist/{queues-BBz35Mqd.mjs → queues-jnugmCYI.mjs} +1 -1
- package/dist/{r2-Zp99S5xF.mjs → r2-Dllx7F7a.mjs} +1 -1
- package/dist/{r2-data-catalog-BeVLZwrE.mjs → r2-data-catalog-CaAAPwKp.mjs} +1 -1
- package/dist/{radar-Cij-XVQJ.mjs → radar-DLSHX2_1.mjs} +1 -1
- package/dist/{rate-limits-DSdToIWv.mjs → rate-limits-DlVTd6QY.mjs} +1 -1
- package/dist/{raw-fetch-DgezeshQ.mjs → raw-fetch-CeW1mW_u.mjs} +1 -1
- package/dist/{realtime-kit-9rJcapfM.mjs → realtime-kit-ct8Fu2kO.mjs} +1 -1
- package/dist/{registrar-CXViZlah.mjs → registrar-CKTB7QTM.mjs} +1 -1
- package/dist/{registrar-sandbox-CvQyjXLJ.mjs → registrar-sandbox-1-nNk6Uy.mjs} +1 -1
- package/dist/{request-tracers-DATfBnE9.mjs → request-tracers-DO6lno0x.mjs} +1 -1
- package/dist/{resource-sharing-Cmhn6ghR.mjs → resource-sharing-DYhXJw44.mjs} +1 -1
- package/dist/{resource-tagging-BTn05AOj.mjs → resource-tagging-CcKWMF9l.mjs} +1 -1
- package/dist/{rules-ens3OHme.mjs → rules-DQKR3qb7.mjs} +1 -1
- package/dist/{rulesets-bkreZRao.mjs → rulesets-B9fZb_JY.mjs} +1 -1
- package/dist/{rum-CpgXFcwl.mjs → rum-BaJio_GD.mjs} +1 -1
- package/dist/{schema-validation-Ca6o94ts.mjs → schema-validation-Cqv8KT1B.mjs} +1 -1
- package/dist/{scim-C4oT8TMc.mjs → scim-DkYH1dep.mjs} +1 -1
- package/dist/{secrets-store-CWEuiDNo.mjs → secrets-store-CMR_pA1t.mjs} +1 -1
- package/dist/{security-center-BOvm7xy6.mjs → security-center-DCHfgCq6.mjs} +1 -1
- package/dist/{security-txt-BCAUBctN.mjs → security-txt-D19uTyaf.mjs} +1 -1
- package/dist/{session-B1ARgLG7.mjs → session-CQpgz61H.mjs} +1 -1
- package/dist/{share-DhmVspmL.mjs → share-CfJbt0WU.mjs} +1 -1
- package/dist/shared-D0xvDsDl.mjs +2 -0
- package/dist/{smart-shield-DZm4fn6z.mjs → smart-shield-BG5WOmi1.mjs} +1 -1
- package/dist/{snippets-oQ0u26-z.mjs → snippets-CYiSdx7R.mjs} +1 -1
- package/dist/{spawn-ChG5Xi9Z.mjs → spawn-j3dn7A69.mjs} +1 -1
- package/dist/{spectrum-Cnkee5Ww.mjs → spectrum-Qvq3yJax.mjs} +1 -1
- package/dist/{speed-DqNnvLBD.mjs → speed-vpoB9msm.mjs} +1 -1
- package/dist/{src-By-zTCHz.mjs → src-Bn0FyQIp.mjs} +5 -5
- package/dist/{ssl-tS3CYZsZ.mjs → ssl-Qw8eVAiS.mjs} +1 -1
- package/dist/{state-OsdDJvdj.mjs → state-C2cBU9iK.mjs} +1 -1
- package/dist/{stream-Bud9Os5V.mjs → stream-BNbkY3zI.mjs} +1 -1
- package/dist/{submit-BtP8she2.mjs → submit-pQNW7uWj.mjs} +1 -1
- package/dist/{tenant-CMwHa-tU.mjs → tenant-xkvdAutS.mjs} +1 -1
- package/dist/{token-validation-BYC7HTok.mjs → token-validation-5F2AbQCz.mjs} +1 -1
- package/dist/triggers-CYdZhJYr.mjs +2 -0
- package/dist/{turnstile-CP4nScaL.mjs → turnstile-BSIaunXn.mjs} +1 -1
- package/dist/{ui-BNoF0KpD.mjs → ui-CTo5OG9r.mjs} +1 -1
- package/dist/{url-info-Chs9h7Y-.mjs → url-info-Q7m7AVih.mjs} +1 -1
- package/dist/{url-normalization-XYxW5Gj0.mjs → url-normalization-Bs2m5jlD.mjs} +1 -1
- package/dist/{url-scanner-D4pYNlO-.mjs → url-scanner-CYmT3C99.mjs} +1 -1
- package/dist/{user-DtefniLc.mjs → user-Bay_0p3C.mjs} +1 -1
- package/dist/{vectorize-BeAY2g-7.mjs → vectorize-cP2OuB5N.mjs} +1 -1
- package/dist/{versions-dMW3bLVv.mjs → versions-D7F26fhH.mjs} +1 -1
- package/dist/{waiting-rooms-K78HeeTg.mjs → waiting-rooms-B5HR1-37.mjs} +1 -1
- package/dist/{web3-Dhw79l4S.mjs → web3-DqCXM4sx.mjs} +1 -1
- package/dist/{workers-l3zMNOU6.mjs → workers-Cu-A8AZc.mjs} +1 -1
- package/dist/{workers-builds-CuOAB3u4.mjs → workers-builds-CmCg27M-.mjs} +1 -1
- package/dist/{workflows-rb7RYBKP.mjs → workflows-DavS4SEh.mjs} +1 -1
- package/dist/{zaraz-CHecMYuo.mjs → zaraz-CKcVy5Xa.mjs} +1 -1
- package/dist/{zero-trust-DAZoa-Aj.mjs → zero-trust-BKVqb2yq.mjs} +1 -1
- package/dist/{zone-BnnqJwW-.mjs → zone-BOcuY4sU.mjs} +1 -1
- package/dist/{zones-DpI2YikF.mjs → zones-BR-9WaY7.mjs} +1 -1
- package/package.json +5 -4
- package/dist/ai-BzJg0RIX.mjs +0 -3
- package/dist/build-CWuStmDi.mjs +0 -2
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +0 -397
- package/dist/deploy-CVvkZFjR.mjs +0 -2
- package/dist/lib-Og5sB51C.mjs +0 -68
- package/dist/shared-Bod3-Exx.mjs +0 -990
- /package/dist/{schema-DCF4yEp_.mjs → schema-DAW-B7wT.mjs} +0 -0
- /package/dist/{tools-Dru4l8yh.mjs → tools-BpNGzfj2.mjs} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"accounts": "# accounts — Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account\n\n## Commands\n\n### Read Operations\n\n- `cf accounts get` — Get information about a specific account that you are a member of.\n- `cf accounts list` — List all accounts you have ownership or verified access to.\n- `cf accounts logs audit list` — Gets a list of audit logs for an account.\n- `cf accounts members get <member-id>` — Get information about a specific member of an account.\n- `cf accounts members list` — List all members of an account.\n- `cf accounts roles get <role-id>` — Get information about a specific role for an account.\n- `cf accounts roles list` — Get all available roles for an account.\n- `cf accounts subscriptions get` — Lists all of an account's subscriptions.\n- `cf accounts tokens get <token-id>` — Get information about a specific Account Owned API token.\n- `cf accounts tokens list` — List all Account Owned API tokens created for this account. Results include active, disabled, and recently-expired tokens when include_expired is set to true.\n- `cf accounts tokens permission-groups list` — Find all available permission groups for Account Owned API Tokens\n\n### Create Operations\n\n- `cf accounts applications create` — Create a custom application for an account. (supports --dry-run, --body)\n- `cf accounts create` — Create an account (only available for tenant admins at this time) (supports --dry-run, --body)\n- `cf accounts members create` — Add a user to the list of members for this account. (supports --dry-run, --body)\n- `cf accounts subscriptions create` — Creates an account subscription. (supports --dry-run, --body)\n- `cf accounts tokens create` — Create a new Account Owned API token. (supports --dry-run, --body)\n\n### Update Operations\n\n- `cf accounts applications update <id>` — Replace the network matchers for a custom application and create a new version. (supports --dry-run, --body)\n- `cf accounts members update <member-id>` — Modify an account member. (supports --dry-run, --body)\n- `cf accounts subscriptions update <subscription-identifier>` — Updates an account subscription. (supports --dry-run, --body)\n- `cf accounts tokens update <token-id>` — Update an existing token. (supports --dry-run, --body)\n- `cf accounts tokens value update <token-id>` — Roll the Account Owned API token secret. (supports --dry-run)\n- `cf accounts update` — Update an existing account. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf accounts applications delete <id>` — Delete a custom application and all of its versions. (supports --dry-run)\n- `cf accounts delete` — Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account (supports --dry-run)\n- `cf accounts members delete <member-id>` — Remove a member from an account. (supports --dry-run)\n- `cf accounts subscriptions delete <subscription-identifier>` — Deletes an account's subscription. (supports --dry-run)\n- `cf accounts tokens delete <token-id>` — Destroy an Account Owned API token. (supports --dry-run)\n\n### Other Operations\n\n- `cf accounts applications get applications` — List applications with different filters. (supports --dry-run)\n- `cf accounts applications get by id <id>` — Get application by ID. (supports --dry-run)\n- `cf accounts categories get by id <id>` — Get application category by ID. (supports --dry-run)\n- `cf accounts categories get categories` — List application categories. (supports --dry-run)\n- `cf accounts tokens verify` — Test whether a token works. (supports --dry-run)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
|
8
8
|
"acm": "# acm — Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates\n\n## Commands\n\n### Read Operations\n\n- `cf acm custom-trust-store get <custom-origin-trust-store-id>` — Retrieves details about a specific root CA certificate in the custom origin trust store, including expiration and subject information.\n- `cf acm custom-trust-store list` — Get Custom Origin Trust Store for a Zone.\n- `cf acm total-tls get` — Get Total TLS Settings for a Zone.\n\n### Create Operations\n\n- `cf acm custom-trust-store create` — Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted. (supports --dry-run, --body)\n\n### Update Operations\n\n- `cf acm total-tls edit` — Set Total TLS Settings or disable the feature for a Zone. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf acm custom-trust-store delete <custom-origin-trust-store-id>` — Removes a root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted. (supports --dry-run)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
|
9
9
|
"addressing": "# addressing — IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control\n\n## Commands\n\n### Read Operations\n\n- `cf addressing address-maps get <address-map-id>` — Show a particular address map owned by the account.\n- `cf addressing address-maps list` — List all address maps owned by the account.\n- `cf addressing leases list` — List all leases owned by the account.\n- `cf addressing loa-documents get <loa-document-id>` — Download specified LOA document under the account.\n- `cf addressing prefixes advertisement-status get <prefix-id>` — View the current advertisement state for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.\n- `cf addressing prefixes bgp-prefixes get <bgp-prefix-id>` — Retrieve a single BGP Prefix according to its identifier\n- `cf addressing prefixes bgp-prefixes list` — List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to control which specific subnets are advertised to the Internet. It is possible to advertise subnets more specific than an IP Prefix by creating more specific BGP Prefixes.\n- `cf addressing prefixes delegations list` — List all delegations for a given account IP prefix.\n- `cf addressing prefixes get <prefix-id>` — List a particular prefix owned by the account.\n- `cf addressing prefixes list` — List all prefixes owned by the account.\n- `cf addressing prefixes service-bindings get <binding-id>` — Fetch a single Service Binding\n- `cf addressing prefixes service-bindings list` — List the Cloudflare services this prefix is currently bound to. Traffic sent to an address within an IP prefix will be routed to the Cloudflare service of the most-specific Service Binding matching the address. **Example:** binding `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other IPs in the prefix to Cloudflare Magic Transit.\n- `cf addressing services list` — Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a service running on the Cloudflare network to enable a Cloudflare product on the IP addresses. This endpoint can be used as a reference of available services on the Cloudflare network, and their service IDs.\n\n### Create Operations\n\n- `cf addressing address-maps create` — Create a new address map under the account. (supports --dry-run, --body)\n- `cf addressing loa-documents create` — Submit LOA document (pdf format) under the account. (supports --dry-run, --body)\n- `cf addressing prefixes bgp-prefixes create <prefix-id>` — Create a BGP prefix, controlling the BGP advertisement status of a specific subnet. When created, BGP prefixes are initially withdrawn, and can be advertised with the Update BGP Prefix API. (supports --dry-run, --body)\n- `cf addressing prefixes create` — Add a new prefix under the account. (supports --dry-run, --body)\n- `cf addressing prefixes delegations create <prefix-id>` — Create a new account delegation for a given IP prefix. (supports --dry-run, --body)\n- `cf addressing prefixes service-bindings create <prefix-id>` — Creates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. **NOTE:** The first Service Binding created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent Service Bindings may be created with a more-specific CIDR. Refer to the [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) for compatibility details. (supports --dry-run, --body)\n- `cf addressing prefixes validate create <prefix-id>` — Triggers a new prefix validation. The checks are run asynchronously and include IRR, RPKI, and prefix ownership. (supports --dry-run)\n\n### Update Operations\n\n- `cf addressing address-maps accounts update <address-map-id>` — Add an account as a member of a particular address map. (supports --dry-run)\n- `cf addressing address-maps edit <address-map-id>` — Modify properties of an address map owned by the account. (supports --dry-run, --body)\n- `cf addressing address-maps ips update <ip-address>` — Add an IP from a prefix owned by the account to a particular address map. (supports --dry-run)\n- `cf addressing address-maps zones update` — Add a zone as a member of a particular address map. (supports --dry-run)\n- `cf addressing prefixes advertisement-status edit <prefix-id>` — Advertise or withdraw the BGP route for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix. (supports --dry-run, --body)\n- `cf addressing prefixes bgp-prefixes edit <bgp-prefix-id>` — Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn). (supports --dry-run, --body)\n- `cf addressing prefixes edit <prefix-id>` — Modify the description for a prefix owned by the account. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf addressing address-maps accounts delete <address-map-id>` — Remove an account as a member of a particular address map. (supports --dry-run)\n- `cf addressing address-maps delete <address-map-id>` — Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted. (supports --dry-run)\n- `cf addressing address-maps ips delete <ip-address>` — Remove an IP from a particular address map. (supports --dry-run)\n- `cf addressing address-maps zones delete` — Remove a zone as a member of a particular address map. (supports --dry-run)\n- `cf addressing prefixes bgp-prefixes delete <bgp-prefix-id>` — Delete a BGP Prefix associated with the specified IP Prefix. A BGP Prefix must be withdrawn before it can be deleted. (supports --dry-run)\n- `cf addressing prefixes delegations delete <delegation-id>` — Delete an account delegation for a given IP prefix. (supports --dry-run)\n- `cf addressing prefixes delete <prefix-id>` — Delete an unapproved prefix owned by the account. (supports --dry-run)\n- `cf addressing prefixes service-bindings delete <binding-id>` — Delete a Service Binding (supports --dry-run)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
|
10
|
-
"ai": "# ai — Run inference on Workers AI models — text generation, image classification, embeddings, and more\n\n## Commands\n\n### Read Operations\n\n- `cf ai authors list` — Searches Workers AI models by author or organization name.\n- `cf ai finetunes list` — Lists all fine-tuning jobs created by the account, including status and metrics.\n- `cf ai finetunes public list` — Lists publicly available fine-tuned models that can be used with Workers AI.\n- `cf ai models list` — Searches Workers AI models by name or description.\n- `cf ai models schema get` — Retrieves the input and output JSON schema definition for a Workers AI model.\n- `cf ai tasks list` — Searches Workers AI models by task type (e.g., text-generation, embeddings).\n\n### Create Operations\n\n- `cf ai finetunes assets create <finetune-id>` — Uploads training data assets for a Workers AI fine-tuning job. (supports --dry-run, --body)\n- `cf ai finetunes create` — Creates a new fine-tuning job for a Workers AI model using custom training data. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf ai finetunes delete <finetune-id>` — Permanently deletes a finetune. D1 rows are removed immediately and R2 objects are moved to a trash bucket with a 30-day lifecycle rule for recovery. (supports --dry-run)\n\n### Other Operations\n\n- `cf ai run <model-name>` —
|
|
10
|
+
"ai": "# ai — Run inference on Workers AI models — text generation, image classification, embeddings, and more\n\n## Commands\n\n### Read Operations\n\n- `cf ai authors list` — Searches Workers AI models by author or organization name.\n- `cf ai finetunes list` — Lists all fine-tuning jobs created by the account, including status and metrics.\n- `cf ai finetunes public list` — Lists publicly available fine-tuned models that can be used with Workers AI.\n- `cf ai models list` — Searches Workers AI models by name or description.\n- `cf ai models schema get` — Retrieves the input and output JSON schema definition for a Workers AI model.\n- `cf ai tasks list` — Searches Workers AI models by task type (e.g., text-generation, embeddings).\n\n### Create Operations\n\n- `cf ai finetunes assets create <finetune-id>` — Uploads training data assets for a Workers AI fine-tuning job. (supports --dry-run, --body)\n- `cf ai finetunes create` — Creates a new fine-tuning job for a Workers AI model using custom training data. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf ai finetunes delete <finetune-id>` — Permanently deletes a finetune. D1 rows are removed immediately and R2 objects are moved to a trash bucket with a 30-day lifecycle rule for recovery. (supports --dry-run)\n\n### Other Operations\n\n- `cf ai run <model-name>` — Run inference on a Workers AI model. The request body is model-specific: fetch the model's input schema with `cf ai models schema get --model <id>` (or `cf ai run <model> --help`) to discover its fields, then pass them as flags or as a single JSON payload via --body. `cf ai models list` enumerates the models this account can run. (supports --dry-run, --body)\n- `cf ai to-markdown supported` — Lists all file formats supported for conversion to Markdown. (supports --dry-run)\n- `cf ai to-markdown transform` — Converts uploaded files into Markdown format using Workers AI. (supports --dry-run, --body)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
|
11
11
|
"ai-audit": "# ai-audit — ai-audit\n\n## Commands\n\n### Read Operations\n\n- `cf ai-audit robots get` — Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps.\n\n### Other Operations\n\n- `cf ai-audit robots bulk-get` — Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname. (supports --dry-run, --body)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
|
12
12
|
"ai-gateway": "# ai-gateway — Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more\n\n## Commands\n\n### Read Operations\n\n- `cf ai-gateway billing spending_limit get` — Retrieve the current spending limit configuration for the account.\n- `cf ai-gateway billing topup config get` — Retrieve the current auto top-up threshold, amount, and any error state.\n- `cf ai-gateway billing topup status` — Get the payment processing status of a top-up by its invoice ID. (supports --body)\n- `cf ai-gateway datasets get <id>` — Retrieves details for a specific AI Gateway dataset.\n- `cf ai-gateway datasets list` — Lists all AI Gateway evaluator types configured for the account.\n- `cf ai-gateway dynamic-routing get <id>` — Get an AI Gateway Dynamic Route.\n- `cf ai-gateway dynamic-routing list` — List all AI Gateway Dynamic Routes.\n- `cf ai-gateway evaluation-types list` — Lists all available evaluator types for scoring AI gateway responses.\n- `cf ai-gateway evaluations get <id>` — Retrieves details for a specific AI Gateway dataset.\n- `cf ai-gateway evaluations list` — Lists all AI Gateway evaluator types configured for the account.\n- `cf ai-gateway get <id>` — Retrieves details for a specific AI Gateway dataset.\n- `cf ai-gateway list` — Lists all AI Gateway evaluator types configured for the account.\n- `cf ai-gateway logs get <id>` — Retrieves detailed information for a specific AI Gateway log entry.\n- `cf ai-gateway logs list` — Lists request/response log entries for the AI gateway with filtering and pagination.\n- `cf ai-gateway provider-configs list` — Lists all AI Gateway evaluator types configured for the account.\n- `cf ai-gateway urls get <provider>` — Retrieves the endpoint URL for an AI Gateway.\n\n### Create Operations\n\n- `cf ai-gateway billing spending_limit create` — Deprecated: spending limits can no longer be created, enabled, or modified and this endpoint always responds 403. Use the new AI Gateway spend limits instead: https://developers.cloudflare.com/ai-gateway/features/spend-limits/. Existing limits can be removed via DELETE /spending-limit. (supports --dry-run, --body)\n- `cf ai-gateway billing topup config create` — Configure auto top-up with a balance threshold and top-up amount. (supports --dry-run, --body)\n- `cf ai-gateway billing topup create` — Create a credit top-up for the given account, charged to the account's default payment method. (supports --dry-run, --body)\n- `cf ai-gateway create` — Creates a new AI Gateway. (supports --dry-run, --body)\n- `cf ai-gateway datasets create <gateway-id>` — Creates a new AI Gateway. (supports --dry-run, --body)\n- `cf ai-gateway dynamic-routing create <gateway-id>` — Create a new AI Gateway Dynamic Route. (supports --dry-run, --body)\n- `cf ai-gateway evaluations create <gateway-id>` — Creates a new AI Gateway. (supports --dry-run, --body)\n- `cf ai-gateway provider-configs create <gateway-id>` — Creates a new AI Gateway. (supports --dry-run, --body)\n\n### Update Operations\n\n- `cf ai-gateway datasets update <id>` — Updates an existing AI Gateway dataset. (supports --dry-run, --body)\n- `cf ai-gateway dynamic-routing update <id>` — Update an AI Gateway Dynamic Route. (supports --dry-run, --body)\n- `cf ai-gateway logs edit <id>` — Updates metadata for an AI Gateway log entry. (supports --dry-run, --body)\n- `cf ai-gateway provider-configs update <id>` — Updates an existing AI Gateway dataset. (supports --dry-run, --body)\n- `cf ai-gateway update <id>` — Updates an existing AI Gateway dataset. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf ai-gateway billing spending_limit delete` — Remove the spending limit for the account. (supports --dry-run)\n- `cf ai-gateway billing topup config delete` — Remove the auto top-up configuration for the account. (supports --dry-run)\n- `cf ai-gateway datasets delete <id>` — Deletes an AI Gateway dataset. (supports --dry-run)\n- `cf ai-gateway delete <id>` — Deletes an AI Gateway dataset. (supports --dry-run)\n- `cf ai-gateway dynamic-routing delete <id>` — Delete an AI Gateway Dynamic Route. (supports --dry-run)\n- `cf ai-gateway evaluations delete <id>` — Deletes an AI Gateway dataset. (supports --dry-run)\n- `cf ai-gateway logs delete <gateway-id>` — Deletes gateway log entries matching the specified criteria. (supports --dry-run)\n- `cf ai-gateway provider-configs delete <id>` — Deletes an AI Gateway dataset. (supports --dry-run)\n\n### Other Operations\n\n- `cf ai-gateway billing credit_balance` — Retrieve the current credit balance, payment method info, and top-up configuration. (supports --dry-run)\n- `cf ai-gateway billing invoice_history` — Retrieve a list of past invoices with pagination, optionally filtered by type. (supports --dry-run)\n- `cf ai-gateway billing invoice_preview` — Retrieve a preview of the upcoming invoice including line items and tax. (supports --dry-run)\n- `cf ai-gateway billing usage_history` — Retrieve aggregated usage meter event summaries for the given time range. (supports --dry-run)\n- `cf ai-gateway dynamic-routing create-deployment <id>` — Create a new AI Gateway Dynamic Route Deployment. (supports --dry-run, --body)\n- `cf ai-gateway dynamic-routing create-version <id>` — Create a new AI Gateway Dynamic Route Version. (supports --dry-run, --body)\n- `cf ai-gateway dynamic-routing get-version <version-id>` — Get an AI Gateway Dynamic Route Version. (supports --dry-run)\n- `cf ai-gateway dynamic-routing list-deployments <id>` — List all AI Gateway Dynamic Route Deployments. (supports --dry-run)\n- `cf ai-gateway dynamic-routing list-versions <id>` — List all AI Gateway Dynamic Route Versions. (supports --dry-run)\n- `cf ai-gateway logs request <id>` — Retrieves the original request payload for an AI Gateway log entry. (supports --dry-run)\n- `cf ai-gateway logs response <id>` — Retrieves the response payload for an AI Gateway log entry. (supports --dry-run)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
|
13
13
|
"ai-search": "# ai-search — ai-search\n\n## Commands\n\n### Read Operations\n\n- `cf ai-search get <id>` — Retrieve the configuration and status of an AI Search instance.\n- `cf ai-search items get <item-id>` — Retrieves a specific indexed item from an AI Search instance.\n- `cf ai-search items list` — Lists indexed items in an AI Search instance.\n- `cf ai-search jobs get <job-id>` — Retrieves details for a specific AI Search indexing job.\n- `cf ai-search jobs list` — Lists indexing jobs for an AI Search instance.\n- `cf ai-search list` — List all AI Search instances in the account.\n- `cf ai-search namespace get <name>` — Retrieve a namespace and its description.\n- `cf ai-search namespace list` — List namespaces in the account, including their descriptions and creation times.\n- `cf ai-search tokens get <id>` — Retrieve a stored AI Search credential without exposing its secret.\n- `cf ai-search tokens list` — List stored AI Search credentials in the account without exposing their secrets.\n\n### Create Operations\n\n- `cf ai-search create <name> <id>` — Create a new AI Search instance with the given configuration. (supports --dry-run, --body)\n- `cf ai-search jobs create <id>` — Creates a new indexing job for an AI Search instance. (supports --dry-run, --body)\n- `cf ai-search namespace create <namespace>` — Create a namespace for organizing AI Search instances. (supports --dry-run, --body)\n- `cf ai-search tokens create <name>` — Create a stored Cloudflare credential for an AI Search instance to access its data source. (supports --dry-run, --body)\n\n### Update Operations\n\n- `cf ai-search namespace update <name>` — Update the description and/or the public endpoint configuration of an existing namespace. The default namespace's description cannot be modified, but its public endpoint can. (supports --dry-run, --body)\n- `cf ai-search tokens update <id>` — Replace a stored AI Search credential and invalidate cached credentials for instances that use it. (supports --dry-run, --body)\n- `cf ai-search update <id>` — Update the configuration of an AI Search instance. (supports --dry-run, --body)\n\n### Delete Operations\n\n- `cf ai-search delete <id>` — Permanently delete an AI Search instance and all its indexed data. (supports --dry-run)\n- `cf ai-search items delete <item-id>` — Deletes a file from a managed AI Search instance and triggers a reindex. (supports --dry-run)\n- `cf ai-search namespace delete <name>` — Permanently delete a namespace. The namespace must be empty (no instances), and the default namespace cannot be deleted. (supports --dry-run)\n- `cf ai-search tokens delete <id>` — Permanently delete a stored AI Search credential. Credentials in use by an instance cannot be deleted. (supports --dry-run)\n\n### Other Operations\n\n- `cf ai-search chat-completions <id>` — Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses. (supports --dry-run, --body)\n- `cf ai-search items chunks <item-id>` — Lists chunks for a specific item in an AI Search instance, including their text content. (supports --dry-run)\n- `cf ai-search items download <item-id>` — Downloads the raw file content for a specific item from the managed AI Search instance storage. (supports --dry-run)\n- `cf ai-search items logs <item-id>` — Lists processing logs for a specific item in an AI Search instance. (supports --dry-run)\n- `cf ai-search items sync <item-id>` — Syncs an item to an AI Search instance index. (supports --dry-run, --body)\n- `cf ai-search items upload <id>` — Uploads a file to a managed AI Search instance via multipart/form-data. (supports --dry-run, --body)\n- `cf ai-search items upsert <id>` — Creates or updates an indexed item in an AI Search instance. (supports --dry-run, --body)\n- `cf ai-search jobs cancel <job-id>` — Cancel an in-progress indexing job for an AI Search instance. (supports --dry-run, --body)\n- `cf ai-search jobs logs <job-id>` — Lists log entries for an AI Search indexing job. (supports --dry-run)\n- `cf ai-search move <id>` — Moves an instance from its current namespace to the specified target namespace. Use 'default' with --destination-namespace to move the instance back to the default namespace. Fails with 400 if the target namespace already has an instance with the same id (ids must be unique within a namespace — the same id can exist in different namespaces). (supports --dry-run, --body)\n- `cf ai-search multi-chat-completions <name>` — Performs a chat completion request against multiple AI Search instances in parallel, merging retrieved content as context for generating a response. (supports --dry-run, --body)\n- `cf ai-search multi-search <name> [query]` — Performs a semantic search query against multiple AI Search instances in parallel, merging the retrieved results into a single ranked response. (supports --dry-run, --body)\n- `cf ai-search purge-cache <id>` — Purges all cached search results for an AI Search instance. A new internal cache key is generated, immediately orphaning all prior cached entries. (supports --dry-run)\n- `cf ai-search search <id> [query]` — Executes a semantic search query against an AI Search instance to find relevant indexed content. (supports --dry-run, --body)\n- `cf ai-search stats <id>` — Retrieve usage and indexing statistics for an AI Search instance. (supports --dry-run)\n\n## Safety Guidelines\n\n- Always use `--dry-run` before destructive operations (delete, update)\n",
|
package/dist/_meta/commands.json
CHANGED
|
@@ -4329,138 +4329,35 @@
|
|
|
4329
4329
|
"command": "cf ai run",
|
|
4330
4330
|
"name": "run",
|
|
4331
4331
|
"fullPath": ["ai", "run"],
|
|
4332
|
-
"description": "
|
|
4333
|
-
"usage": "cf ai run <model-name> [options]",
|
|
4332
|
+
"description": "Run inference on a Workers AI model. The request body is model-specific: fetch the model's input schema with `cf ai models schema get --model <id>` (or `cf ai run <model> --help`) to discover its fields, then pass them as flags or as a single JSON payload via --body. `cf ai models list` enumerates the models this account can run.",
|
|
4333
|
+
"usage": "cf ai run <model-name> [--<model-field> ...] [options]",
|
|
4334
4334
|
"arguments": [
|
|
4335
4335
|
{
|
|
4336
4336
|
"name": "model-name",
|
|
4337
4337
|
"position": 0,
|
|
4338
4338
|
"type": "string",
|
|
4339
4339
|
"required": true,
|
|
4340
|
-
"description": "Model
|
|
4340
|
+
"description": "Model ID, e.g. @cf/meta/llama-3.1-8b-instruct"
|
|
4341
4341
|
}
|
|
4342
4342
|
],
|
|
4343
4343
|
"options": [
|
|
4344
4344
|
{
|
|
4345
|
-
"name": "
|
|
4346
|
-
"type": "string",
|
|
4347
|
-
"required": false,
|
|
4348
|
-
"description": "The text that you want to classify"
|
|
4349
|
-
},
|
|
4350
|
-
{
|
|
4351
|
-
"name": "guidance",
|
|
4352
|
-
"type": "number",
|
|
4353
|
-
"required": false,
|
|
4354
|
-
"description": "Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt",
|
|
4355
|
-
"default": 7.5
|
|
4356
|
-
},
|
|
4357
|
-
{
|
|
4358
|
-
"name": "height",
|
|
4359
|
-
"type": "number",
|
|
4360
|
-
"required": false,
|
|
4361
|
-
"description": "The height of the generated image in pixels"
|
|
4362
|
-
},
|
|
4363
|
-
{
|
|
4364
|
-
"name": "image",
|
|
4365
|
-
"type": "string",
|
|
4366
|
-
"required": false,
|
|
4367
|
-
"description": "For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values"
|
|
4368
|
-
},
|
|
4369
|
-
{
|
|
4370
|
-
"name": "image-b64",
|
|
4371
|
-
"type": "string",
|
|
4372
|
-
"required": false,
|
|
4373
|
-
"description": "For use with img2img tasks. A base64-encoded string of the input image"
|
|
4374
|
-
},
|
|
4375
|
-
{
|
|
4376
|
-
"name": "mask",
|
|
4377
|
-
"type": "string",
|
|
4378
|
-
"required": false,
|
|
4379
|
-
"description": "An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values"
|
|
4380
|
-
},
|
|
4381
|
-
{
|
|
4382
|
-
"name": "negative-prompt",
|
|
4383
|
-
"type": "string",
|
|
4384
|
-
"required": false,
|
|
4385
|
-
"description": "Text describing elements to avoid in the generated image"
|
|
4386
|
-
},
|
|
4387
|
-
{
|
|
4388
|
-
"name": "num-steps",
|
|
4389
|
-
"type": "number",
|
|
4390
|
-
"required": false,
|
|
4391
|
-
"description": "The number of diffusion steps; higher values can improve quality but take longer",
|
|
4392
|
-
"default": 20
|
|
4393
|
-
},
|
|
4394
|
-
{
|
|
4395
|
-
"name": "prompt",
|
|
4396
|
-
"type": "string",
|
|
4397
|
-
"required": false,
|
|
4398
|
-
"description": "A text description of the image you want to generate"
|
|
4399
|
-
},
|
|
4400
|
-
{
|
|
4401
|
-
"name": "seed",
|
|
4402
|
-
"type": "number",
|
|
4403
|
-
"required": false,
|
|
4404
|
-
"description": "Random seed for reproducibility of the image generation"
|
|
4405
|
-
},
|
|
4406
|
-
{
|
|
4407
|
-
"name": "strength",
|
|
4408
|
-
"type": "number",
|
|
4409
|
-
"required": false,
|
|
4410
|
-
"description": "A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image",
|
|
4411
|
-
"default": 1
|
|
4412
|
-
},
|
|
4413
|
-
{
|
|
4414
|
-
"name": "width",
|
|
4415
|
-
"type": "number",
|
|
4416
|
-
"required": false,
|
|
4417
|
-
"description": "The width of the generated image in pixels"
|
|
4418
|
-
},
|
|
4419
|
-
{
|
|
4420
|
-
"name": "lang",
|
|
4421
|
-
"type": "string",
|
|
4422
|
-
"required": false,
|
|
4423
|
-
"description": "The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified",
|
|
4424
|
-
"default": "en"
|
|
4425
|
-
},
|
|
4426
|
-
{
|
|
4427
|
-
"name": "source-lang",
|
|
4428
|
-
"type": "string",
|
|
4429
|
-
"required": false,
|
|
4430
|
-
"description": "The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified",
|
|
4431
|
-
"default": "en"
|
|
4432
|
-
},
|
|
4433
|
-
{
|
|
4434
|
-
"name": "target-lang",
|
|
4435
|
-
"type": "string",
|
|
4436
|
-
"required": false,
|
|
4437
|
-
"description": "The language code to translate the text into (e.g., 'es' for Spanish)"
|
|
4438
|
-
},
|
|
4439
|
-
{
|
|
4440
|
-
"name": "input-text",
|
|
4345
|
+
"name": "body",
|
|
4441
4346
|
"type": "string",
|
|
4442
4347
|
"required": false,
|
|
4443
|
-
"description": "
|
|
4444
|
-
},
|
|
4445
|
-
{
|
|
4446
|
-
"name": "max-length",
|
|
4447
|
-
"type": "number",
|
|
4448
|
-
"required": false,
|
|
4449
|
-
"description": "The maximum length of the generated summary in tokens",
|
|
4450
|
-
"default": 1024
|
|
4348
|
+
"description": "Raw JSON request body, or @path to a JSON file. Use instead of the model's input flags."
|
|
4451
4349
|
},
|
|
4452
4350
|
{
|
|
4453
4351
|
"name": "dry-run",
|
|
4454
4352
|
"type": "boolean",
|
|
4455
4353
|
"required": false,
|
|
4456
|
-
"description": "Validate and show what would happen without executing"
|
|
4457
|
-
"default": false
|
|
4354
|
+
"description": "Validate and show what would happen without executing"
|
|
4458
4355
|
},
|
|
4459
4356
|
{
|
|
4460
|
-
"name": "
|
|
4461
|
-
"type": "
|
|
4357
|
+
"name": "help",
|
|
4358
|
+
"type": "boolean",
|
|
4462
4359
|
"required": false,
|
|
4463
|
-
"description": "
|
|
4360
|
+
"description": "Show help, including this model's input flags"
|
|
4464
4361
|
}
|
|
4465
4362
|
],
|
|
4466
4363
|
"category": "action",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{O as e,w as t}from"./oauth-
|
|
2
|
+
import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d}from"./prompt-DcfYBioA.mjs";import{t as f}from"./cli-types-CFw6Xygp.mjs";function p(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`eligibility <report-id>`,describe:`Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse.`,builder:p,handler:async s=>{if(s.dryRun){i({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/abuse-reports/${s[`report-id`]==null?`<report-id>`:encodeURIComponent(String(s[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(s[`report-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.abuseReports.appeals.eligibility({account_id:l,report_id:s[`report-id`]})),{successLabel:`Loaded`})}},h={command:`appeals`,describe:`Operations for appeals`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
3
3
|
`}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
4
4
|
`,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
5
5
|
`}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{O as e,w as t}from"./oauth-
|
|
2
|
+
import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u}from"./prompt-DcfYBioA.mjs";function d(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).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:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:d,handler:async e=>{if(e.dryRun){i({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)}):s(e.body)});return}let t=await n(e);if(e.body){let n=s(e.body);r(await a(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await u(`destination-organization-id`,`Move accounts to this organization ID.`));let o=c({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)});r(await a(`Creating`,async()=>t.account.batch.move({...o})),{successLabel:`Created`})}},p={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const h={command:`move`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:m,handler:async d=>{if(d.dryRun){i({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({destination_organization_id:l(d[`destination-organization-id`],`destination-organization-id`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.account.move({...e,account_id:p})),{successLabel:`Created`});return}d[`destination-organization-id`]===void 0&&(d[`destination-organization-id`]=await u(`destination-organization-id`,`The destination_organization_id field`));let m=c({destination_organization_id:l(d[`destination-organization-id`],`destination-organization-id`,`text`)});r(await a(`Creating`,async()=>f.account.move({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.account.organization.list({account_id:l})),{successLabel:`Loaded`})}},v={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.account.profile.get({account_id:l})),{successLabel:`Loaded`})}};function x(e){return e.option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 S={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:x,handler:async d=>{if(d.dryRun){i({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({business_address:l(d[`business-address`],`business-address`,`text`),business_email:l(d[`business-email`],`business-email`,`text`),business_name:l(d[`business-name`],`business-name`,`text`),business_phone:l(d[`business-phone`],`business-phone`,`text`),external_metadata:l(d[`external-metadata`],`external-metadata`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Updating`,async()=>f.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}d[`business-address`]===void 0&&(d[`business-address`]=await u(`business-address`,`The business_address field`)),d[`business-email`]===void 0&&(d[`business-email`]=await u(`business-email`,`The business_email field`)),d[`business-name`]===void 0&&(d[`business-name`]=await u(`business-name`,`The business_name field`)),d[`business-phone`]===void 0&&(d[`business-phone`]=await u(`business-phone`,`The business_phone field`)),d[`external-metadata`]===void 0&&(d[`external-metadata`]=await u(`external-metadata`,`The external_metadata field`));let m=c({business_address:l(d[`business-address`],`business-address`,`text`),business_email:l(d[`business-email`],`business-email`,`text`),business_name:l(d[`business-name`],`business-name`,`text`),business_phone:l(d[`business-phone`],`business-phone`,`text`),external_metadata:l(d[`external-metadata`],`external-metadata`,`text`)});r(await a(`Updating`,async()=>f.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})}},C={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`account`,describe:`account`,builder:e=>e.command(h).command(p).command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{O as e,w as t}from"./oauth-
|
|
2
|
+
import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{r as d,t as f}from"./prompt-DcfYBioA.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.option(`category-id`,{type:`number`,description:`Returns the category ID.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Returns the human readable ID.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`name`,{type:`string`,description:`Returns the application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).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 ee={command:`create`,describe:`Create a custom application for an account.`,builder:m,handler:async n=>{if(n.dryRun){a({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({category_id:n[`category-id`],hostnames:n.hostnames,human_id:u(n[`human-id`],`human-id`,`text`),ip_subnets:n[`ip-subnets`],name:u(n.name,`name`,`text`),port_protocols:n[`port-protocols`],support_domains:n[`support-domains`]}):c(n.body)});return}let f=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>f.accounts.applications.create({...e,account_id:p})),{successLabel:`Created`});return}if(n[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);n[`human-id`]===void 0&&(n[`human-id`]=await d(`human-id`,`Returns the human readable ID.`)),n.name===void 0&&(n.name=await d(`name`,`Returns the application name.`));let m=l({category_id:n[`category-id`],hostnames:n.hostnames,human_id:u(n[`human-id`],`human-id`,`text`),ip_subnets:n[`ip-subnets`],name:u(n.name,`name`,`text`),port_protocols:n[`port-protocols`],support_domains:n[`support-domains`]});i(await o(`Creating`,async()=>f.accounts.applications.create({...m,account_id:p})),{successLabel:`Created`})}};function te(e){return e.positional(`id`,{type:`string`,description:`Application 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 h={command:`delete <id>`,describe:`Delete a custom application and all of its versions.`,builder:p(te),handler:async n=>{if(n.dryRun){a({command:`cf accounts applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/resource-library/applications/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await f({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.accounts.applications.delete({account_id:l,id:n.id})),{successLabel:`Deleted`})}};function g(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
|
|
4
4
|
- name: Filter by application name (e.g., name:HR)
|
|
5
5
|
- id: Filter by application ID (e.g., id:498)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{D as e}from"./oauth-
|
|
2
|
+
import{D as e}from"./oauth-DC9g9uK_.mjs";import{n as t}from"./auth-B1CY5zpC.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-BLQ2xXwD.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{r as c,t as l}from"./prompt-DcfYBioA.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).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:`Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:u,handler:async l=>{if(l.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({certificate:s(l.certificate,`certificate`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}l.certificate===void 0&&(l.certificate=await c(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=o({certificate:s(l.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>u.acm.customTrustStore.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <custom-origin-trust-store-id>`,describe:`Removes a root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store/${a[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(a[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(a[`custom-origin-trust-store-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.acm.customTrustStore.delete({zone_id:s,custom_origin_trust_store_id:a[`custom-origin-trust-store-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <custom-origin-trust-store-id>`,describe:`Retrieves details about a specific root CA certificate in the custom origin trust store, including expiration and subject information.`,builder:m,handler:async a=>{if(a.dryRun){r({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store/${a[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(a[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(a[`custom-origin-trust-store-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.acm.customTrustStore.get({zone_id:s,custom_origin_trust_store_id:a[`custom-origin-trust-store-id`]})),{successLabel:`Loaded`})}};function g(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:g,handler:async a=>{let o={page:a.page,per_page:a[`per-page`],limit:a.limit,offset:a.offset};if(a.dryRun){r({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.acm.customTrustStore.list({zone_id:c,...o})),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,builder:e=>e.command(d).command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in your zone.`}).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:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:y,handler:async c=>{if(c.dryRun){r({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.acm.totalTls.edit({...e,zone_id:u})),{successLabel:`Created`});return}if(c.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=o({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled});n(await i(`Creating`,async()=>l.acm.totalTls.edit({...d,zone_id:u})),{successLabel:`Created`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.acm.totalTls.get({zone_id:s})),{successLabel:`Loaded`})}},C={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`acm`,describe:`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,builder:e=>e.command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{D as e,O as t,w as n}from"./oauth-
|
|
2
|
+
import{D as e,O as t,w as n}from"./oauth-DC9g9uK_.mjs";import{i as r,n as i}from"./auth-B1CY5zpC.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-BLQ2xXwD.mjs";import{t as c}from"./local-C6TLPAT6.mjs";import{n as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d,t as f}from"./input-validation-BwUR9z8e.mjs";import{r as p,t as m}from"./prompt-DcfYBioA.mjs";import{n as ee,t as te}from"./raw-fetch-CeW1mW_u.mjs";function h(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <address-map-id>`,describe:`Remove an account as a member of a particular address map.`,builder:h,handler:async e=>{if(e.dryRun){let n=await t();o({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/accounts/${n??`<account-id>`}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();if(e.accountId=l,!await m({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>r.addressing.addressMaps.accounts.delete({account_id:l,address_map_id:e[`address-map-id`],account_id_2:l})),{successLabel:`Deleted`})}};function _(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`update <address-map-id>`,describe:`Add an account as a member of a particular address map.`,builder:_,handler:async e=>{if(e.dryRun){let n=await t();o({command:`cf addressing address-maps accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/accounts/${n??`<account-id>`}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();e.accountId=l,a(await s(`Updating`,async()=>r.addressing.addressMaps.accounts.update({account_id:l,address_map_id:e[`address-map-id`],account_id_2:l})),{successLabel:`Updated`})}},y={command:`accounts`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`,default:!1}).option(`ips`,{type:`string`,array:!0,description:`The ips 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 x={command:`create`,describe:`Create a new address map under the account.`,builder:b,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({description:d(e.description,`description`,`text`),enabled:e.enabled,ips:e.ips}):l(e.body)});return}let r=await i(e),f=e.local?c:await n();if(e.accountId=f,e.body){let t=l(e.body);a(await s(`Creating`,async()=>r.addressing.addressMaps.create({...t,account_id:f})),{successLabel:`Created`});return}let p=u({description:d(e.description,`description`,`text`),enabled:e.enabled,ips:e.ips});a(await s(`Creating`,async()=>r.addressing.addressMaps.create({...p,account_id:f})),{successLabel:`Created`})}};function S(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 C={command:`delete <address-map-id>`,describe:`Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.`,builder:S,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();if(e.accountId=l,!await m({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>r.addressing.addressMaps.delete({account_id:l,address_map_id:e[`address-map-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`default-sni`,{type:`string`,description:`If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account.`}).option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`edit <address-map-id>`,describe:`Modify properties of an address map owned by the account.`,builder:w,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({default_sni:d(e[`default-sni`],`default-sni`,`text`),description:d(e.description,`description`,`text`),enabled:e.enabled}):l(e.body)});return}let r=await i(e),f=e.local?c:await n();if(e.accountId=f,e.body){let t=l(e.body);a(await s(`Updating`,async()=>r.addressing.addressMaps.edit({...t,account_id:f,address_map_id:e[`address-map-id`]})),{successLabel:`Updated`});return}let p=u({default_sni:d(e[`default-sni`],`default-sni`,`text`),description:d(e.description,`description`,`text`),enabled:e.enabled});a(await s(`Updating`,async()=>r.addressing.addressMaps.edit({...p,account_id:f,address_map_id:e[`address-map-id`]})),{successLabel:`Updated`})}};function E(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <address-map-id>`,describe:`Show a particular address map owned by the account.`,builder:E,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();e.accountId=l,a(await s(`Loading`,async()=>r.addressing.addressMaps.get({account_id:l,address_map_id:e[`address-map-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const k={command:`delete <ip-address>`,describe:`Remove an IP from a particular address map.`,builder:O,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps ips delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/ips/${e[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(e[`ip-address`]))}`,pathParams:{"ip-address":String(e[`ip-address`]??``),"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();if(e.accountId=l,!await m({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}a(await s(`Deleting`,async()=>r.addressing.addressMaps.ips.delete({account_id:l,address_map_id:e[`address-map-id`],ip_address:e[`ip-address`]})),{successLabel:`Deleted`})}};function A(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`update <ip-address>`,describe:`Add an IP from a prefix owned by the account to a particular address map.`,builder:A,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps ips update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/ips/${e[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(e[`ip-address`]))}`,pathParams:{"ip-address":String(e[`ip-address`]??``),"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();e.accountId=l,a(await s(`Updating`,async()=>r.addressing.addressMaps.ips.update({account_id:l,address_map_id:e[`address-map-id`],ip_address:e[`ip-address`]})),{successLabel:`Updated`})}},M={command:`ips`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List all address maps owned by the account.`,builder:N,handler:async e=>{if(e.dryRun){o({command:`cf addressing address-maps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`none`});return}let r=await i(e),l=e.local?c:await n();e.accountId=l,a(await s(`Loading`,async()=>r.addressing.addressMaps.list({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const I={command:`delete`,describe:`Remove a zone as a member of a particular address map.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf addressing address-maps zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/zones/${r.zone??r.zoneId??`<zone>`}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let l=await i(r),u=r.local?c:await n();r.accountId=u;let d=await e({zone:r.zone},l,{quiet:r.quiet});if(r.zoneId=d,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as e}from"./session-CQpgz61H.mjs";import{a as t}from"./theme-DbNbIY4d.mjs";import{O as n,w as r}from"./oauth-DC9g9uK_.mjs";import{i}from"./cf-BhDnTcDR.mjs";import{i as a,n as o}from"./auth-B1CY5zpC.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-BLQ2xXwD.mjs";import{t as u}from"./local-C6TLPAT6.mjs";import{n as d,r as f,t as p}from"./body-parser-BO6mfo_W.mjs";import{n as m,t as h}from"./input-validation-BwUR9z8e.mjs";import{n as g,r as _,t as v}from"./prompt-DcfYBioA.mjs";import{t as y}from"./cli-types-CFw6Xygp.mjs";import{n as b}from"./raw-fetch-CeW1mW_u.mjs";import{mkdirSync as x,readFileSync as S,writeFileSync as C}from"node:fs";import{dirname as w,join as T}from"node:path";import{createHash as E}from"node:crypto";function D(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}function O(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function k(e){let t=A(e);if(t.length>1){let e=new Set(t.map(k));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.size===1?[...e][0]:void 0}if(t[0]!==e)return k(t[0]??{});let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===void 0&&e.properties)return`object`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function A(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function j(e,t,n){let r=k(t);if(r===void 0)return;let i=t.enum?.filter(e=>typeof e==`string`||typeof e==`number`);return{name:e.map(D).join(`-`),path:e,type:r,required:n,description:t.description?.split(`
|
|
3
|
+
`)[0],choices:i?.length?i.map(String):void 0,schema:t}}function M(e){let t=new Map,n=A(e);for(let e of n){if(!e.properties)continue;let r=new Set(e.required??[]);for(let[i,a]of Object.entries(e.properties)){if(t.has(i))continue;let e=j([i],a,n.length===1&&r.has(i));e&&t.set(i,e)}}return[...t.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function ee(e,n){if(e.length===0)return`${t.brand(n)}\n (no input fields)`;let r=process.stdout.columns??80,i=e.map(e=>`--${e.name}`),a=Math.min(Math.max(...i.map(e=>e.length))+2,42),o=e.map((e,t)=>{let n=[`[${e.type}]`];e.required&&n.push(`[required]`),e.choices&&n.push(`[choices: ${e.choices.join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${JSON.stringify(e.schema.const)}]`),e.schema.default!==void 0&&n.push(`[default: ${JSON.stringify(e.schema.default)}]`);let o=n.join(` `),s=Math.max(r-a-4,20)-o.length-1,c=e.description===void 0||s<12?``:e.description.length>s?`${e.description.slice(0,s-1)}…`:e.description;return` ${(i[t]??``).padEnd(a)}${[c,o].filter(Boolean).join(` `)}`});return[t.brand(n),...o].join(`
|
|
4
|
+
`)}const te=`_ $0 -- body dry-run dryRun help h local local-endpoint localEndpoint profile quiet q version v zone z`.split(` `);function N(e,t){return t[e.name]??t[O(e.name)]}function P(e,t){return e.filter(e=>e.required&&N(e,t)===void 0)}function F(e){return e.flatMap(e=>[e.name,O(e.name)])}function I(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function L(e,t,n){let r=r=>{n.push(`--${e.name} expects ${r} (got '${I(t)}')`)};switch(e.type){case`number`:{let e=typeof t==`number`?t:Number(I(t));return Number.isNaN(e)?r(`a number`):e}case`boolean`:return typeof t==`boolean`?t:t===`true`?!0:t===`false`?!1:r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return m(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`string`?m(n,e.name,`text`):I(n)}}}function R(e,t,n){let{const:r,pattern:i,minLength:a,maxLength:o,minimum:s,maximum:c}=e.schema;if(r!==void 0&&t!==r){n.push(`--${e.name} must be ${JSON.stringify(r)}`);return}typeof t==`string`&&(i!==void 0&&!new RegExp(i).test(t)&&n.push(`--${e.name} does not match the required format (${i})`),a!==void 0&&t.length<a&&n.push(`--${e.name} must be at least ${a} characters`),o!==void 0&&t.length>o&&n.push(`--${e.name} must be at most ${o} characters`)),typeof t==`number`&&(s!==void 0&&t<s&&n.push(`--${e.name} must be at least ${s}`),c!==void 0&&t>c&&n.push(`--${e.name} must be at most ${c}`))}function z(e,t=[]){let n=new Set([...te,...t]),r=new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(D(t))&&r.set(D(t),t);return[...r.values()].sort()}function B(e,t,n={}){let r=[],i={},a=[...n.reserved??[],...F(e)];for(let n of e){let e=N(n,t);if(e===void 0){n.required&&r.push(`--${n.name} is required`);continue}if(n.choices&&!n.choices.includes(I(e))){r.push(`--${n.name} must be one of: ${n.choices.join(`, `)}`);continue}let a=L(n,e,r);a!==void 0&&(R(n,a,r),f(i,n.path,a))}for(let e of z(t,a))r.push(`Unknown flag --${e}`);return{body:i,errors:r}}function V(e,t=new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&!i.every(e=>typeof e==`string`&&r.has(e))||n.description!==void 0&&typeof n.description!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||!n.oneOf.every(e=>V(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||!n.anyOf.every(e=>V(e,t)))||[`minLength`,`maxLength`,`minimum`,`maximum`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>V(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function H(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!V(n))return;let r=n;return r.properties??r.oneOf??r.anyOf?r:void 0}function U(t,n){let r=E(`sha256`).update([e,...n].join(` `)).digest(`hex`).slice(0,32);return T(i(),`cache`,t,`${r}.json`)}function W(e,t){try{let n=JSON.parse(S(U(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&V(n.schema)?n.schema:void 0}catch{return}}function G(e,t,n){try{let r=U(e,t);x(w(r),{recursive:!0}),C(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function K(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401||t===403)return`the current credentials can't read it`;let n=e.message;return n?(n.split(`
|
|
5
|
+
`)[0]??``).replace(/\.$/,``):`the request failed`}const q=`ai-model-schema`;async function J(e,t,n){let r=W(q,[t,e]);if(r)return{ok:!0,schema:r};let i;try{i=await(await n()).ai.models.schema.get({account_id:t,model:e},{timeoutInSeconds:2e3/1e3,maxRetries:0})}catch(e){return{ok:!1,reason:K(e)}}let a=H(i,`input`);return a?(G(q,[t,e],a),{ok:!0,schema:a}):{ok:!1,reason:`the API returned no input schema`}}const Y="Run `cf ai models list` to see the models you can run.",X=[`model-name`,`modelName`];let Z;function Q(e){return Z=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strict(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${Y}`)}async function ne(e){Z?.showHelp(`log`);let r=e[`model-name`];if(!r)return;let i=e.local?u:await n();if(!i){console.log(`\n${t.muted(`Sign in with \`cf auth login\` to see the input flags for ${r}.`)}`);return}let a=await J(r,i,()=>o(e));console.log(a.ok?`\n${ee(M(a.schema),`Input flags for ${r}`)}`:`\n${t.muted(`Could not load the input flags for ${r}: ${a.reason}.`)}`)}const re={command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:Q,handler:async e=>{if(e.help){await ne(e);return}let t=e[`model-name`];if(!t)throw Error(`A model is required: cf ai run <model>. ${Y}`);let i=e.local?u:e.dryRun?await n()??`<account-id>`:await r(),f=t.split(`/`).map(encodeURIComponent).join(`/`),p;if(e.body!==void 0){if(z(e,X).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);p=d(e.body)}else{let n=await J(t,i,()=>o(e));if(!n.ok)throw Error(`Could not load the input schema for ${t}: ${n.reason}.\nPass the request body directly instead: cf ai run ${t} --body '{…}'`);let r=M(n.schema),a=z(e,[...X,...F(r)]);if(a.length>0)throw Error(`${a.map(e=>`Unknown flag --${e}`).join(`
|
|
6
|
+
`)}\n\nRun \`cf ai run ${t} --help\` for this model's input flags.`);for(let t of P(r,e))t.choices?e[t.name]=await g(t.name,t.description??``,t.choices):t.type===`string`&&(e[t.name]=await _(t.name,t.description??``));let s=B(r,e,{reserved:X});if(s.errors.length>0)throw Error(`${s.errors.join(`
|
|
7
|
+
`)}\n\nRun \`cf ai run ${t} --help\` for this model's input flags.`);p=s.body}if(e.dryRun){c({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i}/ai/run/${f}`,pathParams:{"model-name":t},bodyKind:`json`,body:p});return}let m=await o(e);e.accountId=i;let h=await l(`Running`,async()=>a(m,`POST`,`/accounts/${i}/ai/run/${f}`,{body:p,preserveNonJsonBytes:!0}));if(Buffer.isBuffer(h)){b(h);return}s(h,{successLabel:`Ran`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Searches Workers AI models by author or organization name.`,builder:ie,handler:async e=>{if(e.dryRun){c({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let t=await o(e),i=e.local?u:await r();e.accountId=i,s(await l(`Loading`,async()=>t.ai.authors.list({account_id:i})),{successLabel:`Loaded`})}},oe={command:`authors`,describe:`Search model authors and publishers in the Workers AI catalog`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Finetune asset file upload`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`file-name`,{type:`string`,description:`Name of the file (adapter_config.json or adapter_model.safetensors)`})}const ce={command:`create <finetune-id>`,describe:`Uploads training data assets for a Workers AI fine-tuning job.`,builder:se,handler:async e=>{if(e.dryRun){c({command:`cf ai finetunes assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,"file-name":e[`file-name`]}});return}let t=await o(e),i=e.local?u:await r();if(e.accountId=i,e.file!==void 0||e.body!==void 0||e[`file-name`]!==void 0){let n=new FormData;if(e.file){let t=h(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e[`file-name`]!==void 0&&n.append(`file_name`,String(m(e[`file-name`],`file-name`,`text`)??``)),s(await l(`Creating`,async()=>a(t,`POST`,`/accounts/${i}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=m(e.body,`body`,`binary`);s(await l(`Creating`,async()=>a(t,`POST`,`/accounts/${i}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{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.`)}},le={command:`assets`,describe:`Create and manage fine-tuned model variants trained on your own data`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`model`,{type:`string`,description:`The model field`}).option(`name`,{type:`string`,description:`The name field`}).option(`public`,{type:`boolean`,description:`The public field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`create`,describe:`Creates a new fine-tuning job for a Workers AI model using custom training data.`,builder:ue,handler:async e=>{if(e.dryRun){c({command:`cf ai finetunes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),model:m(e.model,`model`,`text`),name:m(e.name,`name`,`text`),public:e.public}):d(e.body)});return}let t=await o(e),i=e.local?u:await r();if(e.accountId=i,e.body){let n=d(e.body);s(await l(`Creating`,async()=>t.ai.finetunes.create({...n,account_id:i})),{successLabel:`Created`});return}e.model===void 0&&(e.model=await _(`model`,`The model field`)),e.name===void 0&&(e.name=await _(`name`,`The name field`));let a=p({description:m(e.description,`description`,`text`),model:m(e.model,`model`,`text`),name:m(e.name,`name`,`text`),public:e.public});s(await l(`Creating`,async()=>t.ai.finetunes.create({...a,account_id:i})),{successLabel:`Created`})}};function fe(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune 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 pe={command:`delete <finetune-id>`,describe:`Permanently deletes a finetune. D1 rows are removed immediately and R2 objects are moved to a trash bucket with a 30-day lifecycle rule for recovery.`,builder:fe,handler:async e=>{if(e.dryRun){c({command:`cf ai finetunes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=e.local?u:await r();if(e.accountId=i,!await v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}s(await l(`Deleting`,async()=>t.ai.finetunes.delete({account_id:i,finetune_id:e[`finetune-id`]})),{successLabel:`Deleted`})}};function me(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`Lists all fine-tuning jobs created by the account, including status and metrics.`,builder:me,handler:async e=>{if(e.dryRun){c({command:`cf ai finetunes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`none`});return}let t=await o(e),i=e.local?u:await r();e.accountId=i,s(await l(`Loading`,async()=>t.ai.finetunes.list({account_id:i})),{successLabel:`Loaded`})}};function ge(e){return e.option(`limit`,{type:`number`,description:`Pagination Limit`}).option(`offset`,{type:`number`,description:`Pagination Offset`}).option(`order-by`,{type:`string`,description:`Order By Column Name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Lists publicly available fine-tuned models that can be used with Workers AI.`,builder:ge,handler:async e=>{let t={limit:e.limit,offset:e.offset,orderBy:e[`order-by`]};if(e.dryRun){c({command:`cf ai finetunes public list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/finetunes/public`,pathParams:{},query:t,bodyKind:`none`});return}let i=await o(e),a=e.local?u:await r();e.accountId=a,s(await l(`Loading`,async()=>i.ai.finetunes.public.list({account_id:a,...t})),{successLabel:`Loaded`})}},ve={command:`public`,describe:`Create and manage fine-tuned model variants trained on your own data`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ye={command:`finetunes`,describe:`Create and manage fine-tuned model variants trained on your own data`,builder:e=>e.command(de).command(pe).command(he).command(le).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name`}).option(`author`,{type:`string`,description:`Filter by Author`}).option(`source`,{type:`number`,description:`Filter by Source Id`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models`}).option(`search`,{type:`string`,description:`Search`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models whose planned_deprecation_date is in the past — but only within a three-month grace window after that date. Models whose planned_deprecation_date is more than three months in the past remain hidden regardless of this flag. Future planned-deprecation dates are always included regardless of this flag. Defaults to false, preserving the existing behavior of hiding all past-dated deprecations.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`list`,describe:`Searches Workers AI models by name or description.`,builder:y(be),handler:async e=>{let t={per_page:e[`per-page`],page:e.page,task:e.task,author:e.author,source:e.source,hide_experimental:e[`hide-experimental`],search:e.search,include_deprecated:e[`include-deprecated`],format:e.format};if(e.dryRun){c({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/models/search`,pathParams:{},query:t,bodyKind:`none`});return}let i=await o(e),a=e.local?u:await r();e.accountId=a,s(await l(`Loading`,async()=>i.ai.models.list({account_id:a,...t})),{successLabel:`Loaded`})}};function Se(e){return e.option(`model`,{type:`string`,description:`Model Name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get`,describe:`Retrieves the input and output JSON schema definition for a Workers AI model.`,builder:Se,handler:async e=>{let t={model:e.model};if(e.dryRun){c({command:`cf ai models schema get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/models/schema`,pathParams:{},query:t,bodyKind:`none`});return}let i=await o(e),a=e.local?u:await r();e.accountId=a,s(await l(`Loading`,async()=>i.ai.models.schema.get({account_id:a,...t})),{successLabel:`Loaded`})}},we={command:`schema`,describe:`Search the Workers AI model catalog and retrieve input/output schemas`,builder:e=>e.command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Te={command:`models`,describe:`Search the Workers AI model catalog and retrieve input/output schemas`,builder:e=>e.command(xe).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`list`,describe:`Searches Workers AI models by task type (e.g., text-generation, embeddings).`,builder:Ee,handler:async e=>{if(e.dryRun){c({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let t=await o(e),i=e.local?u:await r();e.accountId=i,s(await l(`Loading`,async()=>t.ai.tasks.list({account_id:i})),{successLabel:`Loaded`})}},$={command:`tasks`,describe:`Browse supported inference task types (text-generation, image-classification, etc.)`,builder:e=>e.command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`supported`,describe:`Lists all file formats supported for conversion to Markdown.`,builder:Oe,handler:async e=>{if(e.dryRun){c({command:`cf ai to-markdown supported`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let t=await o(e),i=e.local?u:await r();e.accountId=i,s(await l(`Loading`,async()=>t.ai.toMarkdown.supported({account_id:i})),{successLabel:`Loaded`})}};function Ae(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`}).option(`files`,{type:`string`,description:`The files`})}const je={command:`transform`,describe:`Converts uploaded files into Markdown format using Workers AI.`,builder:Ae,handler:async e=>{if(e.dryRun){c({command:`cf ai to-markdown transform`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files}});return}let t=await o(e),i=e.local?u:await r();if(e.accountId=i,e.file!==void 0||e.body!==void 0||e.files!==void 0){let n=new FormData;if(e.file){let t=h(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.files!==void 0){let t=typeof e.files==`string`?m(e.files,`files`,`text`):e.files;n.append(`files`,typeof t==`string`?t:JSON.stringify(t))}s(await l(`Creating`,async()=>a(t,`POST`,`/accounts/${i}/ai/tomarkdown`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=m(e.body,`body`,`binary`);s(await l(`Creating`,async()=>a(t,`POST`,`/accounts/${i}/ai/tomarkdown`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{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.`)}},Me={command:`to-markdown`,describe:`Convert documents and files to clean Markdown using AI-powered extraction`,builder:e=>e.command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ne={command:`ai`,describe:`Run inference on Workers AI models — text generation, image classification, embeddings, and more`,builder:e=>e.command(re).command(oe).command(ye).command(Te).command($).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{D as e}from"./oauth-
|
|
2
|
+
import{D as e}from"./oauth-DC9g9uK_.mjs";import{i as t,n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{n as o}from"./body-parser-BO6mfo_W.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:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const c={command:`bulk-get`,describe:`Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`,builder:s,handler:async s=>{if(s.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s);if(s.zoneId=await e({zone:s.zone},c,{quiet:s.quiet}),s.body){let e=o(s.body);if(Array.isArray(e)&&e.length>25){let n=Math.ceil(e.length/25),i=null;for(let r=0;r<e.length;r+=25){let o=e.slice(r,r+25);i=await a(`Loading: batch ${Math.floor(r/25)+1}/${n}`,async()=>t(c,`POST`,`/zones/${s.zoneId}/ai-audit/robots/bulk`,{body:o}))}r(i,{successLabel:`Loaded`});return}r(await a(`Loading`,async()=>t(c,`POST`,`/zones/${s.zoneId}/ai-audit/robots/bulk`,{body:e})),{successLabel:`Loaded`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function l(e){return e.option(`subdomain`,{type:`string`,description:`Optional subdomain to fetch robots.txt for. If omitted, fetches robots.txt for the zone apex domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps.`,builder:l,handler:async t=>{let o={subdomain:t.subdomain};if(t.dryRun){i({command:`cf ai-audit robots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/ai-audit/robots`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.aiAudit.robots.get({zone_id:c,...o})),{successLabel:`Loaded`})}},d={command:`robots`,describe:`Operations for robots`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`ai-audit`,describe:`ai-audit`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{O as e,w as t}from"./oauth-
|
|
2
|
+
import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{n as d,r as f,t as p}from"./prompt-DcfYBioA.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`credit_balance`,describe:`Retrieve the current credit balance, payment method info, and top-up configuration.`,builder:ee,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing credit_balance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/credit-balance`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.aiGateway.billing.creditBalance({account_id:l})),{successLabel:`Loaded`})}};function h(e){return e.option(`type`,{type:`string`,description:`Filter invoice type: auto, manual, or all.`,choices:[`auto`,`all`,`manual`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`invoice_history`,describe:`Retrieve a list of past invoices with pagination, optionally filtered by type.`,builder:m(h),handler:async n=>{let c={type:n.type};if(n.dryRun){a({command:`cf ai-gateway billing invoice_history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/invoice-history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.aiGateway.billing.invoiceHistory({account_id:u,...c})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`invoice_preview`,describe:`Retrieve a preview of the upcoming invoice including line items and tax.`,builder:_,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing invoice_preview`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/invoice-preview`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.aiGateway.billing.invoicePreview({account_id:l})),{successLabel:`Loaded`})}};function y(e){return e.option(`amount`,{type:`number`,description:`Spending limit amount in cents (min 100).`}).option(`duration`,{type:`string`,description:`Spending limit duration.`,choices:[`daily`,`weekly`,`monthly`]}).option(`strategy`,{type:`string`,description:`Spending limit strategy.`,choices:[`fixed`,`sliding`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Deprecated: spending limits can no longer be created, enabled, or modified and this endpoint always responds 403. Use the new AI Gateway spend limits instead: https://developers.cloudflare.com/ai-gateway/features/spend-limits/. Existing limits can be removed via DELETE /spending-limit.`,builder:y,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing spending_limit create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/spending-limit`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({amount:n.amount,duration:u(n.duration,`duration`,`text`),strategy:u(n.strategy,`strategy`,`text`)}):c(n.body)});return}let f=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>f.aiGateway.billing.spendingLimit.create({...e,account_id:p})),{successLabel:`Created`});return}if(n.amount===void 0)throw Error(`--amount is required (or pass --body with this field set).`);n.duration===void 0&&(n.duration=await d(`duration`,`Spending limit duration.`,[`daily`,`weekly`,`monthly`])),n.strategy===void 0&&(n.strategy=await d(`strategy`,`Spending limit strategy.`,[`fixed`,`sliding`]));let m=l({amount:n.amount,duration:u(n.duration,`duration`,`text`),strategy:u(n.strategy,`strategy`,`text`)});i(await o(`Creating`,async()=>f.aiGateway.billing.spendingLimit.create({...m,account_id:p})),{successLabel:`Created`})}};function x(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 S={command:`delete`,describe:`Remove the spending limit for the account.`,builder:x,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing spending_limit delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/spending-limit`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.aiGateway.billing.spendingLimit.delete({account_id:l})),{successLabel:`Deleted`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get`,describe:`Retrieve the current spending limit configuration for the account.`,builder:C,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing spending_limit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/spending-limit`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.aiGateway.billing.spendingLimit.get({account_id:l})),{successLabel:`Loaded`})}},T={command:`spending_limit`,describe:`Operations for billing.spending_limit`,builder:e=>e.command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`amount`,{type:`number`,description:`Auto top-up amount in cents (min 1000).`}).option(`threshold`,{type:`number`,description:`Balance threshold in cents that triggers auto top-up (min 500).`}).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:`Configure auto top-up with a balance threshold and top-up amount.`,builder:E,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing topup config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/topup/config`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({amount:n.amount,threshold:n.threshold}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.aiGateway.billing.topup.config.create({...e,account_id:d})),{successLabel:`Created`});return}if(n.amount===void 0)throw Error(`--amount is required (or pass --body with this field set).`);if(n.threshold===void 0)throw Error(`--threshold is required (or pass --body with this field set).`);let f=l({amount:n.amount,threshold:n.threshold});i(await o(`Creating`,async()=>u.aiGateway.billing.topup.config.create({...f,account_id:d})),{successLabel:`Created`})}};function O(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 k={command:`delete`,describe:`Remove the auto top-up configuration for the account.`,builder:O,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing topup config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/topup/config`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.aiGateway.billing.topup.config.delete({account_id:l})),{successLabel:`Deleted`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get`,describe:`Retrieve the current auto top-up threshold, amount, and any error state.`,builder:A,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing topup config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/topup/config`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.aiGateway.billing.topup.config.get({account_id:l})),{successLabel:`Loaded`})}},M={command:`config`,describe:`Operations for billing.topup.config`,builder:e=>e.command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`amount`,{type:`number`,description:`Top-up amount in cents (min 1000).`}).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`,describe:`Create a credit top-up for the given account, charged to the account's default payment method.`,builder:N,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing topup create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/topup`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({amount:n.amount}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.aiGateway.billing.topup.create({...e,account_id:d})),{successLabel:`Created`});return}if(n.amount===void 0)throw Error(`--amount is required (or pass --body with this field set).`);let f=l({amount:n.amount});i(await o(`Creating`,async()=>u.aiGateway.billing.topup.create({...f,account_id:d})),{successLabel:`Created`})}};function F(e){return e.option(`payment-intent-id`,{type:`string`,description:`Stripe invoice ID to check status for.`}).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:`status`,describe:`Get the payment processing status of a top-up by its invoice ID.`,builder:F,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway billing topup status`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/topup/status`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({payment_intent_id:u(n[`payment-intent-id`],`payment-intent-id`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.aiGateway.billing.topup.status({...e,account_id:p})),{successLabel:`Created`});return}n[`payment-intent-id`]===void 0&&(n[`payment-intent-id`]=await f(`payment-intent-id`,`Stripe invoice ID to check status for.`));let m=l({payment_intent_id:u(n[`payment-intent-id`],`payment-intent-id`,`text`)});i(await o(`Creating`,async()=>d.aiGateway.billing.topup.status({...m,account_id:p})),{successLabel:`Created`})}},L={command:`topup`,describe:`Operations for billing.topup`,builder:e=>e.command(P).command(I).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`value-grouping-window`,{type:`string`,description:`Grouping window for usage data.`,choices:[`day`,`hour`],demandOption:!0}).option(`start-time`,{type:`number`,description:`Start time as Unix timestamp in milliseconds.`}).option(`end-time`,{type:`number`,description:`End time as Unix timestamp in milliseconds.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`usage_history`,describe:`Retrieve aggregated usage meter event summaries for the given time range.`,builder:m(R),handler:async n=>{let c={value_grouping_window:n[`value-grouping-window`],start_time:n[`start-time`],end_time:n[`end-time`]};if(n.dryRun){a({command:`cf ai-gateway billing usage_history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/billing/usage-history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.aiGateway.billing.usageHistory({account_id:u,...c})),{successLabel:`Loaded`})}},B={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(te).command(g).command(v).command(z).command(T).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`authentication`,{type:`boolean`,description:`The authentication field`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`id`,{type:`string`,description:`gateway id`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-5000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`store-id`,{type:`string`,description:`The store_id field`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`],default:`postpaid`}).option(`zdr`,{type:`boolean`,description:`The zdr 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 H={command:`create`,describe:`Creates a new AI Gateway.`,builder:V,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({authentication:n.authentication,cache_invalidate_on_update:n[`cache-invalidate-on-update`],cache_ttl:n[`cache-ttl`],collect_logs:n[`collect-logs`],id:u(n.id,`id`,`text`),log_management:n[`log-management`],log_management_strategy:u(n[`log-management-strategy`],`log-management-strategy`,`text`),logpush:n.logpush,logpush_public_key:u(n[`logpush-public-key`],`logpush-public-key`,`text`),rate_limiting_interval:n[`rate-limiting-interval`],rate_limiting_limit:n[`rate-limiting-limit`],rate_limiting_technique:u(n[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:u(n[`retry-backoff`],`retry-backoff`,`text`),retry_delay:n[`retry-delay`],retry_max_attempts:n[`retry-max-attempts`],store_id:u(n[`store-id`],`store-id`,`text`),workers_ai_billing_mode:u(n[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:n.zdr}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.aiGateway.create({...e,account_id:p})),{successLabel:`Created`});return}if(n[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(n[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(n[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(n.id===void 0&&(n.id=await f(`id`,`gateway id`)),n[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(n[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let m=l({authentication:n.authentication,cache_invalidate_on_update:n[`cache-invalidate-on-update`],cache_ttl:n[`cache-ttl`],collect_logs:n[`collect-logs`],id:u(n.id,`id`,`text`),log_management:n[`log-management`],log_management_strategy:u(n[`log-management-strategy`],`log-management-strategy`,`text`),logpush:n.logpush,logpush_public_key:u(n[`logpush-public-key`],`logpush-public-key`,`text`),rate_limiting_interval:n[`rate-limiting-interval`],rate_limiting_limit:n[`rate-limiting-limit`],rate_limiting_technique:u(n[`rate-limiting-technique`],`rate-limiting-technique`,`text`),retry_backoff:u(n[`retry-backoff`],`retry-backoff`,`text`),retry_delay:n[`retry-delay`],retry_max_attempts:n[`retry-max-attempts`],store_id:u(n[`store-id`],`store-id`,`text`),workers_ai_billing_mode:u(n[`workers-ai-billing-mode`],`workers-ai-billing-mode`,`text`),zdr:n.zdr});i(await o(`Creating`,async()=>d.aiGateway.create({...m,account_id:p})),{successLabel:`Created`})}};function U(e){return e.positional(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`create <gateway-id>`,describe:`Creates a new AI Gateway.`,builder:U,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways/${n[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(n[`gateway-id`]))}/datasets`,pathParams:{"gateway-id":String(n[`gateway-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({enable:n.enable,name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.aiGateway.datasets.create({...e,account_id:p,gateway_id:n[`gateway-id`]})),{successLabel:`Created`});return}if(n.enable===void 0)throw Error(`--enable is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await f(`name`,`The name field`));let m=l({enable:n.enable,name:u(n.name,`name`,`text`)});i(await o(`Creating`,async()=>d.aiGateway.datasets.create({...m,account_id:p,gateway_id:n[`gateway-id`]})),{successLabel:`Created`})}};function G(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway 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 K={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:G,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways/${n[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(n[`gateway-id`]))}/datasets/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{"gateway-id":String(n[`gateway-id`]??``),id:String(n.id??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>c.aiGateway.datasets.delete({account_id:l,gateway_id:n[`gateway-id`],id:n.id})),{successLabel:`Deleted`})}};function q(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <id>`,describe:`Retrieves details for a specific AI Gateway dataset.`,builder:q,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways/${n[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(n[`gateway-id`]))}/datasets/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{"gateway-id":String(n[`gateway-id`]??``),id:String(n.id??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.aiGateway.datasets.get({account_id:l,gateway_id:n[`gateway-id`],id:n.id})),{successLabel:`Loaded`})}};function Y(e){return e.option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Name`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`search`,{type:`string`,description:`Search by id, name, filters`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`Lists all AI Gateway evaluator types configured for the account.`,builder:Y,handler:async n=>{let c={page:n.page,per_page:n[`per-page`],name:n.name,enable:n.enable,search:n.search};if(n.dryRun){a({command:`cf ai-gateway datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways/${n[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(n[`gateway-id`]))}/datasets`,pathParams:{"gateway-id":String(n[`gateway-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.aiGateway.datasets.list({account_id:u,gateway_id:n[`gateway-id`],...c})),{successLabel:`Loaded`})}};function Z(e){return e.positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`gateway id`,demandOption:!0}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`update <id>`,describe:`Updates an existing AI Gateway dataset.`,builder:Z,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways/${n[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(n[`gateway-id`]))}/datasets/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{"gateway-id":String(n[`gateway-id`]??``),id:String(n.id??``)},bodyKind:`json`,body:n.body===void 0?l({enable:n.enable,name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.aiGateway.datasets.update({...e,account_id:p,gateway_id:n[`gateway-id`],id:n.id})),{successLabel:`Updated`});return}if(n.enable===void 0)throw Error(`--enable is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await f(`name`,`The name field`));let m=l({enable:n.enable,name:u(n.name,`name`,`text`)});i(await o(`Updating`,async()=>d.aiGateway.datasets.update({...m,account_id:p,gateway_id:n[`gateway-id`],id:n.id})),{successLabel:`Updated`})}},ne={command:`datasets`,describe:`Curated collections of gateway logs used as inputs for evaluations and fine-tuning`,builder:e=>e.command(W).command(K).command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`id`,{type:`string`,description:`gateway 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 ie={command:`delete <id>`,describe:`Deletes an AI Gateway dataset.`,builder:re,handler:async n=>{if(n.dryRun){a({command:`cf ai-gateway delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai-gateway/gateways/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|