diff --git a/.changeset/update-openapi-3359e90fa19e.md b/.changeset/update-openapi-3359e90fa19e.md new file mode 100644 index 0000000000..67d8e1d0e8 --- /dev/null +++ b/.changeset/update-openapi-3359e90fa19e.md @@ -0,0 +1,14 @@ +--- +"cf": minor +--- + +Update the generated command surface for Cloudflare API schemas revision +`3359e90fa19e8e250ab5a402b0f9dbe65bbe82a3`. + +Breaking: Replace `cf organizations members batch create ` +with `cf organizations members bulk-create --organization-id `. +Update scripts to pass the ID as a required flag instead of a positional +argument. The old command has no compatibility alias. + +Use `cf o11y destinations get ` to fetch a Workers Observability +Telemetry Destination by its slug. diff --git a/packages/cli/package.json b/packages/cli/package.json index 614c5eed3b..803d711b91 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -113,7 +113,7 @@ "yargs": "18.2.0" }, "config": { - "openApiVersion": "2f687dad103baa5342ddd1532a2463c5f268f37d" + "openApiVersion": "3359e90fa19e8e250ab5a402b0f9dbe65bbe82a3" }, "engines": { "node": "^22.23.0 || ^24.22.0 || ^26.12.0" diff --git a/packages/cli/src/commands/_generated/_meta/commands.json b/packages/cli/src/commands/_generated/_meta/commands.json index df341b4933..4110739647 100644 --- a/packages/cli/src/commands/_generated/_meta/commands.json +++ b/packages/cli/src/commands/_generated/_meta/commands.json @@ -37955,7 +37955,7 @@ "name": "alert-enabled", "type": "boolean", "required": false, - "description": "Deprecated and ignored: saved-query alerting and rules were removed.", + "description": "Send an hourly notification when new events match this saved view. Receive it by adding the view to a Threat Events saved query notification policy.", "default": false }, { @@ -38152,7 +38152,7 @@ "name": "alert-enabled", "type": "boolean", "required": false, - "description": "Deprecated and ignored: saved-query alerting and rules were removed." + "description": "Send an hourly notification when new events match this saved view. Receive it by adding the view to a Threat Events saved query notification policy." }, { "name": "alert-rollup-enabled", @@ -41723,7 +41723,7 @@ "skills", "update" ], - "description": "Replaces the ordered custom skills assigned to a Threat Signals feed. Requires a paid Threat Signals subscription.", + "description": "Replaces the ordered custom skills assigned to a Threat Signals feed. Requires a paid Threat Signals subscription. Adding an active Custom Skill that would put the feed above its per-feed limit (`cfone.threat.threat_signals_active_skills_per_feed`) returns 403 with `errors[0].reason` `threat_signals_feed_skill_limit`, and `errors[0].feed_custom_skill_limit` and `errors[0].feed_custom_skill_count` give the limit and current count. Removing or reordering skills is always allowed.", "summary": "Set Threat Signals feed skills", "usage": "cf cloudforce-one threat-signals feeds skills update [options]", "arguments": [ @@ -41959,7 +41959,7 @@ "command": "cf cloudforce-one threat-signals skills create", "name": "create", "fullPath": ["cloudforce-one", "threat-signals", "skills", "create"], - "description": "Creates a Custom Skill for the account. Free Threat Signals accounts cannot create Custom Skills.", + "description": "Creates an active Custom Skill for the account. Free Threat Signals accounts cannot create Custom Skills. When the account is at its active Custom Skill limit (`cfone.threat.threat_signals_skills`), returns 403 with `errors[0].reason` `threat_signals_skill_limit`, and `errors[0].custom_skill_limit` and `errors[0].custom_skill_count` give the limit and current count. Managed Default Skills do not count.", "summary": "Create Threat Signals skill", "usage": "cf cloudforce-one threat-signals skills create [options]", "arguments": [], @@ -42211,7 +42211,7 @@ "command": "cf cloudforce-one threat-signals skills update", "name": "update", "fullPath": ["cloudforce-one", "threat-signals", "skills", "update"], - "description": "Updates a Custom Skill. Managed Default Skills cannot be updated. Free Threat Signals accounts cannot update Custom Skills.", + "description": "Updates a Custom Skill. Managed Default Skills cannot be updated. Free Threat Signals accounts cannot update Custom Skills. Activating an inactive skill (`is_active` true) returns 403 with `errors[0].reason` `threat_signals_skill_limit` when the account is at its active Custom Skill limit, or `threat_signals_feed_skill_limit` (with `errors[0].feed_id`, `errors[0].feed_custom_skill_limit`, and `errors[0].feed_custom_skill_count`) when a feed it is assigned to is at its per-feed limit.", "summary": "Update Threat Signals skill", "usage": "cf cloudforce-one threat-signals skills update [options]", "arguments": [ @@ -82938,6 +82938,38 @@ "operationId": "o11y.destinations.delete", "hideCommand": false }, + { + "command": "cf o11y destinations get", + "name": "get", + "fullPath": ["o11y", "destinations", "get"], + "description": "Get a Workers Observability Telemetry Destination.", + "summary": "Get Destination", + "usage": "cf o11y destinations get ", + "arguments": [ + { + "name": "slug", + "position": 0, + "type": "string", + "required": true, + "description": "The destination's slug, which is its name." + } + ], + "options": [ + { + "name": "dry-run", + "type": "boolean", + "required": false, + "description": "Validate and show what would happen without executing", + "default": false + } + ], + "category": "read", + "hasRequestBody": false, + "httpMethod": "GET", + "apiPath": "/accounts/{account_id}/workers/observability/destinations/{slug}", + "operationId": "o11y.destinations.get", + "hideCommand": false + }, { "command": "cf o11y destinations list", "name": "list", @@ -86073,22 +86105,20 @@ "hideCommand": false }, { - "command": "cf organizations members batch create", - "name": "create", - "fullPath": ["organizations", "members", "batch", "create"], + "command": "cf organizations members bulk-create", + "name": "bulk-create", + "fullPath": ["organizations", "members", "bulk-create"], "description": "Batch create multiple memberships that grant access to a specific Organization.", "summary": "Batch create organization members", - "usage": "cf organizations members batch create [options]", - "arguments": [ + "usage": "cf organizations members bulk-create [options]", + "arguments": [], + "options": [ { "name": "organization-id", - "position": 0, "type": "string", "required": true, "description": "Organization ID" - } - ], - "options": [ + }, { "name": "members", "type": "string", @@ -86109,11 +86139,11 @@ "description": "Raw JSON request body (bypasses individual flags)" } ], - "category": "create", + "category": "action", "hasRequestBody": true, "httpMethod": "POST", "apiPath": "/organizations/{organization_id}/members:batchCreate", - "operationId": "organizations.members.batch.create", + "operationId": "organizations.members.bulk-create", "hideCommand": false }, { @@ -173077,7 +173107,6 @@ "organizations logs": "Operations for logs", "organizations logs audit": "Operations for logs.audit", "organizations members": "Members of an organization", - "organizations members batch": "Add members to an organization in bulk", "organizations profile": "View and update the public profile information for an organization", "organizations shares": "Shares across the organization", "page-rules": "page-rules", diff --git a/packages/cli/src/commands/_generated/_meta/schemas.json b/packages/cli/src/commands/_generated/_meta/schemas.json index b49c84a73f..16ce972b34 100644 --- a/packages/cli/src/commands/_generated/_meta/schemas.json +++ b/packages/cli/src/commands/_generated/_meta/schemas.json @@ -27993,7 +27993,7 @@ "name": "alert-enabled", "type": "boolean", "required": false, - "description": "Deprecated and ignored: saved-query alerting and rules were removed." + "description": "Send an hourly notification when new events match this saved view. Receive it by adding the view to a Threat Events saved query notification policy." }, { "name": "alert-rollup-enabled", @@ -28111,7 +28111,7 @@ "name": "alert-enabled", "type": "boolean", "required": false, - "description": "Deprecated and ignored: saved-query alerting and rules were removed." + "description": "Send an hourly notification when new events match this saved view. Receive it by adding the view to a Threat Events saved query notification policy." }, { "name": "alert-rollup-enabled", @@ -60221,6 +60221,28 @@ "hasRequestBody": false, "requestBodyFields": [] }, + "o11y destinations get": { + "operationId": "o11y.destinations.get", + "httpMethod": "GET", + "path": "/accounts/{account_id}/workers/observability/destinations/{slug}", + "pathParams": [ + { + "name": "account_id", + "type": "string", + "required": true + }, + { + "name": "slug", + "flag": "slug", + "positional": true, + "type": "string", + "required": true + } + ], + "queryParams": [], + "hasRequestBody": false, + "requestBodyFields": [] + }, "o11y destinations list": { "operationId": "o11y.destinations.list", "httpMethod": "GET", @@ -62554,15 +62576,14 @@ "hasRequestBody": false, "requestBodyFields": [] }, - "organizations members batch create": { - "operationId": "organizations.members.batch.create", + "organizations members bulk-create": { + "operationId": "organizations.members.bulk-create", "httpMethod": "POST", "path": "/organizations/{organization_id}/members:batchCreate", "pathParams": [ { "name": "organization_id", "flag": "organization-id", - "positional": true, "type": "string", "required": true } diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/reprocess.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/reprocess.ts index 26fa0233be..ca4e5cdb78 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/reprocess.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/reprocess.ts @@ -6,4 +6,7 @@ export default { path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/articles/${request.article_id}/reprocess`, body: "json", + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/get-output.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/get-output.ts index 523648c21f..ae5e19c388 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/get-output.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/get-output.ts @@ -5,4 +5,7 @@ export default { method: "GET", path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/articles/${request.article_id}/skills/${request.skill_id}/output`, + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/list.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/list.ts index de6a22f875..56b426a391 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/list.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/list.ts @@ -5,4 +5,7 @@ export default { method: "GET", path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/articles/${request.article_id}/skills`, + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/run.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/run.ts index 1ca573ca8b..62b73c43f1 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/run.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/articles/skills/run.ts @@ -6,4 +6,7 @@ export default { path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/articles/${request.article_id}/skills/${request.skill_id}/run`, body: "json", + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/feeds/skills/update.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/feeds/skills/update.ts index c069d9e9f5..29a0f59150 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/feeds/skills/update.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/feeds/skills/update.ts @@ -6,4 +6,7 @@ export default { path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/feeds/${request.feed_id}/skills`, body: "json", + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/create.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/create.ts index b41ff15976..51f7820c5e 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/create.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/create.ts @@ -6,4 +6,7 @@ export default { path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/skills`, body: "json", + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/delete.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/delete.ts index c2f420e906..6a76618608 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/delete.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/delete.ts @@ -5,4 +5,7 @@ export default { method: "DELETE", path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/skills/${request.skill_id}`, + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/get.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/get.ts index cd97a8516d..ce10143657 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/get.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/get.ts @@ -5,4 +5,7 @@ export default { method: "GET", path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/skills/${request.skill_id}`, + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/update.ts b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/update.ts index 8fc954a77f..bc2e3f5b8d 100644 --- a/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/update.ts +++ b/packages/cli/src/commands/_generated/_operations/cloudforce-one/threat-signals/skills/update.ts @@ -6,4 +6,7 @@ export default { path: (request: Record) => path`/accounts/${request.account_id}/cloudforce-one/v2/threat-signals/skills/${request.skill_id}`, body: "json", + errors: { + 403: "ForbiddenError", + }, } as const; diff --git a/packages/cli/src/commands/_generated/_operations/o11y/destinations/get.ts b/packages/cli/src/commands/_generated/_operations/o11y/destinations/get.ts new file mode 100644 index 0000000000..9ecb961d10 --- /dev/null +++ b/packages/cli/src/commands/_generated/_operations/o11y/destinations/get.ts @@ -0,0 +1,13 @@ +/** @generated from o11y.destinations.get */ +import { path } from "#api"; + +export default { + method: "GET", + path: (request: Record) => + path`/accounts/${request.account_id}/workers/observability/destinations/${request.slug}`, + errors: { + 401: "UnauthorizedError", + 404: "NotFoundError", + 500: "InternalServerError", + }, +} as const; diff --git a/packages/cli/src/commands/_generated/_operations/organizations/members/batch/create.ts b/packages/cli/src/commands/_generated/_operations/organizations/members/bulk-create.ts similarity index 78% rename from packages/cli/src/commands/_generated/_operations/organizations/members/batch/create.ts rename to packages/cli/src/commands/_generated/_operations/organizations/members/bulk-create.ts index b205290834..0ea3b9c10c 100644 --- a/packages/cli/src/commands/_generated/_operations/organizations/members/batch/create.ts +++ b/packages/cli/src/commands/_generated/_operations/organizations/members/bulk-create.ts @@ -1,4 +1,4 @@ -/** @generated from organizations.members.batch.create */ +/** @generated from organizations.members.bulk-create */ import { path } from "#api"; export default { diff --git a/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/create.ts b/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/create.ts index 945c1d5f5d..73bb44da47 100644 --- a/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/create.ts +++ b/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/create.ts @@ -28,7 +28,7 @@ function builder(yargs: Argv) { .option("alert-enabled", { type: "boolean", description: - "Deprecated and ignored: saved-query alerting and rules were removed.", + "Send an hourly notification when new events match this saved view. Receive it by adding the view to a Threat Events saved query notification policy.", default: false, }) .option("alert-rollup-enabled", { diff --git a/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/update.ts b/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/update.ts index 17a93da731..70809eb76d 100644 --- a/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/update.ts +++ b/packages/cli/src/commands/_generated/cloudforce-one/threat-intel/events/queries/update.ts @@ -32,7 +32,7 @@ function builder(yargs: Argv) { .option("alert-enabled", { type: "boolean", description: - "Deprecated and ignored: saved-query alerting and rules were removed.", + "Send an hourly notification when new events match this saved view. Receive it by adding the view to a Threat Events saved query notification policy.", }) .option("alert-rollup-enabled", { type: "boolean", diff --git a/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/feeds/skills/update.ts b/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/feeds/skills/update.ts index df4da12949..e3331e0a19 100644 --- a/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/feeds/skills/update.ts +++ b/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/feeds/skills/update.ts @@ -21,7 +21,7 @@ import { runWithTelemetry } from "#lib/telemetry/index.js"; function builder(yargs: Argv) { return yargs .usage( - "$0 cloudforce-one threat-signals feeds skills update \n\nReplaces the ordered custom skills assigned to a Threat Signals feed. Requires a paid Threat Signals subscription." + "$0 cloudforce-one threat-signals feeds skills update \n\nReplaces the ordered custom skills assigned to a Threat Signals feed. Requires a paid Threat Signals subscription. Adding an active Custom Skill that would put the feed above its per-feed limit (`cfone.threat.threat_signals_active_skills_per_feed`) returns 403 with `errors[0].reason` `threat_signals_feed_skill_limit`, and `errors[0].feed_custom_skill_limit` and `errors[0].feed_custom_skill_count` give the limit and current count. Removing or reordering skills is always allowed." ) .positional("feed-id", { type: "string", diff --git a/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/create.ts b/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/create.ts index b3cf7d98d6..ef3d7a3b25 100644 --- a/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/create.ts +++ b/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/create.ts @@ -23,7 +23,7 @@ import { runWithTelemetry } from "#lib/telemetry/index.js"; function builder(yargs: Argv) { return yargs .usage( - "$0 cloudforce-one threat-signals skills create\n\nCreates a Custom Skill for the account. Free Threat Signals accounts cannot create Custom Skills." + "$0 cloudforce-one threat-signals skills create\n\nCreates an active Custom Skill for the account. Free Threat Signals accounts cannot create Custom Skills. When the account is at its active Custom Skill limit (`cfone.threat.threat_signals_skills`), returns 403 with `errors[0].reason` `threat_signals_skill_limit`, and `errors[0].custom_skill_limit` and `errors[0].custom_skill_count` give the limit and current count. Managed Default Skills do not count." ) .option("name", { type: "string", diff --git a/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/update.ts b/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/update.ts index 7c8c38916b..d06cbda718 100644 --- a/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/update.ts +++ b/packages/cli/src/commands/_generated/cloudforce-one/threat-signals/skills/update.ts @@ -22,7 +22,7 @@ import { runWithTelemetry } from "#lib/telemetry/index.js"; function builder(yargs: Argv) { return yargs .usage( - "$0 cloudforce-one threat-signals skills update \n\nUpdates a Custom Skill. Managed Default Skills cannot be updated. Free Threat Signals accounts cannot update Custom Skills." + "$0 cloudforce-one threat-signals skills update \n\nUpdates a Custom Skill. Managed Default Skills cannot be updated. Free Threat Signals accounts cannot update Custom Skills. Activating an inactive skill (`is_active` true) returns 403 with `errors[0].reason` `threat_signals_skill_limit` when the account is at its active Custom Skill limit, or `threat_signals_feed_skill_limit` (with `errors[0].feed_id`, `errors[0].feed_custom_skill_limit`, and `errors[0].feed_custom_skill_count`) when a feed it is assigned to is at its per-feed limit." ) .positional("skill-id", { type: "string", diff --git a/packages/cli/src/commands/_generated/o11y/destinations/get.ts b/packages/cli/src/commands/_generated/o11y/destinations/get.ts new file mode 100644 index 0000000000..1b35ff5cc9 --- /dev/null +++ b/packages/cli/src/commands/_generated/o11y/destinations/get.ts @@ -0,0 +1,76 @@ +import operation from "../../_operations/o11y/destinations/get.js"; +import type { CommonYargsOptions, InferArgs } from "#lib/cli-types.js"; +import type { ArgClassification } from "#lib/telemetry/index.js"; +/** + * get command + * @generated from apis/overlays/o11y.ts + */ +import type { Argv, CommandModule } from "yargs"; +import { + createCommandClient, + getAccountId, + resolveAccountIdSilent, +} from "#lib/auth.js"; +import { formatDryRun } from "#lib/dry-run.js"; +import { LOCAL_ACCOUNT_ID } from "#lib/local.js"; +import { formatOutput } from "#lib/output.js"; +import { withProgress } from "#lib/progress.js"; +import { runWithTelemetry } from "#lib/telemetry/index.js"; + +function builder(yargs: Argv) { + return yargs + .usage( + "$0 o11y destinations get \n\nGet a Workers Observability Telemetry Destination." + ) + .positional("slug", { + type: "string", + description: "The destination's slug, which is its name.", + demandOption: true, + }) + .option("dry-run", { + type: "boolean", + description: "Validate and show what would happen without executing", + default: false, + }); +} + +type Args = InferArgs; + +const command: CommandModule = { + command: "get ", + describe: "Get Destination", + builder, + handler: async (argv): Promise => + runWithTelemetry( + { + command: "o11y destinations get", + classification: { + safeFlags: ["dry-run"], + } satisfies ArgClassification, + }, + argv as Record, + async () => { + if (argv.dryRun) { + const __cfDryRunAccountId = await resolveAccountIdSilent(); + formatDryRun({ + command: "cf o11y destinations get", + method: "GET", + url: `https://api.cloudflare.com/client/v4/accounts/${__cfDryRunAccountId ?? ""}/workers/observability/destinations/${argv["slug"] == null ? "" : encodeURIComponent(String(argv["slug"]))}`, + pathParams: { slug: String(argv["slug"] ?? "") }, + bodyKind: "none", + }); + return; + } + const client = await createCommandClient(argv); + const accountId = argv.local ? LOCAL_ACCOUNT_ID : await getAccountId(); + argv.accountId = accountId; + + const result = await withProgress(`Loading`, async () => + client.send(operation, { account_id: accountId, slug: argv["slug"] }) + ); + formatOutput(result, { successLabel: `Loaded` }); + } + ), +}; + +export default command; diff --git a/packages/cli/src/commands/_generated/o11y/destinations/index.ts b/packages/cli/src/commands/_generated/o11y/destinations/index.ts index 56a43ee5a0..de7da3c0ca 100644 --- a/packages/cli/src/commands/_generated/o11y/destinations/index.ts +++ b/packages/cli/src/commands/_generated/o11y/destinations/index.ts @@ -1,5 +1,6 @@ import $create from "./create.js"; import $delete from "./delete.js"; +import $get from "./get.js"; import $list from "./list.js"; import $update from "./update.js"; import type { CommonYargsOptions } from "#lib/cli-types.js"; @@ -17,6 +18,7 @@ const command: CommandModule = { return yargs .command($create) .command($delete) + .command($get) .command($list) .command($update) .demandCommand(1, "Please specify a subcommand"); diff --git a/packages/cli/src/commands/_generated/organizations/members/batch/index.ts b/packages/cli/src/commands/_generated/organizations/members/batch/index.ts deleted file mode 100644 index 0d474d9c9a..0000000000 --- a/packages/cli/src/commands/_generated/organizations/members/batch/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import $create from "./create.js"; -import type { CommonYargsOptions } from "#lib/cli-types.js"; -/** - * batch command group - * @generated from apis/overlays/organizations.ts - */ -import type { CommandModule } from "yargs"; - -const command: CommandModule = { - command: "batch", - describe: "Add members to an organization in bulk", - - builder: (yargs) => { - return yargs - .command($create) - .demandCommand(1, "Please specify a subcommand"); - }, - - handler: () => {}, -}; - -export default command; diff --git a/packages/cli/src/commands/_generated/organizations/members/batch/create.ts b/packages/cli/src/commands/_generated/organizations/members/bulk-create.ts similarity index 87% rename from packages/cli/src/commands/_generated/organizations/members/batch/create.ts rename to packages/cli/src/commands/_generated/organizations/members/bulk-create.ts index adc46059c9..934b5aacfc 100644 --- a/packages/cli/src/commands/_generated/organizations/members/batch/create.ts +++ b/packages/cli/src/commands/_generated/organizations/members/bulk-create.ts @@ -1,8 +1,8 @@ -import operation from "../../../_operations/organizations/members/batch/create.js"; +import operation from "../../_operations/organizations/members/bulk-create.js"; import type { CommonYargsOptions, InferArgs } from "#lib/cli-types.js"; import type { ArgClassification } from "#lib/telemetry/index.js"; /** - * create command + * bulk-create command * @generated from apis/overlays/organizations.ts */ import type { Argv, CommandModule } from "yargs"; @@ -16,9 +16,9 @@ import { runWithTelemetry } from "#lib/telemetry/index.js"; function builder(yargs: Argv) { return yargs .usage( - "$0 organizations members batch create \n\nBatch create multiple memberships that grant access to a specific Organization." + "$0 organizations members bulk-create\n\nBatch create multiple memberships that grant access to a specific Organization." ) - .positional("organization-id", { + .option("organization-id", { type: "string", description: "Organization ID", demandOption: true, @@ -42,13 +42,13 @@ function builder(yargs: Argv) { type Args = InferArgs; const command: CommandModule = { - command: "create ", + command: "bulk-create", describe: "Batch create organization members", builder, handler: async (argv): Promise => runWithTelemetry( { - command: "organizations members batch create", + command: "organizations members bulk-create", classification: { safeFlags: ["dry-run"], } satisfies ArgClassification, @@ -57,7 +57,7 @@ const command: CommandModule = { async () => { if (argv.dryRun) { formatDryRun({ - command: "cf organizations members batch create", + command: "cf organizations members bulk-create", method: "POST", url: `https://api.cloudflare.com/client/v4/organizations/${argv["organization-id"] == null ? "" : encodeURIComponent(String(argv["organization-id"]))}/members:batchCreate`, pathParams: { diff --git a/packages/cli/src/commands/_generated/organizations/members/index.ts b/packages/cli/src/commands/_generated/organizations/members/index.ts index 573e2ca986..2d8d0bd4d4 100644 --- a/packages/cli/src/commands/_generated/organizations/members/index.ts +++ b/packages/cli/src/commands/_generated/organizations/members/index.ts @@ -1,4 +1,4 @@ -import $batch from "./batch/index.js"; +import $bulkcreate from "./bulk-create.js"; import $create from "./create.js"; import $delete from "./delete.js"; import $get from "./get.js"; @@ -16,11 +16,11 @@ const command: CommandModule = { builder: (yargs) => { return yargs + .command($bulkcreate) .command($create) .command($delete) .command($get) .command($list) - .command($batch) .demandCommand(1, "Please specify a subcommand"); },