cf 1.0.0-beta.28 → 1.0.0-beta.29
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/README.md +10 -3
- package/dist/_meta/commands.json +2240 -3181
- package/dist/_meta/hand-written-commands.json +38 -8
- package/dist/_meta/schemas.json +1683 -2505
- package/dist/{abuse-reports-D9edOyag.mjs → abuse-reports-DqXYX_6F.mjs} +10 -10
- package/dist/{access-CKCCSrrU.mjs → access-Cte4yyIz.mjs} +1 -1
- package/dist/{accounts-CNb9U9bK.mjs → accounts-G-x-_cEx.mjs} +58 -57
- package/dist/{acm-CdKTAToZ.mjs → acm-Bg3HqMGG.mjs} +7 -7
- package/dist/{addressing-eZI_C-b0.mjs → addressing-BwEofGEm.mjs} +46 -46
- package/dist/{agent-memory-BBHCEE7h.mjs → agent-memory-DhwZ2KRw.mjs} +15 -15
- package/dist/{ai-Csl_QNwv.mjs → ai-DWWRIQIt.mjs} +16 -16
- package/dist/{ai-audit-DlqWsQi-.mjs → ai-audit-CMEBz6ZP.mjs} +3 -3
- package/dist/ai-gateway-D2s0isU-.mjs +76 -0
- package/dist/ai-search-a0uqr9yJ.mjs +74 -0
- package/dist/{ai-security-DvU2iYkY.mjs → ai-security-H_RqjRoL.mjs} +4 -4
- package/dist/alerting-Bgp9rE4I.mjs +52 -0
- package/dist/analytics-CFYM82FD.mjs +17 -0
- package/dist/{analytics-engine-BlIecoOe.mjs → analytics-engine-BLiEaLxb.mjs} +2 -2
- package/dist/{api-security-DZ7GWOqD.mjs → api-security-B0YtHglt.mjs} +63 -63
- package/dist/{argo-Bh0_cj49.mjs → argo-BPwbzHY7.mjs} +7 -7
- package/dist/{artifacts-VZJWVq_6.mjs → artifacts-B6UwC2PH.mjs} +20 -20
- package/dist/{audit-logs-B8cGL4B9.mjs → audit-logs-kG97iEnI.mjs} +2 -2
- package/dist/auth-Czr8ChBB.mjs +2 -0
- package/dist/auth-DA1PHaHi.mjs +2 -0
- package/dist/auth-Dwfa4S3h.mjs +7 -0
- package/dist/{auth-token-DW4dJVdj.mjs → auth-token-CE3Wa5-b.mjs} +1 -1
- package/dist/{autoconfig-C0ynlGHf.mjs → autoconfig-B4tFR6ua.mjs} +120 -116
- package/dist/{basin-catalog-TehR1sKZ.mjs → basin-catalog-DzVEPupy.mjs} +17 -17
- package/dist/{billing-B2KusU6g.mjs → billing-TERxOuLR.mjs} +11 -11
- package/dist/{blocks-BFulF68V.mjs → blocks-C3Im7AT0.mjs} +1 -1
- package/dist/body-parser-HN91kAf0.mjs +2 -0
- package/dist/{body-unions-DNs981Ia.mjs → body-unions-D9OSaf4M.mjs} +1 -1
- package/dist/{bot-management-CXHXgrQC.mjs → bot-management-SZw9jTOC.mjs} +4 -4
- package/dist/{botnet-feed-UyK7Rfp6.mjs → botnet-feed-DjdAeUtb.mjs} +5 -5
- package/dist/brand-protection-BpA7Gmf1.mjs +18 -0
- package/dist/browser-run-BvjfMK3f.mjs +40 -0
- package/dist/build-CCwo_ydV.mjs +2 -0
- package/dist/{build-FFxzigo4.mjs → build-yQOzZg6Z.mjs} +1 -1
- package/dist/builds-tMa3sbQU.mjs +62 -0
- package/dist/{cache-BacNNtLu.mjs → cache-b_EPh6Is.mjs} +18 -18
- package/dist/cf-DmvZ2L51.mjs +18 -0
- package/dist/{chunk-DSGVRFIS-BaNZNW-M.mjs → chunk-DSGVRFIS-Cj7pO-YQ.mjs} +1 -1
- package/dist/chunk-Q5KVZMHK-WOCEMyET.mjs +363 -0
- package/dist/cli-Cc7ujzAy.mjs +4 -0
- package/dist/{client-side-security-bzB9JosR.mjs → client-side-security-DVkeCzcC.mjs} +14 -14
- package/dist/{cloud-connector-BHtf37R5.mjs → cloud-connector-MVf4acRR.mjs} +3 -3
- package/dist/{cloudflared-QDdHMUEY.mjs → cloudflared-BOkMl8Gm.mjs} +1 -1
- package/dist/cloudforce-one-KrCfQbRx.mjs +318 -0
- package/dist/{command-D895kdlh.mjs → command-BQbZw4Kx.mjs} +1 -1
- package/dist/command-BVct0Dvr.mjs +2 -0
- package/dist/{command-DeutqL1n.mjs → command-C4_lMRkw.mjs} +1 -1
- package/dist/command-CJ3ldWrA.mjs +2 -0
- package/dist/command-CyOdBNur.mjs +2 -0
- package/dist/command-D2XkyO1e.mjs +2 -0
- package/dist/command-DHODgfFZ.mjs +2 -0
- package/dist/command-DIIaZx_f.mjs +2 -0
- package/dist/command-DONwHpqZ.mjs +2 -0
- package/dist/command-DdYnSf-8.mjs +2 -0
- package/dist/command-DqOU7Ql2.mjs +2 -0
- package/dist/{command-CbxXc5IW.mjs → command-HW7k43qu.mjs} +1 -1
- package/dist/command-NqM0lo4a.mjs +2 -0
- package/dist/command-bwVDyMv4.mjs +2 -0
- package/dist/command-yzqs4m83.mjs +2 -0
- package/dist/{completions-BvdKtzsX.mjs → completions-0YKvIyBT.mjs} +2 -2
- package/dist/{connector-interrupts-dUPW6Ya_.mjs → connector-interrupts-CsunbRsr.mjs} +3 -3
- package/dist/{connector-telemetry-events-DWVCqnhn.mjs → connector-telemetry-events-DmQPD7xC.mjs} +3 -3
- package/dist/{connector-telemetry-snapshots-CeMP3qeI.mjs → connector-telemetry-snapshots-C62iHjC9.mjs} +3 -3
- package/dist/{connectors-DZFGNw3i.mjs → connectors-Bg0MU6ZT.mjs} +7 -7
- package/dist/{containers-DCzQCo79.mjs → containers-BiA_bpPR.mjs} +22 -21
- package/dist/{content-scan-XhnNJqXf.mjs → content-scan-4SA2nacB.mjs} +6 -6
- package/dist/{context-BY1Eh_Qe.mjs → context-BGm5_wTT.mjs} +1 -1
- package/dist/{cps-CohlxvuN.mjs → cps-WDmD3V5I.mjs} +3 -3
- package/dist/csam-scanner-Rmy-hBEA.mjs +8 -0
- package/dist/{custom-csrs-BVdMQjYq.mjs → custom-csrs-D-lvkyRV.mjs} +5 -5
- package/dist/{custom-hostnames-r-CxhSa1.mjs → custom-hostnames-B5BQX5m6.mjs} +12 -12
- package/dist/{custom-nameservers-CapMDyly.mjs → custom-nameservers-CZrRjcjx.mjs} +4 -4
- package/dist/{custom-pages-BVIniWfq.mjs → custom-pages-CWwjtfbj.mjs} +10 -10
- package/dist/d1-N81q-FAr.mjs +50 -0
- package/dist/{delegate-CcL6RoGw.mjs → delegate-livNdiwK.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-Ok4ncy06.mjs +2 -0
- package/dist/deploy-context-B_lLfxt7.mjs +55 -0
- package/dist/deploy-input-JZlEJwKB.mjs +2 -0
- package/dist/dev-DxbkJkzc.mjs +4 -0
- package/dist/{diagnostics-C3nqxsAO.mjs → diagnostics-DlJzpO8b.mjs} +7 -7
- package/dist/dialog-CD94-Kzw.mjs +2 -0
- package/dist/discover-D9FNaCDK.mjs +2 -0
- package/dist/discover-DGsMj9ZN.mjs +2 -0
- package/dist/{dist-D-ihn_mV.mjs → dist-BxhwE-W1.mjs} +193 -193
- package/dist/{dls-N1x8sAK3.mjs → dls-5OXuxLAB.mjs} +8 -8
- package/dist/{dns-DATWP-PF.mjs → dns-Burep9O7.mjs} +59 -69
- package/dist/{dns-firewall-n3Y2ui6W.mjs → dns-firewall-hUHaQ0DE.mjs} +8 -8
- package/dist/docs-BFVK88kB.mjs +3 -0
- package/dist/{dry-run-kJbjn4kG.mjs → dry-run-qsnRlRk6.mjs} +1 -1
- package/dist/{durable-objects-DHK9w-vO.mjs → durable-objects-D6R8S2Dk.mjs} +3 -3
- package/dist/email-auth--2KCzZNA.mjs +6 -0
- package/dist/email-routing-DzaExfVf.mjs +44 -0
- package/dist/{email-security-DK_SJ0yi.mjs → email-security-DwQJszzy.mjs} +71 -71
- package/dist/{email-sending-CTQafGec.mjs → email-sending-mQd2qB-o.mjs} +21 -21
- package/dist/errors-C_bGcR0X.mjs +11 -0
- package/dist/field-extractors-MVOizTlB.mjs +8 -0
- package/dist/{firewall-CW-fAI9m.mjs → firewall-DtSIlkfL.mjs} +19 -19
- package/dist/{flagship-RiLnDwfJ.mjs → flagship-9E5gwNki.mjs} +12 -12
- package/dist/{fraud-DvfBBTe8.mjs → fraud-DjqhVJdf.mjs} +3 -3
- package/dist/generate-BzOnRBij.mjs +2 -0
- package/dist/generate-DfxZtpn9.mjs +2 -0
- package/dist/{global-options-DiKj2cQy.mjs → global-options-4pyD17hd.mjs} +1 -1
- package/dist/{google-tag-gateway-C5WYsSXv.mjs → google-tag-gateway-BM5GmCZa.mjs} +3 -3
- package/dist/gt-BV-jij5q.mjs +4 -0
- package/dist/healthchecks-CEZ5f3XJ.mjs +20 -0
- package/dist/{hyperdrive-Ch6klUp3.mjs → hyperdrive-Da8hCcUw.mjs} +12 -12
- package/dist/{iam-LlGEzRCq.mjs → iam-BK6N7NdQ.mjs} +31 -31
- package/dist/{images-C5WqUXkK.mjs → images-3bCWE6Ml.mjs} +33 -33
- package/dist/index.mjs +1 -1
- package/dist/init-BgCF9K8h.mjs +43 -0
- package/dist/{intel-vcWyslaX.mjs → intel-BQ58CJLt.mjs} +30 -30
- package/dist/{interactive-BCDFSPtq.mjs → interactive-JBA3qOUa.mjs} +9 -9
- package/dist/{internal-BhV9WjLp.mjs → internal-CWPz0sBF.mjs} +2 -2
- package/dist/{ips-CqHjVsqd.mjs → ips-3WYegiVW.mjs} +2 -2
- package/dist/{k2-CZT2Pd5J.mjs → k2-Bc_hjmiv.mjs} +5 -5
- package/dist/{kv-Ipa7dnvF.mjs → kv-DbShBhhg.mjs} +6 -6
- package/dist/{lazy-command-DbKVgdGT.mjs → lazy-command-CbGyEqFK.mjs} +1 -1
- package/dist/leaked-credential-checks-DgPefxP9.mjs +16 -0
- package/dist/{live-C9L1bNuE.mjs → live-BTtMv1a6.mjs} +2 -2
- package/dist/load-balancers-C2hg52WA.mjs +84 -0
- package/dist/{local-DIJ7SIKC.mjs → local-B3zt9PXR.mjs} +1 -1
- package/dist/local-DRxctCh9.mjs +2 -0
- package/dist/local-runtime-BOnDiMDc.mjs +2 -0
- package/dist/{log-BWdaOGOW.mjs → log-Brx-wjJW.mjs} +3 -3
- package/dist/log-DBAHla_W.mjs +2 -0
- package/dist/login-CK3nn9a5.mjs +2 -0
- package/dist/{login-DG5ebyab.mjs → login-DiR-buzS.mjs} +3 -3
- package/dist/{logpush-C5Gw7F_9.mjs → logpush-CitvUX-J.mjs} +22 -22
- package/dist/{logs-y3REfHbb.mjs → logs-CfWHu4Ir.mjs} +14 -16
- package/dist/{magic-network-monitoring-BZBGZB6M.mjs → magic-network-monitoring-gU6yzzML.mjs} +17 -17
- package/dist/{magic-transit-BPV_POf5.mjs → magic-transit-B3JY9u5o.mjs} +139 -139
- package/dist/{managed-defense-BaUBSUcz.mjs → managed-defense-C_EQ-NYp.mjs} +9 -9
- package/dist/managed-transforms-DIGl6JkM.mjs +8 -0
- package/dist/{mcp-RPtrISTy.mjs → mcp-DqhQJVaz.mjs} +15 -15
- package/dist/{mesh-DZ4QHBPE.mjs → mesh-DXVZBNDC.mjs} +12 -12
- package/dist/{migrate-CRIUqGi2.mjs → migrate-CmXyk9vX.mjs} +1 -1
- package/dist/{monetization-CVZqM8Xo.mjs → monetization-CWg-mySr.mjs} +9 -9
- package/dist/{network-interconnects-9nS5jL__.mjs → network-interconnects-DhfKL5tG.mjs} +17 -19
- package/dist/{network-DLt2JUo1.mjs → network-jtgq5eb4.mjs} +24 -24
- package/dist/o11y-eYYs59X9.mjs +88 -0
- package/dist/oauth-BgDZMd72.mjs +5 -0
- package/dist/{oauth-Cidoyxfp.mjs → oauth-V37G-PaV.mjs} +1 -1
- package/dist/{observability-C-KNh__y.mjs → observability-CB72eC4T.mjs} +2 -2
- package/dist/{ohttp-gateway-B5nCl4s3.mjs → ohttp-gateway-K9ToEft8.mjs} +4 -4
- package/dist/{organizations-DbeeWUL4.mjs → organizations-BllV7l_c.mjs} +18 -19
- package/dist/output-hFMAotFl.mjs +2 -0
- package/dist/package-oNVeacC9.mjs +2 -0
- package/dist/page-rules-BVmi-ZFW.mjs +35 -0
- package/dist/pages-5spcBpX1.mjs +48 -0
- package/dist/{pay-per-crawl-EHYtSKxX.mjs → pay-per-crawl-BgsdGcBi.mjs} +18 -18
- package/dist/{pay-per-use-wdEhl8k4.mjs → pay-per-use-CzmI1kEA.mjs} +16 -16
- package/dist/pipelines-CbtmLRxt.mjs +40 -0
- package/dist/{precursor-Dx8lN4UJ.mjs → precursor-Dk8YOKf_.mjs} +2 -2
- package/dist/previews-Bv1HMMtO.mjs +6 -0
- package/dist/progress-DE_G09u2.mjs +2 -0
- package/dist/project-settings-D_S-UC8I.mjs +3 -0
- package/dist/prompt-D274Im1O.mjs +4 -0
- package/dist/{queues-DgMc7Z6A.mjs → queues-DGCYUr4g.mjs} +26 -26
- package/dist/{r2-BpTVicIq.mjs → r2-DtCk-Nfi.mjs} +51 -51
- package/dist/{radar-DW-S1VUh.mjs → radar-1CwqOsMZ.mjs} +150 -150
- package/dist/raw-fetch-DhlyWQtk.mjs +2 -0
- package/dist/{ready-d0li0X6r.mjs → ready-CcoEA7M7.mjs} +2 -2
- package/dist/{realtime-DMKHLYF4.mjs → realtime-DFUxwIG5.mjs} +80 -81
- package/dist/registrar-Cl1snz8z.mjs +43 -0
- package/dist/{registrar-sandbox-lVLB1-mC.mjs → registrar-sandbox-Cne9BVCZ.mjs} +9 -9
- package/dist/{reporting-WX8P3Y0k.mjs → reporting-D9FC-Z-3.mjs} +7 -7
- package/dist/request-headers-Bopp5lH_.mjs +2 -0
- package/dist/request-tracers-CSSB9_aW.mjs +4 -0
- package/dist/{resource-sharing-B2ZSt_cA.mjs → resource-sharing-D8yuzJm7.mjs} +18 -18
- package/dist/{rules-CB0QQTB3.mjs → rules-DzmOQ3MB.mjs} +8 -8
- package/dist/rulesets-DsTGcgbc.mjs +42 -0
- package/dist/{rum-BZ_24qZU.mjs → rum-DrJLI93T.mjs} +14 -14
- package/dist/run-C5yPsiO2.mjs +2 -0
- package/dist/run-CXWkMU3x.mjs +2 -0
- package/dist/schema-CfZOW8Zw.mjs +2 -0
- package/dist/{schema-cache-5NkOj7Y3.mjs → schema-cache-CtqAs0PP.mjs} +1 -1
- package/dist/schema-flags-DO3kLYBu.mjs +4 -0
- package/dist/{scim-DchxaJfE.mjs → scim-0OufLKru.mjs} +8 -8
- package/dist/{secrets-store-oAft1cFE.mjs → secrets-store-BQeLzFxv.mjs} +11 -11
- package/dist/{security-insights-DMm0qg_m.mjs → security-insights-D2pj8-O-.mjs} +20 -20
- package/dist/{security-txt-CIt0494b.mjs → security-txt-SKtgW4n-.mjs} +4 -4
- package/dist/session-COdP8BXD.mjs +2 -0
- package/dist/shared-D_2KLpP3.mjs +2 -0
- package/dist/{signed-url-gNangfwc.mjs → signed-url-CcE2zQ4Y.mjs} +2 -2
- package/dist/smart-shield-Dod9Gs6T.mjs +22 -0
- package/dist/snippets-DrrdpLnS.mjs +18 -0
- package/dist/spawn-DNf-Ge8d.mjs +5 -0
- package/dist/{spectrum-DLYIHelC.mjs → spectrum-CHBGZbZF.mjs} +11 -11
- package/dist/{speed-DugG9Tm9.mjs → speed-vOlHyG3v.mjs} +11 -11
- package/dist/sql-BCuLxGSf.mjs +4 -0
- package/dist/src-ByCoEqOw.mjs +133 -0
- package/dist/{ssl-Bg4X3WGk.mjs → ssl-BA_dcVwF.mjs} +60 -62
- package/dist/startup-profile-CyQk_f_L.mjs +2 -0
- package/dist/{startup-profile-DZL2DC44.mjs → startup-profile-uh-F0HRS.mjs} +3 -3
- package/dist/state-B6r-b_-d.mjs +2 -0
- package/dist/{state-mr5ux1Nb.mjs → state-CTLznbVs.mjs} +1 -1
- package/dist/static-assets-DGDoaJf1.mjs +386 -0
- package/dist/stream-CzlqY8hq.mjs +89 -0
- package/dist/{tags-SKz2odE_.mjs → tags-BLeaslAb.mjs} +8 -8
- package/dist/telemetry-COlodX5Z.mjs +2 -0
- package/dist/{telemetry-B4zmCpT0.mjs → telemetry-DF7A5Bpk.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-BhkhBerL.mjs → tenant-custom-nameservers-C5rh6jPf.mjs} +4 -4
- package/dist/{tenants-DD-GMq0K.mjs → tenants-CRirmhxS.mjs} +3 -3
- package/dist/{tools-KW_4hvzY.mjs → tools-BRjRgZnj.mjs} +1 -1
- package/dist/tunnels-nLfIWPYT.mjs +27 -0
- package/dist/{turnstile-DhSU_Xar.mjs → turnstile-CZjXtBCr.mjs} +10 -10
- package/dist/ui-dWsVmFCG.mjs +2 -0
- package/dist/{update-check-HltjTMDE.mjs → update-check-CXMdVBhW.mjs} +1 -1
- package/dist/{update-check-CRttabfu.mjs → update-check-D_Oky9-u.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-K7gkmPvG.mjs → url-normalization-DTKgJHE8.mjs} +4 -4
- package/dist/url-scanner-9XW3zLaU.mjs +16 -0
- package/dist/user-Bk1BIqZ5.mjs +103 -0
- package/dist/{vectorize-BTBerJME.mjs → vectorize-CgOfmWYq.mjs} +15 -15
- package/dist/version-CcuBNjqg.mjs +2 -0
- package/dist/waiting-rooms-C3nTKfK9.mjs +52 -0
- package/dist/{web-assets-LHPQsrnY.mjs → web-assets-CWU3jrit.mjs} +29 -29
- package/dist/{web3-BsOio0Ae.mjs → web3-CRpQ5sl4.mjs} +13 -13
- package/dist/workers-BZMvamn0.mjs +39 -0
- package/dist/{workers-for-platforms-BGp6yr6P.mjs → workers-for-platforms-C7F2ev-5.mjs} +18 -18
- package/dist/{workers-vpc-D8lefWDo.mjs → workers-vpc-ztEKvWmq.mjs} +6 -6
- package/dist/{workflows-B-ZIG3y7.mjs → workflows-Dd88_Nqc.mjs} +24 -24
- package/dist/{wrangler-migration-6E6wT_LZ.mjs → wrangler-migration-BzMTJPdI.mjs} +294 -294
- package/dist/zaraz-BFK0p28R.mjs +22 -0
- package/dist/{zero-trust-BZDXM5r6.mjs → zero-trust-Cdjfp0Ie.mjs} +441 -455
- package/dist/{zones-B-UV_DGE.mjs → zones-DDn5jk6I.mjs} +51 -51
- package/package.json +19 -19
- package/dist/ai-gateway-Lj4On37s.mjs +0 -74
- package/dist/ai-search-BxyhS3X7.mjs +0 -74
- package/dist/alerting-r0G2X9y9.mjs +0 -52
- package/dist/analytics-C6bfqm-W.mjs +0 -17
- package/dist/auth-B-h0BHg7.mjs +0 -2
- package/dist/auth-B6tswVxH.mjs +0 -2
- package/dist/auth-clmqFEWU.mjs +0 -7
- package/dist/body-parser-DoewLePl.mjs +0 -2
- package/dist/brand-protection-kv1ba80i.mjs +0 -14
- package/dist/browser-run-D-vRoZmf.mjs +0 -40
- package/dist/build-BzJGqb2o.mjs +0 -2
- package/dist/builds-BbxINHRP.mjs +0 -64
- package/dist/cf-BQ_LRiut.mjs +0 -18
- package/dist/chunk-SOBRPAPT-QTjnHSNs.mjs +0 -363
- package/dist/cli-B7vslRfu.mjs +0 -4
- package/dist/cloudforce-one-DWBPQDA3.mjs +0 -318
- package/dist/command-AVwd7XjE.mjs +0 -2
- package/dist/command-B87T_f2f.mjs +0 -2
- package/dist/command-CEHhi3t0.mjs +0 -2
- package/dist/command-CYmQE79n.mjs +0 -2
- package/dist/command-Ce8CVLth.mjs +0 -2
- package/dist/command-CqDudQZs.mjs +0 -2
- package/dist/command-D4YcwpVp.mjs +0 -2
- package/dist/command-D9Qyi1B0.mjs +0 -2
- package/dist/command-Dl9ICrRK.mjs +0 -2
- package/dist/command-DtCSe8Hy.mjs +0 -2
- package/dist/command-DwzVtmb3.mjs +0 -2
- package/dist/command-wtBubtZ4.mjs +0 -2
- package/dist/containers-B06OGOEB.mjs +0 -380
- package/dist/csam-scanner-BV4bHq8v.mjs +0 -8
- package/dist/d1-nJCOJZb8.mjs +0 -50
- package/dist/deploy-DJMnWFNk.mjs +0 -2
- package/dist/deploy-context-YCW3eqP1.mjs +0 -56
- package/dist/deploy-input-CQLBXFEB.mjs +0 -2
- package/dist/dev-GsYHvMah.mjs +0 -4
- package/dist/dialog-D5lus4M4.mjs +0 -2
- package/dist/discover-6kAmVMPp.mjs +0 -2
- package/dist/discover-C06Syc2B.mjs +0 -2
- package/dist/docs-CRc_WOXh.mjs +0 -3
- package/dist/email-auth-ptdqNSTZ.mjs +0 -6
- package/dist/email-domains-uL22-zRY.mjs +0 -14
- package/dist/email-routing-CV43rMJC.mjs +0 -44
- package/dist/errors-VG1mgwJl.mjs +0 -11
- package/dist/field-extractors-jcZ_bAGc.mjs +0 -8
- package/dist/generate-CeeWW3eX.mjs +0 -3
- package/dist/generate-D6V4Q58z.mjs +0 -2
- package/dist/gt-BQkaDQDq.mjs +0 -3
- package/dist/healthchecks-BA1fmzTm.mjs +0 -20
- package/dist/init-EVsjBrOz.mjs +0 -43
- package/dist/leaked-credential-checks-EzT4TTjO.mjs +0 -16
- package/dist/load-balancers-Cb3VkSfc.mjs +0 -84
- package/dist/local-D5Vq6ooZ.mjs +0 -2
- package/dist/local-runtime-BZjgkacr.mjs +0 -2
- package/dist/log-DZfik9Jk.mjs +0 -2
- package/dist/login-DRJugxya.mjs +0 -2
- package/dist/managed-transforms-CjkjLzMC.mjs +0 -8
- package/dist/o11y-ySxrnP1Z.mjs +0 -88
- package/dist/oauth-CFVUl-Wv.mjs +0 -4
- package/dist/output-BZQEl3mK.mjs +0 -2
- package/dist/package-B7RgwuFR.mjs +0 -2
- package/dist/page-rules-DRw763O1.mjs +0 -38
- package/dist/pages-DfQnxiTk.mjs +0 -48
- package/dist/pipelines-DbyrI6F4.mjs +0 -40
- package/dist/previews-DEVNSip2.mjs +0 -6
- package/dist/progress-yvPscjYg.mjs +0 -2
- package/dist/project-settings-nBMEx1f-.mjs +0 -3
- package/dist/prompt-CEpZ-lQZ.mjs +0 -4
- package/dist/raw-fetch-Cl5spWC3.mjs +0 -2
- package/dist/registrar-D23gfKBi.mjs +0 -43
- package/dist/request-headers-C0FpeBhz.mjs +0 -2
- package/dist/request-tracers-qd7XOAka.mjs +0 -4
- package/dist/rulesets-DmqwixUC.mjs +0 -42
- package/dist/run-BOKI1uWa.mjs +0 -2
- package/dist/run-DBqOjD1P.mjs +0 -2
- package/dist/schema-Dj9STsWI.mjs +0 -2
- package/dist/schema-flags-CXm9iIv6.mjs +0 -4
- package/dist/session-vzNfUhPl.mjs +0 -2
- package/dist/shared-MK-_lkbn.mjs +0 -2
- package/dist/smart-shield-Boy_qbqd.mjs +0 -22
- package/dist/snippets-DdoDYXW-.mjs +0 -18
- package/dist/spawn-B5F4OIHG.mjs +0 -5
- package/dist/sql-Bb56llsb.mjs +0 -4
- package/dist/src-BoSDeQ9m.mjs +0 -133
- package/dist/startup-profile-DQVkZZpb.mjs +0 -2
- package/dist/state-DW3QZtfh.mjs +0 -2
- package/dist/stream-BuZYDbNR.mjs +0 -89
- package/dist/telemetry-DkDUr4KK.mjs +0 -2
- package/dist/tunnels-D90ztENM.mjs +0 -27
- package/dist/ui-xjCox-gU.mjs +0 -2
- package/dist/url-scanner-BRdWwka4.mjs +0 -16
- package/dist/user-Cmb1_Wu5.mjs +0 -103
- package/dist/version-6Bpy6Bgt.mjs +0 -2
- package/dist/waiting-rooms-LymmKIGr.mjs +0 -52
- package/dist/workers-BnLiOjZf.mjs +0 -39
- package/dist/workers-builds-sKpITeRk.mjs +0 -14
- package/dist/zaraz-BBKki5WS.mjs +0 -22
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{o as n,r,t as i}from"./body-parser-HN91kAf0.mjs";import{a,t as o}from"./context-BGm5_wTT.mjs";import{t as s}from"./dry-run-qsnRlRk6.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./output-hFMAotFl.mjs";import{t as u}from"./run-CXWkMU3x.mjs";import{t as d}from"./progress-DE_G09u2.mjs";import"./telemetry-COlodX5Z.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-D274Im1O.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
|
|
3
3
|
|
|
4
|
-
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>
|
|
4
|
+
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"host"?: string, "id"?: string, "inclusive"?: boolean, "is_paused"?: boolean, "paths"?: [string]}]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>u({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({delete_rules:e[`delete-rules`],rules:n(e.rules,`rules`)}):r(e.body)});return}let u=e.body===void 0?void 0:r(e.body),f=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=u,n=await d(`Creating`,async()=>f.send(m,{body:t,account_id:p,ruleset_id:e[`ruleset-id`]}));l(n,{successLabel:`Created`});return}let h=i({delete_rules:e[`delete-rules`],rules:n(e.rules,`rules`)}),g=await d(`Creating`,async()=>f.send(m,{body:h,account_id:p,ruleset_id:e[`ruleset-id`]}));l(g,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
|
|
5
5
|
|
|
6
|
-
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>
|
|
6
|
+
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>u({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await d(`Creating`,async()=>u.send(_,{body:t,account_id:p,ruleset_id:e[`ruleset-id`]}));l(r,{successLabel:`Created`});return}let m=i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),h=await d(`Creating`,async()=>u.send(_,{body:m,account_id:p,ruleset_id:e[`ruleset-id`]}));l(h,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`};function x(e){return e.usage(`$0 rum rules delete <rule-id>
|
|
7
7
|
|
|
8
|
-
Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset 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 S={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:x,handler:async e=>
|
|
8
|
+
Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset 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 S={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:x,handler:async e=>u({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();if(e.accountId=r,!await p({force:!!e.force}))return;let i=await d(`Deleting`,async()=>n.send(b,{account_id:r,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));l(i,{successLabel:`Deleted`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`};function w(e){return e.usage(`$0 rum rules list
|
|
9
9
|
|
|
10
|
-
Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:w,handler:async e=>
|
|
10
|
+
Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:w,handler:async e=>u({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(C,{account_id:r,ruleset_id:e[`ruleset-id`]}));l(i,{successLabel:`Loaded`})})};var E={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`,body:`json`};function D(e){return e.usage(`$0 rum rules update <rule-id>
|
|
11
11
|
|
|
12
|
-
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>
|
|
12
|
+
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>u({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await d(`Updating`,async()=>u.send(E,{body:t,account_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));l(r,{successLabel:`Updated`});return}let m=i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),h=await d(`Updating`,async()=>u.send(E,{body:m,account_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));l(h,{successLabel:`Updated`})})},k={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/site_info`,body:`json`};function j(e){return e.usage(`$0 rum site-info create
|
|
13
13
|
|
|
14
|
-
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>
|
|
14
|
+
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>u({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let e=n,t=await d(`Creating`,async()=>u.send(A,{body:e,account_id:p}));l(t,{successLabel:`Created`});return}let m=i({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),h=await d(`Creating`,async()=>u.send(A,{body:m,account_id:p}));l(h,{successLabel:`Created`})})};var N={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function P(e){return e.usage(`$0 rum site-info delete <site-id>
|
|
15
15
|
|
|
16
|
-
Deletes an existing Web Analytics site.`).positional(`site-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 F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>
|
|
16
|
+
Deletes an existing Web Analytics site.`).positional(`site-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 F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>u({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();if(e.accountId=r,!await p({force:!!e.force}))return;let i=await d(`Deleting`,async()=>n.send(N,{account_id:r,site_id:e[`site-id`]}));l(i,{successLabel:`Deleted`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function L(e){return e.usage(`$0 rum site-info get <site-id>
|
|
17
17
|
|
|
18
|
-
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:L,handler:async e=>
|
|
18
|
+
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:L,handler:async e=>u({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(I,{account_id:r,site_id:e[`site-id`]}));l(i,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/site_tag/list`,query:[`all`]};function z(e){return e.usage(`$0 rum site-info list-site-tags
|
|
19
19
|
|
|
20
|
-
Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:z,handler:async e=>
|
|
20
|
+
Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:z,handler:async e=>u({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},e,async()=>{let n={all:e.all};if(e.dryRun){let e=await a();s({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e),i=e.local?c:await o();e.accountId=i;let u=await d(`Loading`,async()=>r.send(R,{account_id:i,...n}));l(u,{successLabel:`Loaded`})})};var V={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/zone_tag/list`};function H(e){return e.usage(`$0 rum site-info list-zone-tags
|
|
21
21
|
|
|
22
|
-
Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:H,handler:async e=>
|
|
22
|
+
Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:H,handler:async e=>u({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await a();s({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(V,{account_id:r}));l(i,{successLabel:`Loaded`})})};var W={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/list`,query:[`per_page`,`page`,`order_by`]};function G(e){return e.usage(`$0 rum site-info list
|
|
23
23
|
|
|
24
|
-
Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List Web Analytics sites`,builder:G,handler:async e=>
|
|
24
|
+
Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List Web Analytics sites`,builder:G,handler:async e=>u({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let n={per_page:e[`per-page`],page:e.page,order_by:e[`order-by`]};if(e.dryRun){let e=await a();s({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/list`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e),i=e.local?c:await o();e.accountId=i;let u=await d(`Loading`,async()=>r.send(W,{account_id:i,...n}));l(u,{successLabel:`Loaded`})})};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`,body:`json`};function J(e){return e.usage(`$0 rum site-info update <site-id>
|
|
25
25
|
|
|
26
|
-
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>
|
|
26
|
+
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>u({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await d(`Updating`,async()=>u.send(q,{body:t,account_id:p,site_id:e[`site-id`]}));l(r,{successLabel:`Updated`});return}let m=i({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),h=await d(`Updating`,async()=>u.send(q,{body:m,account_id:p,site_id:e[`site-id`]}));l(h,{successLabel:`Updated`})})};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/validate/${t.hostname}`};function Z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
|
|
27
27
|
|
|
28
|
-
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>
|
|
28
|
+
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>u({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/validate/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(X,{account_id:r,hostname:e.hostname}));l(i,{successLabel:`Loaded`})})},$={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(M).command(F).command(ee).command(K).command(B).command(U).command(Y).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(k).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./interactive-JBA3qOUa.mjs";import{n}from"./version-CcuBNjqg.mjs";import{t as r}from"./agent-context-Dtyy4aKL.mjs";import{t as i}from"./interactive-wQM7Blhm.mjs";import{t as a}from"./request-headers-Bopp5lH_.mjs";import{tt as o}from"./dist-BxhwE-W1.mjs";import{n as s,t as c}from"./state-CTLznbVs.mjs";import{n as l,t as u}from"./delegate-livNdiwK.mjs";import{i as d,r as f}from"./lifecycle-oud60haK.mjs";import{t as p}from"./error-sanitization-BkgtZ0Vx.mjs";import{r as m}from"./sanitization-DkVWMHkc.mjs";import h from"node:os";import{createHash as g,randomUUID as _}from"node:crypto";const v=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),y=`CF_SEND_TELEMETRY`,b=`WRANGLER_SEND_METRICS`,x=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function S(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function C(){let e=S(process.env[y]);if(e!==void 0)return{enabled:e,source:`env`};let t=S(process.env[b]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function w(){return C()?.enabled}function T(){let e=c();if(typeof e.deviceId==`string`&&x.test(e.deviceId))return e.deviceId;let t=_();return s({deviceId:t}),t}function E(){return c().deviceId===void 0}function D(){if(o())return{enabled:!1,source:`do-not-track`};let e=C();if(e!==void 0)return e;let t=c().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=v?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function O(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return y;case`wrangler-env`:return b;default:return}}function k(e){s({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function A(){return c().telemetry?.bannerLastShown}function j(e){s({telemetry:{bannerLastShown:e}})}const M=/^\d{1,5}\.\d{1,5}\.\d{1,5}(?:-[0-9A-Za-z.-]{1,40})?(?:\+[0-9A-Za-z.-]{1,40})?$/;function N(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function P(){return h.version()}function F(){return process.arch}function I(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function L(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function R(e=process.env,t=process.ppid){if(!e.CF_DELEGATION)return!1;let n=e[u];return n===void 0||n===String(t)}function z(e=process.env,t=process.ppid){if(!e.CF_DELEGATION_PID||!R(e,t))return;let n=e[l];if(!(typeof n!=`string`||n.length>64||!M.test(n)))return n}function B(e,t,n){return g(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function V(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let H;function U(){if(H)return H;let[e,o,s]=n.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),c=Date.now(),l=0,u=E(),{enabled:f}=D(),p=r(),m=p.harness?.id??null,h=p.matches.find(e=>e.sessionId),g=R(),_=z();function v(){let r=V(),d=T();return{product:`cf`,cliVersion:n,cliMajor:e??0,cliMinor:o??0,cliPatch:s??0,...r?{prereleaseLabel:r}:{},osPlatform:N(),osVersion:P(),arch:F(),nodeVersion:I(),packageManager:L(),deviceId:d,amplitude_session_id:c,amplitude_event_id:l++,...h?.sessionId?{agentSessionKey:B(d,h.harness.id,h.sessionId)}:{},isFirstUsage:u,isCI:i,isInteractive:t(),cliMode:a(),agent:m,delegated:g,..._?{globalCliVersion:_}:{}}}function y(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${f?`sending`:`would send`}: ${JSON.stringify(n)}`),f)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return H={enabled:f,sendCommandEvent(e,t){if(f)try{d(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(f)try{d(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},H}const W=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),G=1024;function K(t){if(t instanceof e)return t.cancelled||t.signal&&W.has(t.signal)?`cancelled`:t.code===0?`success`:`error`}async function q(e,t,n){let r;try{r=U()}catch{return n()}if(f(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:m(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,G),...e.searchQuery.length>G?{searchQueryTruncated:!0}:{}},o=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-o}),e}catch(e){let t=K(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-o,...t===`error`?p(e):{}}),e}}function J(e,t){return{...e,handler:n=>q(t,n,()=>e.handler(n))}}export{v as a,w as c,D as d,j as f,y as i,O as l,J as n,A as o,k as p,U as r,T as s,q as t,E as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./metadata-Df5kCWJv.mjs";import{t as n}from"./output-hFMAotFl.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const i={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async i=>{let a=t(import.meta.url,`schemas.json`,r);if(!a)throw console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),new e(1);if(i.list){let e=Object.entries(a.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId}));n(e);return}if(i.command.length===0)throw console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),new e(1);let o=i.command.join(` `),s=a.schemas[o];if(!s){let t=Object.keys(a.schemas).filter(e=>e.includes(o)||o.includes(e));if(t.length>0){console.error(`Schema not found for "${o}". Did you mean:`);for(let e of t)console.error(` cf schema ${e}`)}else console.error(`Schema not found for "${o}". Use --list to see available schemas.`);throw new e(1)}n(s)}};export{i as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{a as e}from"./cf-DmvZ2L51.mjs";import{n as t}from"./version-CcuBNjqg.mjs";import{mkdirSync as n,readFileSync as r,writeFileSync as i}from"node:fs";import{dirname as a,join as o}from"node:path";import{createHash as s}from"node:crypto";function c(n,r){let i=s(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return o(e(),`cache`,n,`${i}.json`)}function l(e,t,n,i){try{let a=JSON.parse(r(c(e,t),`utf-8`));return typeof a?.fetchedAt==`number`&&Date.now()-a.fetchedAt<=n?i(a.value):void 0}catch{return}}function u(e,t,r){try{let o=c(e,t);n(a(o),{recursive:!0}),i(o,JSON.stringify({fetchedAt:Date.now(),value:r}),`utf-8`)}catch{}}const d=5e3;function f(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`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.length===0||!n.oneOf.every(e=>f(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>f(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>f(e,t)))||n.if!==void 0&&!f(n.if,t)||n.then!==void 0&&!f(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!f(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>f(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>f(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 p(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!f(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function m(e,t){return l(e,t,36e5,e=>f(e)?e:void 0)}function h(e,t,n){u(e,t,n)}function g(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)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
|
|
3
3
|
`)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}export{h as a,m as i,g as n,l as o,p as r,u as s,d as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{c as e}from"./body-parser-HN91kAf0.mjs";import{i as t,r as n}from"./global-options-4pyD17hd.mjs";import{n as r}from"./input-validation-D7z60HJH.mjs";import{o as i}from"./prompt-D274Im1O.mjs";import{r as a}from"./theme-BGHWSKCw.mjs";import{isDeepStrictEqual as o}from"node:util";function s(e,t=/* @__PURE__ */ new WeakSet){return e===void 0||t.has(e)?!1:(t.add(e),e.readOnly===!0||e.allOf?.some(e=>s(e,t))===!0)}const c=/* @__PURE__ */ new Set(/* @__PURE__ */ `$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function l(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function u(e,t=/* @__PURE__ */ new WeakSet){return!t.has(e)&&(t.add(e),e.readOnly===!0||l(e).some(e=>u(e,t)))}function d(e,t,n=/* @__PURE__ */ new Set){if(u(e))return!0;let r=E(t),i=E(e);for(let e of/* @__PURE__ */ new Set([...i.required??[],...Object.keys(i.properties??{})])){let t=y(r.properties,e);if(n.has(e)||s(t))return!0;let a=y(i.properties,e);if(t&&a&&d(a,t))return!0}let a=e=>e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return k(e).some(e=>e.some(e=>d(e,t,n)))||a(i).some(e=>a(r).some(t=>d(e,t)))}function f(e,t){if(s(e))return!0;if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>c.has(e)||e.startsWith(`x-`))&&l(e).every(e=>f(e,t))}function p(e){return f(e,/* @__PURE__ */ new WeakSet)}function m(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function h(e){let t=e.path.at(-1)??e.name,n=i(e.schema.title?.trim()||m(t)),r=e.description?i(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function g(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const _=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function v(e){return e.every(e=>!_.has(e))}function y(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function b(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function x(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function ee(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function S(e){let t=te(e);if(t.length>1){let e=new Set(t.map(S));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return S(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(ee));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&x(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function te(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function ne(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function C(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>o(e,t)))}function w(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>T(e,t))]),r=n[0];return n.length>0&&n.every(e=>o(e,r))?r:void 0}function T(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>T(e,t))]}function re(e,t){return{type:ne(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:C(e.enum,t.enum),const:w(`const`,[e,t]),default:w(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function E(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=E(s);r=ne(r,e.type),i??=e.title,a??=e.description,o=C(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:re(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:w(`const`,[e]),default:w(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function D(e){return{...e,oneOf:void 0,anyOf:void 0}}function O(e){return(e.allOf??[]).flatMap(e=>[e,...O(e)])}function k(e){return[e,...O(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function ie(e){return Object.keys(E(D(e)).properties??{}).length>0||k(e).some(e=>e.some(ie))}function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j(e){let t=E(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>A(e))||k(e).some(e=>e.every(j))?!0:e.allOf?.some(j)??!1:A(t.const)}function M(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?i(e.title):void 0})}return n}function ae(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):M(e)}function N(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))for(let r of t){let t=W(r),a=e.title?i(e.title):void 0;n.push(a?`${t} (${a})`:t)}else if(e.pattern&&S(e)===`string`){let t=i(e.pattern),r=e.title?i(e.title):void 0;n.push(r?`${t} (${r})`:t)}else return}return n.length>0?n:void 0}function P(e,t,n,r,i){if(!v(e)||s(t))return;let a=i??S(t);if(a===void 0)return;let o=a===`json`?void 0:ae(t),c=o?.map(({value:e})=>String(e)),l=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t]));return{name:e.map(g).join(`-`),path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
|
|
3
|
+
`)[0]??t.title,choices:c?.length?c:void 0,choiceLabels:Object.keys(l).length>0?l:void 0,schema:t}}function oe(e,t){return e===t?e:[.../* @__PURE__ */ new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function se(e,t){let n=oe(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:F(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:o(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ce(e,t){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=(e,t,n)=>{let a=r.get(e);n?i.has(e)||r.set(e,a===void 0?t:se(a,t)):(i.add(e),r.set(e,t))},c=(e,t,c)=>{for(let l of[e,...O(e)]){let u=l.if,f=l.then?E(l.then):void 0,p=f?.required;if(!u||!p?.length)continue;let m=Object.keys(u),h=u.type===void 0?void 0:Array.isArray(u.type)?u.type:[u.type];if(m.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||h!==void 0&&!h.includes(`object`)||d(u,e))continue;let g=new Set(u.required??[]),_=u.properties??{};if(Object.keys(_).some(e=>!g.has(e)))continue;let b=[],x=!0;for(let e of g){if(!v([...t,e])){x=!1;break}let n=y(_,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){x=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>o(e,n.const))),n.type!==void 0){if(r===void 0){x=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>J(e,t)))}}b.push({path:[...t,e],values:r})}if(x&&b.length!==0)for(let l of p){let u=[...t,l].join(`.`);if(n.has(u)||s(y(e.properties,l))||s(y(f?.properties,l)))continue;let d={predicates:b},p=r.get(u),m=c&&y(e.properties,l)===void 0&&!i.has(u);if(!p||m){let e=y(f?.properties,l),n=e===void 0?void 0:P([...t,l],E(e),!1);n&&(a(u,n,c),p=r.get(u))}!c&&p&&!p.requiredIf?.some(e=>o(e,d))&&(p.requiredIf=[...p.requiredIf??[],d])}}},l=(e,t,i,o=!1)=>{if(s(e))return;let u=E(D(e));if(u.properties){let e=new Set(u.required??[]);for(let[c,d]of Object.entries(u.properties)){let u=[...t,c],f=u.join(`.`);if(!v(u)||n.has(f))continue;let p=E(d);if(s(p))continue;let m=ie(d),h=m&&j(d),g=!o&&e.has(c),_=g&&i===void 0,y=g&&i!==void 0?i:void 0;if(h){l(d,u,g?i:u,o);let e=[...r.values()].some(e=>e.required===_&&F(e.requiredWhen,y)&&e.path.length>u.length&&u.every((t,n)=>e.path[n]===t));if(g&&!e){let e=P(u,d,_,y);e&&a(f,{...e,requiredContainer:!0},o)}continue}let b=P(u,p,_,y,m?`json`:void 0);b&&a(f,b,o)}}for(let n of k(e))for(let e of n)l(e,t,i,!0);for(let n of[e,...O(e)])n.if&&n.then&&!d(n.if,e)&&l(n.then,t,i,!0);c(u,t,o)};return l(e,[]),le([...r.values()],t.commandFlags).sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function le(e,n){let r=t(n),i=new Set(e.map(e=>e.name));return e.flatMap(e=>{if(r(e.name)===void 0)return[e];let t=`input-${e.name}`;return r(t)!==void 0||i.has(t)?[]:(i.add(t),[{...e,name:t}])})}function F(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function ue(e,t){if(e.length===0)return`${a.brand(i(t))}\n (no input fields)`;let n=process.stdout.columns??80,r=e.map(e=>`--${i(e.name)}`),o=Math.min(Math.max(...r.map(e=>e.length))+2,42),s=e.map((e,t)=>{let a=[`[${e.type}]`];e.required?a.push(`[required]`):e.requiredWhen&&a.push(`[required with --${i(e.requiredWhen.map(g).join(`-`))}-*]`),e.requiredIf&&a.push(`[conditionally required]`),e.choices&&a.push(`[choices: ${e.choices.map(t=>{let n=i(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${i(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&a.push(`[must be: ${i(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&a.push(`[default: ${i(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=a.join(` `),c=Math.max(n-o-4,20)-s.length-1,l=e.description===void 0?void 0:i(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=r[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[a.brand(i(t)),...s].join(`
|
|
4
|
+
`)}const de=[`_`,`$0`,`--`,...n.flatMap(e=>[e,b(e)])];function I(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=b(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function fe(e,t,n){return e.filter(r=>{let i=n!==void 0&&R(n,r.path).found;return z(r,e,t,n)&&I(r,t)===void 0&&!i&&!B(r.path,e,t)&&!(r.requiredContainer&&V(r,e,t))})}function L(e,t){let n=e=>R(t,e);return e.filter(e=>pe(e,n)&&!n(e.path).found)}function R(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function pe(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>o(r.value,e)))}))??!1)}function z(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(B(e.requiredWhen,t,n)||r!==void 0&&R(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=me(e,t,n),s=a.found||r===void 0?a:R(r,e),c=!a.found||a.descriptor===void 0||!F(a.descriptor.path,e)?s.value:G(a.descriptor,s.value,[]);return s.found&&(i===void 0||i.some(e=>o(c,e)))}))??!1)}function me(e,t,n){for(let r of t){let t=I(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function B(e,t,n){return t.some(t=>{let r=I(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function V(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&I(t,n)!==void 0)}function H(e){return e.flatMap(e=>[e.name,b(e.name)])}function U(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function W(e){return i(U(e))}function G(e,t,n){let a=r=>{n.push(`--${i(e.name)} expects ${r} (got '${W(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(U(t)),r=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?r.includes(`integer`)&&!r.includes(`number`)&&!Number.isInteger(n)?a(`an integer`):n:a(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&a(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return a(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:a(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:a(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return r(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:a(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return r(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?a(`a string`):typeof n==`string`?r(n,e.name,`text`):U(n)}}}function K(e){return Array.from(e).length}function q(e,t,n){let r=i(e.name),{const:a,pattern:s,minLength:c,maxLength:l,minimum:u,maximum:d,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(a!==void 0&&!o(t,a)){n.push(`--${r} must be ${i(JSON.stringify(a)??`undefined`)}`);return}let m=e.schema.enum??M(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>o(t,e)))n.push(`--${r} must be one of: ${m.map(W).join(`, `)}`);else{if(typeof t==`string`){let e=K(t);s!==void 0&&!new RegExp(s).test(t)&&n.push(`--${r} does not match the required format (${i(s)})`),c!==void 0&&e<c&&n.push(`--${r} must be at least ${c} characters`),l!==void 0&&e>l&&n.push(`--${r} must be at most ${l} characters`)}typeof t==`number`&&(u!==void 0&&(f===!0?t<=u:t<u)&&n.push(f===!0?`--${r} must be greater than ${u}`:`--${r} must be at least ${u}`),d!==void 0&&(p===!0?t>=d:t>d)&&n.push(p===!0?`--${r} must be less than ${d}`:`--${r} must be at most ${d}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}}function he(e,t){let n=[],r=G(e,t,n);if(r===void 0||(q(e,r,n),n.length>0))return n[0];let a=Z(e.schema,r);return a.length>0?`--${i(e.name)} ${a[0]?.replace(/^the request body /,``)}`:void 0}function J(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function ge(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>i(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n,r=[]){if(s(e))return[];let a=[...r,e],c=/* @__PURE__ */ new Set;for(let e of a)for(let[t,n]of Object.entries(E(e).properties??{}))s(n)&&c.add(t);let l=[],u=Y(n),f=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(f.length>0&&!f.some(e=>J(e,t)))return[`${u} must be ${ge(f)}`];if(e.const!==void 0&&!o(t,e.const))return[`${u} must be ${i(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>o(t,e)))return[`${u} must be one of: ${e.enum.map(W).join(`, `)}`];if(e.oneOf?.length){let r=e.oneOf.filter(e=>X(e,t,n,a).length===0).length,i=e.oneOf.some(e=>a.some(t=>d(e,t,c)));if(r===0||r!==1&&!i){let t=N(e);return[t?`${u} must be one of: ${t.join(`, `)}`:`${u} must match exactly one allowed shape`]}}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n,a).length===0)){let t=N(e);return[t?`${u} must be one of: ${t.join(`, `)}`:`${u} must match an allowed shape`]}for(let r of e.allOf??[])l.push(...X(r,t,n,a));if(e.if&&!a.some(t=>d(e.if??{},t,c))&&X(e.if,t,n,a).length===0&&e.then&&l.push(...X(e.then,t,n,a)),typeof t==`string`){let n=K(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&l.push(`${u} does not match the required format (${i(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&l.push(`${u} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&l.push(`${u} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&l.push(e.exclusiveMinimum===!0?`${u} must be greater than ${e.minimum}`:`${u} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&l.push(e.exclusiveMaximum===!0?`${u} must be less than ${e.maximum}`:`${u} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&l.push(`${u} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&l.push(`${u} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&l.push(`${u} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)&&(e.minItems!==void 0&&t.length<e.minItems&&l.push(`${u} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&l.push(`${u} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>o(e,t)))&&l.push(`${u} must contain unique items`),e.items))for(let[r,i]of t.entries()){let t=Array.isArray(e.items)?e.items[r]:e.items;if(t===void 0)continue;let o=a.flatMap(e=>[e,...O(e)].flatMap(e=>{let t=Array.isArray(e.items)?e.items[r]:e.items;return t===void 0?[]:[t]}));l.push(...X(t,i,[...n,String(r)],o))}if(typeof t==`object`&&t&&!Array.isArray(t)){let r=t,i=e.properties??{};for(let t of e.required??[])!c.has(t)&&!Object.hasOwn(r,t)&&l.push(`${Y([...n,t])} is required`);for(let[t,o]of Object.entries(r)){if(c.has(t))continue;let r=Object.hasOwn(i,t)?i[t]:void 0;if(r){let e=a.flatMap(e=>{let n=y(E(e).properties,t);return n===void 0?[]:[n]});l.push(...X(r,o,[...n,t],e))}else e.additionalProperties===!1?l.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&l.push(...X(e.additionalProperties,o,[...n,t]))}let o=Object.keys(r).filter(e=>!c.has(e)).length;e.minProperties!==void 0&&o<e.minProperties&&l.push(`${u} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&o>e.maxProperties&&l.push(`${u} must contain at most ${e.maxProperties} properties`)}return l}function Z(e,t){return[...new Set(X(e,t,[]))]}const _e=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){if(s(e))return{schema:{readOnly:!0},exact:!0};let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>c.has(e)||e.startsWith(`x-`));for(let t of _e){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`)){if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`)){if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function ve(e,t){return Z(Q(e).schema,t)}function ye(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=/* @__PURE__ */ new Set([...de,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(g(t))&&r.set(g(t),t);return[...r.values()].sort()}function be(t,n,r={}){let a=[],o=r.baseBody!==void 0,s=r.baseBody===void 0?{}:structuredClone(r.baseBody),c=t.filter(({path:e})=>v(e)),l=[...r.reserved??[],...H(c)];for(let t of c){let r=I(t,n);if(r===void 0){!o&&z(t,c,n)&&!B(t.path,c,n)&&!(t.requiredContainer&&V(t,c,n))&&a.push(`--${i(t.name)} is required`);continue}let l=G(t,r,a);l!==void 0&&(q(t,l,a),o?ye(s,t.path,l):e(s,t.path,l))}if(o)for(let e of L(c,s))I(e,n)===void 0&&a.push(`--${i(e.name)} is required`);for(let e of $(n,l))a.push(`Unknown flag --${i(e)}`);return{body:s,errors:a}}export{L as a,h as c,he as d,Z as f,fe as i,ce as l,H as n,d as o,ve as p,p as r,ue as s,be as t,$ as u};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./
|
|
2
|
+
import{i as e,n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./path-DRw6Y-nd.mjs";import{t as r}from"./dry-run-qsnRlRk6.mjs";import{n as i,t as a}from"./input-validation-D7z60HJH.mjs";import{a as o,t as s}from"./context-BGm5_wTT.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./output-hFMAotFl.mjs";import{t as u}from"./progress-DE_G09u2.mjs";import{t as d}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import"./api-Dnt6lRJG.mjs";import{n as f}from"./prompt-D274Im1O.mjs";function p(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const ee={command:`create`,describe:`Create SCIM Group`,builder:p,handler:async n=>d({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Created`})}else if(n.body!==void 0){let t=d,n=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(n,{successLabel:`Created`})}})};var m={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/scim/v2/Groups/${e.group_id}`,response:!1};function h(e){return e.usage(`$0 scim groups delete <group-id>
|
|
3
3
|
|
|
4
|
-
Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async e=>
|
|
4
|
+
Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async e=>d({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();if(e.accountId=i,!await f({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let a=await u(`Deleting`,async()=>n.send(m,{account_id:i,group_id:e[`group-id`]}));l(a,{successLabel:`Deleted`})})};function _(e){return e.usage("$0 scim groups edit <group-id>\n\nPartially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:`Patch SCIM Group`,builder:_,handler:async n=>d({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})};var y={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Groups/${e.group_id}`};function b(e){return e.usage(`$0 scim groups get <group-id>
|
|
5
5
|
|
|
6
|
-
Retrieves a single SCIM Group resource by group ID.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <group-id>`,describe:`Get SCIM Group`,builder:b,handler:async e=>
|
|
6
|
+
Retrieves a single SCIM Group resource by group ID.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <group-id>`,describe:`Get SCIM Group`,builder:b,handler:async e=>d({command:`scim groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(y,{account_id:i,group_id:e[`group-id`]}));l(a,{successLabel:`Loaded`})})};var S={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Groups`,query:[`startIndex`,`count`,`filter`]};function C(e){return e.usage("$0 scim groups list\n\nLists SCIM Group resources for the account. Returns both system groups (backed by Cloudflare permission groups, prefixed `cloudflare-v1-`) and custom user groups. Supports filtering by `displayName` using SCIM filter syntax.").option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `displayName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`List SCIM Groups`,builder:C,handler:async e=>d({command:`scim groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={startIndex:e[`start-index`],count:e.count,filter:e.filter};if(e.dryRun){let e=await o();r({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(S,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};function T(e){return e.usage("$0 scim groups update <group-id>\n\nReplaces the mutable attributes of a SCIM Group (RFC 7644 Section 3.5.1), including its complete member set. Omitting `externalId` clears it, and omitting `members` replaces the member set with an empty list. For system groups (prefixed `cloudflare-v1-`), only the member set is replaced.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const E={command:`update <group-id>`,describe:`Replace SCIM Group`,builder:T,handler:async n=>d({command:`scim groups update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})},D={command:`groups`,describe:`Groups operations`,builder:e=>e.command(ee).command(g).command(v).command(x).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var O={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/ResourceTypes/${e.resource_type_id}`};function k(e){return e.usage("$0 scim resource-types get <resource-type-id>\n\nReturns a single SCIM resource type by ID (RFC 7643 Section 6). Valid IDs are `User` and `Group`.").positional(`resource-type-id`,{type:`string`,description:`The resource type identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <resource-type-id>`,describe:`Get SCIM Resource Type`,builder:k,handler:async e=>d({command:`scim resource-types get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/ResourceTypes/${e[`resource-type-id`]==null?`<resource-type-id>`:encodeURIComponent(String(e[`resource-type-id`]))}`,pathParams:{"resource-type-id":String(e[`resource-type-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(O,{account_id:i,resource_type_id:e[`resource-type-id`]}));l(a,{successLabel:`Loaded`})})};var j={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/ResourceTypes`};function M(e){return e.usage(`$0 scim resource-types list
|
|
7
7
|
|
|
8
|
-
Returns the list of SCIM resource types supported by the Cloudflare SCIM service (RFC 7643 Section 6, RFC 7644 Section 4). Clients use this to discover available resource categories (e.g. Users, Groups) and their associated schemas. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List SCIM Resource Types`,builder:M,handler:async e=>
|
|
8
|
+
Returns the list of SCIM resource types supported by the Cloudflare SCIM service (RFC 7643 Section 6, RFC 7644 Section 4). Clients use this to discover available resource categories (e.g. Users, Groups) and their associated schemas. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List SCIM Resource Types`,builder:M,handler:async e=>d({command:`scim resource-types list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(j,{account_id:i}));l(a,{successLabel:`Loaded`})})},P={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(A).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Schemas/${e.schema_id}`};function I(e){return e.usage("$0 scim schemas get <schema-id>\n\nReturns a single SCIM schema definition by schema URI ID (RFC 7643 Section 7). Valid IDs are `urn:ietf:params:scim:schemas:core:2.0:User` and `urn:ietf:params:scim:schemas:core:2.0:Group`.").positional(`schema-id`,{type:`string`,description:`The schema URI identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <schema-id>`,describe:`Get SCIM Schema`,builder:I,handler:async e=>d({command:`scim schemas get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"schema-id":String(e[`schema-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(F,{account_id:i,schema_id:e[`schema-id`]}));l(a,{successLabel:`Loaded`})})};var te={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Schemas`};function R(e){return e.usage(`$0 scim schemas list
|
|
9
9
|
|
|
10
|
-
Returns the list of SCIM schemas supported by the Cloudflare SCIM service (RFC 7643 Section 7, RFC 7644 Section 4). Clients use this to introspect the attributes of each resource type. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List SCIM Schemas`,builder:R,handler:async e=>
|
|
10
|
+
Returns the list of SCIM schemas supported by the Cloudflare SCIM service (RFC 7643 Section 7, RFC 7644 Section 4). Clients use this to introspect the attributes of each resource type. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List SCIM Schemas`,builder:R,handler:async e=>d({command:`scim schemas list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(te,{account_id:i}));l(a,{successLabel:`Loaded`})})},B={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var V={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/ServiceProviderConfig`};function H(e){return e.usage(`$0 scim service-provider-config get
|
|
11
11
|
|
|
12
|
-
Returns the SCIM 2.0 Service Provider configuration (RFC 7643 Section 5). IdPs use this endpoint to auto-configure their SCIM integration with Cloudflare, discovering which optional features (patch, bulk, filter, etc.) are supported.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Get SCIM Service Provider Config`,builder:H,handler:async e=>
|
|
12
|
+
Returns the SCIM 2.0 Service Provider configuration (RFC 7643 Section 5). IdPs use this endpoint to auto-configure their SCIM integration with Cloudflare, discovering which optional features (patch, bulk, filter, etc.) are supported.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Get SCIM Service Provider Config`,builder:H,handler:async e=>d({command:`scim service-provider-config get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(V,{account_id:i}));l(a,{successLabel:`Loaded`})})},W={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.usage("$0 scim users create\n\nProvisions a new account member via SCIM. The `userName` field must be a valid email address and must match the primary email in `emails`. The account must be an Enterprise account with SCIM entitlements enabled.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const K={command:`create`,describe:`Create SCIM User`,builder:G,handler:async n=>d({command:`scim users create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Users`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Created`})}else if(n.body!==void 0){let t=d,n=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Users`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(n,{successLabel:`Created`})}})};var q={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/scim/v2/Users/${e.user_id}`,response:!1};function J(e){return e.usage(`$0 scim users delete <user-id>
|
|
13
13
|
|
|
14
|
-
Deprovisions a SCIM User by removing their membership from this account (RFC 7644 Section 3.6). This does not delete the global Cloudflare user.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <user-id>`,describe:`Delete SCIM User`,builder:J,handler:async e=>
|
|
14
|
+
Deprovisions a SCIM User by removing their membership from this account (RFC 7644 Section 3.6). This does not delete the global Cloudflare user.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <user-id>`,describe:`Delete SCIM User`,builder:J,handler:async e=>d({command:`scim users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();if(e.accountId=i,!await f({force:!!e.force,message:`Are you sure you want to remove this user from the account?`}))return;let a=await u(`Deleting`,async()=>n.send(q,{account_id:i,user_id:e[`user-id`]}));l(a,{successLabel:`Deleted`})})};function X(e){return e.usage('$0 scim users edit <user-id>\n\nPartially updates a SCIM User via PATCH operations (RFC 7644 Section 3.5.2). Supports updating `userName`, `name.givenName`, `name.familyName`, and `active`. Setting `active: false` deprovisions the user (removes them from the account). For IdP compatibility, `emails[type eq "work"].value` is also accepted as an alias for `userName`.').positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Z={command:`edit <user-id>`,describe:`Patch SCIM User`,builder:X,handler:async n=>d({command:`scim users edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})};var Q={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Users/${e.user_id}`};function ne(e){return e.usage(`$0 scim users get <user-id>
|
|
15
15
|
|
|
16
|
-
Retrieves a single account member as a SCIM User resource by user tag.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <user-id>`,describe:`Get SCIM User`,builder:ne,handler:async e=>
|
|
16
|
+
Retrieves a single account member as a SCIM User resource by user tag.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <user-id>`,describe:`Get SCIM User`,builder:ne,handler:async e=>d({command:`scim users get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(Q,{account_id:i,user_id:e[`user-id`]}));l(a,{successLabel:`Loaded`})})};var ie={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Users`,query:[`startIndex`,`count`,`filter`]};function ae(e){return e.usage('$0 scim users list\n\nLists account members as SCIM User resources. Supports optional filtering by `userName` (email) using the SCIM filter syntax (e.g. `userName eq "user@example.com"`). Pagination is controlled via `startIndex` and `count` query parameters per RFC 7644 Section 3.4.2.4.').option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `userName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List SCIM Users`,builder:ae,handler:async e=>d({command:`scim users list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={startIndex:e[`start-index`],count:e.count,filter:e.filter};if(e.dryRun){let e=await o();r({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(ie,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};function $(e){return e.usage("$0 scim users update <user-id>\n\nReplaces a SCIM User resource (RFC 7644 Section 3.5.1). Fully replaces the mutable attributes of the user. Supports updating `userName`, `name`, `emails`, and `active`.").positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const se={command:`update <user-id>`,describe:`Replace SCIM User`,builder:$,handler:async n=>d({command:`scim users update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})},ce={command:`users`,describe:`Users operations`,builder:e=>e.command(K).command(Y).command(Z).command(re).command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(D).command(P).command(B).command(W).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./dry-run-qsnRlRk6.mjs";import{a as r,t as i}from"./context-BGm5_wTT.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-hFMAotFl.mjs";import{t as s}from"./progress-DE_G09u2.mjs";import{t as c}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import{r as l,t as u}from"./body-parser-HN91kAf0.mjs";import{a as d,n as f}from"./prompt-D274Im1O.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";var m={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/quota`};function h(e){return e.usage(`$0 secrets-store quota get
|
|
3
3
|
|
|
4
|
-
Lists the number of secrets used in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`View secret usage`,builder:h,handler:async e=>c({command:`secrets-store quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();
|
|
4
|
+
Lists the number of secrets used in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`View secret usage`,builder:h,handler:async e=>c({command:`secrets-store quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();n({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(m,{account_id:l}));o(u,{successLabel:`Loaded`})})},_={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,body:`json`};function y(e){return e.usage(`$0 secrets-store secrets bulk-delete
|
|
5
5
|
|
|
6
|
-
Deletes one or more secrets.`).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk deleting secrets.`})}const b={command:`bulk-delete`,describe:`Delete secrets`,builder:y,handler:async e=>c({command:`secrets-store secrets bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();
|
|
6
|
+
Deletes one or more secrets.`).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk deleting secrets.`})}const b={command:`bulk-delete`,describe:`Delete secrets`,builder:y,handler:async e=>c({command:`secrets-store secrets bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"store-id":String(e[`store-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({ids:e.ids}):l(e.body)});return}let c=e.body===void 0?void 0:l(e.body),d=await t(e),p=e.local?a:await i();if(e.accountId=p,!await f({force:!!e.force,message:`This operation permanently deletes the specified secrets and cannot be undone.`}))return;if(e.body!==void 0){let t=c,n=await s(`Deleting`,async()=>d.send(v,{body:t,account_id:p,store_id:e[`store-id`]}));o(n,{successLabel:`Deleted`});return}if(e.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let m=u({ids:e.ids}),h=await s(`Deleting`,async()=>d.send(v,{body:m,account_id:p,store_id:e[`store-id`]}));o(h,{successLabel:`Deleted`})})};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,body:`json`};function S(e){return e.usage(`$0 secrets-store secrets create <store-id>
|
|
7
7
|
|
|
8
|
-
Creates a secret in the account.`).positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create <store-id>`,describe:`Create a secret`,builder:S,handler:async e=>c({command:`secrets-store secrets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();
|
|
8
|
+
Creates a secret in the account.`).positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create <store-id>`,describe:`Create a secret`,builder:S,handler:async e=>c({command:`secrets-store secrets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"store-id":String(e[`store-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:l(e.body),u=await t(e),d=e.local?a:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>u.send(x,{body:t,account_id:d,store_id:e[`store-id`]}));o(n,{successLabel:`Created`})}})};var w={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}`};function T(e){return e.usage(`$0 secrets-store secrets delete <secret-id>
|
|
9
9
|
|
|
10
|
-
Deletes a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <secret-id>`,describe:`Delete a secret`,builder:T,handler:async e=>c({command:`secrets-store secrets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();
|
|
10
|
+
Deletes a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <secret-id>`,describe:`Delete a secret`,builder:T,handler:async e=>c({command:`secrets-store secrets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();if(e.accountId=l,!await f({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(w,{account_id:l,store_id:e[`store-id`],secret_id:e[`secret-id`]}));o(u,{successLabel:`Deleted`})})};var D={method:`POST`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}/duplicate`,body:`json`};function O(e){return e.usage(`$0 secrets-store secrets duplicate <secret-id>
|
|
11
11
|
|
|
12
|
-
Creates a duplicate of the secret, keeping the value.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`name`,{type:`string`,description:`The name of the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret. Omit it on create or duplicate to inherit the store's scopes. An empty list lets no service use the secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`duplicate <secret-id>`,describe:`Duplicate Secret`,builder:O,handler:async e=>c({command:`secrets-store secrets duplicate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();
|
|
12
|
+
Creates a duplicate of the secret, keeping the value.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`name`,{type:`string`,description:`The name of the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret. Omit it on create or duplicate to inherit the store's scopes. An empty list lets no service use the secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`duplicate <secret-id>`,describe:`Duplicate Secret`,builder:O,handler:async e=>c({command:`secrets-store secrets duplicate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({comment:p(e.comment,`comment`,`text`),name:p(e.name,`name`,`text`),scopes:e.scopes}):l(e.body)});return}let c=e.body===void 0?void 0:l(e.body),f=await t(e),m=e.local?a:await i();if(e.accountId=m,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>f.send(D,{body:t,account_id:m,store_id:e[`store-id`],secret_id:e[`secret-id`]}));o(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await d(`name`,`The name of the secret.`));let h=u({comment:p(e.comment,`comment`,`text`),name:p(e.name,`name`,`text`),scopes:e.scopes}),g=await s(`Creating`,async()=>f.send(D,{body:h,account_id:m,store_id:e[`store-id`],secret_id:e[`secret-id`]}));o(g,{successLabel:`Created`})})};var A={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}`,body:`json`};function j(e){return e.usage(`$0 secrets-store secrets edit <secret-id>
|
|
13
13
|
|
|
14
|
-
Updates a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret, or null when the secret inherits its store's scopes. Set it to null in a patch to inherit again. An empty list lets no service use the secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - the API never returns this value; it exists only to create or modify secrets.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`edit <secret-id>`,describe:`Patch a secret`,builder:j,handler:async e=>c({command:`secrets-store secrets edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();
|
|
14
|
+
Updates a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret, or null when the secret inherits its store's scopes. Set it to null in a patch to inherit again. An empty list lets no service use the secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - the API never returns this value; it exists only to create or modify secrets.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`edit <secret-id>`,describe:`Patch a secret`,builder:j,handler:async e=>c({command:`secrets-store secrets edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({comment:p(e.comment,`comment`,`text`),scopes:e.scopes,value:p(e.value,`value`,`text`)}):l(e.body),sensitiveBodyPaths:[[`value`]]});return}let c=e.body===void 0?void 0:l(e.body),d=await t(e),f=e.local?a:await i();if(e.accountId=f,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>d.send(A,{body:t,account_id:f,store_id:e[`store-id`],secret_id:e[`secret-id`]}));o(n,{successLabel:`Updated`});return}let m=u({comment:p(e.comment,`comment`,`text`),scopes:e.scopes,value:p(e.value,`value`,`text`)}),h=await s(`Updating`,async()=>d.send(A,{body:m,account_id:f,store_id:e[`store-id`],secret_id:e[`secret-id`]}));o(h,{successLabel:`Updated`})})};var N={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}`};function P(e){return e.usage(`$0 secrets-store secrets get <secret-id>
|
|
15
15
|
|
|
16
|
-
Returns details of a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <secret-id>`,describe:`Get a secret by ID`,builder:P,handler:async e=>c({command:`secrets-store secrets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();
|
|
16
|
+
Returns details of a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <secret-id>`,describe:`Get a secret by ID`,builder:P,handler:async e=>c({command:`secrets-store secrets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(N,{account_id:l,store_id:e[`store-id`],secret_id:e[`secret-id`]}));o(u,{successLabel:`Loaded`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,query:[`direction`,`page`,`per_page`,`search`,`order`,`scopes`],joined:[`scopes`]};function L(e){return e.usage(`$0 secrets-store secrets list
|
|
17
17
|
|
|
18
|
-
Lists all store secrets.`).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page.`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment.`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field.`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,array:!0,description:`Only secrets with the given scopes will be returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List store secrets`,builder:L,handler:async e=>c({command:`secrets-store secrets list`,classification:{safeFlags:[`direction`,`order`,`dry-run`]}},e,async()=>{let c={direction:e.direction,page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,scopes:e.scopes};if(e.dryRun){let t=await r();
|
|
18
|
+
Lists all store secrets.`).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page.`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment.`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field.`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,array:!0,description:`Only secrets with the given scopes will be returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List store secrets`,builder:L,handler:async e=>c({command:`secrets-store secrets list`,classification:{safeFlags:[`direction`,`order`,`dry-run`]}},e,async()=>{let c={direction:e.direction,page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,scopes:e.scopes};if(e.dryRun){let t=await r();n({command:`cf secrets-store secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"store-id":String(e[`store-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(I,{account_id:u,store_id:e[`store-id`],...c}));o(d,{successLabel:`Loaded`})})},z={command:`secrets`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(b).command(C).command(E).command(k).command(M).command(F).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var B={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}`};function V(e){return e.usage(`$0 secrets-store stores get <store-id>
|
|
19
19
|
|
|
20
|
-
Returns details of a single store.`).positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <store-id>`,describe:`Get a store by ID`,builder:V,handler:async e=>c({command:`secrets-store stores get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();
|
|
20
|
+
Returns details of a single store.`).positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <store-id>`,describe:`Get a store by ID`,builder:V,handler:async e=>c({command:`secrets-store stores get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf secrets-store stores get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(B,{account_id:l,store_id:e[`store-id`]}));o(u,{successLabel:`Loaded`})})};var U={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores`,query:[`direction`,`page`,`per_page`,`order`],errors:{503:`ServiceUnavailableError`}};function W(e){return e.usage(`$0 secrets-store stores list
|
|
21
21
|
|
|
22
|
-
Lists
|
|
22
|
+
Lists account stores from an eventually consistent projection. Returns retryable HTTP 503 until initial backfill completes; empty accounts are ready immediately.`).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page.`}).option(`order`,{type:`string`,description:`Order stores by values in the given field.`,choices:[`name`,`created`,`modified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List account stores`,builder:W,handler:async e=>c({command:`secrets-store stores list`,classification:{safeFlags:[`direction`,`order`,`dry-run`]}},e,async()=>{let c={direction:e.direction,page:e.page,per_page:e[`per-page`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf secrets-store stores list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(U,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},K={command:`stores`,describe:`Secret stores that hold encrypted key-value secrets accessible by Workers and services`,builder:e=>e.command(H).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`secrets-store`,describe:`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,builder:e=>e.command(_).command(z).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
|